From 35f354e86d3e8b3a76498e238700dc94daefa6be Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 23 Apr 2001 12:24:25 +0000 Subject: [PATCH] Import binutils 2.11. --- gnu/dist/toolchain/Makefile.in | 364 +- gnu/dist/toolchain/bfd/ChangeLog | 9208 ++++++-------- gnu/dist/toolchain/bfd/ChangeLog-9899 | 5595 +++++++++ gnu/dist/toolchain/bfd/MAINTAINERS | 1 + gnu/dist/toolchain/bfd/README | 2 +- gnu/dist/toolchain/bfd/acinclude.m4 | 22 +- gnu/dist/toolchain/bfd/aclocal.m4 | 794 +- gnu/dist/toolchain/bfd/aix386-core.c | 139 +- gnu/dist/toolchain/bfd/aout-adobe.c | 462 +- gnu/dist/toolchain/bfd/aout-arm.c | 40 +- gnu/dist/toolchain/bfd/aout-cris.c | 305 + gnu/dist/toolchain/bfd/aout-encap.c | 12 +- gnu/dist/toolchain/bfd/aout-ns32k.c | 28 +- gnu/dist/toolchain/bfd/aout-tic30.c | 44 +- gnu/dist/toolchain/bfd/aoutf1.h | 19 +- gnu/dist/toolchain/bfd/archures.c | 235 +- gnu/dist/toolchain/bfd/armnetbsd.c | 2 +- gnu/dist/toolchain/bfd/bfd.c | 103 +- gnu/dist/toolchain/bfd/binary.c | 13 +- gnu/dist/toolchain/bfd/bout.c | 48 +- gnu/dist/toolchain/bfd/cache.c | 21 +- gnu/dist/toolchain/bfd/cisco-core.c | 20 +- gnu/dist/toolchain/bfd/coff-a29k.c | 295 +- gnu/dist/toolchain/bfd/coff-alpha.c | 29 +- gnu/dist/toolchain/bfd/coff-apollo.c | 12 +- gnu/dist/toolchain/bfd/coff-arm.c | 477 +- gnu/dist/toolchain/bfd/coff-aux.c | 8 +- gnu/dist/toolchain/bfd/coff-go32.c | 6 +- gnu/dist/toolchain/bfd/coff-h8300.c | 143 +- gnu/dist/toolchain/bfd/coff-h8500.c | 16 +- gnu/dist/toolchain/bfd/coff-i386.c | 29 +- gnu/dist/toolchain/bfd/coff-i860.c | 193 +- gnu/dist/toolchain/bfd/coff-i960.c | 21 +- gnu/dist/toolchain/bfd/coff-ia64.c | 198 + gnu/dist/toolchain/bfd/coff-m68k.c | 112 +- gnu/dist/toolchain/bfd/coff-m88k.c | 6 +- gnu/dist/toolchain/bfd/coff-mcore.c | 154 +- gnu/dist/toolchain/bfd/coff-mips.c | 26 +- gnu/dist/toolchain/bfd/coff-pmac.c | 16 +- gnu/dist/toolchain/bfd/coff-ppc.c | 788 +- gnu/dist/toolchain/bfd/coff-rs6000.c | 1338 +- gnu/dist/toolchain/bfd/coff-sh.c | 66 +- gnu/dist/toolchain/bfd/coff-sparc.c | 8 +- gnu/dist/toolchain/bfd/coff-stgo32.c | 9 +- gnu/dist/toolchain/bfd/coff-tic30.c | 8 +- gnu/dist/toolchain/bfd/coff-tic54x.c | 760 ++ gnu/dist/toolchain/bfd/coff-tic80.c | 8 +- gnu/dist/toolchain/bfd/coff-w65.c | 61 +- gnu/dist/toolchain/bfd/coff-we32k.c | 2 +- gnu/dist/toolchain/bfd/coff-z8k.c | 14 +- gnu/dist/toolchain/bfd/coff64-rs6000.c | 351 + gnu/dist/toolchain/bfd/coffgen.c | 100 +- gnu/dist/toolchain/bfd/cofflink.c | 118 +- gnu/dist/toolchain/bfd/coffswap.h | 112 +- gnu/dist/toolchain/bfd/config.in | 24 +- gnu/dist/toolchain/bfd/corefile.c | 2 - gnu/dist/toolchain/bfd/cpu-a29k.c | 2 +- gnu/dist/toolchain/bfd/cpu-alpha.c | 2 +- gnu/dist/toolchain/bfd/cpu-arc.c | 27 +- gnu/dist/toolchain/bfd/cpu-arm.c | 14 +- gnu/dist/toolchain/bfd/cpu-avr.c | 18 +- gnu/dist/toolchain/bfd/cpu-cris.c | 57 + gnu/dist/toolchain/bfd/cpu-d10v.c | 82 +- gnu/dist/toolchain/bfd/cpu-h8300.c | 23 +- gnu/dist/toolchain/bfd/cpu-h8500.c | 38 +- gnu/dist/toolchain/bfd/cpu-hppa.c | 8 +- gnu/dist/toolchain/bfd/cpu-i370.c | 2 +- gnu/dist/toolchain/bfd/cpu-i386.c | 42 +- gnu/dist/toolchain/bfd/cpu-i860.c | 26 +- gnu/dist/toolchain/bfd/cpu-i960.c | 95 +- gnu/dist/toolchain/bfd/cpu-ia64-opc.c | 589 + gnu/dist/toolchain/bfd/cpu-ia64.c | 57 + gnu/dist/toolchain/bfd/cpu-m32r.c | 2 +- gnu/dist/toolchain/bfd/cpu-m68hc11.c | 38 + gnu/dist/toolchain/bfd/cpu-m68hc12.c | 38 + gnu/dist/toolchain/bfd/cpu-m68k.c | 2 +- gnu/dist/toolchain/bfd/cpu-m88k.c | 5 +- gnu/dist/toolchain/bfd/cpu-mips.c | 82 +- gnu/dist/toolchain/bfd/cpu-ns32k.c | 15 +- gnu/dist/toolchain/bfd/cpu-pj.c | 7 +- gnu/dist/toolchain/bfd/cpu-powerpc.c | 136 +- gnu/dist/toolchain/bfd/cpu-rs6000.c | 52 +- gnu/dist/toolchain/bfd/cpu-sh.c | 18 +- gnu/dist/toolchain/bfd/cpu-sparc.c | 46 +- gnu/dist/toolchain/bfd/cpu-tic54x.c | 39 + gnu/dist/toolchain/bfd/cpu-v850.c | 16 +- gnu/dist/toolchain/bfd/cpu-vax.c | 2 +- gnu/dist/toolchain/bfd/cpu-w65.c | 5 +- gnu/dist/toolchain/bfd/cpu-we32k.c | 2 +- gnu/dist/toolchain/bfd/cpu-z8k.c | 8 - gnu/dist/toolchain/bfd/dep-in.sed | 1 + gnu/dist/toolchain/bfd/doc/ChangeLog | 31 + gnu/dist/toolchain/bfd/doc/Makefile.in | 9 +- gnu/dist/toolchain/bfd/doc/aoutx.texi | 2 +- gnu/dist/toolchain/bfd/doc/archures.texi | 161 +- gnu/dist/toolchain/bfd/doc/bfd.info | 150 +- gnu/dist/toolchain/bfd/doc/bfd.info-1 | 56 +- gnu/dist/toolchain/bfd/doc/bfd.info-2 | 462 +- gnu/dist/toolchain/bfd/doc/bfd.info-3 | 196 +- gnu/dist/toolchain/bfd/doc/bfd.info-4 | 306 +- gnu/dist/toolchain/bfd/doc/bfd.info-5 | 77 +- gnu/dist/toolchain/bfd/doc/bfd.info-6 | 379 +- gnu/dist/toolchain/bfd/doc/bfd.info-7 | 153 +- gnu/dist/toolchain/bfd/doc/bfd.texinfo | 409 +- gnu/dist/toolchain/bfd/doc/bfdint.texi | 7 +- gnu/dist/toolchain/bfd/doc/bfdt.texi | 65 +- gnu/dist/toolchain/bfd/doc/cache.texi | 2 +- gnu/dist/toolchain/bfd/doc/chew.c | 1992 ++- gnu/dist/toolchain/bfd/doc/coffcode.texi | 12 +- gnu/dist/toolchain/bfd/doc/format.texi | 4 +- gnu/dist/toolchain/bfd/doc/hash.texi | 2 +- gnu/dist/toolchain/bfd/doc/libbfd.texi | 10 +- gnu/dist/toolchain/bfd/doc/linker.texi | 2 +- gnu/dist/toolchain/bfd/doc/reloc.texi | 172 +- gnu/dist/toolchain/bfd/doc/section.texi | 439 +- gnu/dist/toolchain/bfd/doc/syms.texi | 4 +- gnu/dist/toolchain/bfd/doc/targets.texi | 111 +- gnu/dist/toolchain/bfd/dwarf1.c | 242 +- gnu/dist/toolchain/bfd/dwarf2.c | 575 +- gnu/dist/toolchain/bfd/ecoff.c | 79 +- gnu/dist/toolchain/bfd/ecoffswap.h | 117 +- gnu/dist/toolchain/bfd/efi-app-ia32.c | 35 + gnu/dist/toolchain/bfd/efi-app-ia64.c | 35 + gnu/dist/toolchain/bfd/elf-bfd.h | 78 +- gnu/dist/toolchain/bfd/elf-hppa.h | 1250 +- gnu/dist/toolchain/bfd/elf-m10200.c | 18 +- gnu/dist/toolchain/bfd/elf-m10300.c | 22 +- gnu/dist/toolchain/bfd/elf32-arc.c | 221 +- gnu/dist/toolchain/bfd/elf32-arm.h | 681 +- gnu/dist/toolchain/bfd/elf32-avr.c | 47 +- gnu/dist/toolchain/bfd/elf32-cris.c | 712 ++ gnu/dist/toolchain/bfd/elf32-d10v.c | 41 +- gnu/dist/toolchain/bfd/elf32-d30v.c | 121 +- gnu/dist/toolchain/bfd/elf32-fr30.c | 83 +- gnu/dist/toolchain/bfd/elf32-gen.c | 32 + gnu/dist/toolchain/bfd/elf32-hppa.c | 5076 ++++++-- gnu/dist/toolchain/bfd/elf32-hppa.h | 14 +- gnu/dist/toolchain/bfd/elf32-i370.c | 67 +- gnu/dist/toolchain/bfd/elf32-i386.c | 562 +- gnu/dist/toolchain/bfd/elf32-i860.c | 1091 +- gnu/dist/toolchain/bfd/elf32-i960.c | 3 +- gnu/dist/toolchain/bfd/elf32-m32r.c | 54 +- gnu/dist/toolchain/bfd/elf32-m68hc11.c | 280 + gnu/dist/toolchain/bfd/elf32-m68hc12.c | 280 + gnu/dist/toolchain/bfd/elf32-m68k.c | 192 +- gnu/dist/toolchain/bfd/elf32-mcore.c | 90 +- gnu/dist/toolchain/bfd/elf32-pj.c | 14 +- gnu/dist/toolchain/bfd/elf32-ppc.c | 456 +- gnu/dist/toolchain/bfd/elf32-sh-lin.c | 29 + gnu/dist/toolchain/bfd/elf32-sparc.c | 165 +- gnu/dist/toolchain/bfd/elf32-v850.c | 309 +- gnu/dist/toolchain/bfd/elf32.c | 1 - gnu/dist/toolchain/bfd/elf64-gen.c | 32 + gnu/dist/toolchain/bfd/elf64-hppa.c | 2704 ++++ gnu/dist/toolchain/bfd/elf64-hppa.h | 47 + gnu/dist/toolchain/bfd/elf64-mips.c | 16 +- gnu/dist/toolchain/bfd/elf64-sparc.c | 274 +- gnu/dist/toolchain/bfd/elf64-x86-64.c | 1918 +++ gnu/dist/toolchain/bfd/elfarm-nabi.c | 73 +- gnu/dist/toolchain/bfd/elfarm-oabi.c | 16 +- gnu/dist/toolchain/bfd/elfcode.h | 118 +- gnu/dist/toolchain/bfd/elfcore.h | 76 +- gnu/dist/toolchain/bfd/elflink.c | 40 +- gnu/dist/toolchain/bfd/elfxx-ia64.c | 4216 +++++++ gnu/dist/toolchain/bfd/elfxx-target.h | 17 +- gnu/dist/toolchain/bfd/epoc-pe-arm.c | 3 +- gnu/dist/toolchain/bfd/epoc-pei-arm.c | 3 +- gnu/dist/toolchain/bfd/format.c | 269 +- gnu/dist/toolchain/bfd/freebsd.h | 1 - gnu/dist/toolchain/bfd/go32stub.h | 236 +- gnu/dist/toolchain/bfd/hash.c | 4 +- gnu/dist/toolchain/bfd/hp300hpux.c | 14 - gnu/dist/toolchain/bfd/hppabsd-core.c | 15 +- gnu/dist/toolchain/bfd/hpux-core.c | 9 +- gnu/dist/toolchain/bfd/ieee.c | 62 +- gnu/dist/toolchain/bfd/libcoff-in.h | 9 + gnu/dist/toolchain/bfd/libcoff.h | 57 +- gnu/dist/toolchain/bfd/libhppa.h | 862 +- gnu/dist/toolchain/bfd/libpei.h | 30 + gnu/dist/toolchain/bfd/linker.c | 29 +- gnu/dist/toolchain/bfd/lynx-core.c | 9 +- gnu/dist/toolchain/bfd/m68klinux.c | 12 +- gnu/dist/toolchain/bfd/m68knetbsd.c | 2 +- gnu/dist/toolchain/bfd/mipsbsd.c | 36 +- gnu/dist/toolchain/bfd/netbsd-core.c | 16 +- gnu/dist/toolchain/bfd/newsos3.c | 2 +- gnu/dist/toolchain/bfd/nlm-target.h | 12 +- gnu/dist/toolchain/bfd/nlm32-alpha.c | 4 +- gnu/dist/toolchain/bfd/nlm32-i386.c | 8 +- gnu/dist/toolchain/bfd/nlm32-ppc.c | 536 +- gnu/dist/toolchain/bfd/nlm32-sparc.c | 37 +- gnu/dist/toolchain/bfd/nlmcode.h | 51 +- gnu/dist/toolchain/bfd/nlmswap.h | 4 +- gnu/dist/toolchain/bfd/ns32knetbsd.c | 3 +- gnu/dist/toolchain/bfd/opncls.c | 4 +- gnu/dist/toolchain/bfd/pc532-mach.c | 15 +- gnu/dist/toolchain/bfd/pe-arm.c | 4 +- gnu/dist/toolchain/bfd/pe-i386.c | 1 - gnu/dist/toolchain/bfd/pe-mips.c | 87 +- gnu/dist/toolchain/bfd/pe-ppc.c | 1 - gnu/dist/toolchain/bfd/pe-sh.c | 1 - gnu/dist/toolchain/bfd/pei-mips.c | 2 - gnu/dist/toolchain/bfd/pei-sh.c | 2 - gnu/dist/toolchain/bfd/peicode.h | 305 +- gnu/dist/toolchain/bfd/peigen.c | 1139 +- gnu/dist/toolchain/bfd/po/POTFILES.in | 21 + gnu/dist/toolchain/bfd/po/bfd.pot | 1016 +- gnu/dist/toolchain/bfd/ppcboot.c | 4 +- gnu/dist/toolchain/bfd/ptrace-core.c | 22 +- gnu/dist/toolchain/bfd/reloc.c | 334 +- gnu/dist/toolchain/bfd/reloc16.c | 121 +- gnu/dist/toolchain/bfd/riscix.c | 60 +- gnu/dist/toolchain/bfd/rs6000-core.c | 626 +- gnu/dist/toolchain/bfd/sco5-core.c | 54 +- gnu/dist/toolchain/bfd/section.c | 570 +- gnu/dist/toolchain/bfd/som.c | 1391 +-- gnu/dist/toolchain/bfd/som.h | 13 +- gnu/dist/toolchain/bfd/sparclinux.c | 8 +- gnu/dist/toolchain/bfd/sparclynx.c | 6 +- gnu/dist/toolchain/bfd/srec.c | 99 +- gnu/dist/toolchain/bfd/stab-syms.c | 6 +- gnu/dist/toolchain/bfd/stabs.c | 4 +- gnu/dist/toolchain/bfd/syms.c | 34 +- gnu/dist/toolchain/bfd/sysdep.h | 12 + gnu/dist/toolchain/bfd/tekhex.c | 19 +- gnu/dist/toolchain/bfd/trad-core.c | 34 +- gnu/dist/toolchain/bfd/versados.c | 32 +- gnu/dist/toolchain/bfd/vms-gsd.c | 11 +- gnu/dist/toolchain/bfd/vms-hdr.c | 15 +- gnu/dist/toolchain/bfd/vms-misc.c | 81 +- gnu/dist/toolchain/bfd/vms-tir.c | 125 +- gnu/dist/toolchain/bfd/vms.c | 69 +- gnu/dist/toolchain/bfd/vms.h | 2 - gnu/dist/toolchain/bfd/xcoff-target.h | 194 + gnu/dist/toolchain/bfd/xcofflink.c | 210 +- gnu/dist/toolchain/binutils/ChangeLog | 7768 +----------- gnu/dist/toolchain/binutils/ChangeLog-9197 | 5218 ++++++++ gnu/dist/toolchain/binutils/ChangeLog-9899 | 1908 +++ gnu/dist/toolchain/binutils/MAINTAINERS | 78 + gnu/dist/toolchain/binutils/Makefile.am | 43 +- gnu/dist/toolchain/binutils/Makefile.in | 177 +- gnu/dist/toolchain/binutils/NEWS | 12 + gnu/dist/toolchain/binutils/README | 2 +- gnu/dist/toolchain/binutils/acinclude.m4 | 31 + gnu/dist/toolchain/binutils/aclocal.m4 | 805 +- gnu/dist/toolchain/binutils/addr2line.1 | 380 +- gnu/dist/toolchain/binutils/addr2line.c | 21 +- gnu/dist/toolchain/binutils/ar.1 | 392 +- gnu/dist/toolchain/binutils/ar.c | 23 +- gnu/dist/toolchain/binutils/arlex.c | 2 +- gnu/dist/toolchain/binutils/binutils.info | 79 +- gnu/dist/toolchain/binutils/binutils.info-1 | 85 +- gnu/dist/toolchain/binutils/binutils.info-2 | 45 +- gnu/dist/toolchain/binutils/binutils.info-3 | 373 +- gnu/dist/toolchain/binutils/binutils.texi | 488 +- gnu/dist/toolchain/binutils/bucomm.h | 11 +- gnu/dist/toolchain/binutils/coffgrok.c | 2 +- gnu/dist/toolchain/binutils/config.in | 3 - gnu/dist/toolchain/binutils/config.texi | 2 +- gnu/dist/toolchain/binutils/configure | 1656 ++- gnu/dist/toolchain/binutils/configure.in | 33 +- gnu/dist/toolchain/binutils/deflex.c | 2 +- gnu/dist/toolchain/binutils/dlltool.c | 9 +- gnu/dist/toolchain/binutils/dllwrap.c | 142 +- gnu/dist/toolchain/binutils/ieee.c | 31 +- gnu/dist/toolchain/binutils/nlmconv.1 | 396 +- gnu/dist/toolchain/binutils/nlmconv.c | 8 +- gnu/dist/toolchain/binutils/nm.1 | 392 +- gnu/dist/toolchain/binutils/nm.c | 40 +- gnu/dist/toolchain/binutils/objcopy.1 | 400 +- gnu/dist/toolchain/binutils/objdump.1 | 389 +- gnu/dist/toolchain/binutils/po/POTFILES.in | 2 - gnu/dist/toolchain/binutils/po/binutils.pot | 1983 +-- gnu/dist/toolchain/binutils/ranlib.1 | 392 +- gnu/dist/toolchain/binutils/rclex.c | 2 +- gnu/dist/toolchain/binutils/rcparse.c | 1537 +-- gnu/dist/toolchain/binutils/rcparse.y | 98 +- gnu/dist/toolchain/binutils/rdcoff.c | 22 +- gnu/dist/toolchain/binutils/readelf.c | 1940 +-- gnu/dist/toolchain/binutils/resrc.c | 42 +- gnu/dist/toolchain/binutils/srconv.c | 31 +- gnu/dist/toolchain/binutils/stabs.c | 22 +- gnu/dist/toolchain/binutils/strings.1 | 390 +- gnu/dist/toolchain/binutils/strings.c | 4 +- gnu/dist/toolchain/binutils/sysdump.c | 4 +- gnu/dist/toolchain/binutils/syslex.c | 2 +- .../toolchain/binutils/testsuite/ChangeLog | 135 +- .../testsuite/binutils-all/hppa/objdump.exp | 5 + .../testsuite/binutils-all/objcopy.exp | 4 +- .../testsuite/binutils-all/objdump.exp | 34 +- .../testsuite/binutils-all/readelf.exp | 90 +- .../binutils/testsuite/binutils-all/readelf.s | 28 +- .../testsuite/binutils-all/readelf.s-64 | 25 + .../testsuite/binutils-all/readelf.ss | 7 +- .../testsuite/binutils-all/readelf.ss-64 | 13 + .../testsuite/binutils-all/readelf.ss-mips | 15 + .../testsuite/binutils-all/readelf.wi | 2 +- .../binutils/testsuite/lib/utils-lib.exp | 9 +- gnu/dist/toolchain/binutils/version.c | 4 +- gnu/dist/toolchain/binutils/windres.h | 4 + gnu/dist/toolchain/config-ml.in | 159 +- gnu/dist/toolchain/config.if | 10 +- gnu/dist/toolchain/config/ChangeLog | 17 + gnu/dist/toolchain/config/acinclude.m4 | 1 + gnu/dist/toolchain/config/mh-ia64pic | 1 + gnu/dist/toolchain/config/mh-irix6 | 4 - gnu/dist/toolchain/config/mh-openedition | 2 + gnu/dist/toolchain/config/mh-sparcpic | 2 +- gnu/dist/toolchain/config/mt-ia64pic | 1 + gnu/dist/toolchain/config/mt-sparcpic | 2 +- gnu/dist/toolchain/configure | 35 +- gnu/dist/toolchain/gas/ChangeLog | 8676 ++++++------- gnu/dist/toolchain/gas/ChangeLog-9697 | 1 - gnu/dist/toolchain/gas/ChangeLog-9899 | 4854 ++++++++ gnu/dist/toolchain/gas/MAINTAINERS | 1 + gnu/dist/toolchain/gas/Makefile.am | 1549 +-- gnu/dist/toolchain/gas/Makefile.in | 1755 +-- gnu/dist/toolchain/gas/NEWS | 22 + gnu/dist/toolchain/gas/README | 2 +- gnu/dist/toolchain/gas/acinclude.m4 | 16 + gnu/dist/toolchain/gas/aclocal.m4 | 788 +- gnu/dist/toolchain/gas/app.c | 124 +- gnu/dist/toolchain/gas/as.c | 210 +- gnu/dist/toolchain/gas/as.h | 199 +- gnu/dist/toolchain/gas/asintl.h | 15 +- gnu/dist/toolchain/gas/atof-generic.c | 52 +- gnu/dist/toolchain/gas/bignum-copy.c | 7 +- gnu/dist/toolchain/gas/bit_fix.h | 33 +- gnu/dist/toolchain/gas/cgen.c | 151 +- gnu/dist/toolchain/gas/cgen.h | 6 +- gnu/dist/toolchain/gas/cond.c | 153 +- gnu/dist/toolchain/gas/config.in | 6 +- gnu/dist/toolchain/gas/config/atof-ieee.c | 211 +- gnu/dist/toolchain/gas/config/atof-tahoe.c | 258 +- gnu/dist/toolchain/gas/config/atof-vax.c | 57 +- gnu/dist/toolchain/gas/config/e-crisaout.c | 17 + gnu/dist/toolchain/gas/config/e-criself.c | 17 + gnu/dist/toolchain/gas/config/m68k-parse.h | 4 +- gnu/dist/toolchain/gas/config/m88k-opcode.h | 2 +- gnu/dist/toolchain/gas/config/obj-bout.c | 165 +- gnu/dist/toolchain/gas/config/obj-bout.h | 19 +- gnu/dist/toolchain/gas/config/obj-coff.c | 292 +- gnu/dist/toolchain/gas/config/obj-coff.h | 72 +- gnu/dist/toolchain/gas/config/obj-ecoff.c | 23 +- gnu/dist/toolchain/gas/config/obj-elf.c | 343 +- gnu/dist/toolchain/gas/config/obj-elf.h | 43 +- gnu/dist/toolchain/gas/config/obj-evax.h | 8 +- gnu/dist/toolchain/gas/config/obj-generic.h | 16 +- gnu/dist/toolchain/gas/config/obj-hp300.c | 19 +- gnu/dist/toolchain/gas/config/obj-hp300.h | 21 +- gnu/dist/toolchain/gas/config/obj-ieee.c | 196 +- gnu/dist/toolchain/gas/config/obj-ieee.h | 14 +- gnu/dist/toolchain/gas/config/obj-multi.h | 63 +- gnu/dist/toolchain/gas/config/obj-som.c | 48 +- gnu/dist/toolchain/gas/config/obj-som.h | 4 +- gnu/dist/toolchain/gas/config/obj-vms.c | 112 +- gnu/dist/toolchain/gas/config/obj-vms.h | 21 +- gnu/dist/toolchain/gas/config/tc-a29k.c | 30 +- gnu/dist/toolchain/gas/config/tc-alpha.h | 7 + gnu/dist/toolchain/gas/config/tc-arc.c | 1341 +- gnu/dist/toolchain/gas/config/tc-arc.h | 31 +- gnu/dist/toolchain/gas/config/tc-avr.c | 801 +- gnu/dist/toolchain/gas/config/tc-avr.h | 40 +- gnu/dist/toolchain/gas/config/tc-cris.c | 2904 +++++ gnu/dist/toolchain/gas/config/tc-cris.h | 139 + gnu/dist/toolchain/gas/config/tc-d10v.c | 920 +- gnu/dist/toolchain/gas/config/tc-d10v.h | 12 +- gnu/dist/toolchain/gas/config/tc-d30v.c | 797 +- gnu/dist/toolchain/gas/config/tc-d30v.h | 13 +- gnu/dist/toolchain/gas/config/tc-fr30.c | 36 +- gnu/dist/toolchain/gas/config/tc-fr30.h | 4 +- gnu/dist/toolchain/gas/config/tc-h8300.c | 254 +- gnu/dist/toolchain/gas/config/tc-h8300.h | 7 +- gnu/dist/toolchain/gas/config/tc-h8500.c | 180 +- gnu/dist/toolchain/gas/config/tc-h8500.h | 5 +- gnu/dist/toolchain/gas/config/tc-hppa.c | 2304 ++-- gnu/dist/toolchain/gas/config/tc-hppa.h | 89 +- gnu/dist/toolchain/gas/config/tc-i370.c | 97 +- gnu/dist/toolchain/gas/config/tc-i370.h | 2 +- gnu/dist/toolchain/gas/config/tc-i860.c | 1436 ++- gnu/dist/toolchain/gas/config/tc-i860.h | 75 +- gnu/dist/toolchain/gas/config/tc-i960.c | 75 +- gnu/dist/toolchain/gas/config/tc-i960.h | 11 +- gnu/dist/toolchain/gas/config/tc-ia64.c | 10142 ++++++++++++++++ gnu/dist/toolchain/gas/config/tc-ia64.h | 261 + gnu/dist/toolchain/gas/config/tc-m32r.c | 729 +- gnu/dist/toolchain/gas/config/tc-m32r.h | 18 +- gnu/dist/toolchain/gas/config/tc-m68851.h | 104 +- gnu/dist/toolchain/gas/config/tc-m68hc11.c | 2813 +++++ gnu/dist/toolchain/gas/config/tc-m68hc11.h | 106 + gnu/dist/toolchain/gas/config/tc-m68k.h | 25 +- gnu/dist/toolchain/gas/config/tc-m88k.c | 46 +- gnu/dist/toolchain/gas/config/tc-m88k.h | 9 +- gnu/dist/toolchain/gas/config/tc-mcore.c | 596 +- gnu/dist/toolchain/gas/config/tc-mcore.h | 13 +- gnu/dist/toolchain/gas/config/tc-mips.c | 1613 +-- gnu/dist/toolchain/gas/config/tc-mips.h | 12 +- gnu/dist/toolchain/gas/config/tc-mn10200.c | 245 +- gnu/dist/toolchain/gas/config/tc-mn10200.h | 4 +- gnu/dist/toolchain/gas/config/tc-mn10300.c | 477 +- gnu/dist/toolchain/gas/config/tc-mn10300.h | 21 +- gnu/dist/toolchain/gas/config/tc-pj.c | 129 +- gnu/dist/toolchain/gas/config/tc-pj.h | 16 +- gnu/dist/toolchain/gas/config/tc-ppc.c | 468 +- gnu/dist/toolchain/gas/config/tc-ppc.h | 33 +- gnu/dist/toolchain/gas/config/tc-sh.c | 1154 +- gnu/dist/toolchain/gas/config/tc-sparc.h | 27 +- gnu/dist/toolchain/gas/config/tc-tahoe.c | 296 +- gnu/dist/toolchain/gas/config/tc-tahoe.h | 13 +- gnu/dist/toolchain/gas/config/tc-tic30.c | 152 +- gnu/dist/toolchain/gas/config/tc-tic30.h | 4 +- gnu/dist/toolchain/gas/config/tc-tic54x.c | 5691 +++++++++ gnu/dist/toolchain/gas/config/tc-tic54x.h | 128 + gnu/dist/toolchain/gas/config/tc-tic80.c | 421 +- gnu/dist/toolchain/gas/config/tc-tic80.h | 10 +- gnu/dist/toolchain/gas/config/tc-v850.c | 1345 +- gnu/dist/toolchain/gas/config/tc-v850.h | 16 +- gnu/dist/toolchain/gas/config/tc-w65.c | 206 +- gnu/dist/toolchain/gas/config/tc-w65.h | 5 +- gnu/dist/toolchain/gas/config/tc-z8k.c | 779 +- gnu/dist/toolchain/gas/config/tc-z8k.h | 8 +- gnu/dist/toolchain/gas/config/te-386bsd.h | 13 +- gnu/dist/toolchain/gas/config/te-aux.h | 2 +- gnu/dist/toolchain/gas/config/te-dpx2.h | 4 +- gnu/dist/toolchain/gas/config/te-go32.h | 6 +- gnu/dist/toolchain/gas/config/te-hp300.h | 3 +- gnu/dist/toolchain/gas/config/te-hppa.h | 22 +- gnu/dist/toolchain/gas/config/te-hppa64.h | 6 + .../toolchain/gas/config/te-hppalinux64.h | 5 + gnu/dist/toolchain/gas/config/te-hpux.h | 4 + gnu/dist/toolchain/gas/config/te-i386aix.h | 18 +- gnu/dist/toolchain/gas/config/te-ic960.h | 6 +- gnu/dist/toolchain/gas/config/te-interix.h | 2 +- gnu/dist/toolchain/gas/config/te-nbsd.h | 8 +- gnu/dist/toolchain/gas/config/te-nbsd532.h | 16 +- gnu/dist/toolchain/gas/config/te-pc532mach.h | 16 +- gnu/dist/toolchain/gas/config/te-ppcnw.h | 13 +- gnu/dist/toolchain/gas/config/te-psos.h | 10 +- gnu/dist/toolchain/gas/config/te-sparcaout.h | 11 +- gnu/dist/toolchain/gas/config/te-sun3.h | 4 +- gnu/dist/toolchain/gas/config/te-sysv32.h | 2 +- gnu/dist/toolchain/gas/config/te-tmips.h | 40 + gnu/dist/toolchain/gas/config/vax-inst.h | 5 +- gnu/dist/toolchain/gas/config/vms-conf.h | 2 +- gnu/dist/toolchain/gas/debug.c | 3 +- gnu/dist/toolchain/gas/dep-in.sed | 58 +- gnu/dist/toolchain/gas/depend.c | 17 +- gnu/dist/toolchain/gas/doc/Makefile.am | 4 + gnu/dist/toolchain/gas/doc/Makefile.in | 14 +- gnu/dist/toolchain/gas/doc/all.texi | 3 + gnu/dist/toolchain/gas/doc/as.1 | 392 +- gnu/dist/toolchain/gas/doc/as.info | 675 +- gnu/dist/toolchain/gas/doc/as.info-1 | 234 +- gnu/dist/toolchain/gas/doc/as.info-2 | 276 +- gnu/dist/toolchain/gas/doc/as.info-3 | 962 +- gnu/dist/toolchain/gas/doc/as.info-4 | 729 +- gnu/dist/toolchain/gas/doc/as.info-5 | 1205 +- gnu/dist/toolchain/gas/doc/as.info-6 | 1902 ++- gnu/dist/toolchain/gas/doc/as.info-7 | 1232 +- gnu/dist/toolchain/gas/doc/as.info-8 | 1627 +-- gnu/dist/toolchain/gas/doc/as.info-9 | 1186 ++ gnu/dist/toolchain/gas/doc/as.texinfo | 999 +- gnu/dist/toolchain/gas/doc/c-arc.texi | 207 + gnu/dist/toolchain/gas/doc/c-arm.texi | 33 +- gnu/dist/toolchain/gas/doc/c-d10v.texi | 7 + gnu/dist/toolchain/gas/doc/c-i386.texi | 254 +- gnu/dist/toolchain/gas/doc/c-i860.texi | 153 + gnu/dist/toolchain/gas/doc/c-m68hc11.texi | 235 + gnu/dist/toolchain/gas/doc/c-m68k.texi | 91 +- gnu/dist/toolchain/gas/doc/c-mips.texi | 64 +- gnu/dist/toolchain/gas/doc/c-tic54x.texi | 767 ++ gnu/dist/toolchain/gas/doc/gasp.info | 418 +- gnu/dist/toolchain/gas/doc/gasp.texi | 410 +- gnu/dist/toolchain/gas/doc/gasver.texi | 2 +- gnu/dist/toolchain/gas/doc/internals.texi | 62 +- gnu/dist/toolchain/gas/dwarf2dbg.c | 1792 ++- gnu/dist/toolchain/gas/dwarf2dbg.h | 27 +- gnu/dist/toolchain/gas/ecoff.c | 376 +- gnu/dist/toolchain/gas/ehopt.c | 133 +- gnu/dist/toolchain/gas/expr.c | 542 +- gnu/dist/toolchain/gas/expr.h | 20 +- gnu/dist/toolchain/gas/flonum-copy.c | 39 +- gnu/dist/toolchain/gas/flonum-konst.c | 187 +- gnu/dist/toolchain/gas/flonum-mult.c | 78 +- gnu/dist/toolchain/gas/flonum.h | 18 +- gnu/dist/toolchain/gas/frags.c | 179 +- gnu/dist/toolchain/gas/frags.h | 71 +- gnu/dist/toolchain/gas/gasp.c | 793 +- gnu/dist/toolchain/gas/hash.c | 64 +- gnu/dist/toolchain/gas/input-file.c | 47 +- gnu/dist/toolchain/gas/input-file.h | 8 +- gnu/dist/toolchain/gas/input-scrub.c | 193 +- gnu/dist/toolchain/gas/itbl-lex.c | 2 +- gnu/dist/toolchain/gas/itbl-ops.c | 166 +- gnu/dist/toolchain/gas/itbl-ops.h | 6 +- gnu/dist/toolchain/gas/listing.c | 282 +- gnu/dist/toolchain/gas/literal.c | 4 +- gnu/dist/toolchain/gas/macro.c | 133 +- gnu/dist/toolchain/gas/macro.h | 42 +- gnu/dist/toolchain/gas/messages.c | 160 +- gnu/dist/toolchain/gas/obj.h | 9 + gnu/dist/toolchain/gas/po/POTFILES.in | 12 + gnu/dist/toolchain/gas/po/gas.pot | 5509 ++++++--- gnu/dist/toolchain/gas/read.c | 1147 +- gnu/dist/toolchain/gas/read.h | 42 +- gnu/dist/toolchain/gas/sb.c | 22 +- gnu/dist/toolchain/gas/sb.h | 8 +- gnu/dist/toolchain/gas/stabs.c | 107 +- gnu/dist/toolchain/gas/subsegs.c | 24 +- gnu/dist/toolchain/gas/subsegs.h | 26 +- gnu/dist/toolchain/gas/symbols.c | 437 +- gnu/dist/toolchain/gas/symbols.h | 6 +- gnu/dist/toolchain/gas/tc.h | 10 +- gnu/dist/toolchain/gas/testsuite/ChangeLog | 562 +- .../toolchain/gas/testsuite/gas/all/cofftag.d | 6 +- .../toolchain/gas/testsuite/gas/all/cond.d | 20 +- .../toolchain/gas/testsuite/gas/all/cond.s | 14 + .../toolchain/gas/testsuite/gas/all/gas.exp | 27 +- .../toolchain/gas/testsuite/gas/arc/adc.d | 85 + .../toolchain/gas/testsuite/gas/arc/adc.s | 68 + .../toolchain/gas/testsuite/gas/arc/add.d | 85 + .../toolchain/gas/testsuite/gas/arc/add.s | 68 + .../toolchain/gas/testsuite/gas/arc/and.d | 85 + .../toolchain/gas/testsuite/gas/arc/and.s | 68 + .../toolchain/gas/testsuite/gas/arc/arc.exp | 151 +- .../toolchain/gas/testsuite/gas/arc/asl.d | 68 + .../toolchain/gas/testsuite/gas/arc/asl.s | 58 + .../toolchain/gas/testsuite/gas/arc/asr.d | 51 + .../toolchain/gas/testsuite/gas/arc/asr.s | 38 + gnu/dist/toolchain/gas/testsuite/gas/arc/b.d | 76 + gnu/dist/toolchain/gas/testsuite/gas/arc/b.s | 40 + .../toolchain/gas/testsuite/gas/arc/bic.d | 85 + .../toolchain/gas/testsuite/gas/arc/bic.s | 68 + gnu/dist/toolchain/gas/testsuite/gas/arc/bl.d | 76 + gnu/dist/toolchain/gas/testsuite/gas/arc/bl.s | 40 + .../toolchain/gas/testsuite/gas/arc/brk.d | 11 + .../toolchain/gas/testsuite/gas/arc/brk.s | 7 + .../toolchain/gas/testsuite/gas/arc/extb.d | 51 + .../toolchain/gas/testsuite/gas/arc/extb.s | 38 + .../toolchain/gas/testsuite/gas/arc/extw.d | 51 + .../toolchain/gas/testsuite/gas/arc/extw.s | 38 + .../toolchain/gas/testsuite/gas/arc/flag.d | 59 +- gnu/dist/toolchain/gas/testsuite/gas/arc/j.d | 194 +- gnu/dist/toolchain/gas/testsuite/gas/arc/j.s | 9 - gnu/dist/toolchain/gas/testsuite/gas/arc/jl.d | 25 + gnu/dist/toolchain/gas/testsuite/gas/arc/jl.s | 9 + gnu/dist/toolchain/gas/testsuite/gas/arc/ld.d | 35 +- gnu/dist/toolchain/gas/testsuite/gas/arc/ld.s | 29 +- .../toolchain/gas/testsuite/gas/arc/ld2.d | 21 + .../toolchain/gas/testsuite/gas/arc/ld2.s | 13 + gnu/dist/toolchain/gas/testsuite/gas/arc/lp.d | 76 + gnu/dist/toolchain/gas/testsuite/gas/arc/lp.s | 40 + .../toolchain/gas/testsuite/gas/arc/lsr.d | 51 + .../toolchain/gas/testsuite/gas/arc/lsr.s | 38 + .../toolchain/gas/testsuite/gas/arc/mov.d | 68 + .../toolchain/gas/testsuite/gas/arc/mov.s | 58 + .../toolchain/gas/testsuite/gas/arc/nop.d | 9 + .../toolchain/gas/testsuite/gas/arc/nop.s | 3 + gnu/dist/toolchain/gas/testsuite/gas/arc/or.d | 85 + gnu/dist/toolchain/gas/testsuite/gas/arc/or.s | 68 + .../toolchain/gas/testsuite/gas/arc/rlc.d | 68 + .../toolchain/gas/testsuite/gas/arc/rlc.s | 58 + .../toolchain/gas/testsuite/gas/arc/ror.d | 51 + .../toolchain/gas/testsuite/gas/arc/ror.s | 38 + .../toolchain/gas/testsuite/gas/arc/rrc.d | 51 + .../toolchain/gas/testsuite/gas/arc/rrc.s | 38 + .../toolchain/gas/testsuite/gas/arc/sbc.d | 85 + .../toolchain/gas/testsuite/gas/arc/sbc.s | 68 + .../toolchain/gas/testsuite/gas/arc/sexb.d | 51 + .../toolchain/gas/testsuite/gas/arc/sexb.s | 38 + .../toolchain/gas/testsuite/gas/arc/sexw.d | 51 + .../toolchain/gas/testsuite/gas/arc/sexw.s | 38 + .../toolchain/gas/testsuite/gas/arc/sleep.d | 11 + .../toolchain/gas/testsuite/gas/arc/sleep.s | 6 + gnu/dist/toolchain/gas/testsuite/gas/arc/st.d | 44 +- gnu/dist/toolchain/gas/testsuite/gas/arc/st.s | 35 +- .../toolchain/gas/testsuite/gas/arc/sub.d | 85 + .../toolchain/gas/testsuite/gas/arc/sub.s | 68 + .../toolchain/gas/testsuite/gas/arc/swi.d | 11 + .../toolchain/gas/testsuite/gas/arc/swi.s | 6 + .../toolchain/gas/testsuite/gas/arc/warn.exp | 5 - .../toolchain/gas/testsuite/gas/arc/warn.s | 7 +- .../toolchain/gas/testsuite/gas/arc/xor.d | 85 + .../toolchain/gas/testsuite/gas/arc/xor.s | 68 + .../toolchain/gas/testsuite/gas/arm/adrl.d | 18 + .../toolchain/gas/testsuite/gas/arm/adrl.s | 14 + .../toolchain/gas/testsuite/gas/arm/arm.exp | 11 +- .../toolchain/gas/testsuite/gas/arm/arm6.s | 9 +- .../gas/testsuite/gas/arm/el_segundo.d | 33 + .../gas/testsuite/gas/arm/el_segundo.s | 54 + .../toolchain/gas/testsuite/gas/arm/inst.d | 60 +- .../toolchain/gas/testsuite/gas/arm/inst.s | 34 + .../toolchain/gas/testsuite/gas/arm/msr-bad.s | 2 + .../toolchain/gas/testsuite/gas/arm/pic.d | 17 + .../toolchain/gas/testsuite/gas/arm/pic.s | 11 + .../toolchain/gas/testsuite/gas/arm/xscale.d | 38 + .../toolchain/gas/testsuite/gas/arm/xscale.s | 40 + .../toolchain/gas/testsuite/gas/cris/addi.d | 19 + .../toolchain/gas/testsuite/gas/cris/addi.s | 16 + .../gas/testsuite/gas/cris/binop-cmpmove.d | 406 + .../gas/testsuite/gas/cris/binop-cmpmovx.d | 233 + .../gas/testsuite/gas/cris/binop-extx.d | 327 + .../gas/testsuite/gas/cris/binop-segref.s | 95 + .../toolchain/gas/testsuite/gas/cris/binop.d | 571 + .../toolchain/gas/testsuite/gas/cris/binop.s | 914 ++ .../toolchain/gas/testsuite/gas/cris/bork.d | 10 + .../toolchain/gas/testsuite/gas/cris/bork.s | 6 + .../gas/testsuite/gas/cris/branch-warn-1.s | 11 + .../gas/testsuite/gas/cris/branch-warn-2.s | 13 + .../gas/testsuite/gas/cris/branch-warn-3.s | 13 + .../toolchain/gas/testsuite/gas/cris/branch.d | 519 + .../toolchain/gas/testsuite/gas/cris/branch.s | 270 + .../toolchain/gas/testsuite/gas/cris/break.d | 27 + .../toolchain/gas/testsuite/gas/cris/break.s | 22 + .../gas/testsuite/gas/cris/brokw-1.d | 20 + .../gas/testsuite/gas/cris/brokw-1.s | 19 + .../gas/testsuite/gas/cris/brokw-2.d | 26 + .../gas/testsuite/gas/cris/brokw-2.s | 21 + .../gas/testsuite/gas/cris/brokw-3.d | 228 + .../gas/testsuite/gas/cris/brokw-3.s | 112 + .../gas/testsuite/gas/cris/bwtest-err-1.s | 91 + .../toolchain/gas/testsuite/gas/cris/ccr.d | 71 + .../toolchain/gas/testsuite/gas/cris/ccr.s | 79 + .../toolchain/gas/testsuite/gas/cris/clear.d | 325 + .../gas/testsuite/gas/cris/continue.d | 10 + .../gas/testsuite/gas/cris/continue.s | 7 + .../toolchain/gas/testsuite/gas/cris/cris.exp | 561 + .../gas/testsuite/gas/cris/diffexp-ovwr.d | 26 + .../gas/testsuite/gas/cris/diffexp-ovwr.s | 21 + .../gas/testsuite/gas/cris/fragtest.d | 64 + .../gas/testsuite/gas/cris/fragtest.s | 70 + .../gas/testsuite/gas/cris/jump-type.d | 220 + .../gas/testsuite/gas/cris/labfloat.d | 12 + .../gas/testsuite/gas/cris/labfloat.s | 8 + .../gas/testsuite/gas/cris/macroat.d | 14 + .../gas/testsuite/gas/cris/macroat.s | 12 + .../gas/testsuite/gas/cris/movem-to-reg.d | 165 + .../toolchain/gas/testsuite/gas/cris/nosep.d | 10 + .../toolchain/gas/testsuite/gas/cris/nosep.s | 8 + .../gas/testsuite/gas/cris/oneop-type.d | 15 + .../gas/testsuite/gas/cris/operand-err-1.s | 45 + .../toolchain/gas/testsuite/gas/cris/prefix.d | 94 + .../toolchain/gas/testsuite/gas/cris/prefix.s | 247 + .../testsuite/gas/cris/pushpop-byte-sreg.d | 39 + .../testsuite/gas/cris/pushpop-dcr1-sreg.d | 15 + .../testsuite/gas/cris/pushpop-dword-sreg.d | 39 + .../testsuite/gas/cris/pushpop-word-sreg.d | 39 + .../gas/testsuite/gas/cris/pushpop.d | 90 + .../gas/testsuite/gas/cris/pushpop.s | 121 + .../gas/testsuite/gas/cris/quick-s6.d | 24 + .../gas/testsuite/gas/cris/quick-u5.d | 17 + .../gas/testsuite/gas/cris/quick-u6.d | 26 + .../toolchain/gas/testsuite/gas/cris/quick.s | 51 + .../gas/testsuite/gas/cris/range-err-1.s | 68 + .../gas/testsuite/gas/cris/range-err-2.s | 10 + .../gas/testsuite/gas/cris/rd-regprefix-1.d | 34 + .../gas/testsuite/gas/cris/rd-regprefix-1.s | 41 + .../gas/testsuite/gas/cris/rd-regprefix-1b.d | 43 + .../gas/testsuite/gas/cris/reg-to-mem.d | 165 + .../gas/testsuite/gas/cris/regprefix-err-1.s | 34 + .../toolchain/gas/testsuite/gas/cris/regreg.d | 15 + .../toolchain/gas/testsuite/gas/cris/regreg.s | 17 + .../toolchain/gas/testsuite/gas/cris/return.d | 13 + .../toolchain/gas/testsuite/gas/cris/return.s | 11 + .../toolchain/gas/testsuite/gas/cris/scc.d | 28 + .../toolchain/gas/testsuite/gas/cris/scc.s | 25 + .../gas/testsuite/gas/cris/sep-err-1.s | 6 + .../gas/testsuite/gas/cris/sep-err-2.s | 5 + .../gas/testsuite/gas/cris/sep-err-3.s | 5 + .../gas/testsuite/gas/cris/separator.d | 8 + .../gas/testsuite/gas/cris/separator.s | 16 + .../gas/testsuite/gas/cris/shexpr-1.d | 8 + .../gas/testsuite/gas/cris/shexpr-1.s | 5 + .../gas/testsuite/gas/cris/sreg-to-x.d | 216 + .../gas/testsuite/gas/cris/string-1.d | 12 + .../gas/testsuite/gas/cris/string-1.s | 8 + .../gas/testsuite/gas/cris/string-2.d | 12 + .../gas/testsuite/gas/cris/string-2.s | 7 + .../toolchain/gas/testsuite/gas/cris/test.d | 324 + .../gas/testsuite/gas/cris/unimplemented.d | 31 + .../gas/testsuite/gas/cris/unimplemented.s | 29 + .../gas/testsuite/gas/cris/unop-mem.d | 218 + .../toolchain/gas/testsuite/gas/cris/unop.s | 668 + .../gas/testsuite/gas/cris/us-err-1.s | 8 + .../gas/testsuite/gas/cris/us-err-2.s | 10 + .../gas/testsuite/gas/cris/us-err-3.s | 10 + .../gas/testsuite/gas/cris/x-to-byte-sreg.d | 94 + .../gas/testsuite/gas/cris/x-to-dcr1-sreg.d | 58 + .../gas/testsuite/gas/cris/x-to-dword-sreg.d | 182 + .../gas/testsuite/gas/cris/x-to-word-sreg.d | 153 + .../gas/testsuite/gas/d30v/bittest.l | 16 +- .../toolchain/gas/testsuite/gas/d30v/inst.d | 197 +- .../toolchain/gas/testsuite/gas/elf/elf.exp | 1 + .../gas/testsuite/gas/elf/section0.d | 8 +- .../gas/testsuite/gas/elf/section0.s | 24 +- .../gas/testsuite/gas/elf/section1.d | 8 +- .../gas/testsuite/gas/elf/section1.s | 40 +- .../gas/testsuite/gas/h8300/h8300.exp | 12 +- .../toolchain/gas/testsuite/gas/h8300/macs.s | 10 +- gnu/dist/toolchain/gas/write.c | 741 +- gnu/dist/toolchain/gas/write.h | 23 +- gnu/dist/toolchain/gettext.m4 | 344 + gnu/dist/toolchain/libtool.m4 | 840 ++ gnu/dist/toolchain/ltcf-c.sh | 689 ++ gnu/dist/toolchain/ltcf-cxx.sh | 887 ++ gnu/dist/toolchain/ltcf-gcj.sh | 571 + gnu/dist/toolchain/ltconfig | 2322 ++-- gnu/dist/toolchain/ltmain.sh | 2736 +++-- gnu/dist/toolchain/md5.sum | 2992 +++++ gnu/dist/toolchain/symlink-tree | 5 + 710 files changed, 143403 insertions(+), 60126 deletions(-) create mode 100644 gnu/dist/toolchain/bfd/ChangeLog-9899 create mode 100644 gnu/dist/toolchain/bfd/MAINTAINERS create mode 100644 gnu/dist/toolchain/bfd/aout-cris.c create mode 100644 gnu/dist/toolchain/bfd/coff-ia64.c create mode 100644 gnu/dist/toolchain/bfd/coff-tic54x.c create mode 100644 gnu/dist/toolchain/bfd/coff64-rs6000.c create mode 100644 gnu/dist/toolchain/bfd/cpu-cris.c create mode 100644 gnu/dist/toolchain/bfd/cpu-ia64-opc.c create mode 100644 gnu/dist/toolchain/bfd/cpu-ia64.c create mode 100644 gnu/dist/toolchain/bfd/cpu-m68hc11.c create mode 100644 gnu/dist/toolchain/bfd/cpu-m68hc12.c create mode 100644 gnu/dist/toolchain/bfd/cpu-tic54x.c create mode 100644 gnu/dist/toolchain/bfd/efi-app-ia32.c create mode 100644 gnu/dist/toolchain/bfd/efi-app-ia64.c create mode 100644 gnu/dist/toolchain/bfd/elf32-cris.c create mode 100644 gnu/dist/toolchain/bfd/elf32-m68hc11.c create mode 100644 gnu/dist/toolchain/bfd/elf32-m68hc12.c create mode 100644 gnu/dist/toolchain/bfd/elf32-sh-lin.c create mode 100644 gnu/dist/toolchain/bfd/elf64-hppa.c create mode 100644 gnu/dist/toolchain/bfd/elf64-hppa.h create mode 100644 gnu/dist/toolchain/bfd/elf64-x86-64.c create mode 100644 gnu/dist/toolchain/bfd/elfxx-ia64.c create mode 100644 gnu/dist/toolchain/bfd/xcoff-target.h create mode 100644 gnu/dist/toolchain/binutils/ChangeLog-9197 create mode 100644 gnu/dist/toolchain/binutils/ChangeLog-9899 create mode 100644 gnu/dist/toolchain/binutils/MAINTAINERS create mode 100644 gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.s-64 create mode 100644 gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.ss-64 create mode 100644 gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.ss-mips create mode 100644 gnu/dist/toolchain/config/mh-ia64pic create mode 100644 gnu/dist/toolchain/config/mh-openedition create mode 100644 gnu/dist/toolchain/config/mt-ia64pic create mode 100644 gnu/dist/toolchain/gas/ChangeLog-9899 create mode 100644 gnu/dist/toolchain/gas/MAINTAINERS create mode 100644 gnu/dist/toolchain/gas/config/e-crisaout.c create mode 100644 gnu/dist/toolchain/gas/config/e-criself.c create mode 100644 gnu/dist/toolchain/gas/config/tc-cris.c create mode 100644 gnu/dist/toolchain/gas/config/tc-cris.h create mode 100644 gnu/dist/toolchain/gas/config/tc-ia64.c create mode 100644 gnu/dist/toolchain/gas/config/tc-ia64.h create mode 100644 gnu/dist/toolchain/gas/config/tc-m68hc11.c create mode 100644 gnu/dist/toolchain/gas/config/tc-m68hc11.h create mode 100644 gnu/dist/toolchain/gas/config/tc-tic54x.c create mode 100644 gnu/dist/toolchain/gas/config/tc-tic54x.h create mode 100644 gnu/dist/toolchain/gas/config/te-hppa64.h create mode 100644 gnu/dist/toolchain/gas/config/te-hppalinux64.h create mode 100644 gnu/dist/toolchain/gas/config/te-hpux.h create mode 100644 gnu/dist/toolchain/gas/config/te-tmips.h create mode 100644 gnu/dist/toolchain/gas/doc/as.info-9 create mode 100644 gnu/dist/toolchain/gas/doc/c-arc.texi create mode 100644 gnu/dist/toolchain/gas/doc/c-i860.texi create mode 100644 gnu/dist/toolchain/gas/doc/c-m68hc11.texi create mode 100644 gnu/dist/toolchain/gas/doc/c-tic54x.texi create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/adc.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/adc.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/add.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/add.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/and.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/and.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/asl.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/asl.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/asr.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/asr.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/b.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/b.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/bic.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/bic.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/bl.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/bl.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/brk.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/brk.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/extb.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/extb.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/extw.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/extw.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/jl.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/jl.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/ld2.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/ld2.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/lp.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/lp.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/lsr.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/lsr.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/mov.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/mov.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/nop.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/nop.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/or.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/or.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/rlc.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/rlc.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/ror.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/ror.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/rrc.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/rrc.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/sbc.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/sbc.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/sexb.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/sexb.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/sexw.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/sexw.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/sleep.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/sleep.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/sub.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/sub.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/swi.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/swi.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/xor.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arc/xor.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arm/adrl.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arm/adrl.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arm/el_segundo.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arm/el_segundo.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arm/msr-bad.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arm/pic.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arm/pic.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arm/xscale.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/arm/xscale.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/addi.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/addi.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/binop-cmpmove.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/binop-cmpmovx.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/binop-extx.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/binop-segref.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/binop.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/binop.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/bork.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/bork.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/branch-warn-1.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/branch-warn-2.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/branch-warn-3.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/branch.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/branch.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/break.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/break.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/brokw-1.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/brokw-1.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/brokw-2.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/brokw-2.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/brokw-3.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/brokw-3.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/bwtest-err-1.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/ccr.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/ccr.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/clear.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/continue.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/continue.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/cris.exp create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/diffexp-ovwr.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/diffexp-ovwr.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/fragtest.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/fragtest.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/jump-type.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/labfloat.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/labfloat.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/macroat.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/macroat.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/movem-to-reg.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/nosep.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/nosep.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/oneop-type.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/operand-err-1.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/prefix.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/prefix.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/pushpop-byte-sreg.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/pushpop-dcr1-sreg.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/pushpop-dword-sreg.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/pushpop-word-sreg.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/pushpop.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/pushpop.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/quick-s6.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/quick-u5.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/quick-u6.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/quick.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/range-err-1.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/range-err-2.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/rd-regprefix-1.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/rd-regprefix-1.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/rd-regprefix-1b.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/reg-to-mem.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/regprefix-err-1.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/regreg.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/regreg.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/return.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/return.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/scc.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/scc.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/sep-err-1.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/sep-err-2.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/sep-err-3.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/separator.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/separator.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/shexpr-1.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/shexpr-1.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/sreg-to-x.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/string-1.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/string-1.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/string-2.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/string-2.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/test.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/unimplemented.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/unimplemented.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/unop-mem.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/unop.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/us-err-1.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/us-err-2.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/us-err-3.s create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/x-to-byte-sreg.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/x-to-dcr1-sreg.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/x-to-dword-sreg.d create mode 100644 gnu/dist/toolchain/gas/testsuite/gas/cris/x-to-word-sreg.d create mode 100644 gnu/dist/toolchain/gettext.m4 create mode 100644 gnu/dist/toolchain/libtool.m4 create mode 100644 gnu/dist/toolchain/ltcf-c.sh create mode 100644 gnu/dist/toolchain/ltcf-cxx.sh create mode 100644 gnu/dist/toolchain/ltcf-gcj.sh create mode 100644 gnu/dist/toolchain/md5.sum diff --git a/gnu/dist/toolchain/Makefile.in b/gnu/dist/toolchain/Makefile.in index ed199492618d..14a775634bc9 100644 --- a/gnu/dist/toolchain/Makefile.in +++ b/gnu/dist/toolchain/Makefile.in @@ -1,7 +1,7 @@ # # Makefile for directory with subdirs to build. -# Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998 -# Free Software Foundation +# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, +# 1999, 2000, 2001 Free Software Foundation # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -37,7 +37,8 @@ infodir=${prefix}/info mandir=${prefix}/man gxx_include_dir=${includedir}/g++ -tooldir = $(exec_prefix)/$(target) +tooldir = $(exec_prefix)/$(target_alias) +build_tooldir = $(exec_prefix)/$(target_alias) program_transform_name = @@ -97,9 +98,9 @@ CHILL_LIB = -lchill CXX = c++ # Use -O2 to stress test the compiler. -LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates -fexceptions +LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates -fexceptions +LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates RANLIB = ranlib @@ -111,6 +112,7 @@ NM = nm LD = ld BZIPPROG = bzip2 +MD5PROG = md5sum # These values are substituted by configure. DEFAULT_YACC = yacc @@ -167,9 +169,7 @@ OTHERS = # This is set by the configure script to the list of directories which # should be built using the target tools. - - -TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib libio librx libstdc++ libg++ winsup opcodes bsp libstub cygmon +TARGET_CONFIGDIRS = libiberty libgloss $(SPECIAL_LIBS) newlib libio librx libstdc++ libg++ winsup opcodes bsp libstub cygmon libf2c libchill libobjc # Target libraries are put under this directory: # Changed by configure to $(target_alias) if cross. @@ -186,14 +186,19 @@ SET_LIB_PATH = # the libraries. This may be changed by configure.in. RPATH_ENVVAR = LD_LIBRARY_PATH +# This is the list of directories that may be needed in RPATH_ENVVAR +# so that programs built for the host machine work. +HOST_LIB_PATH = $$r/bfd:$$r/opcodes + +# This is the list of directories that may be needed in RPATH_ENVVAR +# so that prorgams built for the target machine work. +TARGET_LIB_PATH = $$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs:$$r/$(TARGET_SUBDIR)/libstdc++ + # configure.in sets SET_LIB_PATH to this if --enable-shared was used. +# Some platforms don't like blank entries, so we remove duplicate, +# leading and trailing colons. REALLY_SET_LIB_PATH = \ - if [ x"$$$(RPATH_ENVVAR)" != x ]; then \ - $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes:$$$(RPATH_ENVVAR); \ - else \ - $(RPATH_ENVVAR)=$$r/bfd:$$r/opcodes; \ - fi; \ - export $(RPATH_ENVVAR); + $(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH):$(TARGET_LIB_PATH):$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); ALL = all.normal INSTALL_TARGET = installdirs \ @@ -210,66 +215,17 @@ INSTALL_TARGET_CROSS = installdirs \ $(INSTALL_X11_MODULES) \ $(INSTALL_DOSREL) -CC_FOR_TARGET = ` \ - if [ -f $$r/gcc/xgcc ] ; then \ - if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \ - case "$(target_canonical)" in \ - i[3456]86-*-cygwin*) \ - echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/winsup/include -idirafter $$s/newlib/libc/include -idirafter $$s/newlib/libc/sys/cygwin -idirafter $$s/newlib/libc/sys/cygwin32 -nostdinc; \ - ;; \ - *) \ - echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \ - ;; \ - esac \ - else \ - echo $$r/gcc/xgcc -B$$r/gcc/; \ - fi; \ - else \ - if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ - echo $(CC); \ - else \ - t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \ - fi; \ - fi` +# Should be substed by configure.in +FLAGS_FOR_TARGET = +CC_FOR_TARGET = +CHILL_FOR_TARGET = +CXX_FOR_TARGET = -# If CC_FOR_TARGET is not overriden on the command line, then this +# 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 # build libgcc2.a. We define it here so that it can itself be # overridden on the command line. -GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ - -CHILL_FOR_TARGET = ` \ - if [ -f $$r/gcc/xgcc ] ; then \ - echo $$r/gcc/xgcc -B$$r/gcc/ -L$$r/gcc/ch/runtime/; \ - else \ - if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ - echo $(CC); \ - else \ - t='$(program_transform_name)'; echo gcc | sed -e 's/x/x/' $$t; \ - fi; \ - fi` - -CXX_FOR_TARGET = ` \ - if [ -f $$r/gcc/xgcc ] ; then \ - if [ -f $$r/$(TARGET_SUBDIR)/newlib/Makefile ] ; then \ - case "$(target_canonical)" in \ - i[3456]86-*-cygwin*) \ - echo $$r/gcc/xgcc -B$$r/gcc/ -B$$r/$(TARGET_SUBDIR)/newlib/ -L$$r/$(TARGET_SUBDIR)/winsup -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/winsup/include -idirafter $$s/newlib/libc/include -idirafter $$s/newlib/libc/sys/cygwin -idirafter $$s/newlib/libc/sys/cygwin32 -nostdinc; \ - ;; \ - *) \ - echo $$r/gcc/xgcc -B$$r/gcc/ -idirafter $$r/$(TARGET_SUBDIR)/newlib/targ-include -idirafter $$s/newlib/libc/include -nostdinc; \ - ;; \ - esac \ - else \ - echo $$r/gcc/xgcc -B$$r/gcc/; \ - fi; \ - else \ - if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ - echo $(CXX); \ - else \ - t='$(program_transform_name)'; echo c++ | sed -e 's/x/x/' $$t; \ - fi; \ - fi` +GCC_FOR_TARGET = $$r/gcc/xgcc -B$$r/gcc/ $(FLAGS_FOR_TARGET) AS_FOR_TARGET = ` \ if [ -f $$r/gas/as-new ] ; then \ @@ -422,6 +378,7 @@ BASE_FLAGS_TO_PASS = \ "sharedstatedir=$(sharedstatedir)" \ "sysconfdir=$(sysconfdir)" \ "tooldir=$(tooldir)" \ + "build_tooldir=$(build_tooldir)" \ "gxx_include_dir=$(gxx_include_dir)" \ "gcc_version=$(gcc_version)" \ "gcc_version_trigger=$(gcc_version_trigger)" \ @@ -521,6 +478,7 @@ ALL_MODULES = \ all-bison \ all-byacc \ all-bzip2 \ + all-cgen \ all-cvssrc \ all-db \ all-dejagnu \ @@ -563,7 +521,9 @@ ALL_MODULES = \ all-sed \ all-send-pr \ all-shellutils \ + all-sid \ all-sim \ + all-snavigator \ all-tar \ all-tcl \ all-tcl8.1 \ @@ -574,6 +534,7 @@ ALL_MODULES = \ all-uudecode \ all-wdiff \ all-zip \ + all-zlib \ $(EXTRA_TARGET_HOST_ALL_MODULES) # This is a list of the check targets for all of the modules which are @@ -597,6 +558,7 @@ CROSS_CHECK_MODULES = \ check-bfd \ check-binutils \ check-bzip2 \ + check-cgen \ check-cvssrc \ check-db \ check-dejagnu \ @@ -635,6 +597,8 @@ CROSS_CHECK_MODULES = \ check-sed \ check-send-pr \ check-shellutils \ + check-snavigator \ + check-sid \ check-sim \ check-tar \ check-tcl \ @@ -667,6 +631,7 @@ INSTALL_MODULES = \ install-binutils \ install-bison \ install-byacc \ + install-cgen \ install-cvssrc \ install-db \ install-dejagnu \ @@ -709,7 +674,9 @@ INSTALL_MODULES = \ install-sed \ install-send-pr \ install-shellutils \ + install-sid \ install-sim \ + install-snavigator \ install-tar \ install-textutils \ install-tgas \ @@ -764,9 +731,13 @@ INSTALL_X11_MODULES = \ ALL_TARGET_MODULES = \ all-target-libio \ all-target-libstdc++ \ + all-target-libstdc++-v3 \ all-target-librx \ all-target-libg++ \ all-target-newlib \ + all-target-libf2c \ + all-target-libchill \ + all-target-libobjc \ all-target-libtermcap \ all-target-winsup \ all-target-libgloss \ @@ -774,6 +745,11 @@ ALL_TARGET_MODULES = \ all-target-gperf \ all-target-examples \ all-target-libstub \ + all-target-libffi \ + all-target-libjava \ + all-target-zlib \ + all-target-boehm-gc \ + all-target-qthreads \ all-target-bsp \ all-target-cygmon @@ -782,9 +758,13 @@ ALL_TARGET_MODULES = \ CONFIGURE_TARGET_MODULES = \ configure-target-libio \ configure-target-libstdc++ \ + configure-target-libstdc++-v3 \ configure-target-librx \ configure-target-libg++ \ configure-target-newlib \ + configure-target-libf2c \ + configure-target-libchill \ + configure-target-libobjc \ configure-target-libtermcap \ configure-target-winsup \ configure-target-libgloss \ @@ -792,6 +772,11 @@ CONFIGURE_TARGET_MODULES = \ configure-target-gperf \ configure-target-examples \ configure-target-libstub \ + configure-target-libffi \ + configure-target-libjava \ + configure-target-zlib \ + configure-target-boehm-gc \ + configure-target-qthreads \ configure-target-bsp \ configure-target-cygmon @@ -800,10 +785,19 @@ CONFIGURE_TARGET_MODULES = \ CHECK_TARGET_MODULES = \ check-target-libio \ check-target-libstdc++ \ + check-target-libstdc++-v3 \ check-target-libg++ \ check-target-newlib \ + check-target-libf2c \ + check-target-libchill \ + check-target-libobjc \ check-target-winsup \ check-target-libiberty \ + check-target-libffi \ + check-target-libjava \ + check-target-zlib \ + check-target-boehm-gc \ + check-target-qthreads \ check-target-gperf # This is a list of the install targets for all of the modules which are @@ -811,13 +805,21 @@ CHECK_TARGET_MODULES = \ INSTALL_TARGET_MODULES = \ install-target-libio \ install-target-libstdc++ \ + install-target-libstdc++-v3 \ install-target-libg++ \ install-target-newlib \ + install-target-libf2c \ + install-target-libchill \ + install-target-libobjc \ install-target-libtermcap \ install-target-winsup \ install-target-libgloss \ install-target-libiberty \ install-target-bsp \ + install-target-libjava \ + install-target-zlib \ + install-target-boehm-gc \ + install-target-qthreads \ install-target-gperf # This is a list of the targets for which we can do a clean-{target}. @@ -832,6 +834,7 @@ CLEAN_MODULES = \ clean-bison \ clean-byacc \ clean-bzip2 \ + clean-cgen \ clean-cvssrc \ clean-db \ clean-dejagnu \ @@ -874,7 +877,9 @@ CLEAN_MODULES = \ clean-sed \ clean-send-pr \ clean-shellutils \ + clean-sid \ clean-sim \ + clean-snavigator \ clean-tar \ clean-tcl \ clean-texinfo \ @@ -883,21 +888,31 @@ CLEAN_MODULES = \ clean-time \ clean-uudecode \ clean-wdiff \ - clean-zip + clean-zip \ + clean-zlib # All of the target modules that can be cleaned CLEAN_TARGET_MODULES = \ clean-target-libio \ clean-target-libstdc++ \ + clean-target-libstdc++-v3 \ clean-target-librx \ clean-target-libg++ \ clean-target-newlib \ + clean-target-libf2c \ + clean-target-libchill \ + clean-target-libobjc \ clean-target-winsup \ clean-target-libgloss \ clean-target-libiberty \ clean-target-gperf \ clean-target-examples \ clean-target-libstub \ + clean-target-libffi \ + clean-target-libjava \ + clean-target-zlib \ + clean-target-boehm-gc \ + clean-target-qthreads \ clean-target-bsp \ clean-target-cygmon @@ -1052,7 +1067,12 @@ $(CLEAN_TARGET_MODULES): true; \ fi -clean-target: $(CLEAN_TARGET_MODULES) +clean-target: $(CLEAN_TARGET_MODULES) clean-target-libgcc +clean-target-libgcc: + test ! -d gcc/libgcc || \ + (cd gcc/libgcc && find . -type d -print) | \ + while read d; do rm -f gcc/$$d/libgcc.a || : ; done + -rm -rf gcc/libgcc # Check target. @@ -1154,7 +1174,6 @@ gcc-no-fixedincludes: mv gcc/tmp-include gcc/include 2>/dev/null; \ else true; fi - # This rule is used to build the modules which use FLAGS_TO_PASS. To # build a target all-X means to cd to X and make all. # @@ -1433,12 +1452,12 @@ all-gcc: # in parallel. # .PHONY: bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean -bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean: all-texinfo all-bison all-byacc all-binutils all-gas all-ld +bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean bootstrap4 bootstrap4-lean: all-bootstrap @r=`pwd`; export r; \ s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ echo "Bootstrapping the compiler"; \ - cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $@ + cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $@ @r=`pwd`; export r; \ s=`cd $(srcdir); pwd`; export s; \ case "$@" in \ @@ -1454,7 +1473,7 @@ bootstrap bootstrap-lean bootstrap2 bootstrap2-lean bootstrap3 bootstrap3-lean b esac; \ $(SET_LIB_PATH) \ echo "$$msg"; \ - cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare + cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) $$compare @r=`pwd`; export r; \ s=`cd $(srcdir); pwd` ; export s; \ $(SET_LIB_PATH) \ @@ -1467,7 +1486,7 @@ cross: all-texinfo all-bison all-byacc all-binutils all-gas all-ld s=`cd $(srcdir); pwd`; export s; \ $(SET_LIB_PATH) \ echo "Building the C and C++ compiler"; \ - cd gcc; $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" + cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) LANGUAGES="c c++" @r=`pwd`; export r; \ s=`cd $(srcdir); pwd` ; export s; \ $(SET_LIB_PATH) \ @@ -1533,20 +1552,23 @@ all-bash: all-bfd: all-libiberty all-intl all-binutils: all-libiberty all-opcodes all-bfd all-flex all-bison all-byacc all-intl all-bison: all-texinfo -configure-target-bsp: $(ALL_GCC) -all-target-bsp: configure-target-bsp all-gcc all-binutils all-target-newlib +configure-target-boehm-gc: $(ALL_GCC_CXX) configure-target-qthreads +all-target-boehm-gc: configure-target-boehm-gc +configure-target-bsp: $(ALL_GCC_C) +all-target-bsp: configure-target-bsp all-byacc: all-bzip2: +all-cgen: all-libiberty all-cvssrc: -configure-target-cygmon: $(ALL_GCC) -all-target-cygmon: configure-target-cygmon all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-libstub all-target-bsp +configure-target-cygmon: $(ALL_GCC_C) +all-target-cygmon: configure-target-cygmon all-target-libiberty all-target-libio all-target-libstub all-target-bsp all-db: all-dejagnu: all-tcl all-expect all-tk all-diff: all-libiberty all-emacs: all-emacs19: all-bison all-byacc all-etc: -configure-target-examples: $(ALL_GCC) +configure-target-examples: $(ALL_GCC_C) all-target-examples: configure-target-examples all-expect: all-tcl all-tk all-fileutils: all-libiberty @@ -1557,15 +1579,18 @@ all-gas: all-libiberty all-opcodes all-bfd all-intl all-gash: all-tcl all-gawk: ALL_GCC = all-gcc -all-gcc: all-bison all-byacc all-binutils all-gas all-ld -all-bootstrap: all-libiberty all-bison all-byacc all-binutils all-gas all-ld +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) +configure-target-gperf: $(ALL_GCC_C) all-target-gperf: configure-target-gperf all-target-libiberty all-target-libstdc++ all-gprof: all-libiberty all-bfd all-opcodes all-intl +all-grep: all-libiberty all-grez: all-libiberty all-bfd all-opcodes all-gui: all-gdb all-libproc all-target-librx all-guile: @@ -1577,40 +1602,56 @@ all-intl: all-ispell: all-emacs19 all-itcl: all-tcl all-tk all-tcl8.1 all-tk8.1 all-ld: all-libiberty all-bfd all-opcodes all-bison all-byacc all-flex all-intl -configure-target-libg++: $(ALL_GCC) configure-target-librx -all-target-libg++: configure-target-libg++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio all-target-librx all-target-libstdc++ +configure-target-libg++: $(ALL_GCC_CXX) configure-target-librx +all-target-libg++: configure-target-libg++ all-target-libiberty all-target-librx configure-target-libgloss: $(ALL_GCC) all-target-libgloss: configure-target-libgloss configure-target-newlib -configure-target-libio: $(ALL_GCC) +configure-target-libio: $(ALL_GCC_C) all-target-libio: configure-target-libio all-gas all-ld all-gcc all-target-libiberty all-target-newlib -check-target-libio: +check-target-libio: all-target-libstdc++ all-libgui: all-tcl all-tk all-tcl8.1 all-tk8.1 all-itcl all-libiberty: -configure-target-librx: $(ALL_GCC) configure-target-newlib +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 +all-target-libjava: configure-target-libjava all-zip all-target-zlib all-target-boehm-gc all-target-qthreads all-target-libffi +configure-target-librx: $(ALL_GCC_C) all-target-librx: configure-target-librx -configure-target-libstdc++: $(ALL_GCC) -all-target-libstdc++: configure-target-libstdc++ all-gas all-ld all-gcc all-target-libiberty all-target-newlib all-target-libio -configure-target-libstub: $(ALL_GCC) +configure-target-libstdc++: $(ALL_GCC_C) +all-target-libstdc++: configure-target-libstdc++ all-target-libiberty all-target-libio +configure-target-libstdc++-v3: $(ALL_GCC_C) +all-target-libstdc++-v3: configure-target-libstdc++-v3 all-target-libiberty +configure-target-libstub: $(ALL_GCC_C) all-target-libstub: configure-target-libstub all-libtool: +configure-target-libf2c: $(ALL_GCC_C) +all-target-libf2c: configure-target-libf2c all-target-libiberty +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-make: all-libiberty all-mmalloc: configure-target-newlib: $(ALL_GCC) -configure-target-libtermcap: $(ALL_GCC) -all-target-newlib: configure-target-newlib all-binutils all-gas all-gcc -all-target-libtermcap: configure-target-libtermcap all-binutils all-gas all-gcc -all-opcodes: all-bfd all-libiberty +all-target-newlib: configure-target-newlib +configure-target-libtermcap: $(ALL_GCC_C) +all-target-libtermcap: configure-target-libtermcap +all-opcodes: all-bfd all-libiberty all-cgen all-patch: all-libiberty all-perl: all-prms: all-libiberty +configure-target-qthreads: $(ALL_GCC_C) +all-target-qthreads: configure-target-qthreads all-rcs: all-readline: all-recode: all-libiberty all-sed: all-libiberty all-send-pr: all-prms all-shellutils: -all-sim: all-libiberty all-bfd all-opcodes all-readline +all-sid: all-tcl all-tk +all-sim: all-libiberty all-bfd all-opcodes all-readline all-cgen +all-snavigator: all-tcl all-tk all-itcl all-db all-grep all-libgui all-tar: all-libiberty all-tcl: all-tcl8.1: @@ -1623,15 +1664,19 @@ all-tgas: all-libiberty all-bfd all-opcodes all-time: all-tix: all-tcl all-tk all-tcl8.1 all-tk8.1 all-wdiff: -all-target-winsup: all-target-newlib all-target-libiberty all-target-libtermcap configure-target-winsup -configure-target-winsup: configure-target-newlib +configure-target-winsup: $(ALL_GCC_C) +all-target-winsup: all-target-libiberty all-target-libtermcap configure-target-winsup all-uudecode: all-libiberty all-zip: -configure-target-libiberty: $(ALL_GCC) -all-target-libiberty: configure-target-libiberty all-gcc all-ld all-target-newlib +all-zlib: +configure-target-zlib: $(ALL_GCC_C) +all-target-zlib: configure-target-zlib +configure-target-libiberty: $(ALL_GCC_C) +all-target-libiberty: configure-target-libiberty all-target: $(ALL_TARGET_MODULES) install-target: $(INSTALL_TARGET_MODULES) install-gdb: install-tcl install-tk install-itcl install-tix install-libgui +install-sid: install-tcl install-tk ### other supporting targets MAKEDIRS= \ @@ -1677,22 +1722,67 @@ DEVO_SUPPORT= README Makefile.in configure configure.in \ config.guess config.if config.sub config move-if-change \ mpw-README mpw-build.in mpw-config.in mpw-configure mpw-install \ COPYING COPYING.LIB install-sh config-ml.in symlink-tree \ - mkinstalldirs ltconfig ltmain.sh missing ylwrap + mkinstalldirs ltconfig ltmain.sh missing ylwrap \ + libtool.m4 gettext.m4 ltcf-c.sh ltcf-cxx.sh ltcf-gcj.sh # Files in devo/etc used in any net release. # ChangeLog omitted because it may refer to files which are not in this # distribution (perhaps it would be better to include it anyway). ETC_SUPPORT= Makefile.in configure configure.in standards.texi \ make-stds.texi standards.info* configure.texi configure.info* \ - configbuild.* configdev.* + configbuild.* configdev.* + # When you use `make setup-dirs' or `make taz' you should always redefine # this macro. SUPPORT_FILES = list-of-support-files-for-tool-in-question -.PHONY: taz +# NOTE: No double quotes in the below. It is used within shell script +# as VER="$(VER)" +VER = ` if grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \ + sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'; \ + else \ + sed < $(TOOL)/Makefile.in -n 's/^VERSION *= *//p'; \ + fi` +PACKAGE = $(TOOL) +.PHONY: taz taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex + $(MAKE) -f Makefile.in do-proto-toplev \ + TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ + MD5PROG="$(MD5PROG)" \ + SUPPORT_FILES="$(SUPPORT_FILES)" + $(MAKE) -f Makefile.in do-md5sum \ + TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ + MD5PROG="$(MD5PROG)" \ + SUPPORT_FILES="$(SUPPORT_FILES)" + $(MAKE) -f Makefile.in do-tar-bz2 \ + TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ + MD5PROG="$(MD5PROG)" \ + SUPPORT_FILES="$(SUPPORT_FILES)" + +.PHONY: gdb-taz +gdb-taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex + $(MAKE) -f Makefile.in do-proto-toplev \ + TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ + MD5PROG="$(MD5PROG)" \ + SUPPORT_FILES="$(SUPPORT_FILES)" + $(MAKE) -f Makefile.in do-md5sum \ + TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ + MD5PROG="$(MD5PROG)" \ + SUPPORT_FILES="$(SUPPORT_FILES)" + $(MAKE) -f Makefile.in do-djunpack \ + TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ + MD5PROG="$(MD5PROG)" \ + SUPPORT_FILES="$(SUPPORT_FILES)" + $(MAKE) -f Makefile.in do-tar-bz2 \ + TOOL=$(TOOL) PACKAGE="$(PACKAGE)" VER="$(VER)" \ + MD5PROG="$(MD5PROG)" \ + SUPPORT_FILES="$(SUPPORT_FILES)" + +.PHONY: do-proto-toplev +do-proto-toplev: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex + echo "==> Making $(PACKAGE)-$(VER)/" # Take out texinfo from a few places. sed -e '/^all\.normal: /s/\all-texinfo //' \ -e '/^ install-texinfo /d' \ @@ -1701,7 +1791,8 @@ taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex # ./configure sun4 [ -z "$(CONFIGURE_TARGET_MODULES)" ] \ - || $(MAKE) $(CONFIGURE_TARGET_MODULES) ALL_GCC="" \ + || $(MAKE) $(CONFIGURE_TARGET_MODULES) \ + ALL_GCC="" ALL_GCC_C="" ALL_GCC_CXX="" \ CC_FOR_TARGET="$(CC)" CXX_FOR_TARGET="$(CXX)" # Make links, and run "make diststuff" or "make info" when needed. rm -rf proto-toplev ; mkdir proto-toplev @@ -1721,7 +1812,7 @@ taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex fi ; \ else ln -s ../$$d proto-toplev/$$d ; fi ; \ done - cd etc ; $(MAKE) info + cd etc && $(MAKE) info $(MAKE) distclean # mkdir proto-toplev/etc @@ -1742,25 +1833,35 @@ taz: $(DEVO_SUPPORT) $(SUPPORT_FILES) texinfo/texinfo.tex ln -s ../../../texinfo/util/tex3patch proto-toplev/texinfo/util ; \ else true; fi chmod -R og=u . || chmod og=u `find . -print` - if grep AM_INIT_AUTOMAKE $(TOOL)/configure.in >/dev/null 2>&1; then \ - ver=`sed < $(TOOL)/configure.in -n 's/AM_INIT_AUTOMAKE[^,]*, *\([^)]*\))/\1/p'`; \ - else \ - ver=`sed <$(TOOL)/Makefile.in -n 's/^VERSION *= *//p'`; \ - fi; \ - if test x"$(PACKAGE)" = x; then \ - package="$(TOOL)"; \ - else \ - package="$(PACKAGE)"; \ - fi; \ - $(MAKE) -f Makefile.in do-tar-bz2 TOOL=$(TOOL) VER=$$ver PACKAGE=$$package - -do-tar-bz2: - echo "==> Making $(PACKAGE)-$(VER).tar.bz2" + # -rm -f $(PACKAGE)-$(VER) ln -s proto-toplev $(PACKAGE)-$(VER) - tar cfh $(PACKAGE)-$(VER).tar $(PACKAGE)-$(VER) + +.PHONY: do-tar-bz2 +do-tar-bz2: + echo "==> Making $(PACKAGE)-$(VER).tar.bz2" + -rm -f $(PACKAGE)-$(VER).tar.bz2 + find $(PACKAGE)-$(VER) -follow -name CVS -prune -o -type f -print \ + | tar cTfh - $(PACKAGE)-$(VER).tar $(BZIPPROG) -v -9 $(PACKAGE)-$(VER).tar +.PHONY: do-md5sum +do-md5sum: + echo "==> Adding md5 checksum to top-level directory" + cd proto-toplev && find * -follow -name CVS -prune -o -type f -print \ + | xargs $(MD5PROG) > ../md5.sum + mv md5.sum proto-toplev + +.PHONY: do-djunpack +do-djunpack: + echo "==> Adding updated djunpack.bat to top-level directory" + echo - 's /gdb-[0-9\.]*/gdb-'"$(VER)"'/' + sed < djunpack.bat > djunpack.new \ + -e 's/gdb-[0-9][0-9\.]*/gdb-'"$(VER)"'/' + mv djunpack.new djunpack.bat + -rm -f proto-toplev/djunpack.bat + ln -s ../djunpack.bat proto-toplev/djunpack.bat + TEXINFO_SUPPORT= texinfo/texinfo.tex DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT) @@ -1768,6 +1869,7 @@ DIST_SUPPORT= $(DEVO_SUPPORT) $(TEXINFO_SUPPORT) GAS_SUPPORT_DIRS= bfd include libiberty opcodes intl setup.com makefile.vms mkdep gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas $(MAKE) -f Makefile.in taz TOOL=gas \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(GAS_SUPPORT_DIRS)" # The FSF "binutils" release includes gprof and ld. @@ -1775,53 +1877,62 @@ gas.tar.bz2: $(DIST_SUPPORT) $(GAS_SUPPORT_DIRS) gas BINUTILS_SUPPORT_DIRS= bfd gas include libiberty opcodes ld gprof intl setup.com makefile.vms mkdep binutils.tar.bz2: $(DIST_SUPPORT) $(BINUTILS_SUPPORT_DIRS) binutils $(MAKE) -f Makefile.in taz TOOL=binutils \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(BINUTILS_SUPPORT_DIRS)" .PHONY: gas+binutils.tar.bz2 GASB_SUPPORT_DIRS= $(GAS_SUPPORT_DIRS) binutils ld gprof gas+binutils.tar.bz2: $(DIST_SUPPORT) $(GASB_SUPPORT_DIRS) gas $(MAKE) -f Makefile.in taz TOOL=gas \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(GASB_SUPPORT_DIRS)" .PHONY: libg++.tar.bz2 LIBGXX_SUPPORT_DIRS=include libstdc++ libio librx libiberty libg++.tar.bz2: $(DIST_SUPPORT) libg++ $(MAKE) -f Makefile.in taz TOOL=libg++ \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(LIBGXX_SUPPORT_DIRS)" GNATS_SUPPORT_DIRS=include libiberty send-pr gnats.tar.bz2: $(DIST_SUPPORT) $(GNATS_SUPPORT_DIRS) gnats $(MAKE) -f Makefile.in taz TOOL=gnats \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)" .PHONY: gdb.tar.bz2 GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils intl gdb.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb - $(MAKE) -f Makefile.in taz TOOL=gdb \ + $(MAKE) -f Makefile.in gdb-taz TOOL=gdb \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(GDB_SUPPORT_DIRS)" .PHONY: dejagnu.tar.bz2 DEJAGNU_SUPPORT_DIRS= tcl expect libiberty dejagnu.tar.bz2: $(DIST_SUPPORT) $(DEJAGNU_SUPPORT_DIRS) dejagnu $(MAKE) -f Makefile.in taz TOOL=dejagnu \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(DEJAGNU_SUPPORT_DIRS)" .PHONY: gdb+dejagnu.tar.bz2 GDBD_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl expect dejagnu gdb+dejagnu.tar.bz2: $(DIST_SUPPORT) $(GDBD_SUPPORT_DIRS) gdb - $(MAKE) -f Makefile.in taz TOOL=gdb PACKAGE=gdb+dejagnu \ + $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=gdb+dejagnu \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(GDBD_SUPPORT_DIRS)" .PHONY: insight.tar.bz2 INSIGHT_SUPPORT_DIRS= $(GDB_SUPPORT_DIRS) tcl tk itcl tix libgui insight.tar.bz2: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb - $(MAKE) -f Makefile.in taz TOOL=gdb PACKAGE=insight \ + $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE=insight \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(INSIGHT_SUPPORT_DIRS)" .PHONY: insight+dejagnu.tar.bz2 INSIGHTD_SUPPORT_DIRS= $(INSIGHT_SUPPORT_DIRS) expect dejagnu insight+dejagnu.tar.bz2: $(DIST_SUPPORT) $(INSIGHTD_SUPPORT_DIRS) gdb - $(MAKE) -f Makefile.in taz TOOL=gdb PACKAGE="insight+dejagnu" \ + $(MAKE) -f Makefile.in gdb-taz TOOL=gdb PACKAGE="insight+dejagnu" \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(INSIGHTD_SUPPORT_DIRS)" .PHONY: newlib.tar.bz2 @@ -1839,6 +1950,7 @@ NEWLIB_SUPPORT_DIRS=libgloss # supports newlib (if only minimally). newlib.tar.bz2: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib $(MAKE) -f Makefile.in taz TOOL=newlib \ + MD5PROG="$(MD5PROG)" \ SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \ DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" newlib diff --git a/gnu/dist/toolchain/bfd/ChangeLog b/gnu/dist/toolchain/bfd/ChangeLog index 638ea679922f..380d1ffac71c 100644 --- a/gnu/dist/toolchain/bfd/ChangeLog +++ b/gnu/dist/toolchain/bfd/ChangeLog @@ -1,10 +1,1015 @@ +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. - From mainline 2000-04-03 Kazu Hirata - * coff-h8300.c (h8300_reloc16_extra_cases): Add bsr:16 -> bsr:8 to - the R_PCRWORD_B case. +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 @@ -17,148 +1022,1854 @@ 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. - From 2000-05-23 H.J. Lu - * elf32-ppc.c (ppc_elf_relocate_section): Fix a typo. - 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 + (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-23 Philip Blundell - From 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. +2000-10-25 Chris Demetriou -2000-10-23 Philip Blundell + * ieee.c (ieee_archive_p): Plug one of many possible + memory leaks in error handling. - * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Undo previous - accidental checkin. +2000-10-20 Jakub Jelinek -2000-10-22 Philip Blundell + * 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. - * elf32-arm.h (elf32_arm_finish_dynamic_symbol): Don't make - PLT entries that could serve as a definition for a weak symbol. +2000-10-16 Geoffrey Keating - From 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 (). + * elf64-sparc.c (sparc64_elf_relocate_section): Clear the location + of a GOT reloc. - From 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-sparc.c (sparc64_elf_relocate_section): Likewise. + * 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-16 Geoffrey Keating +2000-10-14 Geoffrey Keating - From 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-15 Philip Blundell +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 - From 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. - From 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-08 Kazu Hirata - From 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. + * archive.c: Fix formatting. + * coff-arm.c: Likewise. + * doc/chew.c: Likewise. - From 2000-05-22 H.J. Lu - * elflink.h (elf_link_output_extsym): Clear the visibility - field for symbols not defined locally. +2000-09-08 Alan Modra - From 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. + * section.c (bfd_get_unique_section_name): Put a dot before the + numeric suffix. -2000-10-16 Philip Blundell +2000-09-07 Kazu Hirata - * configure.in: Set version to 2.10.1. - * configure: Regenerate. + * doc/chew.c: Remove all uses of DEFUN and DEFUN_VOID. + * elf.c: Fix formatting. -2000-09-24 H.J. Lu +2000-09-07 Alexandre Oliva - From 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. + * 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 Philip Blundell +2000-09-06 Geoffrey Keating - Merge from mainline: - - 2000-05-31 Ulrich Drepper + * xcofflink.c (xcoff_link_input_bfd): Include the .tocbss + pseduo-section when determining where the TOC ends. - * 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. + * 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. - (armeb-*-elf, arm*b-*-linux-gnu*): Likewise. + +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-04-14 Matthew Green - - * config.bfd: Add NetBSD/sparc64 support. +2000-08-22 H.J. Lu -2000-05-31 Mark Kettenis + * 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 - Add support for FreeBSD/Alpha. - * configure.in: Add alpha*-*-freebsd* entry to prevent including - OSF core file support. * 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. + * 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. @@ -180,18 +2891,150 @@ * opncls.c (bfd_close_all_done): Mask file perms with 0777 not 0x777. -2000-05-23 Philip Blundell +2000-05-26 Jakub Jelinek - * configure.in: Set version to 2.10. + * 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. -Sat Jul 3 10:35:19 CDT 1999 Joel Sherrill +2000-05-22 Momchil Velikov - * config.bfd (sparc-rtemself): Added. - (sparc-rtemsaout): Added as alternate name for current sparc-rtems. - (sparc-rtems): Switched to ELF from a.out - (i386-rtemscoff): Added as alternate name for current i386-rtems. - (i386-rtems): Switched to ELF. + * 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 @@ -222,6 +3065,40 @@ Sat Jul 3 10:35:19 CDT 1999 Joel Sherrill (_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 @@ -233,6 +3110,109 @@ Sat Jul 3 10:35:19 CDT 1999 Joel Sherrill * 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. @@ -241,12 +3221,286 @@ Sat Jul 3 10:35:19 CDT 1999 Joel Sherrill * 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. + +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. +Mon Apr 17 19:14:36 2000 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. @@ -257,6 +3511,117 @@ Sat Jul 3 10:35:19 CDT 1999 Joel Sherrill 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. + +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. + +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. + +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 + + * 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. + +Wed Apr 5 22:04:20 2000 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. @@ -270,6 +3635,13 @@ Sat Jul 3 10:35:19 CDT 1999 Joel Sherrill 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 @@ -281,6 +3653,23 @@ Sat Jul 3 10:35:19 CDT 1999 Joel Sherrill 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 @@ -352,7 +3741,7 @@ Wed Mar 30 15:28:00 2000 Donald Lindsay 2000-03-11 Alan Modra - * ieee.c (ieee_archive_p): Return bfd_error_wrong_format on + * 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. @@ -462,7 +3851,7 @@ Wed Mar 30 15:28:00 2000 Donald Lindsay 'srelgot'. * elf32-mcore.c (mcore_elf_relocate_section): Initialise - 'oldinst'. + 'oldinst'. * elf32-mips.c: Add ATTRIBUTE_UNUSED to unused function parameters. @@ -473,13 +3862,13 @@ Wed Mar 30 15:28:00 2000 Donald Lindsay * 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. + * peicode.h (pe_ILF_build_a_bfd): Initialise id6. 2000-03-01 H.J. Lu @@ -538,7 +3927,7 @@ Wed Mar 30 15:28:00 2000 Donald Lindsay * configure: regenerate. * config.bfd: Add support for arm-wince, mips-pe and sh-pe - targets. + targets. * targets.c: Add mips and sh pe vectors. @@ -613,7 +4002,7 @@ Fri Feb 25 18:39:26 2000 Rodney Brown (RodneyBrown@pmsc.com) 2000-02-24 Catherine Moore * som.c (som_misc_symbol_info): Add field - secondary_def. + secondary_def. (som_bfd_derive_misc_symbol_info): Initialize secondary_def. (som_build_and_write_symbol_table): Keep track @@ -627,7 +4016,7 @@ Fri Feb 25 18:39:26 2000 Rodney Brown (RodneyBrown@pmsc.com) * 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. @@ -808,7 +4197,7 @@ Thu Feb 17 00:04:48 2000 J"orn Rennecke 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 + * 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. @@ -846,7 +4235,7 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) * (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 + * (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. @@ -857,7 +4246,7 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) the arch/mach info. 2000-02-08 Mark Elbrecht - + * coff-go32.c: Update comment. Update copyright. 2000-01-27 Thomas de Lellis @@ -874,12 +4263,12 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) (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 @@ -918,8 +4307,8 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) * coffcode.h: Use bfd_coff_xxx instead of the macro XXX (where xxx = scnhsz, filhsz, relsz, aoutsz, etc) - * coffswap.h: Ditto. - + * coffswap.h: Ditto. + 2000-01-13 Nick Clifton * elf32-arm.h (elf32_thumb_to_arm_stub): Fix offset in branch to @@ -940,27 +4329,27 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) * 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 funcitoning DLLs. + dlltool to build functioning DLLs. 2000-01-10 Philip Blundell @@ -969,14 +4358,14 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) 2000-01-10 Egor Duda - * config.bfd: Include elf32_i386 vector to target list for cygwin + * 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. @@ -988,5594 +4377,7 @@ Thu Feb 10 20:07:50 GMT 2000 Toshiyasu Morita (toshi.morita@sega.com) * elflink.h (elf_link_add_object_symbols): Combine visibilities. * elf.c (bfd_elf_print_symbol): Interpret st_other as visibility. -1999-12-29 Richard Henderson - - * elflink.h (bfd_elf,size_dynamic_sections): Don't export all - if no dynamic sections created. - -1999-12-27 Nick Clifton - - * peicode.h (pe_bfd_object_p): Only define for PE format - targets. - -1999-12-17 Nick Clifton - - * coff-i386.c (i3coff_object_p): Delete. - (i386coff_vec): Replace reference to i3coff_object_p with a - reference to coff_object_p. - - * coff-mcore.c (pe_object_p): Delete. - - * peicode.h (pe_bfd_object_p): New function: Detect the - presence of a PE format COFF object file. Also detect and - warn about the presence of LINK6 format Image Library Format - object files. - -1999-12-16 Nick Clifton - - * coff-arm.c (NUM_ELEM): New macro. - (NUM_RELOCS): New macro: The number of known ARM relocs. - (RTYPE2HOWTO): Return NULL if the reloc type is out of range. - (coff_arm_rtype_to_howto): Return NULL if the reloc type is out - of range. - (bfd_arm_process_before_allocation): Produce a warning message if - an out of range symbol index is encountered. - -1999-12-14 Nick Clifton - - * elflink.h (is_global_symbol_definition): New Function: Return - true iff the symbol is being given a global definition in this - bfd. - (elf_link_is_defined_archive_symbol): Do not bother processing - symbols for an archive element that has already been included - in the link. - Use is_global_symbol_definition(). - -1999-12-09 Andrew Cagney - - * config.bfd: Add support for sparc-*-netbsdelf* and - sparc-*-netbsdaout*. - -1999-12-13 Nick Clifton - - * elflink.h (elf_link_is_defined_archive_symbol): Check to see - if the symbol is in the common section. - -1999-12-10 Nick Clifton - - * elflink.h (elf_link_is_defined_archive_symbol): New - function: Decide if a symbol, in an archive map is there - because it is defined in the archive element, or because it is - just another common declaration of it. - (elf_link_add_archive_symbols): Use - elf_link_is_defined_archive_symbol to decide if an archive - element contain a reference to a common symbol should be - linked in or not. - -1999-12-10 Nick Clifton - - * elflink.h: Revert previous patch. - * targets.c: Revert previous patch. - * libbfd-in2.h: Revert previous patch. - * libbfd.h: Revert previous patch. - * elfxx-target.h: Revert previous patch. - * archive.c: Revert previous patch. - * aout-target.h: Revert previous patch. - * aout-tic30.h: Revert previous patch. - * bfd.c: Revert previous patch. - * coff-alpha.c: Revert previous patch. - * coff-rs6000.c: Revert previous patch. - * elf64-mips.c: Revert previous patch. - * ieee.c: Revert previous patch. - * libecoff.h: Revert previous patch. - * oasys.c: Revert previous patch. - * som.c: Revert previous patch. - * vms.c: Revert previous patch. - -1999-12-09 Nick Clifton - - * elflink.h (elf_link_add_archive_symbols): Add an archive - element even if contains a symbol which is currently only - considered to be a common. - - * targets.c (struct bfd_target): Add new field - _bfd_allow_commons_in_armap. - * bfd-in2.h:Regenerate. - - * libbfd-in2.h (_bfd_noarchive_allow_commons_in_armap): - Define. - (_bfd_archive_bsd_allow_commons_in_armap): Define. - * libbfd.h: Regenerate. - - * elfxx-target.h: If using COFF archive map, override - definition of allow_commons_in_armap and replace with - bfd_false. - - * archive.c (bfd_compute_and_write_armap): Do not place common - symbols into the archive map unless _bfd_allow_commons_in_armap - returns true. - - * aout-target.h (MY_allow_commons_in_armap): Define. - * aout-tic30.h (MY_allow_commons_in_armap): Define. - * bfd.c (bfd_allow_commons_in_armap): Define. - * coff-alpha.h (alpha_ecoff_allow_commons_in_armap): Define. - * coff-rs6000.h (xcoff_allow_commons_in_armap): Define. - * elf64-mips.c (bfd_elf64_allow_commons_in_armap): Define. - * ieee.c (ieee_ecoff_allow_commons_in_armap): Define. - * libecoff.h (_bfd_ecoff_allow_commons_in_armap): Define. - * oasys.c (oasys_allow_commons_in_armap): Define. - * som.c (som_allow_commons_in_armap): Define. - * vms.c (vms_allow_commons_in_armap): Define. - -1999-12-07 Jim Blandy - - Add support for SSE registers in ELF core files. - * elf.c (elfcore_make_note_pseudosection): New function. - (elfcore_grok_prfpreg): Use it. - (elfcore_grok_prxfpreg): New function. - (elfcore_grok_note): Recognize Linux NT_PRXFPREG notes. - -1999-12-03 Ian Lance Taylor - - * elf32-mips.c (mips_elf_calculate_relocation): Divide R_MIPS_PC16 - value by 4 before storing it back in the field. From - Koundinya. K . - -Tue Nov 30 22:41:14 1999 Jeffrey A Law (law@cygnus.com) - - * archures.c (bfd_mach_am33): Define. - * bfd-in2.h: Rebuilt. - * cpu-m10300.c (bfd_am33_arch): Add to the mn103 architecture list - * elf-m10300.c (mn10300_elf_relax_section): Handle am33 instructions. - (compute_function_info): Handle additional registers saved by - movm on the am33. - (elf_mn10300_mach): Handle E_MN10300_MACH_AM33. - (_bfd_mn10300_elf_final_write_processing): Handle bfd_mach_am33. - -1999-11-29 Jim Blandy - - * elf.c (bfd_get_elf_phdrs, bfd_get_elf_phdr_upper_bound): New - functions. - * bfd-in2.h (bfd_get_elf_phdrs, bfd_get_elf_phdr_upper_bound): New - declarations. - -1999-11-27 Michael Meissner - - * reloc.c (BFD_RELOC_ALPHA_USER_LITERAL): New relocation for - internal use within gas for alpha explicit relocations. - (BFD_RELOC_ALPHA_USER_LITUSE_BASE): Ditto. - (BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF): Ditto. - (BFD_RELOC_ALPHA_USER_LITUSE_JSR): Ditto. - (BFD_RELOC_ALPHA_USER_GPDISP): Ditto. - (BFD_RELOC_ALPHA_USER_GPRELHIGH): Ditto. - (BFD_RELOC_ALPHA_USER_GPRELLOW): Ditto. - - * elf64-alpha.c (elf64_alpha_reloc_map): Add mappings for - BFD_RELOC_ALPHA_USER_*. - - * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate. - -1999-11-26 Fred Fish - - * elf.c (elfcore_read_notes): Add prototype for static function. - (_bfd_elf_make_section_from_phdr): Renamed from bfd_section_from_phdr. - (bfd_section_from_phdr): Replacement function that calls - _bfd_elf_make_section_from_phdr for generic segment types and - backend fucntion pointed to by elf_backend_section_from_phdr for - backend specific segment types. - (_bfd_elfcore_section_from_phdr): Remove call to elfcore_read_notes, - now called by _bfd_elf_make_section_from_phdr. Note that this func - is now just a stub between the caller and bfd_section_from_phdr. - - * elf-bfd.h (struct elf_backend_data): Add new function pointer - elf_backend_section_from_phdr. - (elf_backend_section_from_phdr): Add prototype. - - * elfxx-target.h (elf_backend_section_from_phdr): Define default. - (elfNN_bed): Add elf_backend_section_from_phdr. - -1999-11-25 Nick Clifton - - * coff-arm.c (bfd_arm_get_bfd_for_interworking): Add - SEC_CODE and SEC_READONLY flags to glue sections. - - * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Add - SEC_CODE and SEC_READONLY flags to glue sections. - -1999-11-20 Nick Clifton - - * coff-mcore.c (coff_mcore_relocate_section): Fix typo in previous - delta. - -1999-11-19 Catherine Moore - - * elf32-m68k.c (elf_cpu32_plt0_entry): Fix encoding. - (elf_cpu32_plt_entry): Likewise. - -1999-11-18 Nick Clifton - - * coff-mcore.c (coff_mcore_rtype_to_howto): Special case handling - for RVA relocs. - (coff_mcore_relocate_section): Initialise addend to 0. - Special case processing of RVA reloc. - -1999-11-17 Richard Henderson - - * elf-bfd.h (struct elf_backend_data): Reorder collect and - type_change_ok; add sign_extend_vma. - * elf32-mips.c (elf_backend_sign_extend_vma): Define. - * elfcode.h (elf_swap_symbol_in): Mind be->sign_extend_vma. - (elf_swap_shdr_in, elf_swap_phdr_in): Likewise. - * elfxx-target.h (elf_backend_sign_extend_vma): Default. - (elfNN_bed): Follow struture changes. - -1999-11-09 Ian Lance Taylor - - * libbfd.c (bfd_read): Check result of read against desired result - using !=, not <. - (_bfd_generic_get_section_contents): Set bfd_error if the seek is - invalid compared to the section size. - - * ieee.c (ieee_slurp_debug): Get the length of the debug - information right if there is no data part. - -Tue Nov 2 01:44:41 1999 Jeffrey A Law (law@cygnus.com) - - * som.c (som_fixup_formats): Improve handling of R_AUX_UNWIND, - R_LINETAB, R_LINETAB_ESC, and R_COMMENT. - -1999-10-28 Ian Lance Taylor - - * elflink.h (elf_bfd_final_link): Make last_local signed. - -1999-10-27 Ian Lance Taylor - - * stabs.c (_bfd_link_section_stabs): Make sure .stabstr section - starts with a zero. - -Sat Oct 23 17:36:12 1999 Andrew Cagney - - * archures.c: Add definitions bfd_mach_d10v, bfd_mach_d10v_ts2 and - bfd_mach_d10v_ts3. - * cpu-d10v.c (d10v_ts3_info, d10v_ts2_info): Add. - * bfd-in2.h: Regenerate. - -1999-10-15 Andrew Haley - - * dwarf1.c (parse_die): Fail to parse a die if its length is zero. - -Sun Oct 17 17:19:00 1999 Jeffrey A Law (law@cygnus.com) - - * libhppa.h (bfd_hppa_insn2fmt): Change to return an int. - -1999-10-08 Ian Lance Taylor - - * elflink.h (elf_merge_symbol): When overriding a weak symbol with - a defined symbol in a shared library, clear the DEF_DYNAMIC flag - too. - -Fri Oct 8 13:03:45 1999 Geoffrey Keating - - * elf32-mips.c (mips_elf_calculate_relocation): R_MIPS_LITERAL - relocs also need the GP value. - (_bfd_mips_elf_relocate_section): Handle unpaired LO16 relocs - properly. Handle sign-extension for R_MIPS_64 correctly. Correct - the GP value for R_MIPS_LITERAL relocs too. Handle - R_MIPS_64 relocs properly on big-endian MIPS. - (mips_elf_sign_extend): Behave properly with 'long long'. - (mips_elf_highest): Correct typo. - -Mon Oct 4 17:49:45 1999 Nick Clifton - - * cpu-m32r.c (arch_info_struct): New static global. - (bfd_m32r_arch): Refer to it. - * elf32-m32r.c (m32r_elf_object_p): Recognize E_M32RX_ARCH. - (m32r_elf_print_private_bfd_data): Ditto. - (m32r_elf_final_write_processing): Handle bfd_mach_m32rx. - * archures.c (bfd_mach_m32rx): Define it. - * bfd-in2.h: Rebuild. - -1999-09-28 Fred Fish - - * targets.c (cisco_core_vec): Replaced with two new vecs ... - (cisco_core_big_vec): Add new bigendian vec. - (cisco_core_little_vec): Add new little endian vec. - - * cisco-core.c (CRASH_INFO): Fixed offset replaced with ... - (crash_info_locs): Add array of possible offsets. - (MASK_ADDR): Mask to apply to crash info offset. - (crashinfo_external): Add textbase, database, bssbase and - turn into a typedef. - (cisco_core_file_validate): Renamed from cisco_core_file_p. - Many small changes to account for additional hardware versions. - Pick a reasonable size for ".reg" section. Add a ".crash" - section to allow access to crashinfo_external struct. - (cisco_core_file_p): New version of this function that - iterates over crash_info_locs, calling cisco_core_file_validate. - (cisco_core_vec): Old big endian only vec replaced with ... - (cisco_core_big_vec): Add big endian version. - (cisco_core_little_vec): Add little endian version. - - * configure.in (cisco_core_vec): Split to two new vectors ... - (cisco_core_big_vec): New target vector. - (cisco_core_little_vec): New target vector. - * configure: Regenerate. - * config.bfd (targ): For m68*-*-aout* targ, change cisco_core_vec - to cisco_core_big_vec in targ_selvecs. - -1999-09-28 Geoffrey Keating - - * elf32-mips.c (mips_elf_relocate_hi16): Unused, delete. - (mips_elf_relocate_got_local): Unused, delete. - (mips_elf_relocate_global_got): Unused, delete. - -1999-09-24 Fred Fish - - * elf.c (bfd_section_from_phdr): Add typename variable. Use p_type - to initialize it to something meaningful. Then use it to generate - more useful segment names. - -Sun Sep 19 12:16:47 1999 Jeffrey A Law (law@cygnus.com) - - * som.c (NO_PCREL_MODES): Define if the system does not define - R_SHORT_PCREL_MODE. - (hppa_som_gen_reloc_type): Handle both short and long pcrel branches. - (som_write_fixups): Eliminate redundant pcrel mode relocs. Handle - R_LONG_PCREL_MODE and R_SHORT_PCREL_MODE - * libhppa.h (dis_assemble_22): New function. - (bfd_hppa_insn2fmt): Handle long branch. - - * libhppa.h (bfd_hppa_insn2fmt): Decode and handle formats found - in PA2.0. - -1999-09-17 Alan Modra - - * coff-i386.c (coff_i386_reloc_type_lookup): Support BFD_RELOC_16, - BFD_RELOC_16_PCREL, BFD_RELOC_8, BFD_RELOC_8_PCREL relocs. - (reloc_howto_type howto_table): Tidy comments and whitespace. - -1999-09-17 Nick Clifton - - * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Undo - previous delta. Set sec->gc_mark instead. - -Thu Sep 16 11:21:13 1999 Catherine Moore - - * elf32-m68k.c (elf_cpu32_plt0_entry): Use a1 instead of a0. - (elf_cpu32_plt_entry): Likewise. - -Thu Sep 16 10:48:17 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_final_write_processing): Turn on TRAPNIL. - - * elf-hppa.h (elf_hppa_final_link): If unable to find __gp in the - symbol table, then just compute a suitable value (but do not - create a __gp symbol). - - * elf-hppa.h (elf_hppa_relocate_section): Allow undefined - symbols when building shared libraries. - (elf_hppa_final_link_relocate): Correct handling of PCREL - relocations against undefined symbols. - -1999-09-16 Nick Clifton - - * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Mark - interworking sections as linker created so that they will not - be removed by garbage collection. - -Wed Sep 15 02:31:57 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_final_link): Revamp __gp handling. - (elf_hppa_final_link_relocate): Consistently create an absolute - address, then subtract out the value of __gp. - -1999-09-14 Michael Meissner - - * configure.in (Canonicalization of target names): Remove adding - ${CONFIG_SHELL} in front of $ac_config_sub, since autoconfig 2.14 - generates $ac_config_sub with a ${CONFIG_SHELL} already. - * configure: Regenerate. - -1999-09-14 Nick Clifton - - * elf32-m32r.c (ELF_MAXPAGESIZE): Change to 0x1 (at request of - Mitsubishi). - -Mon Sep 13 20:01:47 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_record_segment_addrs): New function. - (elf_hppa_final_link): Initialize text_segment_base and - data_segment_base. - (elf_hppa_final_link_relocate): Handle SEGREL relocations. - - * elf-hppa.h (elf_hppa_final_link): Remove unused variables. - (elf_hppa_final_link_relocate): Likewise. - (elf_hppa_relocate_insn): Likewise. - (elf_hppa_relocate_section): Initialize HOWTO. - -1999-09-13 Donn Terry - - * coffcode.h (styp_to_sec_flags): Further refinement of COMDAT - handling to support both GNU and MS objects. - - * coffcode.h (coff_write_object_contents): Don't check reloc_count - when determining whether to set F_RELFLG. - -1999-09-13 Philip Blundell - - * elf32-arm.h (elf32_arm_final_link_relocate): Don't range-check - PC24 relocs if the target is an undefined weak symbol. - (arm_add_to_rel): Fix compiler warning. - (elf32_arm_plt0_entry): Correct comments. - -1999-09-13 Alan Modra - - * elfcode.h (write_relocs): Check for the_bfd NULL when handling - an absolute symbol in REL relocs. - -Sun Sep 12 23:47:58 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_final_link_relocate): Handle SECREL32. - Stub SEGREL32. Return an error for any relocation not handled. - -1999-09-12 Ian Lance Taylor - - * cofflink.c (coff_link_add_symbols): Look for special MSVC string - constant symbols, and avoid multiple definition errors on them. - -1999-09-12 Donn Terry - - * libbfd.c (bfd_log2): Rewrite to avoid infinite loop if most - significant bit is set. - -1999-09-11 Ian Lance Taylor - - * coff-ppc.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define. - - * elfcode.h (write_relocs): Handle an absolute symbol in REL - relocs as we do for RELA relocs. - -1999-09-11 Donn Terry - - * libpei.h (_bfd_pei_final_link_postscript): Declare. - (coff_final_link_postscript): Define. - * peigen.c (_bfd_pei_swap_aouthdr_out): Don't set value for data - directory entries here. - (_bfd_pei_final_link_postscript): New function. - - * peigen.c (_bfd_pei_swap_scnhdr_out): Remove code which sets - section flags based on the section name. - - * peicode.h (coff_swap_scnhdr_in): If COFF_IMAGE_WITH_PE, the - get the overflow of the s_nlnno field from the s_nreloc field. - * peigen.c (_bfd_pei_swap_scnhdr_out): If doing a final link, swap - the s_nlnno overflow of the .text section into the s_nreloc - field. - - * peigen.c (add_data_entry): Declare. - (pei_swap_aouthdr_out): Get image size right. Set linker version - more intuitively. - (pei_swap_scnhdr_out): Test for UNINIT section, not .bss. - (pe_print_idata): Code cleanup, print more info, get rid of (now) - extraneous ImageBase. - (pe_print_edata): Likewise. - (pe_print_pdata): Likewise. Print exception entries. - (pe_print_reloc): Likewise. Print MIPS_JMPADDR. - (tbl): Make const, add "UNKNOWN". - (_bfd_pe_print_private_bfd_data_common): Print timestamp. - (_bfd_pe_bfd_copy_private_bfd_data_common): Don't copy deleted - section data directory. - (_bfd_pe_bfd_copy_private_section_data): Copy pe_flags. - - * libpei.h (_bfd_pe_bfd_get_symbol_info): Declare. - * peigen.c (_bfd_pe_bfd_get_symbol_info): New function. - * peicode.h (coff_get_symbol_info): Define. - - * config.bfd (i[3456]86-*-interix*): Set targ_cflags to - -DSTRICT_PE_FORMAT. - * coffcode.h (styp_to_sec_flags): Check STRICT_PE_FORMAT rather - than __INTERIX. - (coff_classify_symbol): Re-revert 1999-08-08 patch if - STRICT_PE_FORMAT. - - * libpei.h: New file, broken out of peicode.h. - * peigen.c: New file, broken out of peicode.h. - * peicode.h: A bunch of code moved out to libpei.h and peigen.c. - * configure.in: Add peigen.lo to list of files required for each - PE target. - * Makefile.am: Rebuild dependencies. - (BFD32_BACKENDS): Add peigen.lo. - (BFD32_BACKENDS_CFILES): Add peigen.c. - (SOURCE_HFILES): Add libpei.h. - * configure, Makefile.in: Rebuild. - - * peicode.h (coff_swap_scnhdr_in): Don't check for a special - section name of _BSS; check IMAGE_SCN_CNT_UNINITIALIZED_DATA - instead. Don't clear the s_paddr field for an uninitialized data - section. - - * coffcode.h (coff_mkobject_hook): Set timestamp field in - coff_data_type to f_timdat. - * peicode.h (pe_mkobject_hook): Likewise. - - * peicode.h (coff_swap_filehdr_in): Check the NT executable magic - number if COFF_IMAGE_WITH_PE. - - * coffcode.h (coff_mkobject_hook): If COFF_WITH_PE, set HAS_DEBUG - to the reverse of IMAGE_FILE_DEBUG_STRIPPED. - (coff_write_object_contents): Set IMAGE_FILE_DEBUG_STRIPPED if - there is no SEC_DEBUGGING section. - * peicode.h (pe_mkobject_hook): Set HAS_DEBUG to the reverse of - IMAGE_FILE_DEBUG_STRIPPED. - - * pe-i386.c (COFF_LONG_FILENAMES): Define. - (COFF_SECTION_ALIGNMENT_ENTRIES): Define. - * pei-i386.c (COFF_LONG_FILENAMES): Define. - (COFF_SECTION_ALIGNMENT_ENTRIES): Define. - - * coffswap.h (IMAGE_BASE): Don't define. - * pei-arm.c (IMAGE_BASE): Don't define. - * pei-i386.c (IMAGE_BASE): Don't define. - * pei-mcore.c (IMAGE_BASE): Don't define. - * pei-ppc.c (IMAGE_BASE): Don't define. - - * cofflink.c (_bfd_coff_link_input_bfd): When writing out a - symbol, switch on the class when determining whether to modify the - value. For PE, don't modify the value of a C_FCN symbol not named - .bf. - - * libbfd-in.h (_bfd_abort): Declare. - (abort): Define. - * bfd.c (_bfd_abort): New function. - * libbfd.h: Rebuild. - - * coffcode.h (coff_set_alignment_hook): Delete POWERPC_LE_PE - special handling. - - * cofflink.c (_bfd_coff_link_input_bfd): If a symbol is stripped, - don't write out the associated line numbers. - - * cofflink.c (_bfd_coff_write_global_sym): Handle section symbol - aux entries. - - * cofflink.c (coff_link_add_symbols): Don't warn about symbol type - changes when the base type is unknown. - - * coffgen.c (coff_print_symbol): Fix printing of aux record for - function symbols. - - * syms.c (BSF_DEBUGGING_RELOC): Define. - * coffcode.h (coff_slurp_symbol_table): If PE, set BSF_DEBUGGING - for C_FCN/C_EFCN symbols, and set BSF_DEBUGGING_RELOC for such - symbols named .bf. - * coffgen.c (fixup_symbol_value): Relocate a symbol which has - BSF_DEBUGGING_RELOC set. - * bfd-in2.h: Rebuild. - -1999-09-10 Ian Lance Taylor - - * ecoff.c (bfd_debug_section): Update initialization for new - comdat_info field. - (_bfd_ecoff_styp_to_sec_flags): Add section parameter. - * libecoff.h (_bfd_ecoff_styp_to_sec_flags): Update declaration. - -1999-09-10 H.J. Lu - - * coff-alpha.c (alpha_ecoff_backend_data): Initialize the new - _bfd_filnmlen field. - * coff-mips.c (mips_ecoff_backend_data): Likewise. - -Fri Sep 10 00:35:14 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_final_link_relocate): Create .opd entries - for FPTR relocs involving local symbols. - - * elf-hppa.h (elf_hppa_final_link_relocate): Get the right - value for the stub address in a call through a stub. - Install the value for a local symbol directly into the DLT - instead of generating a reloc. Correctly handle FPTR64 relocs. - - * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): New function. - (elf_hppa_remark_useless_dynamic_symbols): Similarly. - (elf_hppa_final_link): Call them. - -1999-09-10 Ian Lance Taylor - - * elflink.h (elf_fix_symbol_flags): Move weakdef handling here... - (elf_adjust_dynamic_symbol): ...from here. - -Wed Sep 8 17:56:11 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_howto_table); There is no DIR64WR, DIR64DR - relocation, remove them. SECREL64->LTOFF16WF. - (elf_hppa_final_link_relocate): Handle LTOFF* relocations. Handle - DIR* relocations. - (elf_hppa_relocate_insn): Similarly. - - * elf-hppa.h (elf_hppa_final_link_relocate): Handle PLTOFF* relocs. - (elf_hppa_relocate_insn): Similarly. - - * elf-hppa.h (elf_hppa_final_link_relocate): Handle DPREL* and - GPREL* relocations. - (elf_hppa_relocate_insn): Similarly. - - * elf-hppa.h (elf_hppa_link_final_relocate): Fix typos. - Handle LTOFF_TP* relocs. - (elf_hppa_relocate_insn): Similarly. - - * elf-hppa.h (elf_hppa_final_link_relocate): Handle PCREL* relocs. - Consistently deal with addends. Handle DLTIND14F and DLTREL14F. - (elf_hppa_relocate_insn): Handle PCREL* relocs. - - * elf-hppa.h (elf_hppa_final_link_relocate): Handle LT_OFF_FPTR*, - DIR32, DIR64 and FPTR64 relocations. - (elf_hppa_relocate_insn): Similarly. - - * elf-hppa.h (elf_hppa_final_link): Set the value of __gp to the - address of the .PARISC.global section. - (elf_hppa_relocate_section): Lookup and pass the PA64 hash - table entry elf_hppa_final_link_relocate. Do not give a warning - for a reloc against an external symbol if it has a PA64 hash - table entry. - (elf_hppa_final_link_relocate): Significantly rework. Handle - DLTIND relocations. Compute the final value of the relocation - before passing the value of elf_hppa_relocate_insn. - (elf_hppa_relocate_insn): Revamp to handle just bit tiwiddling - relocation support. Handle DLTIND relocation requests just like - DLTREL relocation requests. Simplify branch handling. - -1999-09-08 Ulrich Drepper - - * elf-hppa.h (elf_hppa_relocate_section): Catch problems with - non-allocated section as done in i386 version. - (elf_hppa_final_link_relocate): Uncomment R_PARISC_14F in switch - statement since this is no know relocation. - -Tue Sep 7 17:25:12 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14F - relocs. - (elf_hppa_relocate_insn): Similarly. - - * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14WR and - DLTREL14WD relocs. - (elf_hppa_relocate_insn): Similarly. - - * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14R and - DLTREL21L relocs. Pass the output bfd to elf_hppa_relocate_insn. - Pass the relocate type rather than the insn format to - elf_hppa_relocate_insn. - (elf_hppa_relocate_insn): Make switch dependent on relocation type - rather than the opcode. Handle DLTREL21L and DLTREL14R relocs. - -1999-09-07 Ian Lance Taylor - - * coffcode.h (bfd_coff_backend_data): Add _bfd_filnmlen field. - (bfd_coff_filnmlen): Define. - (bfd_coff_std_swap_table): Initialize new field. - * coffgen.c (coff_fix_symbol_name): Use bfd_coff_filnmlen rather - than FILNMLEN. - (coff_write_symbols): Likewise. - (coff_get_normalized_symtab): Likewise. - * coff-sh.c (bfd_coff_small_swap_table): Initialize new field. - * libcoff.h: Rebuild. - -1999-09-06 Donn Terry - - * coffcode.h (sort_by_secaddr): New static function if - COFF_IMAGE_WITH_PE. - (coff_compute_section_file_positions): If COFF_IMAGE_WITH_PE, sort - sections by VMA when assigning target_index values. Always set - virt_size. - - * libcoff-in.h (struct pei_section_tdata): Add pe_flags field. - * coffcode.h (coff_set_alignment_hook) [COFF_WITH_PE version]: Set - pe_flags field. - * libcoff.h: Rebuild. - - * coffcode.h (coff_set_custom_section_alignment): Add const to - declaration to match definition. - (coff_write_object_contents): Don't set F_AR32W(R)? if - COFF_WITH_PE. - - * coff-i386.c (in_reloc_p): Add declaration. - (i386coff_vec): Simplify initialization of - application_section_flags. - - * coffcode.h (sec_to_styp_flags): Write separate COFF_WITH_PE - version. Move COFF_WITH_PE specific code to new version. - (stype_to_sec_flags): Likewise. Add section parameter. - * coffgen.c (make_a_section_from_file): Set target_index before - calling styp_to_sec_flags. Pass section to styp_to_sec_flags. - * libcoff.h: Rebuild. - - * syms.c (stt): Add some PE/PEI section names. - (bfd_decode_symclass): Return 'w', not 'U', for a weak undefined - symbol. - (bfd_symbol_info): Check for 'w'. - - * section.c (struct bfd_comdat_info): Define. - (asection): Add comdat field. - (STD_SECTION): Initialize comdat field. - (bfd_make_section_anyway): Likewise. - * bfd-in2.h: Rebuild. - -1999-09-06 Andreas Schwab - - * elflink.h (elf_link_add_object_symbols): Copy NON_GOT_REF flag - to version symbols. - -1999-09-06 Nick Clifton - - * elflink.h (elf_gc_record_vtentry): Use bfd_zmalloc and - bfd_realloc instead of calloc and realloc. - -1999-09-04 Steve Chamberlain - - * cpu-pj.c: New file. - * elf32-pj.c: New file. - * config.bfd (pj*): New cpu. - (pj-*-*, pjl-*-*): New targets. - * configure.in (bfd_elf32_pj_vec): New target vector. - (bfd_elf32_pjl_vec): New target vector. - * archures.c (bfd_arch_pj): Define. - * elf.c (prep_headers): Handle bfd_arch_pj. - * reloc.c: Define BFD_RELOC_PJ_* relocations. - * targets.c (bfd_elf32_pj_vec, bfd_elf32_pjl_vec): Declare and add - to target vector list. - * Makefile.am: Rebuild dependencies. - (ALL_MACHINES): Add cpu-pj.lo. - (ALL_MACHINES_CFILES): Add cpu-pj.c. - (BFD32_BACKENDS): Add elf32-pj.lo. - (BFD32_BACKENDS_CFILES): Add elf32-pj.c. - * configure, Makefile.in, bfd-in2.h, libbfd.h: Rebuild. - -1999-09-04 Ian Lance Taylor - - * elf-bfd.h (ELF_LINK_NON_GOT_REF): Define. - * elflink.h (elf_adjust_dynamic_symbol): Copy REF_REGULAR_NONWEAK - and NON_GOT_REF from weak defined symbol to real symbol. - * elf32-i386.c (elf_i386_check_relocs): Set NON_GOT_REF. - (elf_i386_adjust_dynamic_symbol): If NON_GOT_REF is not set, don't - create a COPY reloc. - * elf32-sparc.c (elf32_sparc_check_relocs): Set NON_GOT_REF. - (elf32_sparc_adjust_dynamic_symbol): If NON_GOT_REF is not set, - don't create a COPY reloc. - -1999-09-03 Ian Lance Taylor - - * elflink.h (elf_bfd_final_link): When counting relocations, don't - count those in sections we are not including in the link. - -Thu Sep 2 17:41:20 1999 Jeffrey A Law (law@cygnus.com) - - * elflink.h (elf_link_add_object_symbols): Work around bogus SH_LINK - field in hpux11 shared libraries. - -1999-09-02 Nick Clifton - - * elflink.h (elf_gc_record_vtentry): Fix memory leak. - -Wed Sep 1 13:34:29 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_add_symbol_hook): New function. - (elf_hppa_final_link, elf_hppa_relocate_section): Likewise. - (elf_hppa_final_link_relocate, elf_hppa_relocate_insn): Likewise. - -1999-08-31 Alexandre Petit-Bianco - - * elflink.h (record_link_assignment): When possible, keep the - original type of the symbol. - -Mon Aug 30 15:26:48 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Allow both - R_PARISC_DIR32 and R_PARISC_DIR64 regardless of how the - tools were configured. - * elf32-hppa.h (_bfd_elf32_hppa_gen_reloc_type): Declare. - -1999-08-26 Mark Mitchell - - * elf32-mips.c (_bfd_mips_elf_check_relocs): Don't allocate local - GOT entries for GOT16 relocations; they're not required. - -1999-08-24 Nick Clifton - - From a patch submitted by Roland McGrath - - * config.bfd (arm-*-netbsd*): New target. - * configure.in (armnetbsd_vec): New target vector. - * configure: Regenerate - * targets.c (bfd_target_vector): Add &armnetbsd_vec. - - * Makefile.am (BFD32_BACKENDS): Add armnetbsd.lo. - (ALL_MACHINES_CFILES): Add armnetbsd.c. - (armnetbsd.lo): New rule with deps. - * Makefile.in: Regenerate. - - * armnetbsd.c: New file: Definitions specific to arm-netbsd - target. - -Tue Aug 24 00:25:58 1999 Jeffrey A Law (law@cygnus.com) - - * som.c (som_slurp_symbol_table): Fix typo in comment. - -Fri Aug 20 17:01:23 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_fake_sections): Compute section indices - here instead of using elf_section_data... - -1999-08-19 Nick Clifton - - * coff-mcore.c (mcore_emit_base_file_entry): New function: Emit - relocations into the base file. - (coff_mcore_relocate_section): Call mcore_emit_base_file_entry if - we are building a base file. - -1999-08-19 Nick Clifton - - * elf32-arm.h (arm_add_to_rel): New function. Add a value to - a REL style reloc. - (elf32_arm_relocate_section): Use arm_add_to_rel to increment - REL relocs when performing a partial relocation. - -1999-08-18 Donn Terry - - * cofflink.c: Move definitions of N_TMASK, et. al., out of - _bfd_coff_link_input_bfd into top level. - - * coff-i386.c (coff_i386_reloc): Handle R_IMAGEBASE. - (RTYPE2HOWTO): Return NULL if reloc type is out of range. - (coff_i386_rtype_to_howto): Likewise. - * coffcode.h (coff_slurp_symbol_table): Change a -2 to N_DEBUG. - Completely ignore symbols which are all zero. - (dummy_reloc16_estimate): Add return 0. - * cofflink.c (_bfd_coff_link_input_bfd): Rename inner scope - variable copy to name_copy to avoid shadowing outer scope - variable. - * libcoff-in.h (coff_data_type): Change raw_syment_count field - from unsigned int to unsigned long. Add timestamp field. - * libcoff.h: Rebuild. - -1999-08-17 H.J. Lu - - * elf32-hppa.c (bfd_elf32_bfd_is_local_label_name): Fix typo in - macro definition. - -1999-08-17 Ian Lance Taylor - - * elf32-mips.c (_bfd_mips_elf_add_symbol_hook): Set BSF_DYNAMIC - for special section symbols. - * elflink.h (elf_merge_symbol): If we have no old BFD, check - BSF_DYNAMIC on the section symbol to see whether the old BFD is - dynamic. - -1999-08-15 Mark Mitchell - - * elf32-mips.c (mips_elf_calculate_relocation): Fix unfortunate - coincidence of variable names between old and new code. - -1999-08-12 Nick Clifton - - * elf32-arm.h (elf32_arm_to_thumb_stub): Make 'offset' parameter - into a bfd_vma and 'addend' parameter a 'bfd_signed_vma'. - (elf32_thumb_to_arm_stub): Make 'offset' parameter into a bfd_vma - and 'addend' parameter a 'bfd_signed_vma'. - (elf32_arm_final_link_relocate): Do not involve stubs in - R_ARM_THM_PC22 relocs relative to section symbols, they are long - jumps, not function calls. - -1999-08-11 Robin Farine - - * elf32-arm.h (elf32_arm_final_link_relocate): Check for overflow - in R_ARM_PC24 relocs. - -Tue Aug 10 12:48:09 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (elf_hppa_fake_sections): New function. - * elf32-hppa.c (elf_backend_fake_sections): Define. - - * elf-hppa.h (elf_hppa_final_write_processing): Update for - recent changes to the arch_info structure. - - * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle - R_HPPA_SEGBASE and R_HPPA_SEGREL32. - * cpu-hppa.c (bfd_hppa20w_arch): New entry in architecture info - list. - -Tue Aug 10 00:34:29 1999 Mark P. Mitchell - Ralf Baechle - - * elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): Always - output DT_MIPS_GOTSYM. - (_bfd_mips_elf_finish_dynamic_sections): Use the same value as - DT_MIPS_SYMTABNO if there are no global GOT symbols. - -Tue Aug 10 00:21:08 1999 Mark P. Mitchell - - * elf32-mips.c (mips_elf_create_dynamic_relocation): Change - prototype. Handle local symbols. Add commentary. - (mips_elf_calculate_relocation): Adjust accordingly. - (_bfd_mips_elf_check_relocs): Handle local symbols in R_MIPS_32 - relocations. - - * elflink.h (elf_bfd_final_link): Tweak last change. - -1999-08-09 Mark Mitchell - - * elflink.h (elf_link_size_reloc_section): Use the counts in the - elf-section data to allocate just the right amount of relocation - space. Don't allocate the hash space twice. - (elf_bfd_final_link): Calculate the amount of space to allocate in - each relocation section. - -Mon Aug 9 17:37:30 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type, case 32): When in - 64bit mode, generate a section relative relocation for a 32bit - wide relocation. - (elf_hppa_is_local_label_name): New function. - * elf32-hppa.c (elf_hppa_is_local_label_name): Deleted. To be - shared between 32bit and 64bit port. - -1999-08-09 Mark Mitchell - - * elf32-mips.c (elf_mips_howto_table): Fix src_mask for - R_MIPS_GOT16 and R_MIPS_CALL16. - (mips_elf_got16_entry): Use mips_elf_high to calculate the value - to use when looking for a preexisting GOT entry. - -1999-08-09 Jakub Jelinek - - * elf64-sparc.c (sparc64_elf_relocate_section): Back out part of - the Sep. 4th, 1998 change. glibc 2.0.x dynamic linker had bug, - not binutils. - * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. - -1999-08-09 Geoff Keating - - * elflink.h (elf_link_output_extsym): Don't output a weak - reference to an undefined symbol just because it was defined weak - in a shared object. - -1999-08-09 Eli Zaretskii - - * coffgen.c (coff_find_nearest_line): When looking for file, use - last best match rather than first. If address is beyond last line - number record, don't return the last line as the correct value. - -1999-08-08 Ian Lance Taylor - - * section.c (SEC_SMALL_DATA): Rename from SEC_SHORT. - * bfd-in2.h: Rebuild. - -1999-08-08 Mark Elbrecht - - * libcoff-in.h (struct coff_section_alignment_entry): Define. - * coffcode.h (coff_set_custom_section_alignment): New static - function. - (coff_section_alignment_table): New static array. - (coff_new_section_hook): Use coff_set_customer_section_alignment. - * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define. - * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define. - * libcoff.h: Rebuild. - -1999-08-08 Ian Lance Taylor - - * Makefile.am: Rename .dep* files to DEP*. Change DEP variable to - MKDEP. - * Makefile.in: Rebuild. - -1999-08-08 Mumit Khan - - * section.c (SEC_SHARED): Define. - * coffcode.h (sec_to_styp_flags): Handle SEC_SHARED. - (styp_to_sec_flags): Likewise. - * peicode.h (coff_swap_scnhdr_out): Likewise. - * bfd-in2.h: Rebuild. - -1999-08-08 Ian Lance Taylor - - * coffcode.h (coff_classify_symbol): Comment out part of - 1999-08-05 change which breaks cygwin DLLs. - - * acinclude.m4 (BFD_BINARY_FOPEN): Change -windows to -windows*. - * aclocal.m4, configure: Rebuild. - -1999-08-06 Ian Lance Taylor - - * section.c (global_syms): Only initialize union field if - __STDC__. - -1999-08-04 Mark Mitchell - - * elf32-mips.c (mips_elf_got16_entry): Don't multiply GOT index by - the size of a GOT entry here. - (mips_elf_calculate_relocation): Don't create a local GOT entry - for the symbol in a GOT16 relocation; just for it's high-order bit - (_bfd_mips_elf_relocate_section): Fix thinko. - -1999-08-05 Ian Lance Taylor - - Based on patches from Donn Terry : - * coffcode.h (enum coff_symbol_classification): Define. - (bfd_coff_backend_data): Rename _bfd_coff_sym_is_global to - _bfd_coff_classify_symbol. Change return type. - (bfd_coff_classify_symbol): Rename from bfd_coff_sym_is_global. - (coff_slurp_symbol_table): Use coff_classify_symbol. - (coff_classify_symbol): New static function. - (coff_sym_is_global): Never define. - (bfd_coff_std_swap_table): Initialize with coff_classify_symbol. - * cofflink.c (coff_link_check_ar_symbols): Use - bfd_coff_classify_symbol rather than bfd_coff_sym_is_global. - (coff_link_add_symbols): Likewise. - (_bfd_coff_link_input_bfd): Likewise. - * coff-sh.c (bfd_coff_small_swap_table): Initialize with - coff_classify_symbol. - * libcoff.h: Rebuild. - -Wed Aug 4 18:08:07 1999 Jeffrey A Law (law@cygnus.com) - - * libhppa.h (R_HPPA_LTPSEL, R_HPPA_RTPSEL): New field selectors - (e_ltpsel, e_rtpsel): Similarly. - - * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle 21bit e_ltpsel - and 14bit ertpsel. Handle 64bit psel. - -1999-08-04 Mark Mitchell - - * elf32-mips.c (_bfd_mips_elf_relocate_section): Tweak HI16/LO16 - handling for REL relocations. And only left-shift R_MIPS26 - relocation addends where necessary. - -1999-08-03 Mark Mitchell - - * elf32-mips.c (mips_elf_next_lo16_addend): Rename to ... - (mips_elf_next_lo16_relocation): Don't compute the addend here. - Just return the relocation found. - (mips_elf_relocate_section): Pull the LO16 addend out of the - section itself when using REL relocations. - - * elf32-mips.c (mips_elf_calculate_relocation): Restore - _DYNAMIC_LINK handling and handling of undefined symbols in shared - libraries. - -1999-08-03 Ian Lance Taylor - - * elf32-ppc.c (ppc_elf_relocate_section): Don't use the relocation - value of a symbol in a SEC_DEBUGGING section. Warn when doing a - relocation against a symbol in an input section with no output - section. From Daniel Jacobowitz . - - * coff-stgo32.c (go32_stubbed_coff_object_p): Remove; not used. - - * acinclude.m4 (BFD_CC_FOR_BUILD): Change to use conftest, and to - look for generated file correctly. - * aclocal.m4, configure: Rebuild. - -1999-08-02 Mark Mitchell - - * elf32-mips.c (_bfd_mips_elf_relocate_section): Handle R_MIPS_26 - and R_MIPS16_26 relocations correctly when relocating. - (_bfd_mips_elf_check_relocs): Don't assume that R_MIPS_CALL_HI16 - and R_MIPS_CALL_LO16 are for global symbols. - -1999-08-02 Jakub Jelinek - - * elflink.h (elf_bfd_final_link): Copy the whole isym, not just - some fields. - * elf64-sparc.c (sparc64_elf_output_arch_syms): Declare used - variables and initialize them. - -1999-08-01 Mark Mitchell - - * elf32-mips.c (_bfd_mips_elf_final_link): Handle the case where - there are no global symbols requiring GOT entries. - (_bfd_mips_elf_size_dynamic_sections): Likewise. - (_bfd_mips_elf_finish_dynamic_symbol): Likewise. - (_bfd_mips_elf_finish_dynamic_sections): Likewise. - - * elf32-mips.c (mips_elf_calculate_relocation): Undefined weak - symbols are considered to have the value zero. - (_bfd_mips_elf_relocate_section): Don't try to perform a - relocation for an undefined symbol. - (_bfd_mips_elf_check_relocs): Allocate locate GOT space for local - GOT16 relocations. - -1999-07-30 Jakub Jelinek - - * elf64-sparc.c (sparc64_elf_build_plt): Cosmetic change - ABI - wants ba,a,pt %xcc instead of %icc. - Emit correct .PLT0-(.PLTN+4) initial value into the pointer slots - of large PLT entries. - (sparc64_elf_plt_ptr_offset): Fix calculation. - (sparc64_elf_finish_dynamic_symbol): Negative value of R_SPARC_JMP_SLOT - addend should be relative to load address, not .plt section start. - (sparc64_elf_size_info): Sparc64 uses 32bit .hash entries. - -1999-07-30 Jakub Jelinek - - * elf-bfd.h (struct elf_backend_data): Add - print_symbol_all and output_arch_syms backend methods. - * elfxx-target.h: Likewise. - * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create, - sparc64_elf_add_symbol_hook, sparc64_elf_output_arch_syms, - sparc64_elf_get_symbol_type, sparc64_elf_symbol_processing): New - functions. - (sparc64_elf_size_dynamic_sections): Leave space for STT_REGISTER - symbols in .dynsym, add their names into .dynstr. Put those symbols - into dynlocal. - (sparc64_elf_finish_dynamic_sections): Fix up DT_SPARC_REGISTER - pointers to STT_REGISTER symbols in dynsym section. - (sparc64_elf_print_symbol_all): New function. - * elf.c (bfd_elf_print_symbol): Allow special backend symbol - printing using the print_symbol_all hook. - -1999-07-30 Catherine Moore - - * elf32-arm.h (elf32_arm_check_relocs): Use r_offset for - R_ARM_GNU_VTENTRY. - -1999-07-29 Richard Henderson - - * elf32-mips.c (_bfd_mips_elf_final_link): Only re-sort dynsyms if - dynamic_sections_created. - -1999-07-29 Richard Henderson - - * elf32-mips.c (mips_info_to_howto_rel): Split out switch to ... - (mips_rtype_to_howto): ... new function. - (_bfd_mips_elf_relocate_section): Use it. - -1999-07-28 Mark Mitchell - - * elf32-mips.c (_bfd_mips_elf_relocate_section): Fix typo. - -1999-07-27 Nick Clifton - - Patch generated by Bernd Schmidt. - - * coff-arm.c (coff_arm_is_local_label_name): Change to strip - out only symbols that start with LOCAL_LABEL_PREFIX followed by 'L'. - -1999-07-23 Donn Terry - - * libcoff-in.h (coff_link_hash_entry): Add coff_link_hash_flags - field, and define COFF_LINK_HASH_PE_SECTION_SYMBOL. - * cofflink.c (coff_link_add_symbols): If PE, handle section - symbols specially. - * libcoff.h: Rebuild. - - * config.bfd (i[3456]86-*-interix*): New target. - -1999-07-21 Mark Elbrecht - - * coffcode.h (styp_to_sec_flags): If COFF_LONG_SECTION_NAMES and - COFF_SUPPORT_GNU_LINKONCE, mark sections whose names begin with - .gnu.linkonce with SEC_LINKONCE and SEC_LINK_DUPLICATES_DISCARD. - * coff-go32.c: (COFF_LONG_SECTION_NAMES): Define. - (COFF_SUPPORT_GNU_LINKONCE): Define. - * coff-stgo32.c: (COFF_LONG_SECTION_NAMES): Define. - (COFF_SUPPORT_GNU_LINKONCE): Define. - -1999-07-21 Ian Lance Taylor - - From Mark Elbrecht: - * makefile.dos: Remove; obsolete. - * configure.bat: Remove; obsolete. - -1999-07-21 H.J. Lu - - * config.bfd (i[3456]86-*-vxworks*): Add targ_underscore=yes. - -1999-07-21 Philippe De Muyter - - * cofflink.c (_bfd_coff_generic_relocate_section): Issue an error - message and fail if a symbol index is out of range. - -1999-07-21 Ian Lance Taylor - - * elf32-mips.c (mips_elf_calculate_relocation): Get the GP value - when looking at a R_MIPS_GOT16 relocation. - -1999-07-20 Nick Clifton - - * coff-m88k.c: Use CREATE_BIG_COFF_TARGET_VEC. - -Mon Jul 19 14:03:44 1999 Mark P. Mitchell - - * elf32-mips.c (_bfd_mips_elf_final_link): Restore setting of GP - removed in previous change. - (_bfd_mips_elf_relocate_section): Adjust GP relative relocations - in relocateable output. - -1999-07-19 Ian Lance Taylor - - * coff-m88k.c (m88kbcs_vec): Initialize new field of bfd_target - structure. - - * elflink.h (elf_merge_symbol): Do merge symbols from the same BFD - if they appear to be specially created by the linker. - -1999-07-19 Nick Clifton - - * targets.c (alternative_target): New field in bfd_target - structure. - (bfd_search_for_target): New function: Find a target that - satisifies a search function. - * bfd-in2.h: Regenerate. - - * elfxx-target.h: Initialise the alternative_target field of - the bfd_target structures to point to the other target (if - defined). - * nlm-target.h: Initialise the alternative_target field of - the bfd_target structures to point to the other target (if - defined). - - * coffcode.h (CREATE_BIG_COFF_TARGET_VEC): New macro. - (CREATE_LITTLE_COFF_TARGET_VEC): New macro. - - * aix386-core.c: Initialise new field of bfd_target structure. - * aout-adobe.c: Initialise new field of bfd_target structure. - * aout-arm.c: Initialise new field of bfd_target structure. - * aout-target.h: Initialise new field of bfd_target structure. - * aout-tic30.c: Initialise new field of bfd_target structure. - * binary.c: Initialise new field of bfd_target structure. - * bout.c: Initialise new field of bfd_target structure. - * cisco-core.c: Initialise new field of bfd_target structure. - * coff-a29k.c: Use CREATE_BIG_COFF_TARGET_VEC. - * coff-alpha.c: Initialise new field of bfd_target structure. - * coff-apollo.c: Use CREATE_BIG_COFF_TARGET_VEC. - * coff-arm.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC. - * coff-h8300.c: Use CREATE_BIG_COFF_TARGET_VEC. - * coff-h8500.c: Use CREATE_BIG_COFF_TARGET_VEC. - * coff-i386.c: Initialise new field of bfd_target structure. - * coff-i860.c: Initialise new field of bfd_target structure. - * coff-i960.c: Use CREATE_LITTLE_COFF_TARGET_VEC. - * coff-m68k.c: Use CREATE_BIG_COFF_TARGET_VEC. - * coff-mcore.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC. - * coff-mips.c: Initialise new field of bfd_target structure. - * coff-ppc.c: Initialise new field of bfd_target structure. - * coff-rs6000.c: Initialise new field of bfd_target structure. - * coff-sh.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC. - * coff-sparc.c: Use CREATE_BIG_COFF_TARGET_VEC. - * coff-tic30.c: Initialise new field of bfd_target structure. - * coff-tic80.c: Use CREATE_LITTLE_COFF_TARGET_VEC. - * coff-w65.c: Use CREATE_LITTLE_COFF_TARGET_VEC. - * coff-we32k.c: Use CREATE_BIG_COFF_TARGET_VEC. - * coff-z8k.c: Use CREATE_BIG_COFF_TARGET_VEC. - * hppabsd-core.c: Initialise new field of bfd_target structure. - * hpux-core.c: Initialise new field of bfd_target structure. - * i386msdos.c: Initialise new field of bfd_target structure. - * i386os9k.c: Initialise new field of bfd_target structure. - * ieee.c: Initialise new field of bfd_target structure. - * ihex.c: Initialise new field of bfd_target structure. - * irix-core.c: Initialise new field of bfd_target structure. - * mipsbsd.c: Initialise new field of bfd_target structure. - * netbsd-core.c: Initialise new field of bfd_target structure. - * oasys.c: Initialise new field of bfd_target structure. - * osf-core.c: Initialise new field of bfd_target structure. - * ppcboot.c: Initialise new field of bfd_target structure. - * ptrace-core.c: Initialise new field of bfd_target structure. - * sco5-core.c: Initialise new field of bfd_target structure. - * som.c: Initialise new field of bfd_target structure. - * srec.c: Initialise new field of bfd_target structure. - * tekhex.c: Initialise new field of bfd_target structure. - * trad-core.c: Initialise new field of bfd_target structure. - * versados.c: Initialise new field of bfd_target structure. - * vms.c: Initialise new field of bfd_target structure. - -1999-07-19 Andreas Schwab - - * elflink.h (elf_bfd_final_link): Remove unused variables rel_hash - and rel_hdr. - -Sat Jul 17 02:28:28 1999 Mark P. Mitchell - - * elflink.h (elf_link_adjust_relocs): New function. - (elf_bfd_final_link): Use it. - (elf_link_input_bfd): Deal with the fact that there can be - two relocation sections for a single section. - (elf_reloc_link_order): Likewise. - - * elf32-mips.c (_bfd_mips_elf_final_link): Don't set GP for - a relocateable object. - (_bfd_mips_elf_relocate_section): Handle relocateable links. - -1999-07-16 Jakub Jelinek - - * elf64-sparc.c (sparc64_elf_info_to_howto): Use ELF64_R_TYPE_ID. - (sparc64_elf_get_reloc_upper_bound, - sparc64_elf_get_dynamic_reloc_upper_bound, - sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table, - sparc64_elf_canonicalize_dynamic_reloc, sparc64_elf_write_relocs): - New functions. - (sparc64_elf_check_relocs, sparc64_elf_relocate_section): Use - ELF64_R_TYPE_ID/DATA where appropriate. - -1999-07-16 Jakub Jelinek - - * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Remove - DT_SPARC_PLTFMT. - -1999-07-16 Ian Lance Taylor - - * elf32-mips.c (mips_elf_local_relocation_p): New static - function. - (mips_elf_next_lo16_addend): Call bfd_set_error on failure. - (mips_elf_calculate_relocation): Use mips_elf_local_relocation_p. - Always set *require_jalxp. - (mips_elf_stub_section_p): Mark abfd parameter as unused. - (_bfd_mips_elf_relocate_section): Only look for LO16 following - GOT16 if the GOT16 is against a local symbol. Don't return false - for an undefined symbol. If there is an overflow, assert that we - have a name. - -1999-07-16 Andreas Schwab - - * elflink.h (elf_link_record_local_dynamic_symbol): Remove unused - variables `link' and `elfsec'. - (elf_bfd_final_link): Remove unused variable `os'. - -Thu Jul 15 17:55:31 1999 Mark P. Mitchell - - * elf32-mips.c (_bfd_mips_elf_modify_segment_map): Don't require - a PT_PHDR program headers. - (_bfd_mips_elf_final_link): Don't assume there are going to be - section symbols when we're not building a shared object. - (_bfd_mips_elf_check_relocs): Make sure we have a GOT when - we need one. - -1999-07-15 J.T. Conklin - - * config.bfd (i[3456]86-*-vxworks*): New target. - -1999-07-15 Mark Mitchell - - * elf32-mips.c (mips_elf_stub_section_p): New function. - (mips_elf_calculate_relocation): Handle MIPS16 stub functions. - (mips_elf_relocate_section): Adjust calling sequence for - mips_elf_calculate_relocation and mips_elf_perform_relocation. - (mips_elf_perform_relocation): Turn `jal' into `jalx' where - required. - -1999-07-15 Ian Lance Taylor - - * configure.in: Bump version number to 2.9.5. - * configure: Rebuild. - -Thu Jul 15 02:56:15 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type, case R_HPPA): Handle - 64bit format. - (_bfd_elf_hppa_gen_reloc_type, case R_GOTOFF): Use base reloc type - to derive final type instead of hardwiring a selection. - -1999-07-14 Mark Mitchell - - * elf32-mips.c (mips_elf_obtain_contents): Swap 16-bit halves of - things relocated by R_MIPS16_GPREL. - (mips_elf_perform_relocation): Likewise. - -Wed Jul 14 15:23:19 1999 Jim Wilson - - * elfxx-target.h (elfNN_bed): Add elf_backend_want_dynbss. - -1999-07-14 Richard Henderson - - * elf32-mips.c (struct mips_got_info): Add global_gotno. - (_bfd_mips_elf_size_dynamic_sections): Set it. - (_bfd_mips_elf_final_link): Re-sort; verify the got did not grow. - (mips_elf_sort_hash_table): Set max_non_got_dynindex based off - new argument max_local. - -1999-07-14 Mark Mitchell - - * elf32-mips.c (mips_elf_obtain_contents): Swap the 16-bit - subwords when handling an R_MIPS16_26 relocation. - (mips_elf_perform_relocation): Don't be paranoid abour right-shift - semantics. - - * elf32-mips.c (elf_mips16_gprel_howto): Adjust src_mask and - dst_mask to match reality. - (_bfd_mips_elf_calculate_relocation): Handle R_MIPS16_GPREL. - (mips_elf_obtain_contents): Use bfd_get. - (mips_elf_perform_relocation): Handle R_MIPS16_GPREL. - (mips_elf_relocate_section): Likewise. - -1999-07-13 Mark Mitchell - - * elf32-mips.c (mips_elf_calculate_relocation): Handle R_MIPS16_26. - (mips_elf_relocate_section): Adjust calling sequence for - mips_elf_perform_relocation. - (mips_elf_perform_relocation): Take additional argument. Handle - R_MIPS16_26. Use bfd_put for convenience. - -1999-07-13 Richard Henderson - - * elf.c (assign_file_positions_for_segments): Thinko last change. - Always overwrite p_flags. - -1999-07-13 Richard Henderson - - * elf-bfd.h (struct elf_backend_data): Add want_dynbss. - * elflink.c (_bfd_elf_create_dynamic_sections): Only create - .dynbss and .rel[a].bss if want_dynbss. - * elfxx-target.h (elf_backend_want_dynbss): Provide default. - -1999-07-13 Richard Henderson - - * elf.c (assign_file_positions_for_segments): Don't overwrite p_flags. - -1999-07-13 Richard Henderson - - * elf-bfd.h (struct elf_link_local_dynamic_entry): New. - (struct elf_link_hash_table): Add dynlocal. - (_bfd_elf_link_lookup_local_dynindx): Prototype. - (_bfd_elf_link_adjust_dynindx): Delete. - (_bfd_elf_link_renumber_dynsyms): Prototype. - (_bfd_elf,link_record_local_dynamic_symbol): Prototype. - * elfcode.h (elf_link_record_local_dynamic_symbol): New alias. - * elflink.c (_bfd_elf_link_adjust_dynindx): Delete. - (_bfd_elf_link_lookup_local_dynindx): New function. - (elf_link_renumber_hash_table_dynsyms): New function. - (_bfd_elf_link_renumber_dynsyms): New function. - * elflink.h (elf_link_record_local_dynamic_symbol): New function. - (struct elf_assign_sym_version_info): Delete removed_dynamic. - (bfd_elf,size_dynamic_sections): Use _bfd_strip_section_from_output - instead of elf_link_remove_section_and_adjust_dynindices. - Remove removed_dynamic code. Use _bfd_elf_link_renumber_dynsyms. - (elf_link_assign_sym_version): Remove removed_dynamic code. - (elf_link_renumber_dynsyms): Delete. - (elf_bfd_final_link): Install section and local symbols into .dynsym. - - * elf32-m68k.c (elf_m68k_adjust_dynindx): Delete. - (elf_m68k_size_dynamic_sections): Don't set section dynindicies. - (elf_m68k_finish_dynamic_sections): Don't write section dynsyms. - * elf32-mips.c: Similarly. - * elf32-ppc.c: Similarly. - * elf32-sparc.c: Similarly. - * elf64-alpha.c: Similarly. - * elf64-sparc.c: Similarly. - -1999-07-13 Mark Mitchell - - * elf32-mips.c (mips_elf_calculate_relocation): Do not complain - when _gp_disp is undefined. Do not check R_MIPS_LO16 for overflow - when the relocation is against _gp_disp. - -1999-07-12 Mark Mitchell - - * dwarf2.c (read_attribute): Support DW_FORM_ref8. - * elf32-mips.c (mips_elf_link_hash_entry): Change mips_32_relocs - to possibly_dynamic_relocs. Adjust usage throughout code. - (elf_mips_howto_table): Handle R_MIPS_64 correctly. - (elf_mips_ctor64_howto): Likewise. - (mips_elf_calculate_relocation): Handle R_MIPS_64 like R_MIPS_32. - Adjust indentation. - (mips_elf_relocate_section): Handle R_MIPS_64 in 32-bit mode. - (_bfd_mips_elf_check_relocs): Handle R_MIPS_64 like R_MIPS_32. - Use MIPS_ELF_GOT_SIZE to calculate the size of GOT entries. - * elf64-mips.c (elf_backend_may_use_rel_p): Define. - -1999-07-12 Ian Lance Taylor - - * Makefile.am: Rebuild dependencies. - * Makefile.in: Rebuild. - - * bfd-in.h: Remove tests of COFF_IMAGE_WITH_PE. - * bfd-in2.h: Rebuild. - - * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED - as appropriate. Use EMPTY_HOWTO as appropriate. Fill in - structure initializations. Add casts. - * reloc.c (EMPTY_HOWTO): Define. - * bfd-in2.h: Rebuild. - * coff-h8300.c (h8300_reloc16_extra_cases): Remove useless - comparisons against 0. - * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Change - previous_ibfd_e_flags to unsigned long. - * vms.h (struct vms_private_data_struct): Change section_count to - unsigned. - * vms-gsd.c (_bfd_vms_slurp_gsd): Change psect_idx to unsigned. - (_bfd_vms_write_gsd): Change symnum to unsigned. - * vms-hdr.c (_bfd_vms_write_hdr): Change symnum to unsigned. - * vms-tir.c (etir_sta): Change psect to unsigned. - (alloc_section): Change idx to unsigned. - (tir_sta, tir_ctl): Change psect to unsigned. - (_bfd_vms_write_tir): Change len and before to bfd_size_type. - * vms.c (priv_section_count): Change to unsigned. - -1999-07-12 Andreas Schwab - - * elf32-m68k.c: Add some ATTRIBUTE_UNUSED. - * m68klinux.c: Likewise. - -1999-07-12 Ian Lance Taylor - - * Many files: Changes to avoid gcc warnings: Remove unused local - variables. Add default case to enum switches. - * coff-arm.c (bfd_arm_allocate_interworking_sections): Only - compile if not COFF_IMAGE_WITH_PE. - (record_arm_to_thumb_glue, record_thumb_to_arm_glue): Likewise. - (bfd_arm_get_bfd_for_interworking): Likewise. - (bfd_arm_process_before_allocation): Likewise. - * epoc-pei-arm.c: Don't rename bfd_arm functions. - * pei-arm.c: Likewise. - * elf32-mips.c (mips_elf_link_hash_table_create): Don't declare. - (MIPS_ELF_ADD_DYNAMIC_ENTRY): Correct last change. - (mips_elf_got16_entry): Put parens around & in body of ==. - (mips_elf_calculate_relocation): Correct test for empty string. - * vms-gsd.c: Use _bfd_error_handler rather than fprintf to - stderr. - * vms-misc.c (_bfd_vms_length_hash_symbol): Correct sprintf - format. - -1999-07-11 Ian Lance Taylor - - * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED - as appropriate. Fill in structure initializations. Add variable - initializations. Add casts. - * dwarf1.c (parse_line_table): Change eachLine to unsigned long. - (dwarf1_unit_find_nearest_line): Change i to unsigned long. - - * elf.c (bfd_elf_hash): Change parameter from unsigned char * to - char *. - * elf-bfd.h (bfd_elf_hash): Update declaration. - * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Remove casts - when calling bfd_elf_hash. - -1999-07-11 Mark Mitchell - - * libbfd.c (bfd_put_8): Make it of type `void'. - * bfd-in2.h: Regenerated. - * elf32-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Conditionalize - for 32-bit hosts. - (_bfd_mips_elf_final_link): Likewise. - - * elflink.h (elf_link_read_relocs_from_section): Be type-correct. - -Thu Jul 8 12:32:23 1999 John David Anglin - - * config.bfd (hppa*-*-linux-gnu*): New target - -1999-07-07 Mark Mitchell - - * elf-bfd.h (_bfd_mips_elf_section_from_shdr): Constify. - (_bfd_mips_elf_create_dynamic_sections): New function. - (_bfd_mips_elf_add_symbol_hook): Likewise. - (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. - (_bfd_mips_elf_finish_dynamic_symbol): Likewise. - (_bfd_mips_elf_finish_dynamic_sections): Likewise. - (_bfd_mips_elf_gc_mark_hook): Likewise. - (_bfd_mips_elf_gc_sweep_hook): Likewise. - (_bfd_mips_elf_always_size_sections): Likewise. - (_bfd_mips_elf_size_dynamic_sections): Likewise. - (_bfd_mips_elf_check_relocs): Likewise. - (_bfd_mips_elf_link_hash_table_create): Likewise. - (_bfd_mips_elf_print_private_data): Likewise. - (_bfd_mips_elf_link_output_symbol_hook): Likewise. - (_bfd_mips_elf_final_link): Likewise. - (_bfd_mips_elf_additional_program_headers): Likewise. - (_bfd_mips_elf_modify_segment_map): Likewise. - (_bfd_mips_elf_relocate_section): Likewise. - * elf32-mips.c (mips_elf32_object_p): Move contents into - _bfd_mips_elf_object_p. - (mips_elf_additional_program_headers): Rename to - _bfd_mips_elf_additional_program_headers. - (mips_elf_modify_segment_map): Rename to - _bfd_mips_elf_modify_segment_map. - (elf_mips_abi_name): Change prototype. - (mips_elf32_section_from_shdr): Merge into - _bfd_mips_elf_section_from_shdr. - (mips_elf32_section_processing): Merge into - _bfd_mips_elf_section_processing. - (mips_elf_final_link): Rename to _bfd_mips_elf_final_link. Invoke - the right back-end ELF linker. - (mips_elf_relocate_section): Rename to - _bfd_mips_elf_relocate_section. Clean up. Adjust for 64-bit code. - (mips_elf_link_output_symbol_hook): Rename to - _bfd_mips_elf_link_output_symbol_hook. - (mips_elf_create_dynamic_section): Rename to - _bfd_mips_elf_create_dynamic_section. - (mips_elf_check_relocs): Rename to _bfd_mips_elf_check_relocs. - Adjust for 64-bit code. Use mips_elf_got_section. - (mips_elf_adjust_dynamic_symbol): Rename to - _bfd_mips_elf_adjust_dynamic_symbol. Use - mips_elf_allocate_dynamic_relocations. - (mips_elf_finish_dynamic_symbol): Rename to - _bfd_mips_elf_finish_dynamic_symbol. Use mips_elf_got_section. - Adjust for 64-bit code. - (mips_elf_finish_dynamic_sections): Rename to - _bfd_mips_elf_finish_dynamic_sections. Adjust for 64-bit code. - (mips_elf_always_size_sections): Rename to - _bfd_mips_elf_always_size_sections. - (mips_elf_add_symbol_hook): Rename to - _bfd_mips_elf_add_symbol_hook. - (mips_elf_next_lo16_addend): Constify. - (mips_elf_calculate_relocation): Likewise. - (mips_elf_obtain_contents): Likewise. - (mips_elf_perform_relocation): Likewise. - (mips_elf_create_dynamic_relocation): Likewise. - (mips_elf_allocate_dynamic_relocations): New function. - (MIPS_ELF_REL_DYN_SECTION_NAME): New macro. - (MIPS_ELF_REL_SIZE): Likewise. - (MIPS_ELF_DYN_SIZE): Likewise. - (MIPS_ELF_GOT_SIZE): Likewise. - (MIPS_ELF_SYM_SIZE): Likewise. - (MIPS_ELF_LOG_FILE_ALIGN): Likewise. - (MIPS_ELF_GET_WORD): Likewise. - (MIPS_ELF_PUT_WORD): Likewise. - (MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise. - (STUB_LW): Conditionalize for 64-bit value. - (elf_mips_howto_table): Add R_MIPS_HIGHER and R_MIPS_HIGHEST - entries. - (_bfd_mips_elf_merge_private_bfd_data): Merge e_ident[EI_CLASS]. - Check it for inconsistency. - (_bfd_mips_elf_print_private_bfd_data): Print ABI=64 for 64-bit - ABI. - (_bfd_mips_elf_fake_sections): Remove duplicate handling of - .msym. - (mips_elf_global_got_index): Use MIPS_ELF_GOT_SIZE. - (mips_elf_got_offset_from_index): Use misp_elf_got_section. - (mips_elf_create_local_got_entry): Use MIPS_ELF_GOT_SIZE. - (mips_elf_local_got_index): Likewise. - (mips_elf_got_page): Likewise. - (mips_elf_got_info): Likewise. - (mips_elf_create_dynamic_relocation): Handle 32-bit/64-bit split. - (ELF_DYNAMIC_INTERPRETER): Handle 64-bit code. - (mips_elf_create_dynamic_sections): Use MIPS_ELF_LOG_FILE_ALIGN, - instead of constant `2'. - (mips_elf_create_got_section): Tidy. Use MIPS_ELF_GOT_SIZE. - (mips_elf_create_msym_section): Use MIPS_ELF_LOG_FILE_ALIGN. - (mips_elf_size_dynamic_sections): Use - MIPS_ELF_REL_DYN_SECTION_NAME, MIPS_ELF_GOT_SIZE, - MIPS_ELF_ADD_DYNAMIC_ENTRY. Remove #if 0'd code. - Adjust all releveant entries in elf backend table. - * elf64-mips.c (mips_elf64_section_from_shdr): Remove. - (mips_elf64_section_processing): Likewise. - Adjust elf backend entries to use _bfd_mips_elf variants now - publicly available. - - * elflink.h (elf_link_create_dynamic_sections): Handle non-standard - hash-entry sizes. - (size_dynamic_sections): Likewise. - (elf_link_output_extsym): Likewise. - * elf.c: (elf_fake_sections): Likewise. - * libbfd.c (bfd_get): New macro. - (bfd_put): Likewise. - * bfd-in2.h: Regenerated. - -1999-07-07 Mark Mitchell - - * elf-bfd.h (elf_size_info): Add hash_entry_size, - int_rels_per_ext_rel, swap_dyn_out, swap_reloc_in, swap_reloc_out, - wap_reloca_in, and swap_reloca_out. - * elflink.h (elf_link_read_relocs_from_section): Adjust to handle - multiple internal relocations per external relocation. - (link_read_relocs): Likewise. - (elf_bfd_final_link): Likewise. - (elf_link_input_bfd): Likewise. - (elf_gc_mark): Likewise. - (elf_gc_smash_unused_vtentry_relocs): Likewise. - * elfcode.h (elf_swap_dyn_out): Adjust type to match - elf_swap_dyn_in. - (size_info): Add entries for new fields. - * elf64-mips.c (mips_elf64_swap_reloc_out): Enable. - (mips_elf64_be_swap_reloc_in): New function. - (mips_elf64_be_swap_reloc_out): Likewise. - (mips_elf64_be_swap_reloca_in): Likewise. - (mips_elf64_be_swap_reloca_out): Likewise. - (mips_elf64_size_info): Add entries for new fields. - -1999-07-07 Ian Lance Taylor - - * elflink.h (elf_bfd_final_link): Assert that section reloc_count - field equals the new rel_count field. - (elf_link_input_bfd): When doing a relocateable link, use the new - rel_count field rather than the reloc_count field. - (elf_reloc_link_order): Likewise. - (elf_finish_pointer_linker_section): Likewise. - - Based on patch from H.J. Lu : - * elflink.h (elf_merge_symbol): Permit a non-weak definition in a - shared library to override a weak definition in a regular object. - -Tue Jul 6 10:23:39 1999 Jeffrey A Law (law@cygnus.com) - - * libhppa.h: Revert July 2, 1999 patch. - - * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): T mode selectors - need to generate DLTIND relocations, not DLTREL relocations. - -1999-07-05 Nick Clifton - - * coffcode.h (coff_set_arch_mach_hook): Recognise arm 5 - architectures. - (coff_set_flags): Recognise arm 5 architectures. - - * cpu-arm.c: Add support for strongarm and arm9 cpus. - Add support for armv5 architecture. - - * archures.c: Add bfd_mach_arm_5 and bfd_mach_arm_5T. - - * reloc.c: Add new, assembler only, ARM reloc: - BFD_RELOC_ARM_ADRL_IMMEDIATE. - - * bfd-in2.h: Regenerate. - -1999-07-02 Mark Mitchell - - * dwarf2.c (parse_comp_unit): Add ABBREV_LENGTH parameter. - (_bfd_dwarf2_find_nearest_line): Add ADDR_SIZE parameter. - * elf.c (_bfd_elf_find_nearest_line): Pass it. - * elf32-arm.h (elf32_arm_find_nearest_line): Likewise. - * elf32-mips.c (ABI_64_P): New macro. - (IRIX_COMPAT): We are IRIX6-compatible if ABI_64_P. - (_bfd_mips_elf_find_nearest_line): Adjust call to - _bfd_dwarf2_find_nearest_line. - * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype. - * libbfd.h: Regenerated. - -1999-07-02 Ian Lance Taylor - - * config.bfd: Add * at the end of i[3456]86-*-unixware. - -Fri Jul 2 12:21:10 1999 Jeffrey A Law (law@cygnus.com) - - * libhppa.h (HPPA_R_ARG_RELOC): Delete. - (HPPA_R_CONSTANT, HPPA_R_ADDEND): Likewise. - -1999-07-01 Mark Mitchell - - * elf-bfd.h (bfd_elf_section_data): Add rel_count and rel_count2 - fields. - (_bfd_elf_init_reloc_shdr): New function. - * elf.c (_bfd_elf_new_section_hook): Use bfd_zalloc, rather than - bfd_alloc followed by memset. - (_bfd_elf_init_reloc_shdr): New function, split out from ... - (elf_fake_sections): Here. - (assign_section_numbers): Assign section numbers for the second - relocation section, if required. - * elflink.h (elf_link_output_relocs): New function. - (elf_link_size_reloc_section): Likewise. - (elf_bfd_final_link): Use elf_link_size_reloc_section. - (elf_link_input_bfd): Use elf_link_output_relocs. - - * elf32-mips.c (_bfd_mips_elf_fake_sections): Use - _bfd_elf_init_reloc_shdr to initialize rel_hdr2. - -Thu Jul 1 13:58:48 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle R_PCREL_CALL - with 22bit format. - -1999-06-28 Mark Mitchell - - * elf32-mips.c (mips_elf_got_info): Move declaration before - prototypes. Change global_gotsym to be a pointer to a hash entry, - rather than a number index. - (mips_elf_link_hash_entry): Move declaration before prototypes. - (mips_elf_irix6_finish_dynamic_symbol): New function. - (mips_elf_sign_extend): Likewise. - (mips_elf_high): Likewise. - (mips_elf_higher): Likewise. - (mips_elf_highest): Likewise. - (mips_elf_global_got_index): Likewise. - (mips_elf_local_got_index): Likewise. - (mips_elf_got_offset_from_index): Likeiwse. - (mips_elf_record_global_got_symbol): Likewise. - (mips_elf_got_page): Likewise. - (mips_elf_next_lo16_addend): Likewise. - (mips_elf_calculate_relocation): Likewise. - (mips_elf_obtain_contents): Likewise. - (mips_elf_perform_relocation): Likewise. - (mips_elf_assign_gp): Likewise. - (mips_elf_sort_hash_table_f): Likewise. - (mips_elf_sort_hash_table): Likewise. - (mips_elf_got_section): Likewise. - (mips_elf_got_info): Likewise. - (mips_elf_create_local_got_entry): Likewise. - (mips_elf_got16_entry): Likewise. - (mips_elf_create_dynamic_relocation): Likewise. - (elf_mips_howto_table): Add description of R_MIPS_SCN_DISP. - (mips_elf_final_gp): Use mips_elf_assign_gp. - (_bfd_mips_elf_symbol_processing): Don't move SHN_COMMON symbols - into SHN_SCOMMON automatically on IRIX6. - (mips_elf_add_symbol_hook): Likewise. - (mips_elf_relocate_section): Rewrite, using - mips_elf_calculate_relocation and mips_elf_perform_relocation. - (mips_elf_create_dynamic_section): Use MIPS_ELF_STUB_SECTION_NAME. - Don't deal with .rld_map on IRIX6. - (mips_elf_create_got_section): Adjust use of global_gotsym. Set - section flags appropriately for .got. - (mips_elf_check_relocs): Handle IRIX6 relocations making use of - the got. Call mips_elf_record_global_got_symbol and allocate - local got space appropriately. - (mips_elf_size_dynamic_sections): Use bfd_byte *, not unsigned - char *. Rework calculation of GOT size. Sort dynamic symbol - table entries so entries that do not require GOT entries appear at - the beginning. Don't use DT_MIPS_HIPAGENO on IRIX6. Remove dead - code dealing with DT_INIT and DT_FINI. Remove fiddling with - global_gotsym. - (mips_elf_finish_dynamic_symbol): Adjust creation of global GOT - entries. - (mips_elf_finish_dynamic_symbol): Use - mips_elf_irix6_finish_dynamic_symbol. - (mips_elf_finish_dynamic_sections): Correct off-by-one error - setting DT_MIPS_UNREFEXTNO. Adjust setting of DT_MIPS_GOTSYM for - change to global_gotsym. Set DT_MIPS_OPTIONS on IRIX6. - -1999-06-30 Ian Lance Taylor - - * elf32-mips.c (mips_elf_final_link): Don't set CPIC when doing a - relocateable link. From Ralf Baechle . - -1999-06-04 Philip Blundell - - * elf32-arm.h (elf_backend_got_header_size): Define. - (elf_backend_plt_header_size): Likewise. - -1999-06-28 Jim Pick - - * elf32-arm.h (elf32_arm_relocate_section): Mind no_undefined - -Tue Jun 29 02:25:03 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.c (elf_hppa_howto_table): Use bfd_elf_generic_reloc as - relocation function. - * elf32-hppa.c (hppa_elf_reloc): Kill unused/unwanted function. - -1999-06-27 Mark Mitchell - - * elf32-mips.c (MIPS_ELF_SRDATA_SECTION_NAME): New macro. - (MIPS_ELF_OPTIONS_SECTION_NAME): Likewise. - (MIPS_ELF_STUB_SECTION_NAME): Likewise. - (_bfd_mips_elf_section_from_shdr): Use them. - (_bfd_mips_elf_fake_sections): Likewise. Add .srdata to the list - of GP-relative sections. - (_bfd_mips_elf_set_section_contents): Use them. - (_bfd_mips_elf_section_processing): Share code between .sdata and - .lit4/.lit8 sections. Set appropriate flags for .srdata. - (mips_elf_additional_program_headers): Add handling for - PT_MIPS_OPTIONS segment on IRIX6. - (mips_elf_modify_segment_map): Likeiwse. - (mips_elf_final_link): Set EF_MIPS_CPIC when required by the ABI. - Include the options sections on IRIX6. Don't look for GP-relative - sections by name; use SHF_MIPS_GPREL instead. - (ELF_DYNAMIC_INTERPRETER): Adjust to use /usr/lib32/libc.so.1 for - the N32 ABI. - (mips_elf_create_dynamic_sections): Don't muck about with section - alignments and such on IRIX6. - (mips_elf_adjust_dynamic_symbol): Use MIPS_ELF_STUB_SECTION_NAME. - (mips_elf_size_dynamic_sections): Likewise. Adjust to handle the - fact that ELF_DYNAMIC_INTERPRETER is no longer a constant. Use - bfd_zalloc rather than bfd_alloc and memset. - (mips_elf_finish_dynamic_symbol): Use MIPS_ELF_STUB_SECTION_NAME. - Don't assert the existence of .rld_map on IRIX6. - (mips_elf_finish_dynamic_sections): Use MIPS_ELF_STUB_SECTION_NAME. - - * elf32-mips.c (mips_elf_adjust_dynindx): Remove. - (mips_elf_size_dynamic_sections): Use _bfd_elf_link_adjust_dynindx - instead. - -1999-06-26 Mark Mitchell - - * elf32-mips.c (mips_elf_swap_msym_in): New function. - (mips_elf_swap_msym_out): New function. - (mips_elf_create_msym_section): Likewise. - (MIPS_ELF_MSYM_SECTION_NAME): New macro. - (_bfd_mips_elf_final_write_processing): Set sh_link for .msym. - (_bfd_mips_elf_section_from_shdr): Reject an SHT_MIPS_MSYM - section not named .msym. - (_bfd_mips_elf_fake_sections): Use MIPS_ELF_MSYM_SECTION_NAME, not - .msym directly. Set appropriate attributes for the .msym - section. - (mips_elf_link_hash_entry): Add min_dyn_reloc_index field. - (mips_elf_link_hash_newfunc): Clear it. - (mips_elf_create_dynamic_sections): Create the .msym section - on IRIX6. - (mips_elf_size_dynamic_sections): Allocate space for the - .msym section. Add a DT_MIPS_MSYM entry. - (mips_elf_finish_dynamic_symbol): Write out a .msym entry for - the symbol. - (mips_elf_finish_dynamic_sections): Assign a value for - DT_MIPS_MSYM. Add .msym entries for the section symbols as well. - - * elf32-mips.c (irix_compat_t): New enumeration. - (ABI_N32_P): New macro. - (IRIX_COMPAT): Likewise. - (SGI_COMPAT): Implement in terms of IRIX_COMPAT. - (mips_elf_relocate_section): Fix typo. - -1999-06-26 Mumit Khan - - * peicode.h (coff_swap_scnhdr_out): Mark non readonly BFD sections - as writable PE sections. - -1999-06-26 David Mosberger - - * dwarf2.c (struct arange): New type. - (struct comp_unit): Replace LOW and HIGH by member ARANGE. - (arange_add): New function. - (decode_line_info): Keep track of address ranges that a compilation - unit covers. - (comp_unit_contains_address): Return true if address is contained - in _any_ of the address ranges associated with a compilation unit. - (_bfd_dwarf2_find_nearest_line): Call comp_unit_find_nearest_line - on the first comp_unit that contains the address. - -1999-06-26 David Mosberger - - * dwarf2.c (struct dwarf2_debug): Add member dwarf_line_buffer. - (decode_line_info): Add variable STASH and initialize it to point - to the per-bfd dwarf2_debug info. Remove static variable - dwarf_line_buffer and use stash->dwarf_line_buffer in its place. - -1999-06-26 Ian Lance Taylor - - * elflink.h (elf_link_output_extsym): It's OK for a -Bsymbolic - shared library to have an undefined symbol. - - From Franz Sirl : - * elf32-ppc.c (ppc_elf_relocate_section): Fix last patch. - -Thu Jun 24 20:59:11 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.c (elf_hppa_final_write_processing): New function. - * elf32-hppa.c: Remove everything related to symbol extension - sections & records. Use the common elf_hppa_final_write_processing. - -1999-06-22 Mark Mitchell - - * elflink.h (size_dynamic_sections): Use user-specified init/fini - functions instead of _init/_fini if requested. - -1999-06-23 Ian Lance Taylor - - * elf.c (bfd_section_from_shdr): Avoid crashing on a bogus sh_link - field. - -1999-06-22 Ian Lance Taylor - - From Franz Sirl : - * elf32-ppc.c (ppc_elf_size_dynamic_sections): Set unused dynindx - field to 0, not -1. - (ppc_elf_finish_dynamic_sections): Check for positive section - dynindx field, rather than comparing against -1. - (ppc_elf_relocate_section): Only return false if undefined_symbol - or reloc_overflow fail, not always upon encountering an error. - -1999-06-22 Mark Mitchell - - * elflink.h (link_read_relocs): Explicitly cast external_relocs to - bfd_byte * before performing pointer arithmetic. - -Tue Jun 22 13:06:25 1999 Jeffrey A Law (law@cygnus.com) - - * elf-hppa.h: New file. Common stuff for elf32 and elf64 PA - support. - * elf32-hppa.c: Include elf-hppa.h. - (ARCH_SIZE): Define. - (elf_hppa_reloc_type_lookup): Delete. Found in the common code - now. - (elf32_hppa_info_to_howto): Similarly. - (elf_hppa_howto_table): Similarly. - (elf_hppa_reloc_type_lookup): Similarly. - (hppa_elf_gen_reloc_type): Similarly. - * elf32-hppa.h (ELF_HOWTO_TALBE, N_PARISC_RELOCS): Delete. - -1999-06-22 Nick Clifton - - * elf32-v850.c (v850_elf_final_link_relocate): Catch overflow - handling R_V850_22_PCREL relocation. - -1999-06-21 Ian Lance Taylor - - * coff-arm.c (arm_emit_base_file_entry): Explicitly declare return - type. - -Sun Jun 20 14:13:57 1999 Richard Henderson - - * section.c (_bfd_strip_section_from_output): Ignore sections - DISCARDed by the link script. - -1999-06-19 Ian Lance Taylor - - * elflink.h (elf_link_remove_section_and_adjust_dynindices): - Remove unused local variable spp. - - * xcofflink.c (bfd_xcoff_size_dynamic_sections): Don't crash if - the entry symbol is not set. - -Fri Jun 18 04:24:57 1999 Richard Henderson - - * elf64-alpha.c (elf64_alpha_relocate_section): Don't adjust - GPDISP or LITUSE in a relocatable link. - -Thu Jun 17 21:24:43 1999 J"orn Rennecke - - * dwarf1.c (alloc_dwarf1_unit): Allocate using bfd_zalloc. - * (alloc_dwarf1_func): Likewise. - -Wed Jun 16 03:09:57 1999 Jeffrey A Law (law@cygnus.com) - - * libhppa.h: Fix various formatting errors. - (assemble_3); Rewrite using CATENATE. - (assemble_17): Fix various bugs. - -1999-06-16 Nick Clifton - - * elf32-mcore.c (R_MCORE_RAW): Fix definition. - -1999-06-15 Richard Henderson - - * section.c (SEC_SHORT): Define. - * bfd-in2.h: Rebuild. - -1999-06-13 Mark Mitchell - - * elflink.h (elf_link_remove_section_and_adjust_dynindices): - Remove abfd parameter. Use _bfd_strip_section_from_output. - (bfd_elf_size_dynamic_sections): Adjust callers accordingly. - - * elf-bfd.h (_bfd_elf_link_adjust_dynindx): New function. - * elflink.c (_bfd_elf_link_adjust_dynindx): Define it. - * elflink.h (elf_link_remove_section_and_adjust_dynindices): New - function. - (bfd_elf_size_dynamic_sections): Use it. - -1999-06-13 Alan Modra - - * elf32-i386.c (elf_howto_table): Change R_386_PC8 from - complain_overflow_bitfield to complain_overflow_signed. - -1999-06-13 Mark Mitchell - - * elflink.h (elf_link_read_relocs_from_section): New function, - split out from ... - (elf_link_read_relocs): Here. Use it for both relocation - sections. - -1999-06-12 Mark Mitchell - - * elfcode.h (elf_slurp_reloc_table_from_section): Don't assume - asect->reloc_count is valid. - -1999-06-12 Ian Lance Taylor - - * elf32-mips.c (mips_elf32_section_processing): Permit a - SHT_MIPS_REGINFO section to have a size of 0. - -1999-06-12 David O'Brien - - * config.bfd (alpha*-*-freebsd*): New target. - (i[3456]86-*-freebsd*): Now defaults to ELF. - -1999-06-11 Ian Lance Taylor - - * reloc.c (_bfd_relocate_contents): Permit bitfield relocations to - wrap if the relocation covers the high bit of an address. - - * dwarf2.c (decode_line_info): Remove unused variable first_time. - -1999-06-10 Jakub Jelinek - - * 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_info_to_howto): Likewise; handle vtable relocations. - -1999-06-07 Richard Henderson - - * section.c (_bfd_strip_section_from_output): Remove output - sections with no initial link_order. - -1999-06-07 Nick Clifton - - * elf32-m88k.c (ELF_MAXPAGESIZE): Define. - -Mon Jun 7 11:49:43 1999 Andreas Schwab - - * Makefile.am (SOURCE_HFILES): Add missing headers. - * Makefile.in: Regenerated. - -1999-06-06 Mark Mitchell - - * elf32-mips.c (_bfd_mips_elf_print_private_data): Recognize - the N32 ABI. - -1999-06-04 Franz Sirl - - * elf32-ppc.c (ppc_elf_relocate_section): Don't barf on out of - range undefweak symbols. - * hash.c: Add missing comma after @xref{} - * linker.c: Likewise. - -1999-06-04 Nick Clifton - - * elfxx-target.h (ELF_MAXPAGESIZE): Produce an error message - if not defined. - * elf32-gen.c (ELF_MAXPAGESIZE): Define. - * elf32-i860.c (ELF_MAXPAGESIZE): Define. - * elf32-i960.c (ELF_MAXPAGESIZE): Define. - * elf64-gen.c (ELF_MAXPAGESIZE): Define. - -1999-06-04 Ian Lance Taylor - - * Makefile.am: Rebuild dependencies. - (BFD32_BACKENDS): Add dwarf1.lo. - (BFD32_BACKENDS_CFILES): Add dwarf1.c. - * Makefile.in: Rebuild. - -1999-06-04 Nick Clifton - - * Makefile.am: Add epoc-arm-pe target. - * Makefile.in: Regenerate. - * pe-arm.c: Only redefine interworking function names if they have - not already been redefined. - * pei-arm.c: Only redefine interworking function names if they have - not already been redefined. - * epoc-pe-arm.c: Redefine interworking function names to avoid a - name space clash. - * epoc-pei-arm.c: Redefine interworking function names to avoid a - name space clash. - -1999-06-03 Nick Clifton - - * elfxx-target.h (ELF_MAXPAGESIZE): Default to 0x1000 not 1. - -Fri Jun 4 10:05:11 1999 Andreas Schwab - - * elf.c (elf_fake_sections): Undo change of 1999-05-10. - -Fri Jun 4 03:10:49 1999 J"orn Rennecke - - * elf32-sh.c (sh_elf_relax_delete_bytes): Fix setting of - start / stop for recalculating of r_addend of R_SH_SWITCH*. - -Fri Jun 4 02:53:13 1999 J"orn Rennecke - - * elf32-sh.c (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH32 - in other text sections. - -Fri Jun 4 02:29:34 1999 J"orn Rennecke - - * libbfd.c (_bfd_generic_verify_endian_match): New function. - * libbfd-in.h (_bfd_generic_verify_endian_match): Declare. - * libbfd.h: Regenerate. - * coff-sh.c (sh_merge_private_data): Delete. - (coff_bfd_merge_private_bfd_data): Change to - _bfd_generic_verify_endian_match. - (elf32-sh.c): bfd_elf32_bfd_merge_private_bfd_data: Define. - -1999-06-03 Ulrich Drepper - - * elf32-arm.h: Fix typo: change ELF_MAXPAGE_SIZE to ELF_MAXPAGESIZE. - -1999-06-03 Ian Lance Taylor - - * bfd-in.h (bfd_elf32_arm_allocate_interworking_sections): Correct - prototype. - (bfd_elf32_arm_process_before_allocation): Likewise. - * bfd-in2.h: Rebuild. - -1999-06-03 David Mosberger - - * dwarf2.c (struct line_info): Add member END_SEQUENCE to keep - track of end_sequence markers. - (add_line_info): Add END_SEQUENCE arg. - (decode_line_info): Don't try to infer lo_pc and hi_pc from the - debug-line info---it doesn't work right if a compilation unit - consists of multiple discontiguous code-sequences. It would be - worthwhile to optimize for the common case where a compilation - unit results in a contiguous set of code sequences, but this is - quite tricky to get right for arbitrary DWARF2 files. - (lookup_address_in_line_info_table): Don't use the last line entry - for a compilation unit for anything with an address higher than - this line entry. Also, check for end_sequence markers to - correctly handle discontinuities. - (_bfd_dwarf2_find_nearest_line): When checking previously loaded - compilation units, check all compilation units with each->high==0 - just like when reading compilation units. - - * dwarf2.c (decode_line_info): Initialize table->files and - table->last_line to NULL to avoid segfaults due to random - values in these members. - (concat_filename): Check for out-of-range file number before - indexing filename table. Segfaults suck. - - * dwarf2.c (decode_line_info): Don't truncate address to least - significant 32 bits (breaks 64 bit targets). - (lookup_address_in_function_table): Ditto. - (comp_unit_contains_address): Ditto. - -1999-06-02 Mark Mitchell > - - * elf32-mips.c (elf_mips_howto_table): Add R_MIPS_JALR. - * elf64-mips.c (mips_elf64_howto_table_rel): Likewise. - (mips_elf64_howto_table_rela): Likewise. - - * elfcode.h (elf_slurp_reloc_table_from_section): New function, - split out from ... - (elf_slurp_reloc_table): Here. Use it to handle the case where a - single section has two associated relocation sections. - -1999-06-02 Mark Salter - - * coffcode.h (coff_set_alignment_hook): Set lma from s_vaddr if - COFF_WITH_PE defined. - -1999-06-02 Nick Clifton - - * pe-arm.c: Rename global arm interworking functions to avoid name - collision when all targets BFD is built. - * pei-arm.c: Ditto. - -1999-05-31 Mark Mitchell - - * elf-bfd.h (elf_backend_data): Remove use_rela_p. Add - may_use_rel_p, may_use_rela_p, default_use_rela_p. - (bfd_elf_section_data): Add use_rela_p. - * elf.c (bfd_section_from_shdr): Set use_rela_p appropriately. - (_bfd_elf_new_section_hook): Likewise. - (elf_fake_sections): Use may_use_rela_p, etc., instead of - use_rela_p. - (_bfd_elf_copy_private_section_data): Copy use_rela_p. - * elfcode.h (write_relocs): Determine whether or not use rela - relocs based on the relocation section header. - * elflink.c (_bfd_elf_create_dynamic_sections): Use default_use_rela_p - instead of use_rela_p. - * elfxx-target.h (elf_backend_may_use_relp): New macro. - (elf_backend_may_use_rela_p): Likewise. - (elf_backend_default_use_rela_p): Likewise. - (elfNN_bed): Use them. - -Wed Jun 2 12:38:49 1999 Miodrag Vallat - - * hosts/alphalinux.h (TRAD_CORE_EXTRA_SIZE_ALLOWED): Expand to 4096. - -Tue Jun 1 17:57:58 1999 Mark P. Mitchell - - * reloc.c (BFD_RELOC_MIPS_SUB): New relocation. - (BFD_RELOC_MIPS_GOT_PAGE): Likewise. - (BFD_RELOC_MIPS_GOT_OFST): Likewise. - (BFD_RELOC_MIPS_GOT_DISP): Likewise. - * bfd-in2.h: Regenerated. - * libbfd.h: Likewise. - * elf32-mips.c (mips_info_to_howto_rela): New function. - (USE_REL): Adjust for new conventions. - (MINUS_ONE): New macro. - (elf_mips_howto_table): Add R_MIPS_SUB. - (mips_r): Add entries for MIPS_SUB, MIPS_GOT_PAGE, MIPS_GOT_OFST, - and MIPS_GOT_DISP. - (mips_elf_final_write_processing): Set sh_link, not sh_info, for a - .MIPS.content section. - (_bfd_mips_elf_fake_sections): Treat all sections that begin - with .MIPS.content as .MIPS.content sections. Set - SHF_MNIPS_NOSTRIP for such section. - (elf_info_to_howto): Define to mips_info_to_howto_rela. - * elf64-mips.c (mips_r): Add entries for MIPS_SUB, MIPS_GOT_PAGE, - MIPS_GOT_OFST, and MIPS_GOT_DISP. - -Wed Jun 2 11:51:12 1999 Andreas Schwab - - * vms-misc.c (_bfd_vms_hash_newfunc): Fix use of uninitialized - variable. - - * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Avoid ambigous - `else'. - -1999-05-30 Philip Blundell - - * elf32-arm.h (elf32_arm_relocate_section): Reinstate change of - 1993-03-25 (!!). Take into account the bitmasks for the reloc so - the addend does not overflow into the rest of the word. - -1999-05-29 Nick Clifton - - * bfd-in.h: Amend prototype for - bfd_elf32_arm_process_before_allocation . - * bfd-in.h: Regenerate. - - * elfarm-oabi.c (NUM_ELEM): New macro: Compute the number of - elements in a fixed sized array. - (ARM_ELF_ABI_VERSION): Define. - (ARM_ELF_OS_ABI_VERSION): Define. - (R_ARM_THM_ABS5): Fix rightshift and size. - (R_ARM_THM_PC22): Fix size. - (R_ARM_PLT32): Define Howto. - (find_howto): New function: Locate a howto based on a reloc - number. - (elf32_arm_info_to_howto): Use find_howto if necessary. - (elf32_arm_reloc_map): Change type of field bfd_reloc_val to - bfd_reloc_code_real_type. - (elf32_arm_reloc_map[]): Add entries for BFD_RELOC_VTABLE_INHERIT - and BFD_RELOC_VTABLE_ENTRY. - (elf32_arm_reloc_type_lookup): Use find_howto if necessary. - - * elfarm-nabi.c (NUM_ELEM): New macro: Compute the number of - elements in a fixed sized array. - (ARM_ELF_ABI_VERSION): Define. - (ARM_ELF_OS_ABI_VERSION): Define. - (R_ARM_THM_ABS5): Fix rightshift and size. - (R_ARM_THM_PC22): Fix size. - (elf32_arm_info_to_howto_rel): Rename to elf32_arm_info_to_howto. - (elf32_arm_reloc_map): Change type of field bfd_reloc_val to - bfd_reloc_code_real_type. - - * elf32-arm.h (struct elf32_arm_link_hash_table): Add new field: - no_pipeline_knowledge. - (elf32_arm_link_hash_create): Initialise new field to zero. - (bfd_elf32_arm_process_before_allocation): Add new paraemter: - no_pipeline_knowledge. Use this parameter to initialise the field - in the globals data structure. - (elf32_arm_final_link_relocate): Only add in pipeline offset if - no_pipeline_knowledge is false and the binary is from an old - toolchain. - (elf32_arm_merge_private_data): Generate an error if an attempt is - made to linl together big endian and little endian code. - (elf32_arm_post_process_headers): New function: Initialise the - EI_OSABI and EI_ABIVERSION fields of the newly created ELF program - header. - (elf_backend_post_process_headers): Define. - -1999-05-28 Nick Clifton - - * elf-bfd.h (struct elf_backend_data): Add new field: - elf_backend_post_process_headers. - - * elfxx-target.h (elf_backend_post_process_headers): Define to - NULL if not already defined. - (elfNN_bed): Initialise elf_backend_post_process_headers field. - - * elf.c (prep_headers): Set the EI_OSABI and EI_ABIVERSION fields - to zero. - (_bfd_elf_compute_section_file_positions): Call - elf_backend_post_process_headers if defined. - -1999-05-28 Ian Lance Taylor - - * configure.in: Check whether getuid and getgid exist. - * archive.c: Define getuid and getgid as macros if HAVE_GETUID or - HAVE_GETGID are not defined, respectively. - (bfd_write_armap): Don't special case on _WIN32 for getuid and - getgid. - * configure.host: Set ac_cv_func_get{ug}id for *-*-windows*. - * configure, config.in: Rebuild. - -1999-05-28 Martin Dorey - - * elf32-i960.c: New file. - * elf.c (prep_headers): Handle bfd_arch_i960. - * targets.c (bfd_target_vector): Add &bfd_elf32_i960_vec. - * config.bfd (i960-*-elf*): New target. - * configure.in (bfd_elf32_i960_vec): New target vector. - * Makefile.am (BFD32_BACKENDS): Add elf32-i960.lo. - (BFD32_BACKENDS_CFILES): Add elf32-i960.c. - * Makefile.in, aclocal.m4, configure: Rebuild. - -1999-05-27 Nick Clifton - - * elfarm-oabi.c (elf32_arm_howto_table): Add entry for - R_ARM_PLT32. - (find_howto): New function: Find entries in the - elf32_arm_howto_table. - (elf32_arm_info_to_howto): Use find_howto if the entry cannot be - computed simply. - (elf32_arm_reloc_type_lookup): Add lookup for - BFD_RELOC_ARM_PLT32. - -1999-05-25 Philip Blundell - - * bfd/elf32-arm.h (elf32_arm_link_hash_newfunc): New function. - (elf32_arm_link_hash_table_create): Use above function as the - constructor for hash table entries. - (elf32_arm_relocate_section): Avoid crash when there is no output - section. - (elf32_arm_final_link_relocate): New parameter h. - (elf32_arm_relocate_section): Pass symbol hash entry to above - routine. - (elf32_arm_gc_sweep_hook, elf32_arm_check relocs): Correct - comments. - -1999-05-25 Catherine Moore - - * coff-arm.c (coff_arm_relocate_section): Don't emit - base file entries for pc-relative values. - -1999-05-25 DJ Delorie - - * peicode.h (coff_swap_sym_in): When we create the actual section - to reflect the not-there section C_SECTION symbols refer to, - change the symbol class to C_STAT as the section is now really - there. - -1999-05-24 Philip Blundell - - * elf32-arm.h (elf32_arm_relocate_section): Undo change of - 1999-03-25. - -Mon May 17 13:35:35 1999 Stan Cox - - * coff-arm.c (_bfd_coff_arm_set_private_flags): Changed - F_PIC_INT to F_PIC. - * coffcode.h (coff_set_arch_mach_hook): Added F_ARM_2a, and - F_ARM_3M labels. Changed F_PIC_INT to F_PIC. - -1999-05-16 Nick Clifton - - * coff-mcore.c (in_reloc_p): Reinstate. - -1999-05-15 Nick Clifton - - * reloc.c (BFD_RELOC_MCORE_RVA): Define. - * bfd-in2.h: Regenerate. - * coff-mcore.c (in_reloc_p): Remove defintion. - (mcore_coff_howto): Add IMAGE_REL_MCORE_RVA. - (mcore_coff_reloc_type_lookup): Map BFD_RELOC_RVA to - IMAGE_REL_MCORE_RVA. - (coff_mcore_rtype_to_howto): Add special processing for - IMAGE_REL_MCORE_RVA. - (coff_mcore_relocate_section): Add support for - IMAGE_REL_MCORE_RVA. - * elf32-mcore (mcore_elf_howto_): Add R_MCORE_RELATIVE. - (mcore_elf_reloc_type_lookup): Map BFD_RELOC_RVA to - R_MCORE_RELATIVE. - (mcore_elf_relocate_section): Delete redundant case labels. - -Fri May 14 10:59:55 1999 Andreas Schwab - - * elf32-arm.h (elf32_arm_relocate_section): Fix operator - precedence between bit-and and comparison. - -Thu May 13 09:45:23 1999 Joel Sherrill (joel@OARcorp.com) - - * config.bfd (i[3456]86*-*-rtems*, m68k*-*-rtems*): Added to - list of target formats (targ_selvecs). - (i[3456]86*-*-rtemself*, mips*el-*-rtems*): New targets. - (powerpcle*-*rtems*, sh-*-rtemself*): New targets. - -1999-05-10 DJ Delorie - - * ecoff.c (_bfd_ecoff_write_armap): give the symtab element a - reasonable mode until "ar x" is smart enough to skip it (fixes - gcc/libgcc.a builds on mips-ecoff targets - - * coffcode.h (styp_to_sec_flags): Explain how COMDATs are supposed - to work. Hack to support MS import libraries, which use different - COMDAT types than GNU. - (coff_slurp_symbol_table): C_SECTION symbols are local; they refer - to implied zero-length sections (see peicode below) - * coffgen.c (coff_get_normalized_symtab): Properly read long MS - filename symbols, which use one *or more* auxents. - * coffswap.h (coff_swap_aux_in): ditto - * peicode.h (coff_swap_sym_in): Build the implied zero-length - sections - -Tue May 11 15:51:58 1999 Jeffrey A Law (law@cygnus.com) - - * elf32-v850.c (v850_elf_howto_table): Make partial_inplace false - for all relocations. - -1999-05-10 Catherine Moore - - * bfd-in.h (bfd_arm_allocate_interworking_sections): Static - if COFF_IMAGE_WITH_PE. - (bfd_arm_process_before_allocation): Likewise. - (bfd_arm_get_bfd_for_interworking): Likewise. - * coff-arm.c: Likewise. - * bfd-in2.h: Regenerate. - * configure.in (armpe_little_vec): Remove coff-arm.lo. - (armpe_big_vec): Likewise. - * configure: Rebuild. - -1999-05-10 Nick Clifton - - * elf.c (elf_fake_sections): Check for .rel. as start of rel - section, not just .rel. Same for .rela. - -1999-05-07 Nick Clifton - - * coff-mcore.c (coff_mcore_relocate_section): Replace assert about - endianism with an error message. - -Thu May 6 17:09:09 1999 Fred Fish - - * dwarf2.c (read_abbrevs): Change cast of dwarf_abbrev_buffer - assignment from "unsigned char *" to "char *". - (decode_line_info): Likewise for dwarf_line_buffer assignment. - -1999-05-05 Catherine Moore - - * coff-arm.c (coff_arm_relocate_section): Add one to - address of ARM_RVA32 thumb functions. - -1999-05-05 Catherine Moore - - * elf32-m68k.c (elf32_m68k_set_private_flags): New. - (elf32_m68k_copy_private_bfd_data): New. - (elf32_m68k_merge_private_bfd_data): New. - (elf32_m68k_print_private_bfd_data): New. - (CPU32_FLAG): Define. - (PLT_CPU32_ENTRY_SIZE): Define. - (elf_cpu32_plt0_entry): Declare. - (elf_cpu32_plt_entry): Declare. - (elf_m68k_adjust_dynamic_symbol): Generate cpu32 plt entries. - (elf_m68k_finish_dynamic_symbol): Likewise. - (elf_m68k_finish_dynamic_sections): Likewise. - (elf_backend_plt_header_size): Remove definition. - (bfd_elf32_bfd_copy_private_bfd_data): Define. - (bfd_elf32_bfd_merge_private_bfd_data): Define. - (bfd_elf32_bfd_set_private_flags): Define. - (bfd_elf32_bfd_print_private_bfd_data): Define. - -Mon May 3 09:24:49 1999 Jeffrey A Law (law@cygnus.com) - - * som.c (som_fixup_formats): Fix comments for R_SHORT_PCREL_MODE - and R_LONG_PCREL_MODE. - -1999-04-29 Nick Clifton - - * coff-mcore.c (coff_mcore_relocate_section): Fix typos. - -Fri Apr 28 16:36:19 1999 Stan Cox - - * elf32-sh.c (sh_elf_relocate_section): Include relocation addend - in relocation calculation. - -1999-04-26 Tom Tromey - - * aclocal.m4, configure: Updated for new version of libtool. - -1999-04-21 Nick Clifton - - * coff-mcore.c: Add support for mcore relocs. - -1999-04-20 Gavin Romig-Koch - - * elf32-mips.c (_bfd_mips_elf_print_private_bfd_data): Scrap the - incorrect use EF_MIPS_xxBITPTRS. - -1999-04-18 Ian Lance Taylor - - * elf64-alpha.c (elf64_alpha_relax_section): Remove unused local - variable insn. - - * bfd-in2.h: Rebuild. - * libbfd.h: Rebuild. - -Sat Apr 17 20:55:15 1999 Catherine Moore - - * coff-arm.c (coff_arm_rtype_to_howto): Remove ARM26D transform. - (coff_arm_relocate_section): Add ARM26D transform. Only - change to ARM26D for relocateable links. - -1999-04-16 Gavin Romig-Koch - - * elf32-mips.c (_bfd_mips_elf_print_private_bfd_data): New. - (bfd_elf32_bfd_print_private_bfd_data): New. - -1999-04-15 Doug Evans - - * elf32-arm.h (elf32_arm_final_link_relocate): For R_ARM_THM_ABS5, - refetch addend if USE_REL, add many comments regarding current state. - For R_ARM_THM_PC22, refetch addend if USE_REL, simplify. - * elfarm-nabi.c (elf32_arm_howto_table): For R_ARM_THM_ABS5, fix - size and rightshift. For R_ARM_THM_PC22, fix bitsize. - * elfarm-oabi.c (elf32_arm_howto_table): Ditto. - -Wed Apr 14 14:33:08 1999 Richard Henderson - - * elf32-mips.c (_bfd_mips_elf_read_ecoff_info): Zero `debug'. - * elf64-alpha.c (elf64_alpha_read_ecoff_info): Likewise. - -1999-04-13 David Mosberger - - * dwarf2.c (decode_line_info): Don't truncate address to least - significant 32 bits (breaks 64 bit targets). - (lookup_address_in_function_table): Ditto. - (comp_unit_contains_address): Ditto. - -Tue Apr 13 21:27:19 1999 Catherine Moore - - * coff-arm.c (arm_emit_base_file_entry): New routine. - (A2T3_OFFSET): Define. - (T2A3_OFFSET): Define. - (coff_arm_relocate_section): Emit base file entries for interworking - stubs. - -1999-04-13 Philip Blundell - - * elfarm-nabi.c (elf32_arm_howto_table): Add dummy entries for - relocs 17 through 19. - -Sun Apr 11 01:25:17 1999 Richard Henderson - - * elfcode.h: Remove fnmatch.h. - * elflink.h (elf_link_assign_sym_version): Call back to ld - instead of calling fnmatch. - - * config.bfd (i?86-*-beoself): Include pe vecs. - -Sun Apr 11 01:14:06 1999 Richard Henderson - - * elf32-i386.c (elf_i386_finish_dynamic_sections): Allow .plt - to go missing. - -1999-04-10 Richard Henderson - - * elf32-i386.c (elf_i386_relocate_section): Mind no_undefined - when trying to resolve dynamic symbol references. - * elf32-m68k.c (elf_m68k_relocate_section): Likewise. - * elf32-mips.c (mips_elf_relocate_section): 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. - * elflink.h (elf_link_output_extsym): Likewise. - -Sat Apr 10 15:12:09 1999 Richard Henderson - - * section.c (_bfd_strip_section_from_output): New function moved from - * elf64-alpha.c (elf64_alpha_strip_section_from_output): ... here. - * elf32-i386.c (elf_i386_size_dynamic_sections): Use it. - * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. - * elf32-mips.c (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-sparc.c (sparc64_elf_size_dynamic_sections): Likewise. - * bfd-in2.h: Update. - -1999-04-09 Ian Lance Taylor - - * elf64-sparc.c: Fix incorrect calls to bfd_check_overflow. - -1999-04-08 Nick Clifton - - * coff-mcore.c: New File: Support for mcore-pe targets. - * cpu-mcore.c: New File: Support for mcore targets. - * elf32-mcore.c: New File: Support for mcore-elf target. - * pe-mcore.c: New File: Definitions for mcore-pe target. - * pei-mcore.c: New File: Definitions for mcore-pei target. - * Makefile.am: Add support for MCore targets. - * Makefile.in: Regenerate. - * config.bfd: Add support for MCore targets. - * configure.in: Add support for MCore targets. - * configure: Regenerate. - * archures.c: Add support for MCore architecture. - * bfd-in2.h: Regenerate. - * coffcode.h: Add support for mcore-pe targets. - * elf.c: Add support for mcore-elf target. - * reloc.c: Add support for MCore relocs. - * targets.c: Add support for MCore targets. - -1999-04-07 Nick Clifton - - * elfarm-nabi.c (elf32_arm_howto_table): Add entries for - R_ARM_XPC25 and R_ARM_THM_XPC22. - (elf32_arm_reloc_map): Remove redundant entries. - -1999-04-06 Ian Lance Taylor - - * sysdep.h (LC_MESSAGES): Never define. - -1999-04-06 Chris Torek - - * reloc.c (bfd_check_overflow): Add addrsize parameter. Change - all callers. Rewrite completely. - (_bfd_relocate_contents): Rewrite overflow checking. - * bfd-in2.h: Rebuild. - -1999-04-05 Ian Lance Taylor - - From Gabriel Paubert : - * elf32-ppc.c (ppc_elf_howto_raw): Set R_PPC_GOT16_LO, - R_PPC_PLT16_LO and R_PPC_SECTOFF_LO to be complain_overflow_dont. - Set R_PPC_PLT16_HA, R_PPC_SECTOFF_HA and R_PPC_EMB_NADDR16_HA to - have a rightshift of 16 and use ppc_elf_addr16_ha_reloc. - * ppcboot.c (ppcboot_vec): Use little endian routines for - headers. - - * elf.c (elfcore_strndup): Only define if it will be used. - * elf32-ppc.c (ppc_elf_relax_section): Remove unused locals irel - and irelend. - (ppc_elf_check_relocs): Remove unused local i. - (ppc_elf_gc_mark_hook): Add default case to switch. - - From Bernd Nitzler : - * srec.c (srec_scan): Accept \r in symbol definitions. - (srec_object_p): Set HAS_SYMS if we saw any symbols. - (symbolsrec_object_p): Likewise. - -1999-04-04 Don Bowman - - * config.bfd: Add mips*el-*-vxworks* and mips*-*-vxworks*. - -1999-04-04 Ian Lance Taylor - - * dwarf1.c (parse_line_table): Remove unused locals last_pc and - last_line. - * elf-bfd.h (_bfd_elfcore_section_from_phdr): Declare. - * elf32-i386.c (elf_i386_gc_mark_hook): Add default case to - switch. - * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Remove unused - local i. - * syms.c (_bfd_stab_section_find_nearest_line): Remove unused - local val. - -1999-03-31 Nick Clifton - - * config.bfd: Add support for arm-epoc-pe target. - * configure.in: Add support for arm-epoc-pe target. - * configure: Regenerate. - * 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 - TARGET_LITTLE_SYM and TARGET_BIG_SYM. - * pei-arm.h: 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. - -1999-03-30 Nick Clifton - - * elf.c (elf_map_symbols): Handle the case where section - symbols are generated for content-less sections which are - not mapped to the output file. - - * linker.c: Replace direct references to fields in BFD structure - with accessor macros. - - * elflink.h: Replace direct references to fields in BFD structure - with accessor macros. - -1999-03-25 Philip Blundell - - * config.bfd: Eliminate redundancy in checks for Linux/ARM. - - * elf32-arm.h (elf32_arm_relocate_section): Take the rightshift into - account when adjusting section symbols during a partial link. - -1999-03-24 Nick Clifton - - * coff-sparc.c (struct coff_reloc_map): Change type of field - 'bfd_reloc_val' to bfd_reloc_code_real_type. - * elf-m10200.c (struct mn10200_reloc_map): Ditto. - * elf-m10300.c (struct mn10300_reloc_map): Ditto. - * elf32-arc.c (struct arc_reloc_map): Ditto. - * elf32-d10v.c (struct d10v_reloc_map): Ditto. - * elf32-d30v.c (struct d30v_reloc_map): Ditto. - * elf32-fr30.c (struct fr30_reloc_map): Ditto. - * elf32-m32r.c (struct m32r_reloc_map): Ditto. - * elf32-sh.c (struct elf_reloc_map): Ditto. - * elf32-sparc.c (struct elf_reloc_map): Ditto. - * elf32-v850.c (struct v850_reloc_map): Ditto. - * elf64-sparc.c (struct elf_reloc_map): Ditto. - * elfarm-nabi.c (struct elf32_arm_reloc_map): Ditto. - * elfarm-oabi.c (struct elf32_arm_reloc_map): Ditto. - -1999-03-17 Martin Hunt - - * syms.c (_bfd_stab_section_find_nearest_line): Changed this - function so source-level assembly works. If multiple N_SOs - are seen without and N_FUNs, create an indextable entry with - a NULL function name. - -1999-03-16 Gavin Romig-Koch - - * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data) Allow merging - of certian similar cpus. - -1999-03-16 Gavin Romig-Koch - - * elf32-mips.c (_bfd_mips_elf_final_write_processing): - Add the 5000. Change the architecture for the 5400 to mips4. - (elf_mips_mach): Add r5000. - -1999-03-11 Doug Evans - - * cpu-i960.c (scan_i960_mach): Recognize i960:ka_sa and i960:kb_sb. - -1999-03-11 Nick Clifton - - * binary.c (binary_set_section_contents): Generate warning about - huge file offsets for any section that will occupy file space, not - just those that are loadable. - -1999-02-24 Jim Blandy - - * libbfd.h: Regenerate after Nick Clifton's Feb 17 changes. - -1999-02-22 Jim Lemke - - * elf32-ppc.c: Add ppc_elf_relax_section() for the ld option mpc860c0. - -Mon Feb 22 18:26:51 1999 Ian Lance Taylor - - * elf-bfd.h (ELF_LINK_HASH_REF_REGULAR_NONWEAK): Define. - * elflink.h: Revert all changes since Feb 16. Instead: - (elf_link_add_object_symbols): Set REF_REGULAR_NONWEAK flag if - appropriate. Copy it to version symbols. - (elf_fix_symbol_flags): Set REF_REGULAR_NONWEAK for non ELF - symbols if appropriate. - (elf_adjust_dynamic_symbol): Set REF_REGULAR_NONWEAK for weakdef - symbol if appropriate. - (elf_link_output_extsym): If symbol is marked as undefined, and - has no nonweak references, mark it as weak undefined. - -Fri Feb 19 16:01:12 1999 Ian Lance Taylor - - * elflink.h (elf_merge_symbol): When overriding a dynamic - definition with a weak undefined symbol, set NEEDS_PLT if it is a - function. - (elf_link_add_object_symbols): Don't copy the other field if we - are overridding. - -Thu Feb 18 18:07:43 1999 Ian Lance Taylor - - * elflink.h (elf_merge_symbol): Do not merge any symbol from a - shared object with a weak undefined symbol. - -1999-02-18 Nick Clifton - - * elfarm-nabi.c: Set partial_inplace back to false. - -1999-02-17 Nick Clifton - - * coff-arm.c (TARGET_UNDERSCORE): Re-enable. - (USER_LABEL_PREFIX): Set to "_". - - The following patches are from: Scott Bambrough - - - * libaout.h (M_ARM6_NETBSD): Set to 143. - - * reloc.c: Add ARM PIC relocs: BFD_RELOC_ARM_GOT12, - BFD_RELOC_ARM_GOT32, BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_COPY, - BFD_RELOC_ARM_GLOB_DAT, BFD_RELOC_ARM_PLT32, - BFD_RELOC_ARM_RELATIVE, BFD_RELOC_ARM_GOTOFF, BFD_RELOC_ARM_GOTPC. - * bfd-in2.h: Regenerate. - - * elfarm-nabi.c (elf32_arm_howto_table): Set partial_inplace to - 'true' as REL relocs are now being used. Add new PIC relocs: - R_ARM_COPY, R_ARM_GLOB_DAT, R_ARM_JUMP_SLOT, R_ARM_RELATIVE, - R_ARM_GOTOFF, R_ARM_GOTPC, R_ARM_GOT32, R_ARM_PLT32. - - * elf32-arm.h (elf32_arm_merge_private_bfd_data): Check byte order - of targets. - (elf32_arm_final_link_relocate): Change parameters so that entire - reloc is passed. Add support for PIC relocs. - (elf32_arm_relocate_section): Pass entire reloc to - elf32_arm_final_link_relocate. - (elf32_arm_check_relocs): Handle new PIC relocs. - (elf32_arm_adjust_dynamic_symbol): New function. - (elf32_arm_size_dynamic_sections): New function. - (elf32_arm_discard_copies): New function. - (elf32_arm_finish_dynamic_symbol): New function. - (elf32_arm_finish_dynamic_sections): New function. - (ELF_MAXPAGE_SIZE): Define. - (bfd_elf32_bfd_reloc_type_lookup): Define. - (elf_backend_relocate_section): Define. - (elf_backend_adjust_dynamic_symbol): Define. - (elf_backend_create_dynamic_sections): Define. - (elf_backend_finish_dynamic_symbol): Define. - (elf_backend_finish_dynamic_sections): Define. - (elf_backend_size_dynamic_sections): Define. - (elf_backend_plt_readonly): Define. - (elf_backend_want_got_plt): Define. - (elf_backend_want_plt_sym): Define. - -Wed Feb 17 12:02:26 1999 Stan Cox - - * elf32-mips.c (_bfd_mips_elf_section_from_shdr): Make reginfo - sections SEC_LINK_ONCE and SEC_LINK_DUPLICATES_SAME_SIZE. - (_bfd_mips_elf_fake_sections): Likewise. - -Wed Feb 17 12:07:23 1999 Andreas Schwab - - * elfarm-oabi.c (bfd_elf32_arm_allocate_interworking_sections, - bfd_elf32_arm_get_bfd_for_interworking, - bfd_elf32_arm_process_before_allocation): Define to avoid clash - with elfarm-nabi.c. - - * elf32-arm.h: Don't declare elf32_arm_info_to_howto. - (elf32_thumb_to_arm_stub, elf32_arm_to_thumb_stub, - elf32_arm_find_nearest_line): Make them static. - -Tue Feb 16 22:44:37 1999 Ian Lance Taylor - - * elflink.h (elf_merge_symbol): Add pflags parameter. Change all - callers. Do not merge a definition from a shared object with a - weak undefined symbol. - (elf_link_add_object_symbols): Do not change the symbol type or - size if the old symbol overrides the new one. - -1999-02-08 Nick Clifton - - * config.bfd: Add support for strongarm target. - -Mon Feb 8 11:18:14 1999 Andreas Schwab - - * elf32-m68k.c (reloc_map): Use the correct types for the struct - fields instead of unsigned char. - -Fri Feb 5 00:22:36 1999 Ian Lance Taylor - - * Makefile.am: Rebuild dependencies. - * Makefile.in: Rebuild. - -Thu Feb 4 22:30:13 1999 Ian Lance Taylor - - * configure.in: Change AC_PREREQ to 2.13. Remove AM_CYGWIN32. - Change AM_EXEEXT to AC_EXEEXT and AM_PROG_INSTALL to - AC_PROG_INSTALL. Add comments to uses of AC_DEFINE. - * acinclude.m4: Add comments to uses of AC_DEFINE. - * acconfig.h: Remove. - * configure: Rebuild with current autoconf/automake. - * aclocal.m4: Likewise. - * config.in: Likewise. - * Makefile.in: Likewise. - -1999-02-04 DJ Delorie - - * libbfd.c (real_read): don't call fread for zero bytes. This - covers up a bug (or misuse of bfd) that's exposed by Solaris. - -Thu Feb 4 12:38:10 1999 Stan Cox - - * elf32-mips.c (mips_elf_relocate_section): Insure that the target - of a jump is in the current 256 MB region. - -Thu Feb 4 12:15:38 1999 Ian Lance Taylor - - * format.c (bfd_check_format_matches): Change last patch to only - take effect for the binary target. - -Wed Feb 3 19:40:12 1999 Ian Lance Taylor - - * elf32-i386.c (elf_i386_reloc_type_lookup): Add BFD_RELOC_CTOR. - -Wed Feb 3 15:02:44 1999 Catherine Moore - - * elf32-fr30.c (fr30_elf_check_relocs): New routine. - -Tue Feb 2 21:38:28 1999 Ian Lance Taylor - - * format.c (bfd_check_format_matches): If the target was - previously specified, don't check other targets when checking for - an archive file. - -Tue Feb 2 18:16:43 1999 Catherine Moore - - * elf32-arm.h (elf32_arm_reloc_map): Removed. - (elf32_arm_reloc_type_lookup): Removed - * elfarm-nabi.c (elf32_arm_reloc_map): New. - (elf32_arm_reloc_type_lookup): New. - * elfarm-oabi.c (elf32_arm_reloc_map): New. - (elf32_arm_reloc_type_lookup): New. - -Mon Feb 1 19:49:21 1999 Catherine Moore - - * elfarm-nabi.c: Renamed from elf32-arm-newabi.c. - * elfarm-oabi.c: Renamed from elf32-arm-oldabi.c - * Makefile.am: Use new files. - * Makefile.in: Regenerate. - * configure.in: Use new files. - * configure: Regenerate. - -1999-02-01 Nick Clifton - - * elf32-fr30.c (fr30_elf_gc_mark_hook): New function. - (fr30_elf_gc_sweep_hook): New function. - (elf_backend_can_gc_sections): Define. - -Mon Feb 1 12:21:47 1999 Catherine Moore - - * targets.c (bfd_target_vector): Add bfd_elf32_littlearm_oabi_vec - and bfd_elf32_bigarm_oabi_vec. - -Mon Feb 1 11:46:31 1999 Catherine Moore - - * Makefile.am (elf32-arm-oldabi.lo): New. - (elf32-arm-newabi.lo): New. - * Makefile.in: Regenerate. - * config.bfd (thumb-*-elf): Remove definition of targ_underscore. - (arm-*-elf): Likewise. - (arm-*-oabi): New. - (thumb-*-oabi): New. - * configure: Regenerate. - * configure.in (bfd_elf32_littlearm_oabi_vec): New. - (bfd_elf32_bigarm_oabi_vec): New. - * elf32-arm-newabi.c: New. - * elf32-arm-oldabi.c: New. - * elf32-arm.c: Removed. - * elf32-arm.h: New. - -Mon Feb 1 11:52:12 1999 Frank Ch. Eigler - - * binary.c (binary_set_section_contents): Omit warnings for - unloadable sections. - -1999-01-31 Michael Meissner - - * config.bfd (powerpc{,le}-*-vxworks*): Add aliases to - powerpc{,le}-*-eabi. - -1999-01-29 Nick Clifton - - * dwarf2.c (read_unsigned_leb128): Remove unused variables. - * dwarf2.c (read_signed_leb128): Remove unused variables. - -Fri Jan 29 00:47:21 1999 H.J. Lu - - * elf.c (assign_file_positions_for_segments): Only adjust - p_align when needed. - -Thu Jan 28 20:05:22 1999 Ian Lance Taylor - - * binary.c (binary_set_section_contents): Don't return early for a - non-loadable section, in case the first section is non-loadable. - Don't set the low lma for a SEC_NEVER_LOAD section. From Maciej - W. Rozycki . - -1999-01-28 Nick Clifton - - * elf32-fr30.c (fr30_reloc_map): Add R_FR30_GNU_VTINHERIT and - R_FR30_GNU_VTENTRY relocs. - -Thu Jan 28 11:08:16 1999 Catherine Moore - - * elflink.h (elf_link_output_sym): Zero syms which are - part of sections which have been excluded. - -Wed Jan 27 13:35:35 1999 Stan Cox - - * coff-arm.c (_bfd_coff_arm_set_private_flags): Changed F_PIC - to F_PIC_INT. - * coffcode.h (coff_set_arch_mach_hook): Removed F_ARM_2a and - F_ARM_3M labels. Changed F_PIC to F_PIC_INT. - -1999-01-27 Nick Clifton - - * elf32-fr30.c (fr30_elf_howto_table): Fix name of R_FR30_48 - relocation. - (fr30_final_link_relocate): Use computed value as result of - relocation. - -1999-01-26 Frank Ch. Eigler - - * binary.c (binary_set_section_contents): Emit warning for - huge file offsets due to widely-dispersed section LMAs. - -Mon Jan 18 03:35:35 1999 Ian Lance Taylor - - * elf.c (assign_file_positions_for_segments): If not D_PAGED, - align first section to largest section alignment, not first - section alignment. - -1999-01-04 Jason Molenda (jsm@bugshack.cygnus.com) - - * configure.in: Require autoconf 2.12.1 or higher. - -Tue Dec 22 15:21:41 1998 Catherine Moore - - * archures.c (bfd_mach_i386_i386_intel_syntax): Define. - * bfd-in2.h: Likewise. - * cpu-i386.c (bfd_i386_arch_intel_syntax): New. - -1998-12-16 Gavin Romig-Koch - - * archures.c,bfd-in2.h (bfd_mach_mips4111): New. - * 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): - bfd_mach_mips4111 -> E_MIPS_ARCH_3 | E_MIPS_MACH_4111. - -1998-12-15 Gavin Romig-Koch - - * elf32-mips.c (elf_mips_abi_name): New. - (_bfd_mips_elf_merge_private_bfd_data): Compare EF_MIPS_ABI flags. - -1998-12-12 Gavin Romig-Koch - - * elf32-mips.c (_bfd_mips_elf_final_write_processing): - Handle bfd_mach_mips4300. - -1998-12-11 Ulrich Drepper - - * elf32-i386.c: Remove leaked development code from patch - 1998-12-10 by Richard Henderson. - -1998-12-10 Richard Henderson - - * elf32-i386.c (elf_i386_relocate_section): Don't fail relocations - in debug sections for symbol defined externally. - -Thu Dec 10 10:58:38 1998 Andreas Schwab - - * targets.c (bfd_target_vector): Remove duplicate entry for - tekhex_vec. - -1998-12-09 Nick Clifton - - * elf32-fr30.c (fr30_elf_howto_table): Set src_mask fields to 0 - since we are using RELAs. - -Tue Dec 8 22:15:48 1998 Ian Lance Taylor - - SCO Open Server Release 5 core file support, from Jouke Numan - : - * sco5-core.c: New file. - * configure.in (i[3456]86-*-sco3.2v5*): Use sco5-core.lo. - (sco5-core.lo): Define SCO5_CORE in COREFLAG. - * Makefile.am: Rebuild dependencies. - (OPTIONAL_BACKENDS): Add sco5-core.lo. - (OPTIONAL_BACKENDS_CFILES): Add sco5-core.c. - * bfd.c (struct _bfd): Add sco5_core_data field to tdata. - * targets.c (sco5_core_vec): Add to target list if SCO5_CORE. - * bfd-in2.h, configure, Makefile.in: Rebuild. - -Tue Dec 8 19:38:42 1998 Mark Klein - - * config.bfd (hppa*-*-mpeix*): New target. - * configure.in: Add AC_HEADER_DIRENT. - (hppa*-*-mpeix*): New target. - * configure.host (hppa*-*-mpeix*): New host. - * hpux-core.c: Check HOST_HPPAMPEIX. Use HAVE_DIRENT_H and - friends rather than just including . - * som.h (struct som_symbol): Add hppa_priv_level and apto - tc_data. Change all users. - (struct somdata): Add comp_unit field. - (obj_som_compilation_unit): Define. - (bfd_som_attach_compilation_unix): Declare. - * som.c: Check HOST_HPPAMPEIX. - (struct som_misc_symbol_info): Add new field priv_level. - (som_object_setup): Add current_offset parameter. Change all - callers. - (setup_sections): Likewise. - (som_object_p): For EXECLIBMAGIC, read the lst header. - (som_write_symbol_strings): Add compilation_unit parameter. - Change all callers. - (som_finish_writing): Write out compilation_unit. - (som_bfd_derive_misc_symbol_info): Set priv_level. - (som_build_and_write_symbol_table): Set xleast field to 3. - (som_slurp_symbol_table): Set symbol priv_level. - (bfd_som_attach_compilation_unit): New function. - (som_bfd_ar_write_symbol_stuff): Set xleast field to 3. Set - priv_level into symbol_value. - * configure, config.in: Rebuild. - -Tue Dec 8 16:21:35 1998 Ian Lance Taylor - - * hpux-core.c (hpux_core_core_file_p): Change call to nonexistent - warning function to call _bfd_error_handler instead. - - * libbfd.c (COERCE32): Cast through unsigned long and long to - avoid bug in old version of gcc. - - * elf64-alpha.c (elf64_alpha_additional_program_headers): Remove. - (elf_backend_additional_program_headers): Don't define. - -1998-12-08 Nick Clifton - - * elf32-fr30.c (fr30_final_link_relocate): Fix PC relative - relocations to include offset of 2 included in the insns, and the - offset of the relocs within the section. - -Wed Dec 2 15:03:59 1998 David Taylor - - The following changes were made by David Taylor - , Edith Epstein - , Jim Blandy - , and Elena Zannoni - as part of the project to merge in - changes originally made by HP; HP did not create ChangeLog - entries. - - * aclocal.m4, configure, Makefile.in: Rebuilt using latest - automake macro library. - - * hpux-core.c (hpux_core_core_file_p): this function now - understands HPUX 10.30 thread info. Yes, the thread stacks can be - found in the corefile! Also, in hpux_core_core_file_p, if we - encounter a section with an unknown type, don't punt. Instead, - just skip it. Also, count the number of sections of known type - that we encounter. If we encounter at least one good one, then - we'll declare that the file is a core file. If we encounter any - unknown ones but some known ones, then we'll issue a warning (but - still declare it to be a core file). Also, correctly decide when a - file is not a core. - (PROC_INFO_HAS_THREAD_ID): define if CORE_ANON_SHMEM defined. - (CORE_ANON_SHMEM): define if not defined. - (hpux_core_struct): add members lwpid and user_tid. - (core_kernel_thread_id, core_user_thread_id): new macros. - (make_bfd_asection): use bfd_alloc to allocate room for a copy of - the name before storing it in the bfd. - (hpux_core_core_file_p): handle threads. - - * libhppa.h (GET_FIELD): protect against redefinition. - (HPPA_WIDE): define. - (GET_FIELD): define. - (GET_BIT): define. - (MASK): define. - (CATENATE): define. - (ELEVEN): define. - (sign_extend): redefine. - (assemble_6): define. - (assemble_12): rewrite. - (assemble_16): define. - (assemble_16a): define. - (assemble_17): rewrite. - (assemble_22): define. - -1998-12-07 Nick Clifton - - * elf32-fr30.c (fr30_final_link_relocate): Using signed - relocations for signed values. - -Sun Dec 6 16:30:33 1998 Ian Lance Taylor - - * mipsbsd.c (MY(set_arch_mach)): Make static. - * aoutx.h (NAME(aout,machine_type)): For bfd_arch_mips, use - bfd_mach_mips* macros rather than simple numbers. - - COFF weak symbol support, based on patches from Mark Elbrecht - : - * coffcode.h (coff_slurp_symbol_table): Handle C_WEAKEXT. - * coffgen.c (coff_renumber_symbols): Handle weak symbols. - (coff_write_alien_symbol): Likewise. - * cofflink.c (coff_link_check_ar_symbols): Likewise. - (coff_link_add_symbols): Likewise. - (_bfd_coff_link_input_bfd): Likewise. - (_bfd_coff_write_global_sym): Likewise. - - * elf.c (copy_private_bfd_data): Always initialize the - includes_phdrs field. - - * elflink.h (elf_fix_symbol_flags): Check for case where a non-ELF - file defines a symbol first mentioned in an ELF file. - - * bfd-in.h: Always define BFD_HOST_64_BIT and BFD_HOST_U_64_BIT if - possible, rather than only if BFD64. - * elflink.h (compute_bucket_count): Just check BFD_HOST_U_64_BIT, - not __GNUC__. - * bfd-in2.h: Rebuild. - - * srec.c (srec_set_section_contents): Correct test to avoid - switching to 4 byte addresses after seeing a second section which - requires 3 byte addresses. From Joel Schantz - . - - * config.bfd (m68*-*-gnu*): New target. From Aymeric Vincent - . - -1998-12-04 Jim Blandy - - * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Fix logic to - decide whether the output file is -mrelocatable-lib, - -mrelocatable, or neither. (gdb.base/nodebug.exp) - -1998-12-03 Nick Clifton - - * elf32-fr30.c: Add support for R_FR30_48 reloc. - * reloc.c: Add BFD_RELOC_FR30_48 relocation. - * bfd-in2.h: Regenerate. - * libbfd.h: Regenerate - -Wed Dec 2 00:58:37 1998 Ian Lance Taylor - - * elflink.h (elf_adjust_dynamic_symbol): Warn on an attempt to - link against a dynamic symbol with no type or size. - -1998-12-01 Ulrich Drepper - - * elf32-i386.c (i386_check_relocs) [R_386_32]: Don't emit - relocation for section which does not get loaded. - (elf_i386_relocate_section) [R_386_32]: Likewise. - -Tue Dec 1 11:33:33 1998 Jim Wilson - - * coff-h8300.c (h8300_bfd_link_add_symbols): Make reloc_size, - reloc_count and i long instead of unsigned long. Handle error - return from bfd_canonicalize_reloc. - -1998-12-01 Nick Clifton - - * elf32-v850.c (v850_elf_relocate_section): Detect the absence of - a hash table. - -Mon Nov 30 15:28:09 1998 J"orn Rennecke - - * elf32-sh.c (elf/sh.h): Include. - sh_reloc_type: Delete. Changed all references to elf_sh_reloc_type. - (sh_elf_howto_tab): Add HOWTO for R_SH_SWITCH8. - (sh_reloc_map): Map BFD_RELOC_8_PCREL to R_SH_SWITCH8. - (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH8. - * Makefile.in: Add dependency of elf32-sh.lo on $(INCDIR)/elf/sh.h. - -Fri Nov 27 17:51:38 1998 Geoff Keating - - * elflink.h (compute_bucket_count): Don't allow minsize==0, it - causes division by zero later on. - -Thu Nov 26 11:19:35 1998 Dave Brolley - - * elf32-fr30.c (fr30_elf_pc9_reloc,fr30_elf_pc12_reloc): Not - needed. - -1998-11-25 DJ Delorie - - * coff-i386.c (i3coff_object_p): Remove hack. Use new emulation - hook now. - -Tue Nov 24 10:25:27 1998 Nick Clifton - - * elf32-fr30.c (fr30_elf_relocate_section): Call - fr30_final_link_relocate. - (fr30_final_link_relocate): New function: Handle I20 and I32 - relocs. - (fr30_elf_i32_reloc): New function: Handle I32 relocs. - (fr30_elf_pc9_reloc): New function: Handle 9_PCREL relocs. - (fr30_elf_pc12_reloc): New function: Handle 12_PCREL relocs. - - * elf32-v850.c (v850_elf_relocate_section): Reset hi16s reloc - chain to empty. - - The following changes are based on a patch submitted by Gianluca - Moro : - - (v850_elf_perform_relocation): Only update a hi16s reloc if it has - not already been updated. - (find_remembered_hi16s_reloc): New parameter 'already_found' - returns state of remembered hi16s reloc. - (remember_hi16s_reloc): Set 'found' field to false. - (hi16s_location): Add 'found' field. - -1998-11-23 DJ Delorie - - * coff-i386.c (bfd_pe_dll_not_recognized_hack): the linker wants - to see .DLL files as unrecognized. - (i3coff_object_p): Sorry, had to hack it to not recognize these - files (pei-i386) on request. - -1998-11-23 DJ Delorie - - * opncls.c (bfd_make_readable): need more cleanup for symbols and - relents. Call bfd_check_format to reinitialize. - -Fri Nov 20 14:21:36 1998 Nick Clifton - - * elf32-fr30.c (fr30_elf_relocate_section): Remove spurious - warnings. - -Thu Nov 19 14:42:15 1998 Geoffrey Noer - - * aclocal.m4: regenerate - * configure: regenerate - -Tue Nov 17 20:23:35 1998 Richard Henderson - - * elf-bfd.h (struct elf_link_hash_entry): Add vtable_entries_size. - * elf.c (_bfd_elf_link_hash_newfunc): Clear it. - * elflink.h (elf_gc_propagate_vtable_entries_used): Copy it, and - respect it as an upper bound on what memory to reference. - (elf_gc_smash_unused_vtentry_relocs): Likewise. - (elf_gc_record_vtentry): Handle as-yet undefined vtables. Set and - update vtable_entries_size appropriately. - -Tue Nov 17 15:28:31 1998 Nick Clifton - - * elf32-fr30.c (fr30_reloc_type_lookup): Used integers to hold - reloc number. - -Mon Nov 16 22:19:21 1998 DJ Delorie - - * archive.c (bfd_ar_hdr_from_filesystem): support BFD_IN_MEMORY - bfds; they have no "file" so we fake it. - * bfd-in2.h: add bfd_make_writable and bfd_make_readable (regen) - * libbfd.c (bfd_write): Allow writing to BFD_IN_MEMORY bfds by - resizing the memory buffer. - * opncls.c (bfd_make_writable): New function; lets you write a - bfd_create'd bfd to an in-memory buffer. - (bfd_make_readable): New function; lets you read back that buffer - as if it were from bfd_openr. Used to build generated archive - members (winsup's ld's dlltool) - -Mon Nov 16 19:15:19 1998 Dave Brolley - - * po/bfd.pot: Regenerated. - -Mon Nov 16 10:57:06 1998 Nick Clifton - - * elf32-v850.c (hi16s_location): Replaced fixed size array with - linked list. - -Sun Nov 15 20:28:25 1998 Richard Henderson - - * elf64-alpha.c (elf64_alpha_relax_section): Search for the proper - element of the gotentry list for local symbols too. - (elf64_alpha_relocate_section): Unify local and global handling. - Assert that gotent->use_count > 0. - -Sat Nov 14 15:16:01 1998 Ian Lance Taylor - - * configure.in (vms_alpha_vec): Rename from evax_alpha_vec, and - update for file name changes of July 2, 1998. - (vms_vax_vec): New. - * configure: Rebuild. - -Thu Nov 12 19:19:54 1998 Dave Brolley - - * po/bfd.pot: Regenerated. - -Tue Nov 10 16:17:06 1998 Geoffrey Noer - - * acinclude.m4, config.bfd: detect cygwin* instead of cygwin32*. - * aclocal.m4, configure: regenerate - -Tue Nov 10 15:13:59 1998 Nick Clifton - - * elf.c (prep_headers): Add support for bfd_arch_fr30. - -Tue Nov 10 13:37:36 1998 Felix Lee - - * acinclude.m4 (BFD_HAVE_SYS_PROCFS_TYPE, - BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): didn't define macro when value - was cached. - * aclocal.m4, configure: regenerated. - -Tue Nov 10 14:31:01 1998 Catherine Moore - - * elf32-d10v.c (reloc_type): Add R_D10V_GNU_VTINHERIT and - R_D10V_GNU_VTENTRY relocs. - (elf_d10v_howto_table): Likewise. - (d10v_reloc_map d10v_reloc_map): Likewise. - (elf32_d10v_gc_mark_hook): New. - (elf32_d10v_gc_sweep_hook): New. - (elf32_d10v_check_relocs): New. - (elf32_d10v_relocate_section): New. - (elf_backend_relocate_section): Define. - (elf_backend_can_gc_sections): Define. - -Sat Nov 7 18:07:51 1998 Peter Schauer - - * Makefile.am (BFD32_BACKENDS): Move vms files here... - (BFD64_BACKENDS): ...from here. - (BFD32_BACKENDS_CFILES): Move vms files here... - (BFD64_BACKENDS_CFILES): ...from here. - * Makefile.in: Rebuild. - -Wed Nov 4 15:58:48 1998 Nick Clifton - - * Makefile.am: Add FR30 target. - * Makefile.in: Add FR30 target. - * archures.c: Add support for FR30. - * config.bfd: Add support for FR30. - * configure.in: Add support for FR30. - * reloc.c: Add support for FR30 relocations. - * targets.c: Add support for FR30 relocations. - * bfd-in2.h: Regenerate. - * configure: Regenerate. - * libbfd.h: Regenerate. - * cpu-fr30.c: New file. - * elf32-fr30.c: New file. - -Mon Nov 2 14:59:33 1998 Geoffrey Noer - - * configure.in: detect cygwin* instead of cygwin32* - * configure: regenerate - -Sun Nov 1 19:32:28 1998 Jeffrey A Law (law@cygnus.com) - - * elf-m10300.c (mn10300_elf_relax_section): Do not use alloca, - use bfd_malloc and free instead and check return value from bfd_malloc. - -Sun Nov 1 16:20:35 1998 Ian Lance Taylor - - * libbfd-in.h (_bfd_dwarf1_find_nearest_line): Declare. - * libbfd.h: Rebuild. - - * elf32-mips.c (mips_elf_dynsym_sec_names): Comment out. - (SIZEOF_MIPS_DYNSYM_SECNAMES): Likewise. - (MIPS_TEXT_DYNSYM_SECN): Likewise. - (_bfd_mips_elf_fake_sections): Don't set sh_info field of a .hash - section. - (struct mips_elf_link_hash_table): Remove dynsym_sec_strindex - field. - (mips_elf_link_hash_table_create): Don't initialize - dynsym_sec_strindex. - (mips_elf_gc_mark_hook): Add default case to avoid warning. - (mips_elf_size_dynamic_sections): Generate a section symbol for - every output section. - (mips_elf_finish_dynamic_sections): Count all sections for - DT_MIPS_UNREFEXTNO. - (mips_elf_finish_dynamic_sections): Use dynamic symbols for all - output sections. - -Sun Nov 1 12:46:53 1998 Geoff Keating - - * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Allocate two slots - for later PLT entries in large PLTs. - (ppc_elf_finish_dynamic_symbol): Allow for the extra slots. - -Sat Oct 31 20:10:09 1998 Jeffrey A Law (law@cygnus.com) - - * elf32-ppc.c (ppc_elf_reload_section): Fix typo. - -1998-10-26 15:58 Ulrich Drepper - - * elf-bfd.h (struct elf_link_hash_entry): Add new field elf_hash_value. - * elflink.h (elf_collect_hash_codes): New function. This function is - called for each exported symbol and we compute the ELF hash value for - it. - (compute_bucket_value): New function. It is called from - size_dynamic_sections to determine the hash table size. When we are - optimizing a better, but slower, algorithm is used. - (size_dynamic_sections): Call compute_bucket_value. - - * elf.c (bfd_elf_hash): Optimize the hash function a bit. - -Mon Oct 19 20:03:21 1998 Catherine Moore - - * elf32-sh.c: Add HOWTO entries for R_SH_GNU_VTINHERIT and - R_SH_GNU_VTENTRY. - (sh_elf_gc_mark_hook): New. - (sh_elf_gc_sweep_hook): New. - (sh_elf_check_relocs): New. - (elf_backend_can_gc_sections): Define. - -Mon Oct 19 16:57:05 1998 Felix Lee - - * acinclude.m4: undo previous gettext change - * aclocal.m4: rebuild with right version of aclocal. - -Mon Oct 19 01:47:21 1998 Felix Lee - - * acinclude.m4, aclocal.m4: move gettext-related fragments from - aclocal.m4 to acinclude.m4, so they don't get lost. - - * elfcore.h: rewrite for better corefile support. - * elf.c (elfcore_*): new functions. - * elf-bfd.h (elf_obj_tdata): new structure members. - * acconfig.h, acinclude.m4, configure.in: add feature-tests for - flavor of procfs. - * aclocal.m4, config.in, configure, Makefile.in: regenerated. - -Fri Oct 16 14:07:45 1998 Catherine Moore - - * elf32-m32r.c: Add HOWTO entries for R_M32R_GNU_VTINHERIT - and R_M32R_GNU_VTENTRY. - (elf_backend_can_gc_sections): Define. - (m32r_elf_check_relocs): New. - (m32r_elf_gc_mark_hook): New. - (m32r_elf_gc_sweep_hook): New. - (m32r_elf_relocate_section): Handle VT relocs. - -Mon Oct 12 14:18:40 1998 Nick Clifton - - * coff-arm.c (arm_relocate_section): Remove redundant test. - - * bfd-in2.h (struct reloc_howto_struct): Improve comment to make - cleat that the 'bitsize' field is the size of the bitfield AFTER - relocation not before. - - * elf32-m32r.c (R_M32R_18_PCREL): Fix size of bitfield. - - * coff-mips.c (mips_relocate_hi): Cope with missing refhi or reflo - relocs. - -Tue Oct 6 09:20:44 1998 Catherine Moore - - * elf32-sparc.c: Add HOWTO entries for R_SPARC_GNU_VTINHERIT and - R_SPARC_GNU_VTENTRY. - (elf32_sparc_check_relocs): Handle them. - (elf32_sparc_reloc_type_lookup): Likewise. - (elf32_sparc_relocate_section): Likewise. - (elf32_sparc_gc_mark_hook): New. - (elf32_sparc_gc_sweep_hook): New. - -Mon Oct 5 14:55:30 1998 Jeffrey A Law (law@cygnus.com) - - * som.c (som_finish_writing): Perform some sanity checks when - writing an executable or shared library. - -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.c (_bfd_elf_find_nearest_line): Add call to - _bfd_dwarf1_find_nearest_line. - * elf32-mips.c (_bfd_mips_elf_find_nearest_line): - Add call to _bfd_dwarf1_find_nearest_line. - * configure: Rebuilt. - -Mon Oct 5 10:06:22 1998 Catherine Moore - - * elflink.h (elf_gc_sections): Do not allow garbage - collection if dynamic sections have been created. - -Mon Oct 5 09:07:37 1998 Catherine Moore - - * elf32-v850.c: Add HOWTO entries for R_V850_GNU_VTINHERIT and - R_V850_GNU_VTENTRY. - (v850_elf_check_relocs): Handle VTINHERIT and VTENTRY relocs. - (v850_elf_perform_relocation): Likewise. - (v850_elf_final_link_relocate): Likewise. - (v850_elf_relocate_section): Likewise. - (v850_elf_gc_sweep_hook): New routine. - (v850_elf_gc_mark_hook): New routine. - (elf_backend_can_gc_sections): Define. - -Mon Oct 5 09:04:25 1998 Catherine Moore - - * elf32-m68k.c (elf_m68k_gc_sweep_hook): Don't assume - that dynobj exists. - -Sun Oct 4 23:29:34 1998 David Edelsohn - - * rs6000-core.c (rs6000coff_core_file_matches_executable_p): - Declare size as bfd_size_type. - (rs6000coff_get_section_contents): Declare count as bfd_size_type. - -Sun Oct 4 20:38:29 1998 Jeffrey A Law (law@cygnus.com) - - * cpu-hppa.c (bfd_hppa20_arch): Define. Link it into the bfd_hppa_arch - structure. - * som.c (CPU_PA_RISC2_0): Define. - (_PA_RISC2_0_ID): Likewise. - (som_finish_writing): Use CPU_PA_RISC2_0 for the system_id as needed. - -Sun Oct 4 21:19:09 1998 Ian Lance Taylor - - * elflink.h (elf_link_add_object_symbols): When a versioned symbol - has a base which is already defined, only add the referenced - symbol to the dynamic symbol table if it is defined or referenced - by a regular file. - - * elf32-i386.c (elf_i386_info_to_howto_rel): Handle vtable relocs - correctly. - -1998-09-27 Andreas Schwab - - * elflink.h (elf_link_add_object_symbols): Undo last change. - -Wed Sep 23 16:09:31 1998 Richard Henderson - - * elflink.h (elf_link_add_object_symbols): Don't record a dynamic - symbol for the indirect alias to a versioned symbol. - -Mon Sep 21 12:15:22 1998 Catherine Moore - - * elf32-i386.c (elf32_i386_vtinherit_howto): New. - (elf32_i386_vtentry_howto): New. - (elf_i386_reloc_type_lookup): Return elf32_i386_vtentry_howto - or elf32_i386_vtinherit_howto on lookup. - -Sun Sep 20 00:48:07 1998 Andreas Schwab - - * elf32-m68k.c: Include "elf/m68k.h". Remove definition of enum - reloc_type. Rename R_68K__max to R_68K_max. - (howto_table): Use _bfd_elf_rel_vtable_reloc_fn for a VTENTRY - reloc. - -Sun Sep 20 00:09:25 1998 Chris Torek - - * libbfd.c (bfd_getb32): Rewrite expression to get better code. - (bfd_getl32, bfd_getb_signed_32, bfd_getl_signed_32): Likewise. - - * libbfd.c (bfd_log2): Cast to bfd_vma before shifting, not - after. - -Sat Sep 19 22:42:23 1998 Doug Rabson - - * elflink.h (elf_link_add_object_symbols): Ensure that the warning - message has a null byte terminator. - -Fri Sep 18 14:35:29 1998 Nick Clifton - - * elf32-v850.c (v850_elf_perform_relocation): Ignore contents of - word subject to R_V850_32 relocation. - -Thu Sep 17 17:20:36 1998 Nick Clifton - - * dwarf2.c: Add comment describing problem computing line numbers - for undefined symbols at link time. - -Thu Sep 17 16:03:28 1998 Richard Henderson - - * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't - transform a defweak into a plt entry. - (elf64_alpha_calc_dynrel_sizes): Allow room for secondary - plt entry references to receive a RELATIVE reloc. - (elf64_alpha_finish_dynamic_symbol): Fill them in. - (elf64_alpha_relocate_section): Assert we don't overrun - the allocated relocation space. - -Wed Sep 16 18:03:13 1998 Nick Clifton - - * elf.c (swap_out_syms): Always treat section symbols as - special, even if they are attached to a common section. - -Wed Sep 16 10:34:13 1998 Nick Clifton - - * elf32-v850.c (v850_elf_symbol_processing): Move symbols in - sections with v850 common section attributes into named v850 - common sections. - (v850_elf_add_symbol_hook): Move symbols in sections with v850 - common section attributes into named v850 common sections. - -Wed Sep 16 11:26:49 CDT 1998 Catherine Moore - - * elf32-arm.c (elf32_arm_gc_mark_hook): Remove print - statement. - -1998-09-15 Geoff Keating - - * elf32-ppc.c (ppc_elf_relocate_section): Reverse output_offset - part of Vladimir's change of 1998-08-19. Make a R_PPC_SDAREL16 - reloc to the wrong section a warning, not an error. .dynsbss - is not an output section, so there is no need to check for it. - -Tue Sep 15 12:40:05 1998 Catherine Moore - - * elf-bfd.h: Add argument to elf_backend_get_symbol_type. - -Tue Sep 15 08:34:40 1998 Catherine Moore - - * elf.c (swap_out_syms): Pass type to elf_backend_get_symbol_type. - * elf32-arm.c: Add HOWTO entries for R_ARM_GNU_VTINHERIT and - R_ARM_GNU_VTENTRY. - (elf32_arm_gc_mark_hook): New. - (elf32_arm_gc_sweep_hook): New. - (elf32_arm_check_relocs): New. - (elf32_arm_final_link_relocate): Handle VTINHERIT and VTENTRY - relocations. - (elf32_arm_relocate_section): Handle VTINHERIT and VTENTRY - relocations. - -1998-09-10 Geoff Keating - - * elf32-ppc.c (ppc_elf_relocate_section): If dynobj is NULL, - assume there is no PLT or GOT. - -Wed Sep 9 14:24:12 1998 Nick Clifton - - * elf32-arm.c (elf32_arm_find_nearest_line): New function: just - like _elf_bfd_find_nearest_line() except that STT_ARM_TFUNC is - also accepted as a function symbol type. - -Mon Sep 7 13:24:03 1998 Peter Schauer - - * rs6000-core.c (_LONG_LONG): Define for AIX 4.x only. - -Sat Sep 5 20:40:18 1998 Ian Lance Taylor - - * libbfd-in.h (_bfd_nolink_bfd_gc_sections): Correct definition to - match definition of _bfd_gc_sections field. - * libbfd.h: Rebuild. - -Fri Sep 4 13:54:23 1998 David Miller - - * elf32-sparc.c (elf32_sparc_relocate_section): Properly adjust - the addend of a dynamic relocation referencing a section. - * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. - (sparc64_elf_finish_dynamic_symbol): Fix the PLT relocation offset. - -Thu Sep 3 17:28:50 1998 Richard Henderson - - * elflink.h (bfd_elfNN_size_dynamic_sections): Verify that the - bed has a size_dynamic_sections routine before trying to use it. - -Mon Aug 31 14:49:22 1998 Richard Henderson - - * elf32-mips.c (elf_mips_gnu_vtentry_howto): Use - _bfd_elf_rel_vtable_reloc_fn. - -Mon Aug 31 10:23:40 1998 Catherine Moore - - * Makefile.am: Add elf32-arm.c. - * Makefile.in: Rebuild. - * elf-bfd.h: Add elf_backend_get_symbol_type. - * elf.c (swap_out_syms): If defined, call - elf_backend_get_symbol_type. - * elf32-arm.c: Define elf_backend_get_symbol_type. - (elf32_arm_get_symbol-type): New routine. - (record_thumb_to_arm_glue): Change to use STT_ARM_TFUNC. - (bfd_elf32_arm_process_before_allocation): Change to - check for STT_ARM_TFUNC. - (elf32_arm_final_link_relocate): Likewise. - * elfxx-target.h: Add elf_backend_get_symbol_type. - -Fri Aug 28 19:44:07 1998 Richard Henderson - - * archures.c (bfd_mach_alpha_ev[456]): New. - * cpu-alpha.c: Rework to match these types. - * bfd-in2.h: Rebuild. - -Fri Aug 28 19:38:53 1998 Richard Henderson - - * elf-bfd.h (_bfd_elf_rel_vtable_reloc_fn): Declare. - * elf.c (_bfd_elf_rel_vtable_reloc_fn): New. - - * elf32-i386.c (elf_howto_table): Add vtable relocs. - (elf_i386_reloc_type_lookup): Recognize them. - (elf_i386_check_relocs): Pass them off to generic code. - (elf_i386_relocate_section): Ignore them. - (elf_i386_gc_mark_hook, elf_i386_gc_sweep_hook): New. - (elf_backend_can_gc_sections): True. - -Thu Aug 20 15:03:45 1998 Nick Clifton - - * elf32-arm.c (elf32_thumb_to_arm_stub): Check sym_sec is not NULL - before looking at owner field. - (elf32_arm_to_thumb_stub): Ditto. - (elf32_arm_relocate_section): Compute name before calling - elf32_arm_final_link_relocate(). - -Thu Aug 20 11:30:17 1998 Michael Snyder - - * elf.c: comment and formatting cleanups. - * elfcore.h: ditto. - -Wed Aug 19 15:43:26 1998 Michael Snyder - - * elfcode.h (elf_object_p): Reject files of header type ET_CORE - (core files are treated differently than object files). - * elf-bfd.h (_bfd_elf_write_corefile_contents, - bfd_elf_mkcorefile): declare. - * elfxx-target.h (_bfd_elf_write_corefile_contents, - bfd_elf_mkcorefile): add to bfd_target vector. - * elfcore.h (elf_core_file_p): save the program header table, - and set the bfd architecture from the elf file header. - * elf.c (bfd_elf_mkcorefile): new function. - (_bfd_elf_write_corefile_contents): new function. - (assign_file_positions_for_segments): add cases for handling - PT_NOTE segments. (assign_file_positions_except_relocs): - core files should be handled the same as exec files. - (prep_headers): identify core files as type ET_CORE. - (copy_private_bfd_data): identify the sections belonging to - the PT_NOTE segment. - - * elf32-sparc.c (elf32_sparc_final_write_processing): - add break statement to default case. - -1998-08-19 Vladimir N. Makarov - - * elf32-ppc.c (ppc_elf_relocate_section): Check that output - section (not input) will be in sections ".sbss", ".sbss2", - ".sdata", and ".sdata" for R_PPC_SDAREL16, R_PPC_EMB_SDA2REL, - R_PPC_EMB_SDA21, R_PPC_EMB_RELSDA. In all these cases also ignore - output_offset for correct evaluation of addend. - -Tue Aug 18 11:48:12 1998 Catherine Moore - - * elf32-arm.c: Add prefix bfd_ to elf32_arm_get_bfd_for_interworking, - elf32_arm_allocate_interworking_sections and - elf32_arm_process_before_allocation. - -Tue Aug 18 11:46:00 1998 Nick Clifton - - * bfd-in.h: Ammend prototype for - elf32_arm_process_before_allocation to remove surplus third - argument. - - * bfd-in2.h: Regenerate. - -Sat Aug 15 20:55:08 1998 Richard Henderson - - * elf64-alpha.c (elf64_alpha_relax_section): Handle indirect symbols. - -Fri Aug 14 09:12:28 1998 Stan Cox - - * aoutx.h (aout_link_input_section_ext): Use the relocation already - calculated for RELOC_SPARC_REV32 case. - -Thu Aug 13 14:02:02 1998 Catherine Moore - - * bfd-in.h: Add prototypes for elf32_arm_get_bfd_for_interworking, - elf32_arm_allocate_interworking_sections and - elf32_arm_process_before_allocation. - * bfd-in2.h: Regenerated. - * elf32-arm.c Define elf32_arm_link_hash_table. - (insert_thumb_branch): New routine. - (find_thumb_glue): New routine. - (find_arm_glue): New routine. - (record_arm_to_thumb_glue): New routine. - (record_thumb_to_arm_glue): New routine. - (elf32_arm_link_hash_table_create): New routine. - (elf32_arm_get_bfd_for_interworking): New routine. - (elf32_arm_allocate_interworking_sections) New routine. - (elf32_arm_process_before_allocation) New routine. - (elf32_thumb_to_arm_stub): New routine. - (elf32_arm_to_thumb_stub): New routine. - (elf32_print_private_bfd_data): Fix typo. - (elf32_arm_final_link_relocate): Add argument sym_sec. - Check for branches to thumb symbols in case R_ARM_PC24. - Check for branches to arm symbols in case R_ARM_THM_PC22. - (elf32_arm_relocate_section): Pass symbol section to - elf32_arm_final_link_relocate. - -Wed Aug 12 19:00:39 1998 Geoff Keating - - * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Generate PLT - entries unless the symbol is defined in the executable; in - particular, undefined weak symbols get a PLT entry. - -Wed Aug 12 14:48:33 1998 Ian Lance Taylor - - * libaout.h: Remove nested comment to avoid warning. - -Wed Aug 12 08:10:11 1998 Catherine Moore - - * elf32-arm.c (elf32_arm_final_link_relocate): Rework - R_ARM_PC24 relocation. - -Tue Aug 11 14:42:26 1998 Catherine Moore - - * elf32-arm.c (elf32_arm_final_link_relocate): Remove unused - argument is_local. Add argument sym_flags. Check sym_flags - in R_ARM_ABS32 case. Include addend for R_ARM_THM_PC22 case. - (elf32_arm_relocate_section): Don't pass local sym and pass - sym_flags to elf32_arm_final_link_relocate. - -Mon Aug 10 20:38:39 1998 Richard Henderson - - * elf64-alpha.c (elf64_alpha_calc_dynrel_sizes): Correct last change - to not count too few relocs for dynamicly linked executables. - -Mon Aug 10 15:35:34 1998 Richard Henderson - - * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Never consider - symbols without a dynamic index dynamic. Consider all weak - symbols dynamic. - (elf64_alpha_strip_section_from_output): Don't assume 1-1 - correspondance between input and output sections. - -Mon Aug 10 15:31:39 1998 Andreas Schwab - - * elflink.h (elf_gc_common_finalize_got_offsets): For backends - that use a .got.plt section start the got offset at zero. - -Mon Aug 10 17:31:21 1998 Ian Lance Taylor - - * ieee.c (ieee_write_processor): Correct the processor ID written - out for bfd_arch_m68k, accommodating change of March 25. - -Sun Aug 9 20:55:44 1998 Catherine Moore - - * elf32-arm.c (elf32_arm_final_link_relocate): Rework - R_ARM_THM_RPC22 relocations. - -Sat Aug 8 15:15:30 1998 Richard Henderson - - * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Undef weak symbols - are always dynamic. - (elf64_alpha_calc_dynrel_sizes): Allow enough room for RELATIVE - .got relocs in -Bsymbolic shared objects. - -Wed Aug 5 15:48:08 1998 Nick Clifton - - * elf32-arm.c: Add private flags to ELF header. - (elf32_arm_print_private_bfd_data): New Function. - (elf32_arm_set_private_flags): New Function. - (elf32_arm_copy_private_flags): New Function. - (elf32_arm_merge_private_bfd_data): New Function. - -Mon Aug 3 17:10:15 1998 Ian Lance Taylor - - * elf32-sparc.c (elf32_sparc_check_relocs): Permit WPLT30 against - a local symbol. - (elf32_sparc_relocate_section): Likewise. - -Sun Aug 2 03:19:23 1998 Richard Henderson - - * elf32-ppc.c (ppc_elf_check_relocs): Init sgot to NULL. Create the - .got if any relocation referrs to _GLOBAL_OFFSET_TABLE_. - (ppc_elf_relocate_section): Pull sgot and splt search to the start - of the function. Recognize no .plt as static linking. - -1998-08-01 Ulrich Drepper - - * elf32-mips.c (_bfd_mips_elf_section_from_shdr): Don't pass - ".liblist" string through gettext. - -Fri Jul 31 16:38:14 1998 Catherine Moore - - * Makefile.am: Add support for elf32-arm.lo. - * Makefile.in: Rebuild. - * config.bfd (arm-*-elf): Define targ_defvec and targ_selvecs. - (thumb-*-elf): Define targ_defvec and targ_selvecs. - * configure.in: Handle bfd_elf32_littlearm_vec and bfd_elf32_bigarm_vec. - * configure: Regenerate. - * elf.c: (prep_headers): Support arch_type of EM_ARM. - * targets.c: Support new targets bfd_elf32_bigarm_vec and - bfd_target bfd_elf32_littlearm_vec. - * elf32-arm.c: New file. - -Tue Jun 28 19:05:28 1998 Stan Cox - - * libaout.h (M_SPARCLITE_LE): New machine. - * sunos.c (MACHTYPE_OK): Add machine M_SPARCLITE_LE. - * aoutf1.h (sunos_set_arch_mach): Add machine M_SPARCLITE_LE. - (sunos_write_object_contents): Add machine bfd_mach_sparc_sparclite_le - * aoutx.h (howto_table_ext): Add relocation R_SPARC_REV32. - (NAME(aout,machine_type)) Add machine bfd_mach_sparc_sparclite_le - (aout_link_input_section_ext): Add RELOC_SPARC_REV32 support. - * elf32-sparc.c (_bfd_sparc_elf_howto_table, sparc_reloc_map, - elf32_sparc_relocate_section): Rename R_SPARC_32LE to be R_SPARC_REV32 - * libbfd.h (bfd_reloc_code_real_names): Rename BFD_RELOC_SPARC_32LE to - be BFD_RELOC_SPARC_REV32. - * reloc.c: Ditto. - * config.bfd (sparc86x-*-aout): New - -Fri Jul 24 13:54:19 1998 Nick Clifton - - * linker.c (_bfd_generic_final_link): Allocate NULL symbol before - actually mapping the output sections. - -Fri Jul 24 11:24:29 1998 Jeffrey A Law (law@cygnus.com) - - - * elf-m10300.c (mn10300_elf_howto): Add R_MN10300_24 entry. - (mn10300_elf_reloc_map): Similarly. - (mn10300_elf_final_link_relocate): Handle R_MN10300_24. - -Fri Jul 24 12:36:04 1998 Ian Lance Taylor - - * elf32-mips.c (elf_mips_howto_table): Add reloc types used on - Irix 6. - (bfd_elf32_bfd_reloc_type_lookup): Add default case. - * elf64-mips.c: Replace all uses of mips_elf64_reloc_type with - elf_mips_reloc_type defined in elf/mips.h. - -1998-07-24 Ulrich Drepper - - * elf64-mips.c: Remove reloc_type definition completely. It's now - in elf/mips.h. - -Thu Jul 23 13:33:19 1998 Doug Evans - - * elf64-mips.c (mips_elf64_reloc_type): #if 0 out more relocations - as they are defined in elf/mips.h now. - -Thu Jul 23 11:29:43 1998 Jeffrey A Law (law@cygnus.com) - - - * Re-add lost change: - * elf-m10300.c (elf32_mn10300_link_hash_entry): Add new field - "movm_stack_size". - (mn10300_elf_relax_section): Include stack space for register saves - in the imm8 field of a "call" instruction. - (compute_function_info): Determine how much stack is allocated by - the movm instruction. Fix typo. - (elf32_mn10300_link_hash_newfunc): Initialize movm_stack_size. - -Thu Jul 23 11:38:05 1998 Ian Lance Taylor - - * elf32-sparc.c (elf_backend_got_header_size): Define as 4. - * elf64-sparc.c (elf_backend_got_header_size): Define as 8. - -1998-07-22 Ulrich Drepper - - * elf32-ppc.c: Change use of pp_reloc_type to elf_ppc_reloc_type. - -Wed Jul 22 16:27:18 1998 Nick Clifton - - * elf32-hppa.h: Let ELF header define the enum containing the - external reloc numbers. - * elf32-i386.h: Likewise. - -1998-07-22 14:57 Ulrich Drepper - - * elf-m10300.c: Let ELF header now define the macros to get the enum. - * elf32-mips.c: Likewise. - * elf32-ppc.c: Likewise. - -Wed Jul 22 13:53:52 1998 Nick Clifton - - * bfd-in2.h: Change type of 'class' parameter to 'unsigned int' in - bfd_coff_set_symbol_class(), in order to avoid K&R compatability - prblems. - * bfd-in.h: Regenerate. - * coffgen.c (bfd_coff_set_symbol_class): Change type of 'class' - parameter to 'unsigned int' to avoid K&R compatability problems. - -Wed Jul 22 16:43:24 1998 Ian Lance Taylor - - * ieee.c (ieee_find_nearest_line): Change filename_ptr and - functionname_ptr to be const. Change line_ptr to be unsigned. - - * coffcode.h (coff_link_output_has_begun): Simplify handling when - macro is not defined. Change second parameter from bfd_link_info - to coff_final_link_info. Add prototype. - (coff_final_link_postscript): Simplify handling when macro is not - defined. Add prototype. - -1998-07-22 13:08 Ulrich Drepper - - * elf-mn10300.c: Before include system specific ELF header define - START_RELOC_NUMBERS, RELOC_NUMBER, and END_RELOC_NUMBERS. - * elf32-mips.c: Likewise. - * elf32-ppc.c: Likewise. - -Wed Jul 22 13:46:51 1998 Ian Lance Taylor - - * elf64-mips.c (mips_elf64_reloc_type): Copy Ulrich's elf32-mips.c - temporary patch over to elf64-mips.c as well. - -1998-07-21 Ulrich Drepper - - * elf32-mips.c (reloc_type): Temporarily disable definition of - standard relocation since they are now defined in elf/mips.h. - -Tue Jul 21 09:47:00 1998 Catherine Moore - - * elf-m10200.c (mn10200_elf_final_link_relocate): - Modify range test for case R_MN10200_8. - - * elf-m10300.c (mn10300_elf_final_link_relocate): - Modify range test for case R_MN10300_8. - -Mon Jul 20 18:50:54 1998 Richard Henderson - - * elf-bfd.h (struct elf_backend_data): Add got_ & plt_header_size. - * elf32-i386.c (elf_backend_got_header_size): Define. - (elf_backend_plt_header_size): Define. - * elf32-m68k.c, elf32-mips.c, elf32-ppc.c: Likewise. - * elf32-sparc.c, elf64-alpha.c, elf64-sparc.c: Likewise. - * elfxx-target.h: Provide a default of zero. - * elflink.c (_bfd_elf_create_got_section): Use got_header_size. - * elflink.h (elf_gc_common_finalize_got_offsets): Likewise. - - * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't remove a PLT - entry from an executable, even if the plt refcount goes to 0. - -Mon Jul 20 12:47:26 1998 Andreas Schwab - - * aoutx.h (NAME(aout,find_nearest_line)): Also remember the - directory name at the line number. - - * elf.c (_bfd_elf_find_nearest_line): Also consider symbols - with an unspecified type. - -Wed Jul 15 11:20:01 1998 Ian Lance Taylor - - * sunos.c: Add undef of valid to avoid problem on SunOS. - -Tue Jul 14 15:30:59 1998 Richard Henderson - - * config.bfd (i?86-pc-beos{pe,elf,}*): Recognize. - -Tue Jul 14 11:22:21 1998 Andreas Schwab - - * elf32-m68k.c (elf_m68k_check_relocs): Also reference count - R_68K_PCxx and R_68K_xx relocations. Make sure that - ELF_LINK_HASH_NEEDS_PLT is always set for a PLT reloc reference. - (elf_m68k_gc_sweep_hook): Also reference count R_68K_PCxx and - R_68K_xx relocations. - (elf_m68k_adjust_dynamic_symbol): Reset the plt offset of a symbol - that has no plt entry. - (elf_m68k_relocate_section): Ignore the plt offset in a static - link. - * elflink.h (elf_adjust_dynamic_symbol): Reset the plt offset for - an ignored symbol. - (elf_gc_common_finalize_got_offsets): Set the got offsets also in - a static link. - - * elf32-m68k.c (R_68K_GNU_VTINHERIT, R_68K_GNU_VTENTRY): New reloc - types. - (howto_table, reloc_map): Add entries for them. - (elf_m68k_check_relocs): Handle them. Implement reference - counting for got and plt entries. - (elf_m68k_gc_mark_hook, elf_m68k_gc_sweep_hook): New functions. - (elf_m68k_adjust_dynamic_symbol): Handle unreferenced plt - symbols. - (rtype_to_howto_rel, elf_info_to_howto_rel): Delete. - (elf_m68k_relocate_section): Handle the new reloc types. - (bfd_elf32_bfd_final_link, elf_backend_gc_mark_hook, - elf_backend_gc_sweep_hook, elf_backend_can_gc_sections): Define. - * elflink.h (elf_link_add_object_symbols): When creating an - indirect reference for symbol versioning also copy the plt - offset. - (elf_fix_symbol_flags): When clearing the ELF_LINK_HASH_NEEDS_PLT - flag also reset the plt offset. - (elf_link_assign_sym_version): Likewise. - (elf_gc_common_finalize_got_offsets): Increment the got offset by - the size of the entry in bytes. - (elf_gc_allocate_got_offsets): Likewise. - -Tue Jul 14 11:18:14 1998 Ian Lance Taylor - - * elflink.h (elf_gc_sections): Return true rather than falling off - the bottom. - - * coffgen.c (bfd_coff_set_symbol_class): Call bfd_alloc, not - xmalloc. - -Mon Jul 13 11:06:31 1998 Nick Clifton - - * coff-arm.c: Supress definition of TARGET_UNDERSCORE and add a - comment describing when it should be enabled. - Changed definition of USER_LABEL_PREFIX to "", to fall into line - with GCC sources. - -Mon Jul 13 13:06:54 1998 Ian Lance Taylor - - * ieee.c (ieee_slurp_external_symbols): Handle call optimization - information ATN records. - -Fri Jul 10 16:31:06 1998 Ian Lance Taylor - - * ieee.c (ieee_slurp_external_symbols): Select an appropriate - section for an absolute symbol in a fully linked file. Based on - patch from Christian Holland . - -Wed Jul 8 11:29:56 1998 Manfred Hollstein - - * coff-m88k.c (m88k_special_reloc): Don't lose the information - that a symbol is undefined. - -Tue Jul 7 21:47:02 1998 Jeffrey A Law (law@cygnus.com) - - * som.c (som_bfd_gc_sections): Define. - -Mon Jul 6 11:35:50 1998 Nick Clifton - - * coff-arm.c (aoutarm_std_reloc_howto): Do not complain about - overflows in ARM_26D patches, since they have already been - implmented. Patch submitted by Dr. R.J. Black - -Sat Jul 4 12:25:36 1998 Ian Lance Taylor - - * coffcode.h (coff_write_object_contents): If we have any long - section names, call coff_write_symbols even if there are no - symbols. - -Fri Jul 3 13:11:35 1998 Ian Lance Taylor - - * elf.c (copy_private_bfd_data): Only set phdr_included once for a - PT_LOAD segment, rather than only setting it once for the entire - file. - - * elf.c (_bfd_elf_make_section_from_shdr): When setting the LMA, - rather than ignoring every phdr with a p_paddr of 0, ignore all - the phdrs if they all have a p_paddr of 0. - - * stabs.c (_bfd_write_stab_strings): Check whether the .stabstr - section was discarded from the link. - -Fri Jul 3 14:39:05 1998 J"orn Rennecke - - * coff-sh.c (sh_insn_uses_freg): Ignore lowest bit of register number. - -Fri Jul 3 14:35:48 1998 J"orn Rennecke - - * coff-sh.c (sh_insns_conflict): Load of fpscr conflicts with - floating point operations. - -Thu Jul 2 18:37:25 1998 Ian Lance Taylor - - * cofflink.c (_bfd_coff_link_input_bfd): Skip undefined global - function symbols. - -Thu Jul 2 14:59:42 1998 Klaus Kaempf - - Merge of vax/vms (read-only) support - * configure.com: Support Vax target. - * makefile.vms: Support Vax target. - * vms.h: Renamed from evax.h, merged vax/vms (read-only) support. - * vms.c: Renamed from evax-alpha.c, merged vax/vms (read-only) - support. - * vms-hdr.c: Renamed from evax-emh.c, merged vax/vms (read-only) - support. - * vms-gsd.c: Renamed from evax-egsd.c, merged vax/vms (read-only) - support. - * vms-tir.c: Renamed from evax-etir.c, merged vax/vms (read-only) - support. - * vms-misc.c: Renamed from evax-misc.c, merged vax/vms (read-only) - support. - * libbfd.c (real_read): Use unbuffered read on VMS/Vax. - * targets.c (bfd_target_ovax_flavour): New flavour. - (vms_alpha_vec): Renamed from evax_alpha_vec. - (vms_vax_vec): New. - (target_vector): Update accordingly. - * config.bfd (alpha*-*-*vms*): Use vms_alpha_vec, not - evax_alpha_vec. - (vax*-*-*vms*): New target. - * Makefile.am: Update for renamed files. Rebuild dependencies. - * bfd-in2.h: Rebuild. - * configure.in, Makefile.in, aclocal.m4: Rebuild. - -Thu Jul 2 13:31:55 1998 Ian Lance Taylor - - Based on patch from Matt Semersky : - * linker.c (_bfd_generic_final_link): Force a trailing NULL - pointer on abfd->outsymbols. - (generic_add_output_symbol): Handle NULL sym parameter. - -Wed Jul 1 17:05:53 1998 Nick Clifton - - * elf.c (copy_private_bfd_data): Add support for changing VMA or - LMA of sections. - -Wed Jul 1 16:58:50 1998 Ian Lance Taylor - - * coff-sh.c (sh_relax_delete_bytes): Correct address comparisons - when handling 32 bit immediate relocs. - * elf32-sh.c (sh_elf_relax_delete_bytes): Likewise. - -Tue Jun 30 09:55:03 1998 Jeffrey A Law (law@cygnus.com) - - * section.c (STD_SECTION): Account for recently added gc_mark - field in struct asection. - - * elf-m10300.c (bfd_mn10300_elf_merge_private_bfd_data): New function. - (bfd_elf32_bfd_merge_private_bfd_data): Define. - -Thu Jun 25 18:31:41 1998 Richard Henderson - - ELF Section-level Garbage Collection: - * bfd.c (bfd_gc_sections): New. - * 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. - * 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. - * targets.c (BFD_JUMP_TABLE_LINK): Add _bfd_gc_sections. - - * reloc.c (BFD_RELOC_VTABLE_INHERIT, BFD_RELOC_VTABLE_ENTRY): New. - (bfd_generic_gc_sections): New. - * section.c (SEC_KEEP): New. - (asection): Add gc_mark member. - - * elfcode.h (elf_gc*): New name remappings. - * elflink.h (elf_link_input_bfd): Don't set contents on stabs - sections to be excluded. - (elf_gc_mark, elf_gc_sweep, elf_gc_sweep_symbol): New. - (elf_gc_propogate_vtable_entries_used): New. - (elf_gc_smash_unused_vtentry_relocs): New. - (elf_gc_sections, elf_gc_record_vtinherit, elf_gc_record_vtentry): New. - (elf_gc_common_finalize_got_offsets): New. - (elf_gc_allocate_got_offsets, elf_gc_common_final_link): New. - * elfxx-target.h: Add and default gc hooks. - - * elf-bfd.h (struct elf_link_hash_entry): Swap got_offset/plt_offset - for unions. - (struct elf_obj_tdata): Likewise for local_got_offsets. - * elf.c, elf-i386.c, elf32-m68k.c, elf32-mips.c: Update all uses. - * elf32-ppc.c, elf32-sparc.c, elf64-alpha.c: Likewise. - * elf64-sparc.c, elflink.h: Likewise. - - * elf-bfd.h (struct elf_link_hash_entry): Add vtable members. - (ELF_LINK_HASH_MARK): Define. - (struct elf_backend_data): Add GC hooks. - * elf.c (_bfd_elf_link_hash_newfunc): Zero vtable members. - - * elf-m10300.c (mn10300_elf_check_relocs): New. - (mn10300_elf_gc_mark_hook): New. - (R_MN10300_GNU_VTINHERIT, R_MN10300_GNU_VTENTRY): New. - (elf_mn10300_howto, mn10300_reloc_map): Handle them. - (mn10300_elf_final_link_relocate): Likewise. - (mn10300_elf_relocate_section): Likewise. - (elf_backend_can_gc_sections): Define. - * elf32-mips.c (R_MIPS_GNU_VTINHERIT, R_MIPS_GNU_VTENTRY): New. - (elf_mips_gnu_vtinherit_howto, elf_mips_gnu_vtentry_howto): New. - (bfd_elf32_bfd_reloc_type_lookup): Handle them. - (mips_info_to_howto_rel): Likewise. - (mips_elf_relocate_section): Likewise. - (mips_elf_check_relocs): Likewise. - (mips_elf_gc_mark_hook, mips_elf_gc_sweep_hook): New. - (elf_backend_can_gc_sections): Define. - * elf32-ppc.c (R_PPC_GNU_VTINHERIT, R_PPC_GNU_VTENTRY): New. - (ppc_elf_howto_raw): Handle them. - (ppc_elf_reloc_type_lookup): Likewise. - (ppc_elf_relocate_section): Likewise. - (ppc_elf_check_relocs): Reference count .got and .plt entries. - Handle new vtable relocs. - (ppc_elf_adjust_dynamic_symbol): Recognize unused .plt entries. - (ppc_elf_gc_mark_hook, ppc_elf_gc_sweep_hook): New. - (elf_backend_can_gc_sections): Define. - -Fri Jun 26 10:48:23 1998 Jeffrey A Law (law@cygnus.com) - - * archures.c (bfd_mach_mn10300): Define. - * elf-m10300.c: Include elf/mn10300.h - (elf_mn10300_mach): New function. - (_bfd_mn10300_elf_final_write_processing): Likewise. - (_bfd_mn10300_elf_object_p): Likewise. - (elf_backendfinal_write_processing): Define. - (elf_backend_object_p): Likewise. - -Thu Jun 25 18:31:08 1998 Nick Clifton - - * elf32-v850.c (v850_elf_perform_relocation): Fix HI16_S - relocation. - -Wed Jun 24 17:17:57 1998 Ian Lance Taylor - - * elflink.h (elf_bfd_final_link): Loop over input_bfds using the - link_next field, not the next field. - -Sun Jun 21 19:38:39 1998 Ian Lance Taylor - - * elf.c (map_sections_to_segments): Check the section address - against the phdr size both with and without a modulo of - maxpagesize. - -Fri Jun 19 17:08:18 1998 Ian Lance Taylor - - * elf32-mips.c (mips_elf_size_dynamic_sections): Only strip a - linker created empty input section if the output section has the - same name. - - * elflink.h (elf_link_output_extsym): Print an error message if - _bfd_elf_section_from_bfd_section fails. - - * elf.c (_bfd_elf_section_from_bfd_section): Call bfd_set_error on - failure. - -Tue Jun 16 11:55:55 1998 Ian Lance Taylor - - * elf.c (copy_private_bfd_data): Improve handling of Solaris - native linker output. Avoid putting an empty section in more than - one segment. - -Fri Jun 12 13:30:17 1998 Tom Tromey - - * po/Make-in (all-yes): If maintainer mode, depend on .pot file. - ($(PACKAGE).pot): Unconditionally depend on POTFILES. - -Fri Jun 12 13:34:02 1998 Doug Evans - - * elf.c (swap_out_syms): New arg relocatable_p. - Don't add section VMA to symbols for relocatable output. - (_bfd_elf_compute_section_file_positions): Update call to - swap_out_syms. - -Mon Jun 8 15:20:57 1998 Nick Clifton - - * elf32-v850.c (v850_elf_perform_relocation): Make comparisons - against 'addend' be signed rather than unsigned. - -Sat Jun 6 00:31:21 1998 Nick Clifton - - * elf32-m32r.c: Add prototyps for static functions. - - * coff-arm.c: Add prototypes for static functions. - -Fri Jun 5 17:21:51 1998 Nick Clifton - - * elf.c (elf_sort_sections): Sort by LMA first then VMA, since the - LMA is used to order sections in a segment. - - * elf32-v850.c: Add prototypes for static functions. - Change type of addend parameter to bfd_vma in various functions. - -Fri Jun 5 18:09:58 1998 Ian Lance Taylor - - * aoutx.h (howto_table_ext): Change RELOC_BASE13 to use - complain_overflow_signed instead of complain_overflow_bitfield. - -Fri Jun 5 15:11:11 1998 Andreas Schwab - - * elf.c (elf_map_symbols): Don't add section VMA to symbol value - when comparing against 0. - -Wed Jun 3 17:52:49 1998 Ian Lance Taylor - - * Makefile.am (config.status): New target. - * Makefile.in: Rebuild. - -Wed Jun 3 12:18:24 1998 Stan Cox - - * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Give an - error if previous object endianness doesn't match current object. - -Tue Jun 2 17:50:59 1998 Nick Clifton - - * elf32-v850.c (v850_elf_print_private_bfd_data): Call - _bfd_elf_print_private)bfd_data (). - -Tue Jun 2 15:29:35 1998 Ian Lance Taylor - - * elflink.h (elf_merge_symbol): Don't always set type_change_ok - and size_change_ok. - (elf_link_add_object_symbols): Set type_change_ok and - size_change_ok before calling elf_merge_symbol. - - * elf32-mips.c (mips_elf_relocate_section): If we issue an - undefined symbol error, don't also issue an overflow error. - -Tue Jun 2 13:51:00 1998 Geoff Keating - - * elf32-ppc.c (ppc_elf_relocate_section): The target of an - R_PPC_LOCAL24PC relocation should be local; if not, print an error - message instead of crashing. - -Mon Jun 1 18:23:12 1998 Yuli Barcohen - - * archures.c (bfd_mach_cpu32): Define. - (bfd_default_scan): Add case for 68060. Fix 68332 case to use - bfd_mach_cpu32. - * cpu-m68k.c (arch_info_struct): Add m68k:cpu32. - * ieee.c: Include . - (ieee_object_p): Parse out process ID string to make it more - likely to be acceptable for bfd_scan_arch. - * bfd-in2.h: Rebuild. - -Mon Jun 1 11:12:02 1998 Nick Clifton - - * elf32-m32r.c (m32r_elf_print_private_bfd_data): Also call - _bfd_elf_print_private_bfd_data() so that the program header will - be displayed. - -Mon Jun 1 12:14:28 1998 Ian Lance Taylor - - * peicode.h (coff_swap_sym_in): Check for C_SECTION rather than - 0x68. Reindent. Add some comments. - -Fri May 29 09:58:08 1998 Nick Clifton - - * elf.c (copy_private_bfd_data): Adjust physical address of - segment in output BFD to contain LMAs of its sections. - -Tue May 26 19:37:47 1998 Stan Cox - - * elf32-sparc.c (_bfd_sparc_elf_howto_table, sparc_reloc_map, - elf32_sparc_relocate_section): Added R_SPARC_32LE for little - endian data 32 bit relocations. - (elf32_sparc_merge_private_bfd_data): Check if linking little - endian objects with big endian objects. - (elf32_sparc_object_p): Set bfd_mach_sparc_sparclite_le. - (elf32_sparc_final_write_processing): Set EF_SPARC_LEDATA in e_flags. - * libbfd.h (bfd_reloc_code_real_names): Added BFD_RELOC_SPARC_32LE. - * reloc.c: Same. - * cpu-sparc.c (arch_info_struct): Added sparc:sparclite_le - * archures.c (bfd_mach_sparc_sparclite_le): New. - * bfd-in2.h (BFD_RELOC_SPARC_32LE, bfd_mach_sparc_sparclite_le): New. - -Thu May 21 16:59:28 1998 Nick Clifton - - * peicode.h (add_data_entry): Fix precedence of operators in if () - statement. - -Tue May 19 18:41:19 1998 Ian Lance Taylor - - * bfd-in.h: Move over patch to bfd-in2.h. - - * reloc.c (bfd_check_overflow): Add casts before shifts which may - not fit in 32 bits. - (_bfd_relocate_contents): Likewise. - -Mon May 18 14:44:15 1998 Nick Clifton - - * peicode.h (add_data_entry): If the section has no private data - then do not create a Data Dictionary entry for it. - -Mon May 18 00:09:28 1998 Richard Henderson - - * elf64-alpha.c (elf64_alpha_relax_section): Set again on changes. - (elf64_alpha_can_merge_gots, elf64_alpha_merge_gots, - elf64_alpha_size_got_sections): Rewrite, handling multiple got - subsections during relaxation more correctly. - -Thu May 14 14:22:58 1998 Nick Clifton - - * bfd-in2.h: Add new prototype: bfd_coff_set_symbol_class (). - Add extra argument to bfd_arm_process_before_allocation (). - * bfd-in.h: Reflect changes made in bfd-in2.h. - * coffgen.c (bfd_coff_set_symbol_class): New function. Set the - coff class of a BFD symbol. - * coff-arm.c: Add support for interworking between Thumb code and - non-interworking aware ARM code. - -Sun May 10 22:33:59 1998 Jeffrey A Law (law@cygnus.com) - - * po/Make-in (install-info): New target. - -Thu May 7 17:40:56 1998 Ian Lance Taylor - - * filemode.c: Remove; not used. - - If sysdep.h includes a header file, don't include it again: - * aix386-core.c: Don't include , , or - . - * aoutx.h: Don't include . Use "sysdep.h" rather than - . - * archive.c: Don't include or . - * evax-alpha.c; Don't include . - * evax-egsd.c: Likewise. - * evax-etir.c: Likewise. - * evax-misc.c: Likewise. - * evax-emh.c: Likewise. Also, don't include . - * hppabsd-core.c: Don't include , , or - . - * hpux-core.c: Likewise. - * netbsd-core.c: Likewise. - * som.c: Likewise. - * libbfd.c: Don't include . - * nlmcode.h: Don't include . - * osf-core.c: Don't include or . - * ptrace-core.c: Don't include , , - , or . - * trad-core.c: Don't include or . - -Thu May 7 13:12:50 1998 Klaus Kaempf - - * configure.com: If the version number can not be found in - configure.in, set it to "unknown" rather than "2.8.1". - -Wed May 6 09:46:05 1998 Gavin Koch - - * elf32-mips.c (elf_mips_mach): New. - (_bfd_mips_elf_object_p): Use elf_mips_mach. - (_bfd_mips_elf_final_write_processing): Use the names - of machines, rather than the numbers. Set both the ARCH - and MACH in e_flags. Handle a few more specific machines. - (_bfd_mips_elf_merge_private_bfd_data): Merge both - EF_MIPS_ARCH and EF_MIPS_MACH. - -Tue May 5 21:01:53 1998 Richard Henderson - - * syms.c (bfd_is_local_label): Revert last change. - * srec.c (srec_write_symbols): Discard debugging symbols. - -Tue May 5 23:36:06 1998 Ian Lance Taylor - - * som.c: Include . - * som.h: Don't include sysdep.h. - -Tue May 5 18:29:24 1998 Tom Tromey - - * libbfd.h: Rebuilt. - * libbfd-in.h: Removed gettext includes and defines. - * sysdep.h: Moved gettext-related includes and defines here. - -Tue May 5 16:47:54 1998 Richard Henderson - - * srec.c (srec_write_symbols): Use bfd_is_local_label rather than - an ad-hoc test. Kill bogus #if 0 code. - * syms.c (bfd_is_local_label): Consider BSF_DEBUGGING symbols local. - -Mon May 4 16:10:33 1998 Ian Lance Taylor - - * sunos.c (sunos_check_dynamic_reloc): Don't use the PLT address - when generating a normal executable for a symbol defined in a - regular file. When copying a reloc into the output file, adjust - the addend for a PC relative reloc against a global symbol. - -Mon May 4 10:08:18 1998 Tom Tromey - - * libbfd.h: Rebuilt. - * libbfd-in.h (_): Define as dgettext. - -Mon May 4 11:02:23 1998 Ian Lance Taylor - - * coff-arm.c (coff_arm_relocate_section): Cast to bfd_signed_vma, - not signed. - * peicode.h (pe_saved_coff_bfd_print_private_bfd_data): Use PARAMS - when declaring parameter types. - (pe_saved_coff_bfd_copy_private_bfd_data): Likewise. - -Wed Apr 29 15:35:03 1998 Ian Lance Taylor - - * config.bfd: If we include any ELF targets in targ_defvec and/or - targ_selvecs, then add the generic ELF targets to targ_selvecs. - * elf32-gen.c (dummy): New static const variable. - (elf_generic_info_to_howto): New static function. - (elf_generic_info_to_howto_rel): New static function. - (elf_info_to_howto): Define as elf_generic_info_to_howto. - (elf_info_to_howto_rel): Define as elf_generic_info_to_howto_rel. - * elf64-gen.c: Same changes as elf32-gen.c. - * elfcode.h (elf_object_p): For the generic target, ignore a - failure of bfd_default_set_arch_mach. Fix indentation a bit. - -Tue Apr 28 20:05:52 1998 Ian Lance Taylor - - * configure.in (WIN32LIBADD): Add -lintl on cygwin32. - * configure: Rebuild. - -Tue Apr 28 12:16:57 1998 Jason Molenda (crash@bugshack.cygnus.com) - - * config.bfd: Update OSR5/Unixware patterns. - -Mon Apr 27 18:02:24 1998 Richard Henderson - - * elf.c (assign_file_positions_for_segments): Allow for holes - between sections added by a link script. - -Mon Apr 27 11:49:55 1998 Ian Lance Taylor - - * configure.in: Change version number to 2.9.4 - * configure: Rebuild. - - Based on patch from H.J. Lu : - * elf.c (bfd_elf_get_bfd_needed_list): New function. - * bfd-in.h (bfd_elf_get_bfd_needed_list): Declare. - * bfd-in2.h: Rebuild. - -Sat Apr 25 20:07:53 1998 Richard Henderson - - * elf64-alpha.c (struct alpha_relax_info): Replace elfsym with other. - Change all users. - -Sat Apr 25 18:29:07 1998 Richard Henderson - - * elf64-alpha.c (struct alpha_relax_info): Add tsec & elfsym members. - (elf64_alpha_relax_section): Fill them in. - (elf64_alpha_relax_opt_call): Implement more than a stub. - (elf64_alpha_add_symbol_hook): Don't set SEC_LOAD or default - alignment on .scommon. - (elf64_alpha_merge_gots): Merge use counts as well. - -Sat Apr 25 14:07:29 1998 Richard Henderson - - * elf64-alpha.c (elf64_alpha_relax_section): Use the proper section - for calculating a local symbol's address. - (elf64_alpha_calc_got_offsets): Skip entries with 0 use count. - Set the .got's cooked size as well as the raw size. - -Fri Apr 24 09:16:00 1998 Nick Clifton - - * elf32-v850.c (v850_elf_print_private_bfd_data): Add - internationalisation of printed information. - - * coff-arm.c (coff_arm_print_private_bfd_data): Add - internationalisation of printed information. - -Fri Apr 24 12:09:18 1998 Ian Lance Taylor - - * syms.c (struct indexentry): Change directory_name, file_name, - and function_name fields to char *. - (struct stab_find_info): Change cached_file_name field to char *. - -Thu Apr 23 08:13:04 1998 Nick Clifton - - * peicode.h (dir_names): Add missing N_() macros to dir_names array. - -Wed Apr 22 13:06:15 1998 Tom Tromey - - * po/Make-in (MKINSTALLDIRS): Don't look in $(top_srcdir). - -Wed Apr 22 17:48:48 1998 Ian Lance Taylor - - * Makefile.am (install-data-local): Make $(includedir). - * Makefile.in: Rebuild. - -Wed Apr 22 13:06:15 1998 Tom Tromey - - * libbfd-in.h: Use `gettext' and not `dgettext' for now. - -Wed Apr 22 12:53:40 1998 Ian Lance Taylor - - * Makefile.am (INCLUDES): Add -I$(srcdir)/../intl -I../intl. - * Makefile.in: Rebuild. - - * bfd-in2.h: Rebuild for Nick's changes. - -Tue Apr 21 23:11:51 1998 Richard Henderson - - * archive.c (_bfd_generic_read_ar_hdr_mag): Fix lossage in last - change wrt length == max_namelen. - -Tue Apr 21 21:19:36 1998 Tom Tromey - - * Many files: Added gettext invocations around user-visible - strings. - * libbfd-in.h: Added gettext includes and defines. - * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY, - HAVE_LC_MESSAGES): Define. - * configure.in: Call CY_GNU_GETTEXT. Create po/Makefile.in and - po/Makefile. - * Makefile.am (SUBDIRS): Added po. - (POTFILES): New macro. - (po/POTFILES.in): New target. - (SOURCE_HFILES): New macro. - (HFILES): Use it. - * po/Make-in, po/POTFILES.in, po/bfd.pot: New files. - -Tue Apr 21 13:38:18 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) - - * elfcore.h (bfd_prstatus): Copy core_prstatus from the first - NT_PRSTATUS note section encountered, it contains the status of - the currently executing thread when the core file was written. - -Tue Apr 21 10:00:12 1998 Nick Clifton - - * libcoff.h: Add extra parameter to - bfd_coff_link_output_has_begun overrideable function. - * cofflink.c: Pass extra parameter to - bfd_coff_link_output_has_begun function. - * bfd-in.h: Add prototypes for exported ARM interworking - functions. - * peicode.h: ARM specific code reorganised to conform to BFD - coding conventions. - * coffcode.h: ARM specific code reorganised to conform to BFD - coding conventions. - * coff-arm.c: Code reorganised to conform to the BFD coding - conventions. Global variables have been moved into an ARM - specific hash table structure and a new function: - bfd_arm_get_bfd_for_interworking() has been created which is - called from the linker scripts. - -Tue Apr 21 00:11:51 1998 Richard Henderson - - * archive.c (_bfd_generic_read_ar_hdr_mag): Simplify end-of-name test. - - * elf64-alpha.c (elf64_alpha_find_reloc_at_ofs): Renamed from - elf64_alpha_relax_find_reloc_ofs. Changed all callers. - (elf64_alpha_add_symbol_hook): Put small commons in .scommon not .sbss. - (elf64_alpha_size_got_sections): Don't merge .got sections twice. - -Sat Apr 18 01:21:04 1998 Stan Cox - - * config.bfd: Added sparc86x support. - -Fri Apr 17 22:29:04 1998 Ian Lance Taylor - - * elf32-mips.c (mips_elf_relocate_section): Do not complain about - an out of range pc-relative jump/call to an undefined weak symbol. - -Thu Apr 16 13:49:00 1998 Richard Henderson - - * elf64-alpha.c (elf64_alpha_do_reloc_gpdisp): Do all gpdisp - comparisons signed. - -Thu Apr 16 11:43:33 1998 Ian Lance Taylor - - * archive.c (bfd_generic_archive_p): If a slurp subroutine returns - an error other than bfd_error_system_call, set the error to - bfd_error_wrong_format. - - * targets.c (bfd_target_vector) [SELECT_VECS not defined]: Add - bfd_elf32_powerpcle_vec. - - * elf.c (copy_private_bfd_data): If all the p_paddr fields in the - program segments are zero, don't set p_paddr_valid. - -Wed Apr 15 22:15:16 1998 Richard Henderson - - * elf64-alpha.c: Initial implementation of relaxation -- - (struct alpha_elf_link_hash_entry): Add use_count member. - (elf64_alpha_check_relocs): Initialize and increment it. - (elf64_alpha_can_merge_gots): Check it when considering merging. - (elf64_alpha_merge_gots): Drop entries with zero use. - (elf64_alpha_calc_got_offsets_for_symbol): Likewise. - (elf64_alpha_always_size_sections): Split out got sizing ... - (elf64_alpha_size_got_sections): ... here. New function. - (elf64_alpha_relax_find_reloc_ofs): New function. - (elf64_alpha_relax_with_lituse): Likewise. - (elf64_alpha_relax_without_lituse): Likewise. - (elf64_alpha_relax_opt_call): Likewise. - (elf64_alpha_relax_section): Likewise. - (elf64_alpha_add_symbol_hook): Likewise. - (elf64_alpha_howto_table): Implement GPRELHIGH/LOW & IMMED_GP_16. - (elf64_alpha_relocate_section): Likewise. - (bfd_elf64_bfd_relax_section): Define. - (elf_backend_add_symbol_hook): Likewise. - -Wed Apr 15 16:08:46 1998 Richard Henderson - - * elf.c (prep_headers): Use new EM_SPARCV9 symbol. - * elf64-sparc.c (ELF_MACHINE_CODE): Likewise. - (ELF_MACHINE_ALT1): New. Set to EM_OLD_SPARC64. - -Wed Apr 15 11:34:33 1998 Ian Lance Taylor - - * configure.in: Add -lkernel32 to WIN32LIBADD on cygwin32. - * configure: Rebuild. - -Mon Apr 13 16:46:27 1998 Ian Lance Taylor - - * Makefile.am (libbfd_la_LIBADD): Add @WIN32LIBADD@. - (libbfd_la_LDFLAGS): Add @WIN32LDFLAGS@. - * configure.in: Define and substitute WIN32LDFLAGS and - WIN32LIBADD. - * aclocal.m4: Rebuild with new libtool. - * configure, Makefile.in: Rebuild. - -Fri Apr 10 13:44:27 1998 Ian Lance Taylor - - * coffcode.h (coff_write_object_contents): Move a PE COMDAT symbol - before any other symbols in the same section. - -Wed Apr 8 14:50:23 1998 Michael Meissner - - * config.bfd (powerpc*-*-*): Remove PowerPC NT support from ELF - systems. - -Tue Apr 7 16:25:31 1998 Gavin Romig-Koch - - * dwarf2.c (comp_unit): Move it earlier in the source. Add - addr_size. - (read_address): Replace 'bdf*' argument with 'comp_unit*' argument. - Use addr_size for address size, rather than sizeof(bfd_vma). - (read_attribute): Replace bdf* argument with 'comp_unit*' argument. - Fix call to read_address. - (decode_line_info): Replace bdf* argument with 'comp_unit*' argument. - Scrap other unneeded arguments. Fix call to read_address. - (scan_unit_for_functions): Fix call to read_attribute. - (parse_comp_unit): We now handle more values for addr_size. - Set addr_size in unit. Fix call to read_attribute and - decode_line_info. - -Tue Apr 7 15:44:47 1998 Gavin Romig-Koch - - * dwarf2.c (parse_comp_unit): Drop use of unit->name when it is null. - -Tue Apr 7 12:35:18 1998 Ian Lance Taylor - - * archures.c (bfd_default_scan): Add m68k cases back to default - switch, reverting patch of March 25, since IEEE support depends - upon them. - -Mon Apr 6 14:06:40 1998 Ian Lance Taylor - - * Makefile.am (diststuff): New target. - * Makefile.in: Rebuild. - -Sun Apr 5 16:21:44 1998 Jeffrey A Law (law@cygnus.com) - - * som.c (som_bfd_ar_write_symbol_stuff): Fix computation of - som_offset when we have an extended name table. - -Sun Apr 5 16:04:39 1998 H.J. Lu - - * Makefile.am (stamp-lib): Check that .libs/libbfd.a exists before - trying to copy it. - * Makefile.in: Rebuild. - -Fri Apr 3 11:09:42 1998 Andreas Schwab - - * elf32-m68k.c (elf_m68k_size_dynamic_sections): Generate section - symbols when creating a shared library. - (elf_m68k_adjust_dynindx): New function, used by above code. - (elf_m68k_finish_dynamic_sections): Initialize the section - symbols. - (elf_m68k_relocate_section): Change abort to BFD_ASSERT. - -Wed Apr 1 16:04:02 1998 Nick Clifton - - * coff-arm.c (in_reloc_p): Use ARM_RVA32 in place of constant - value 11. - -Wed Apr 1 13:36:58 1998 Andreas Schwab - - * elf32-m68k.c (elf_m68k_relocate_section, case R_68K_PLT*O): Fix - assertion. - -Tue Mar 31 00:12:12 1998 Jeffrey A Law (law@cygnus.com) - - * elf-m10300.c (mn10300_elf_relax_section): Correctly handle - absolute symbols. - -Mon Mar 30 12:46:15 1998 Ian Lance Taylor - - * configure.in: Set version to 2.9.1. - * configure: Rebuild. - - * Branched binutils 2.9. - -Mon Mar 30 12:20:50 1998 Brent Baccala - - * syms.c (ENABLE_CACHING): Define. - (struct indexentry): Define. - (struct stab_cache): Remove. - (cmpindexentry): New static function. - (struct stab_find_info): Add new fields: indextable, - indextablesize, cached_indexentry, cached_offset, cached_stab, and - cached_file_name. Remove fields: file_cache, function_cache, and - line_cache. - (_bfd_stab_section_find_nearest_line): Rewrite to build a sorted - index table and search it. - -Mon Mar 30 10:39:34 1998 Ian Lance Taylor - - * elf.c (_bfd_elf_copy_private_section_data): Call - copy_private_bfd_data once we've seen the last SEC_ALLOC section. - - * cpu-mips.c: Remove trailing comma at end of enumeration list. - -Sat Mar 28 16:33:02 1998 Ian Lance Taylor - - * coff-arm.c: Define all globally visible variables and functions - only when COFF_WITH_PE is not defined. - * configure.in (armpe_little_vec, armpe_big_vec): Add - coff-arm.lo. - * configure: Rebuild. - -Fri Mar 27 16:06:02 1998 Ian Lance Taylor - - Fix some gcc -Wall warnings: - * aout-arm.c (MY(fix_pcrel_26)): Add casts to avoid warnings. - * archive.c (_bfd_generic_read_ar_hdr_mag): Likewise. - * archures.c (bfd_default_scan): Likewise. - * bfd.c (bfd_scan_vma): Likewise. - * binary.c (mangle_name): Likewise - * coff-arm.c (aoutarm_fix_pcrel_26): Likewise. - * coff-sh.c (sh_relocate_section): Likewise. - * coff-stgo32.c (create_go32_stub): Likewise. - * coffcode.h (coff_slurp_line_table): Likewise. - * ecoff.c (_bfd_ecoff_write_armap): Likewise. - * elf.c (_bfd_elf_make_section_from_shdr): Likewise. - (assign_file_positions_for_segments): Likewise. - * elf32-mips.c (mips_elf_relocate_section): Likewise. - * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise. - * oasys.c (oasys_write_sections): Likewise. - * ppcboot.c (ppcboot_object_p): Likewise. - (mangle_name): Likewise. - * riscix.c (riscix_fix_pcrel_26): Likewise. - * srec.c (srec_scan): Likewise. - * stabs.c (_bfd_write_section_stabs): Likewise. - * sunos.c (sunos_add_dynamic_symbols): Likewise. - * aout-ns32k.c (_bfd_ns32k_relocate_contents): Add default case to - switch. Declare parameters for function pointers. - * archures.c (bfd_default_scan): Add braces to avoid ambiguous if - warning. - * elf.c (elf_sort_sections): Likewise. - * coff-arm.c (coff_thumb_pcrel_common): Initialize relocation. - Add default cases to switches. - (coff_arm_relocate_section): Remove unused local variables. - Always set rstat. - (coff_arm_bfd_set_private_flags): Change flag variable to type - flagword. - * coff-mips.c (mips_relocate_section): Initialize use_lo. - * coff-ppc.c (ppc_record_toc_entry): Change i to unsigned int. - (dump_toc): Change cat to const, and initialize it. - * coff-sh.c (sh_relax_delete_bytes): Initialize start and voff. - * elf32-sh.c (sh_elf_relax_delete_bytes): Likewise. - (sh_elf_relocate_section): Initialize r_symndx. - * coffcode.h (coff_compute_section_file_positions): Only declare - old_sofar if ALIGN_SECTIONS_IN_FILE. - (coff_write_object_contents): Initialize csym. - * coffgen.c (coff_pointerize_aux): Make type and class unsigned. - * cpu-ns32k.c (_bfd_ns32k_get_displacement): Add default case to - switch. - * dwarf2.c: Include libiberty.h. - (read_2_signed_bytes, read_4_signed_bytes): Comment out. - (decode_line_info): Remove unused local variables. - * elf32-m32r.c (m32r_elf_sda16_reloc): Likewise. - (m32r_elf_relocate_section): Likewise. - * elf32-v850.c (v850_elf_store_addend_in_insn): Likewise. - (v850_elf_reloc): Likewise. - * elf-bfd.h (elf_linker_section_t): Make alignment unsigned. - (struct elf_obj_tdata): Make cverdefs and cverrefs unsigned. - * elf.c (assign_file_positions_for_segments): Always set adjust. - * elf32-d30v.c (bfd_elf_d30v_reloc): Initialize tmp_addr. Fully - parenthesize expression. - * elf32-m32r.c (m32r_elf_relocate_section): Always initialize h. - (m32r_elf_object_p): Return a value. - (m32r_elf_print_private_bfd_data): Change fprintf format string. - * elf32-mips.c (mips_elf_final_link): Initialize last. - (mips_elf_finish_dynamic_sections): Initialize last and dindx. - * elf32-v850.c (v850_elf_object_p): Return a value. - (v850_elf_print_private_bfd_data): Change fprintf format string. - * elfcode.h (elf_slurp_symbol_table): Change symcount and i to - unsigned long. - * elflink.h (elf_link_add_object_symbols): Change vernum to - unsigned int, and initialize it. Change fprintf format string. - (NAME(bfd_elf,size_dynamic_sections)): Cast -1 to bfd_size_type - when setting or comparing to soname_indx. - (elf_create_pointer_linker_section): Change num_symbols to - unsigned int. - * libcoff-in.h (coff_data_type): Change flags to flagword. - * peicode.h (pe_print_idata): Initialize idx. Change j to - bfd_size_type. Initialize hint_member. Remove useless test to - time_stamp. - (pe_print_edata): Change num_functions and num_names in struct - EDT_type to unsigned long. Remove cast. Change fprintf format - string. - * ppcboot.c (ppcboot_object_p): Change i to size_t. - * reloc.c (bfd_get_reloc_size): Change return type to unsigned - int. - * reloc16.c (bfd_coff_reloc16_relax_section): Change shrinks to - int *. Update uses. Change j to long. - * bfd-in2.h, libcoff.h: Rebuild. - -Fri Mar 27 10:10:46 1998 Catherine Moore - - * elf32-v850.c Remove definition of USE_REL. - (v850_elf_info_to_howto_rela): New function. - (v850_elf_perform_relocation): Renamed from - v850_elf_store_addend_in_insn. Removed replace argument. - (v850_elf_reloc): store the relocation in the addend field instead - of the insn. - (v850_elf_final_link_relocate): Now calls - v850_elf_perform_relocation. - (v850_elf_relocate_section): Remove code to generate REL - relocations. - -Thu Mar 26 13:32:17 1998 Ian Lance Taylor - - * coffcode.h (coff_new_section_hook): Set the type and storage - class in the native symbol information allocated for a new section - symbol. - -Thu Mar 26 10:13:41 1998 Nick Clifton - - * peicode.h: Chain together calls to - coff_bfd_copy_private_bfd_data and - coff_bfd_print_private_bfd_data. - - * coff-arm.c: Add prototypes for - coff_arm_bfd_print_private_bfd_data and - coff_arm_bfd_copy_private_bfd_data. - -Wed Mar 25 15:45:55 1998 Nick Clifton - - * coffcode.h (coff_mkobject_hook): Set private falgs even for a PE - build. - - * peicode.h: Call arm-coff private data functions after handling - pe private data. - - * coff-arm.c: Turn statics into globals so that they can be shared - both pe and pei backends. - -Wed Mar 25 15:19:38 1998 Ian Lance Taylor - - * aoutf1.h (sunos_set_arch_mach): Use bfd_mach_m68* rather than - plain numbers. - (sunos_write_object_contents): Likewise. - * aoutx.h (NAME(aout,machine_type)): Likewise. - * coffcode.h (coff_set_arch_mach_hook): Likewise. - -Wed Mar 25 13:59:24 1998 Andreas Schwab - - * archures.c (bfd_mach_m68*): Add definitions for various m68k - variants. - (bfd_default_scan): Remove m68k special cases. - * bfd-in2.h: Rebuild. - * mipsbsd.c (MY(write_object_contents)): Use bfd_mach_m68* rather - than plain numbers. - * sparclynx.c (NAME(lynx,set_arch_mach)): Likewise. - * cpu-m68k.c (arch_info_struct): Likewise. Add entry for - m68k:68000. - (bfd_m68k_arch): Set mach field to zero to signal no explicit - selection, change printable_name to just "m68k" and make that the - default instead of m68k:68020. - - * aout-tic30.c (NAME): Define this to avoid multiple definitions - from aoutx.h. - (MY_get_section_contents): Define as aout_32_get_section_contents - rather than NAME(aout,get_section_contents). - - * elf-m10300.c (elf32_mn10300_link_hash_table_create): Fix cast. - - * evax-alpha.c (evax_set_arch_mach): Only accept bfd_arch_alpha - and call bfd_default_set_arch_mach to do the real work. - -Wed Mar 25 10:41:35 1998 Richard Henderson - - * bout.c (BALX): Include return register g14 as part of the insn. - (BALX_MASK): New. - (calljx_callback): Use it. - -Wed Mar 25 11:19:28 1998 Ian Lance Taylor - - * libbfd-in.h (BFD_ALIGN): Cast this parameter to bfd_vma. - * libbfd.h: Rebuild. - - * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Change - byte_count to unsigned int. - (mn10300_elf_relax_section): Initialize internal_relocs. Remove - unused local variables. - - * evax-alpha.c (evax_close_and_cleanup): Remove unused local - variables er and er1. - - * cpu-v850.c: Include . - (scan): Case isdigit argument to unsigned char. - - From Yan Meroth : - * ihex.c (ihex_scan): Add extbase variable so that getting an - extended linear address record does not ignore any previous - extended address. - (ihex_write_object_contents): When writing out an extended linear - address record, zero out any previous extended address. - -Tue Mar 24 16:09:43 1998 Manfred Hollstein - - * ieee.c (do_one): Check section before dereferencing it. - (ieee_canonicalize_reloc): Likewise with src->relent.sym_ptr_ptr. - (ieee_generic_stat_arch_elt): Likewise with abfd->my_archive. - -Mon Mar 23 18:51:47 1998 Joel Sherrill - - * config.bfd: (sh*-*-rtems*): Switched from ELF to COFF. - -Mon Mar 23 14:23:36 1998 Nick Clifton - - * coff-arm.c: Add interworking functions to pe backends. - -Fri Mar 20 18:47:20 1998 Ian Lance Taylor - - * configure.in: Use AM_DISABLE_SHARED. - * aclocal.m4, configure: Rebuild with libtool 1.2. - -Fri Mar 20 11:25:41 1998 Nick Clifton - - * coff-arm.c (coff_arm_relocate_section): Better error messages - when interowrking conflucts occur. Courtesy of Jonathan Walton - and Tony Thompson. - (aoutarm_std_reloc_howto): Fixed bitsize fields of rightshifted - relocations. Patch courtesy of Jonathan Walton and Tony - Thompson. - -Fri Mar 20 02:26:43 1998 Richard Henderson - - * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Revert - part of Feb 22 change controling when to override the existing - symbol with the .plt entry. - -Wed Mar 18 09:26:25 1998 Nick Clifton - - * config.bfd (targ_cpu): Add thumb-pe target. - - * coffcode.h (OTHER_GLOBAL_CLASS): Support thumb external - functions in PE build. - -Sun Mar 8 23:37:26 1998 Stan Cox - - * config.bfd (sparclite-*-elf*): Added. - -Mon Feb 23 19:31:19 1998 Ian Lance Taylor - - * configure.in: Add elf.lo to elf shell variable. - * Makefile.am (BFD_LIBS): Remove elf.lo. - (BFD_LIBS_CFILES): Remove elf.c. - (BFD32_BACKENDS): Add elf.lo. - (BFD32_BACKENDS_CFILES): Add elf.c. - * configure, Makefile.in: Rebuild. - -1998-02-23 15:53 Richard Henderson - - * elf32-i386.c (elf_i386_relocate_section): A pc-relative - relocation against a non-local symbol should not have a dynamic - relocation. - -Mon Feb 23 16:17:08 1998 Ian Lance Taylor - - * peicode.h (coff_swap_filehdr_in): Don't set BFD flag HAS_SYMS in - COFF filehdr flags. - (pe_print_private_bfd_data): Print PE flags. From Mikey - . - -Sun Feb 22 20:39:00 1998 Richard Henderson - - * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Don't create - a plt entry when we can determine that we authoritatively define - the symbol. - -Sun Feb 22 20:33:05 1998 Richard Henderson - - * configure.in (COREFILE selection): Remove sparc-*-linux*. They - don't actually use trad-core, but a SunOS-style core file handled - by gdb directly. - * hosts/sparclinux.h: Remove. - -Wed Feb 18 15:31:06 1998 Ian Lance Taylor - - * peicode.h (pe_print_idata): If there is no .idata section, look - for the import tables in some other section. Make the initial - label line up better with the data. Print the import address - table even if there is no import name table. If the import - address table holds actual addresses, print them. - -Tue Feb 17 12:58:34 1998 Ian Lance Taylor - - * libbfd.c (bfd_seek): If fseek fails, save errno around call to - bfd_tell. If errno is EINVAL, set bfd_error_file_truncated, not - bfd_error_system_call. - -Fri Feb 13 13:11:33 1998 Ian Lance Taylor - - * Makefile.am (AUTOMAKE_OPTIONS): Define. - * configure, Makefile.in, aclocal.m4: Rebuild with automake 1.2e. - - From H.J. Lu : - * Makefile.am (libbfd_la_LDFLAGS): Define. - * Makefile.in: Rebuild. - -Thu Feb 12 17:31:11 1998 Ian Lance Taylor - - NetBSD patches from Gordon W. Ross : - * netbsd.h (MACHTYPE_OK): Define. - (MY(write_object_contents)): Use DEFAULT_ARCH and DEFAULT_MID when - calling N_SET_MACHTYPE, rather than having a switch. - * libaout.h (enum machine_type): Add M_PMAX_NETBSD, M_VAX_NETBSD, - and M_ALPHA_NETBSD. - * i386netbsd.c (MACHTYPE_OK): Don't define. - (DEFAULT_MID): Define. - * m68k4knetbsd.c (SEGMENT_SIZE): Don't define. - (MACHTYPE_OK): Don't define. - (DEFAULT_MID): Define. - * m68knetbsd.c: (MACHTYPE_OK): Don't define. - (DEFAULT_MID): Define. - * ns32knetbsd.c (MACHTYPE_OK): Don't define. - (DEFAULT_MID): Define. - * sparcnetbsd.c (MACHTYPE_OK): Don't define. - (DEFAULT_MID): Define. - - NetBSD patches from Gordon W. Ross : - * vaxnetbsd.c: New file. - * netbsd-core.c: Clean up. Remove unused macros. Use netbsd - rather than netbsd_core. - * targets.c (vaxnetbsd_vec): Declare. - (bfd_target_vector): Add vaxnetbsd_vec. If NETBSD_CORE is - defined, add netbsd_core_vec. - * configure.in: Set COREFILE for alpha*-*-netbsd* and - powerpc-*-netbsd* to netbsd-core.lo. If COREFILE is - netbsd-core.lo, set COREFLAG to -DNETBSD_CORE. - * config.bfd (alpha*-*-netbsd*): New target. - * Makefile.am: Rebuild dependencies. - (BFD32_BACKENDS): Add vaxnetbsd.lo. - (BFD32_BACKENDS_CFILES): Add vaxnetbsd.c. - * configure, Makefile.in: Rebuild. - - * configure.host: Remove the old shared library build stuff. We - now use libtool instead. - -Wed Feb 11 17:13:09 1998 Richard Henderson - - * tekhex.c (tekhex_write_object_contents): Call tekhex_init. - -Tue Feb 10 19:23:28 1998 H.J. Lu - - * configure.in: Take stab-syms.lo out of sparclinux_vec list. - * configure: Rebuild. - -Tue Feb 10 15:16:38 1998 Nick Clifton - * elf32-v850.c (remember_hi16s_reloc): New function. - (find_remembered_hi16s_reloc): New function. - (v850_elf_store_addend_in_insn): Use the above new functions to - match up HI6S relocs with LO16 relocs. - -Tue Feb 10 15:01:39 1998 Ian Lance Taylor - - * configure.in: Change -linux* to -linux-gnu*. - * config.bfd, configure.host: Likewise. - * configure: Rebuild. - -Mon Feb 9 19:40:59 1998 Nick Clifton - - * elf32-v850.c (v850_elf_store_addend_in_insn): Fix another - LO16/HI16S bug and improve comments about what is going on. - -Sat Feb 7 15:27:03 1998 Ian Lance Taylor - - * configure, aclocal.m4: Rebuild with new libtool. - -Fri Feb 6 14:48:20 1998 Nick Clifton - - * elf32-v850.c (v850_elf_merge_private_bfd_data): Do not complain - when merging v850 code into v850e/v850ea code. Do not initialise - output flags if the input is the default architecture. - -Fri Feb 6 11:50:22 1998 Jeffrey A Law (law@cygnus.com) - - * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): For BFD_RELOC_CTOR - get the size from bfd_arch_bits_per_address instead of directly - from the isa. - -Thu Feb 5 14:21:34 1998 Michael Meissner - - * libbfd-in.h (BFD_ALIGN): If rounding up would cause the address - to wrap, just return all 1's bits instead. - * libbfd.h: Regenerate. - -Thu Feb 5 11:51:05 1998 Ian Lance Taylor - - * coff-i386.c (coff_pe_i386_relocate_section): New static function - if COFF_WITH_PE. - (coff_relocate_section): If COFF_WITH_PE, define as - coff_pe_i386_relocate_section. - * coffcode.h (coff_write_object_contents): If COFF_IMAGE_WITH_PE, - skip empty sections, to match coff_write_object_contents. - - * elf64-mips.c (mips_elf64_swap_reloca_out): Swap out r_addend, - rather than swapping out r_offset twice. From Luke Deller - . - -Wed Feb 4 19:11:28 1998 Ian Lance Taylor - - * configure.in: Set libtool_enable_shared rather than - libtool_shared. Remove diversion hack. - * configure, Makefile.in, doc/Makefile.in, aclocal.m4: Rebuild - with new libtool. - -Wed Feb 4 16:10:21 1998 Brent Baccala - - * syms.c (struct stab_cache): Define. - (struct stab_find_info): Remove cached_offset, cached_stab, - cached_str, and cached_stroff fields. Add file_cache, - function_cache, and line_cache fields. - (_bfd_stab_section_find_nearest_line): Use extensive caching to - speed up searches. - -Wed Feb 4 13:34:22 1998 Ian Lance Taylor - - * peicode.h (pe_print_idata): Check for import of ordinal rather - than name. - (pe_print_edata): If there is no .edata section, look for the - export data in some other section. - -Mon Feb 2 20:05:42 1998 Jason Molenda (crash@bugshack.cygnus.com) - - * configure.in: Change version to 2.8.4. - * configure: Regenerated. - -Mon Feb 2 17:39:39 1998 Steve Haworth - - Add tms320c30 support: - * cpu-tic30.c: New file. - * aout-tic30.c: New file. - * coff-tic30.c: New file. - * archures.c (bfd_arch_tic30): Define. - (bfd_tic30_arch): Declare. - (bfd_archures_list): Add bfd_tic30_arch. - * targets.c (bfd_target_vector): Add tic30_aout_vec and - tic30_coff_vec. - * reloc.c (BFD_RELOC_TIC30_LDP): Define. - * coffcode.h (coff_set_arch_mach_hook): Add tic30 case. - (coff_set_flags): Likewise. - * config.bfd (tic30-*-*aout*, tic30-*-*coff*): New targets. - * configure.in (tic30_aout_vec, tic30_coff_vec): New vectors. - * Makefile.am: Rebuild dependencies. - (ALL_MACHINES): Add cpu-tic30.lo. - (ALL_MACHINES_CFILES): Add cpu-tic30.c. - (BFD32_BACKENDS): Add aout-tic30.lo and coff-tic30.lo. - (BFD32_BACKENDS_CFILES): Add aout-tic30.c and coff-tic30.c. - * configure, Makefile.in, bfd-in2.h, libbfd.h: Rebuild. - -Mon Feb 2 12:25:12 1998 Nick Clifton - - * elf32-v850.c (v850_elf_store_addend_in_insn): Allow HI16_S reloc - to lag behind LO16 reloc by a couple of instructions. - -Mon Feb 2 14:09:46 1998 Ian Lance Taylor - - * Makefile.am ($(srcdir)/bfd-in2.h): Add dummy command to force - make to reexamine the file timestamp. - ($(srcdir)/libbfd.h, $(srcddir)/libcoff.h): Likewise. - - * elf64-alpha.c (ELF_MAXPAGESIZE): Change to 0x10000 from - 0x100000. - -Fri Jan 30 19:07:07 1998 Geoff Keating - - * elf32-ppc.c (ppc_elf_create_dynamic_sections): New procedure - to create .dynsbss and .rela.sbss sections. - (ppc_elf_adjust_dynamic_symbol): Put space for small data to be - copied from dynamic objects into .sbss. - (ppc_elf_size_dynamic_sections): Strip .rela.sbss if we don't - use it. Correct typo of .rela.sdata2. - (ppc_elf_finish_dynamic_symbol): Generate reloc to where we - put the data, which may now be in .sbss. - (ppc_elf_relocate_section): A SDAREL16 reloc can be in dynsbss. - (elf_backend_create_dynamic_sections): Define as - ppc_elf_create_dynamic_sections. - - * elf32-ppc.c (ppc_elf_check_relocs): Don't emit R_PPC_REL* relocs - against _GLOBAL_OFFSET_TABLE_. - (ppc_elf_relocate_section): Don't emit R_PPC_REL32 relocs in - shared libraries which refer to local symbols. Make sure that the - test for allocating space for a reloc in a shared object is the - same as the test for emitting a reloc. - -Thu Jan 29 15:55:35 1998 J.J. van der Heijden - - * config.bfd (i[3456]-*-mingw32*): New target. - * acinclude.m4 (BFD_BINARY_OPEN): Check for mingw32. - * aclocal.m4, configure: Rebuild. - -Wed Jan 28 13:41:26 1998 Ian Lance Taylor - - * elf.c (_bfd_elf_close_and_cleanup): Only check the strtab if we - have a bfd_object. - -Tue Jan 27 21:43:55 1998 Richard Henderson - - Sparc v9 ABI compliant PLT: - * elf64-sparc.c (PLT_HEADER_SIZE): V9 ABI uses 4 entries. - (plt_templates, sparc64_elf_build_plt_entry): Delete. - (LARGE_PLT_THRESHOLD): New define. - (GOT_RESERVED_ENTRIES): V9 ABI only uses 1. - (sparc64_elf_build_plt): New function. - (sparc64_elf_plt_entry_offset): Likewise. - (sparc64_elf_plt_ptr_offset): Likewise. - (sparc64_elf_adjust_dynamic_symbol): Change h->plt_offset to - contain the index for convenience. Skip the initial entries - in .rela.plt. - (sparc64_elf_size_dynamic_sections): Zero the allocated contents - memory for the benefit of .rela.plt. - (sparc64_elf_relocate_section): Call sparc64_elf_plt_entry_offset. - (sparc64_elf_finish_dynamic_symbol): Kill template stuff. Use - sparc64_elf_plt_entry_offset & sparc64_elf_plt_ptr_offset for reloc. - (sparc64_elf_finish_dynamic_sections): DT_PLTGOT points to .plt. - Call sparc64_elf_build_plt. - (elf_backend_want_got_plt): No. - (elf_backend_plt_readonly): No. - (elf_backend_plt_alignment): 8. - - * elf.c (_bfd_elf_close_and_cleanup): New function; free the shstrtab. - * elf-bfd.h (_bfd_elf_close_and_cleanup): Declare it. - * elfxx-target.h (bfd_elfNN_close_and_cleanup): Arrange for it - to be called. - -Tue Jan 27 21:45:15 1998 Jeffrey A Law (law@cygnus.com) - - * archures.c (bfd_mach_mips*): Add definitions for various MIPS - processors. - * cpu-mips.c (arch_info_struct): Add mips variants. - * bfd-in2.h: Rebuilt. - -Tue Jan 27 15:06:04 1998 Nick Clifton - - * coff-arm.c (coff_arm_relocate_section): Preserve the contents of - t2a3_b_insn. - -Tue Jan 27 12:47:27 1998 Robert Lipe - - * config.bfd (i[3456]86-sco3.2v5*): ELF now the default. - (i[3456]86sco3.2v5*coff): New target. - -Mon Jan 26 15:41:30 1998 Ian Lance Taylor - - * bfd-in2.h: Rebuild with changes to chew--tab expansion. - -Thu Jan 22 21:26:48 1998 Richard Henderson - - * bfd.c (bfd_get_error_handler): Add orthogonal function. - * bfd-in2.h: Regenerate. - -Thu Jan 22 21:13:39 1998 Richard Henderson - - * tekhex.c (tekhex_write_object_contents): Check for no symbols. - -Wed Jan 21 21:19:03 1998 Ian Lance Taylor - - * coff-i386.c (coff_i386_rtype_to_howto): If COFF_WITH_PE, don't - adjust addend for an output common symbol (from Jimmy Blair - ). If COFF_WITH_PE, adjust addend for PC relative - defined symbol to counteract adjustment made in generic relocation - code. - - * dwarf2.c: Include sysdep.h, not stdio.h and stdlib.h. - -Wed Jan 21 21:16:06 1998 Manfred Hollstein - - * coff-m88k.c (GET_SCNDHR_NRELOC): Fix typo in macro name. - (GET_SCNDHR_NLNNO): Likewise. - -Mon Jan 19 12:49:52 1998 Ian Lance Taylor - - * cpu-sh.c (arch_info_struct): Correct next field of sh3e. - -Wed Jan 14 17:23:27 1998 Nick Clifton - - * elf32-m32r.c: Add macros to handle NOP insertion. - -Wed Jan 14 16:15:22 1998 Richard Henderson - - * xcofflink.c (xcoff_mark_symbol): Don't mark the absolute section. - (xcoff_mark): Likewise. - (xcoff_build_ldsyms): Mark absolute symbols. - -Wed Jan 14 16:03:11 1998 Richard Henderson - - * bout.c (b_out_write_object_contents): Sort symbols before output - to keep {CALL,BAL}NAME symbols adjacent. - (b_out_symbol_cmp): New function. - -For older changes see ChangeLog-9697 +For older changes see ChangeLog-9899 Local Variables: mode: change-log diff --git a/gnu/dist/toolchain/bfd/ChangeLog-9899 b/gnu/dist/toolchain/bfd/ChangeLog-9899 new file mode 100644 index 000000000000..c6348c48667d --- /dev/null +++ b/gnu/dist/toolchain/bfd/ChangeLog-9899 @@ -0,0 +1,5595 @@ +1999-12-29 Richard Henderson + + * elflink.h (bfd_elf,size_dynamic_sections): Don't export all + if no dynamic sections created. + +1999-12-27 Nick Clifton + + * peicode.h (pe_bfd_object_p): Only define for PE format + targets. + +1999-12-17 Nick Clifton + + * coff-i386.c (i3coff_object_p): Delete. + (i386coff_vec): Replace reference to i3coff_object_p with a + reference to coff_object_p. + + * coff-mcore.c (pe_object_p): Delete. + + * peicode.h (pe_bfd_object_p): New function: Detect the + presence of a PE format COFF object file. Also detect and + warn about the presence of LINK6 format Image Library Format + object files. + +1999-12-16 Nick Clifton + + * coff-arm.c (NUM_ELEM): New macro. + (NUM_RELOCS): New macro: The number of known ARM relocs. + (RTYPE2HOWTO): Return NULL if the reloc type is out of range. + (coff_arm_rtype_to_howto): Return NULL if the reloc type is out + of range. + (bfd_arm_process_before_allocation): Produce a warning message if + an out of range symbol index is encountered. + +1999-12-14 Nick Clifton + + * elflink.h (is_global_symbol_definition): New Function: Return + true iff the symbol is being given a global definition in this + bfd. + (elf_link_is_defined_archive_symbol): Do not bother processing + symbols for an archive element that has already been included + in the link. + Use is_global_symbol_definition(). + +1999-12-09 Andrew Cagney + + * config.bfd: Add support for sparc-*-netbsdelf* and + sparc-*-netbsdaout*. + +1999-12-13 Nick Clifton + + * elflink.h (elf_link_is_defined_archive_symbol): Check to see + if the symbol is in the common section. + +1999-12-10 Nick Clifton + + * elflink.h (elf_link_is_defined_archive_symbol): New + function: Decide if a symbol, in an archive map is there + because it is defined in the archive element, or because it is + just another common declaration of it. + (elf_link_add_archive_symbols): Use + elf_link_is_defined_archive_symbol to decide if an archive + element contain a reference to a common symbol should be + linked in or not. + +1999-12-10 Nick Clifton + + * elflink.h: Revert previous patch. + * targets.c: Revert previous patch. + * libbfd-in2.h: Revert previous patch. + * libbfd.h: Revert previous patch. + * elfxx-target.h: Revert previous patch. + * archive.c: Revert previous patch. + * aout-target.h: Revert previous patch. + * aout-tic30.h: Revert previous patch. + * bfd.c: Revert previous patch. + * coff-alpha.c: Revert previous patch. + * coff-rs6000.c: Revert previous patch. + * elf64-mips.c: Revert previous patch. + * ieee.c: Revert previous patch. + * libecoff.h: Revert previous patch. + * oasys.c: Revert previous patch. + * som.c: Revert previous patch. + * vms.c: Revert previous patch. + +1999-12-09 Nick Clifton + + * elflink.h (elf_link_add_archive_symbols): Add an archive + element even if contains a symbol which is currently only + considered to be a common. + + * targets.c (struct bfd_target): Add new field + _bfd_allow_commons_in_armap. + * bfd-in2.h:Regenerate. + + * libbfd-in2.h (_bfd_noarchive_allow_commons_in_armap): + Define. + (_bfd_archive_bsd_allow_commons_in_armap): Define. + * libbfd.h: Regenerate. + + * elfxx-target.h: If using COFF archive map, override + definition of allow_commons_in_armap and replace with + bfd_false. + + * archive.c (bfd_compute_and_write_armap): Do not place common + symbols into the archive map unless _bfd_allow_commons_in_armap + returns true. + + * aout-target.h (MY_allow_commons_in_armap): Define. + * aout-tic30.h (MY_allow_commons_in_armap): Define. + * bfd.c (bfd_allow_commons_in_armap): Define. + * coff-alpha.h (alpha_ecoff_allow_commons_in_armap): Define. + * coff-rs6000.h (xcoff_allow_commons_in_armap): Define. + * elf64-mips.c (bfd_elf64_allow_commons_in_armap): Define. + * ieee.c (ieee_ecoff_allow_commons_in_armap): Define. + * libecoff.h (_bfd_ecoff_allow_commons_in_armap): Define. + * oasys.c (oasys_allow_commons_in_armap): Define. + * som.c (som_allow_commons_in_armap): Define. + * vms.c (vms_allow_commons_in_armap): Define. + +1999-12-07 Jim Blandy + + Add support for SSE registers in ELF core files. + * elf.c (elfcore_make_note_pseudosection): New function. + (elfcore_grok_prfpreg): Use it. + (elfcore_grok_prxfpreg): New function. + (elfcore_grok_note): Recognize Linux NT_PRXFPREG notes. + +1999-12-03 Ian Lance Taylor + + * elf32-mips.c (mips_elf_calculate_relocation): Divide R_MIPS_PC16 + value by 4 before storing it back in the field. From + Koundinya. K . + +Tue Nov 30 22:41:14 1999 Jeffrey A Law (law@cygnus.com) + + * archures.c (bfd_mach_am33): Define. + * bfd-in2.h: Rebuilt. + * cpu-m10300.c (bfd_am33_arch): Add to the mn103 architecture list + * elf-m10300.c (mn10300_elf_relax_section): Handle am33 instructions. + (compute_function_info): Handle additional registers saved by + movm on the am33. + (elf_mn10300_mach): Handle E_MN10300_MACH_AM33. + (_bfd_mn10300_elf_final_write_processing): Handle bfd_mach_am33. + +1999-11-29 Jim Blandy + + * elf.c (bfd_get_elf_phdrs, bfd_get_elf_phdr_upper_bound): New + functions. + * bfd-in2.h (bfd_get_elf_phdrs, bfd_get_elf_phdr_upper_bound): New + declarations. + +1999-11-27 Michael Meissner + + * reloc.c (BFD_RELOC_ALPHA_USER_LITERAL): New relocation for + internal use within gas for alpha explicit relocations. + (BFD_RELOC_ALPHA_USER_LITUSE_BASE): Ditto. + (BFD_RELOC_ALPHA_USER_LITUSE_BYTOFF): Ditto. + (BFD_RELOC_ALPHA_USER_LITUSE_JSR): Ditto. + (BFD_RELOC_ALPHA_USER_GPDISP): Ditto. + (BFD_RELOC_ALPHA_USER_GPRELHIGH): Ditto. + (BFD_RELOC_ALPHA_USER_GPRELLOW): Ditto. + + * elf64-alpha.c (elf64_alpha_reloc_map): Add mappings for + BFD_RELOC_ALPHA_USER_*. + + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate. + +1999-11-26 Fred Fish + + * elf.c (elfcore_read_notes): Add prototype for static function. + (_bfd_elf_make_section_from_phdr): Renamed from bfd_section_from_phdr. + (bfd_section_from_phdr): Replacement function that calls + _bfd_elf_make_section_from_phdr for generic segment types and + backend fucntion pointed to by elf_backend_section_from_phdr for + backend specific segment types. + (_bfd_elfcore_section_from_phdr): Remove call to elfcore_read_notes, + now called by _bfd_elf_make_section_from_phdr. Note that this func + is now just a stub between the caller and bfd_section_from_phdr. + + * elf-bfd.h (struct elf_backend_data): Add new function pointer + elf_backend_section_from_phdr. + (elf_backend_section_from_phdr): Add prototype. + + * elfxx-target.h (elf_backend_section_from_phdr): Define default. + (elfNN_bed): Add elf_backend_section_from_phdr. + +1999-11-25 Nick Clifton + + * coff-arm.c (bfd_arm_get_bfd_for_interworking): Add + SEC_CODE and SEC_READONLY flags to glue sections. + + * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Add + SEC_CODE and SEC_READONLY flags to glue sections. + +1999-11-20 Nick Clifton + + * coff-mcore.c (coff_mcore_relocate_section): Fix typo in previous + delta. + +1999-11-19 Catherine Moore + + * elf32-m68k.c (elf_cpu32_plt0_entry): Fix encoding. + (elf_cpu32_plt_entry): Likewise. + +1999-11-18 Nick Clifton + + * coff-mcore.c (coff_mcore_rtype_to_howto): Special case handling + for RVA relocs. + (coff_mcore_relocate_section): Initialise addend to 0. + Special case processing of RVA reloc. + +1999-11-17 Richard Henderson + + * elf-bfd.h (struct elf_backend_data): Reorder collect and + type_change_ok; add sign_extend_vma. + * elf32-mips.c (elf_backend_sign_extend_vma): Define. + * elfcode.h (elf_swap_symbol_in): Mind be->sign_extend_vma. + (elf_swap_shdr_in, elf_swap_phdr_in): Likewise. + * elfxx-target.h (elf_backend_sign_extend_vma): Default. + (elfNN_bed): Follow struture changes. + +1999-11-09 Ian Lance Taylor + + * libbfd.c (bfd_read): Check result of read against desired result + using !=, not <. + (_bfd_generic_get_section_contents): Set bfd_error if the seek is + invalid compared to the section size. + + * ieee.c (ieee_slurp_debug): Get the length of the debug + information right if there is no data part. + +Tue Nov 2 01:44:41 1999 Jeffrey A Law (law@cygnus.com) + + * som.c (som_fixup_formats): Improve handling of R_AUX_UNWIND, + R_LINETAB, R_LINETAB_ESC, and R_COMMENT. + +1999-10-28 Ian Lance Taylor + + * elflink.h (elf_bfd_final_link): Make last_local signed. + +1999-10-27 Ian Lance Taylor + + * stabs.c (_bfd_link_section_stabs): Make sure .stabstr section + starts with a zero. + +Sat Oct 23 17:36:12 1999 Andrew Cagney + + * archures.c: Add definitions bfd_mach_d10v, bfd_mach_d10v_ts2 and + bfd_mach_d10v_ts3. + * cpu-d10v.c (d10v_ts3_info, d10v_ts2_info): Add. + * bfd-in2.h: Regenerate. + +1999-10-15 Andrew Haley + + * dwarf1.c (parse_die): Fail to parse a die if its length is zero. + +Sun Oct 17 17:19:00 1999 Jeffrey A Law (law@cygnus.com) + + * libhppa.h (bfd_hppa_insn2fmt): Change to return an int. + +1999-10-08 Ian Lance Taylor + + * elflink.h (elf_merge_symbol): When overriding a weak symbol with + a defined symbol in a shared library, clear the DEF_DYNAMIC flag + too. + +Fri Oct 8 13:03:45 1999 Geoffrey Keating + + * elf32-mips.c (mips_elf_calculate_relocation): R_MIPS_LITERAL + relocs also need the GP value. + (_bfd_mips_elf_relocate_section): Handle unpaired LO16 relocs + properly. Handle sign-extension for R_MIPS_64 correctly. Correct + the GP value for R_MIPS_LITERAL relocs too. Handle + R_MIPS_64 relocs properly on big-endian MIPS. + (mips_elf_sign_extend): Behave properly with 'long long'. + (mips_elf_highest): Correct typo. + +Mon Oct 4 17:49:45 1999 Nick Clifton + + * cpu-m32r.c (arch_info_struct): New static global. + (bfd_m32r_arch): Refer to it. + * elf32-m32r.c (m32r_elf_object_p): Recognize E_M32RX_ARCH. + (m32r_elf_print_private_bfd_data): Ditto. + (m32r_elf_final_write_processing): Handle bfd_mach_m32rx. + * archures.c (bfd_mach_m32rx): Define it. + * bfd-in2.h: Rebuild. + +1999-09-28 Fred Fish + + * targets.c (cisco_core_vec): Replaced with two new vecs ... + (cisco_core_big_vec): Add new bigendian vec. + (cisco_core_little_vec): Add new little endian vec. + + * cisco-core.c (CRASH_INFO): Fixed offset replaced with ... + (crash_info_locs): Add array of possible offsets. + (MASK_ADDR): Mask to apply to crash info offset. + (crashinfo_external): Add textbase, database, bssbase and + turn into a typedef. + (cisco_core_file_validate): Renamed from cisco_core_file_p. + Many small changes to account for additional hardware versions. + Pick a reasonable size for ".reg" section. Add a ".crash" + section to allow access to crashinfo_external struct. + (cisco_core_file_p): New version of this function that + iterates over crash_info_locs, calling cisco_core_file_validate. + (cisco_core_vec): Old big endian only vec replaced with ... + (cisco_core_big_vec): Add big endian version. + (cisco_core_little_vec): Add little endian version. + + * configure.in (cisco_core_vec): Split to two new vectors ... + (cisco_core_big_vec): New target vector. + (cisco_core_little_vec): New target vector. + * configure: Regenerate. + * config.bfd (targ): For m68*-*-aout* targ, change cisco_core_vec + to cisco_core_big_vec in targ_selvecs. + +1999-09-28 Geoffrey Keating + + * elf32-mips.c (mips_elf_relocate_hi16): Unused, delete. + (mips_elf_relocate_got_local): Unused, delete. + (mips_elf_relocate_global_got): Unused, delete. + +1999-09-24 Fred Fish + + * elf.c (bfd_section_from_phdr): Add typename variable. Use p_type + to initialize it to something meaningful. Then use it to generate + more useful segment names. + +Sun Sep 19 12:16:47 1999 Jeffrey A Law (law@cygnus.com) + + * som.c (NO_PCREL_MODES): Define if the system does not define + R_SHORT_PCREL_MODE. + (hppa_som_gen_reloc_type): Handle both short and long pcrel branches. + (som_write_fixups): Eliminate redundant pcrel mode relocs. Handle + R_LONG_PCREL_MODE and R_SHORT_PCREL_MODE + * libhppa.h (dis_assemble_22): New function. + (bfd_hppa_insn2fmt): Handle long branch. + + * libhppa.h (bfd_hppa_insn2fmt): Decode and handle formats found + in PA2.0. + +1999-09-17 Alan Modra + + * coff-i386.c (coff_i386_reloc_type_lookup): Support BFD_RELOC_16, + BFD_RELOC_16_PCREL, BFD_RELOC_8, BFD_RELOC_8_PCREL relocs. + (reloc_howto_type howto_table): Tidy comments and whitespace. + +1999-09-17 Nick Clifton + + * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Undo + previous delta. Set sec->gc_mark instead. + +Thu Sep 16 11:21:13 1999 Catherine Moore + + * elf32-m68k.c (elf_cpu32_plt0_entry): Use a1 instead of a0. + (elf_cpu32_plt_entry): Likewise. + +Thu Sep 16 10:48:17 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_final_write_processing): Turn on TRAPNIL. + + * elf-hppa.h (elf_hppa_final_link): If unable to find __gp in the + symbol table, then just compute a suitable value (but do not + create a __gp symbol). + + * elf-hppa.h (elf_hppa_relocate_section): Allow undefined + symbols when building shared libraries. + (elf_hppa_final_link_relocate): Correct handling of PCREL + relocations against undefined symbols. + +1999-09-16 Nick Clifton + + * elf32-arm.h (bfd_elf32_arm_get_bfd_for_interworking): Mark + interworking sections as linker created so that they will not + be removed by garbage collection. + +Wed Sep 15 02:31:57 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_final_link): Revamp __gp handling. + (elf_hppa_final_link_relocate): Consistently create an absolute + address, then subtract out the value of __gp. + +1999-09-14 Michael Meissner + + * configure.in (Canonicalization of target names): Remove adding + ${CONFIG_SHELL} in front of $ac_config_sub, since autoconfig 2.14 + generates $ac_config_sub with a ${CONFIG_SHELL} already. + * configure: Regenerate. + +1999-09-14 Nick Clifton + + * elf32-m32r.c (ELF_MAXPAGESIZE): Change to 0x1 (at request of + Mitsubishi). + +Mon Sep 13 20:01:47 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_record_segment_addrs): New function. + (elf_hppa_final_link): Initialize text_segment_base and + data_segment_base. + (elf_hppa_final_link_relocate): Handle SEGREL relocations. + + * elf-hppa.h (elf_hppa_final_link): Remove unused variables. + (elf_hppa_final_link_relocate): Likewise. + (elf_hppa_relocate_insn): Likewise. + (elf_hppa_relocate_section): Initialize HOWTO. + +1999-09-13 Donn Terry + + * coffcode.h (styp_to_sec_flags): Further refinement of COMDAT + handling to support both GNU and MS objects. + + * coffcode.h (coff_write_object_contents): Don't check reloc_count + when determining whether to set F_RELFLG. + +1999-09-13 Philip Blundell + + * elf32-arm.h (elf32_arm_final_link_relocate): Don't range-check + PC24 relocs if the target is an undefined weak symbol. + (arm_add_to_rel): Fix compiler warning. + (elf32_arm_plt0_entry): Correct comments. + +1999-09-13 Alan Modra + + * elfcode.h (write_relocs): Check for the_bfd NULL when handling + an absolute symbol in REL relocs. + +Sun Sep 12 23:47:58 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_final_link_relocate): Handle SECREL32. + Stub SEGREL32. Return an error for any relocation not handled. + +1999-09-12 Ian Lance Taylor + + * cofflink.c (coff_link_add_symbols): Look for special MSVC string + constant symbols, and avoid multiple definition errors on them. + +1999-09-12 Donn Terry + + * libbfd.c (bfd_log2): Rewrite to avoid infinite loop if most + significant bit is set. + +1999-09-11 Ian Lance Taylor + + * coff-ppc.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define. + + * elfcode.h (write_relocs): Handle an absolute symbol in REL + relocs as we do for RELA relocs. + +1999-09-11 Donn Terry + + * libpei.h (_bfd_pei_final_link_postscript): Declare. + (coff_final_link_postscript): Define. + * peigen.c (_bfd_pei_swap_aouthdr_out): Don't set value for data + directory entries here. + (_bfd_pei_final_link_postscript): New function. + + * peigen.c (_bfd_pei_swap_scnhdr_out): Remove code which sets + section flags based on the section name. + + * peicode.h (coff_swap_scnhdr_in): If COFF_IMAGE_WITH_PE, the + get the overflow of the s_nlnno field from the s_nreloc field. + * peigen.c (_bfd_pei_swap_scnhdr_out): If doing a final link, swap + the s_nlnno overflow of the .text section into the s_nreloc + field. + + * peigen.c (add_data_entry): Declare. + (pei_swap_aouthdr_out): Get image size right. Set linker version + more intuitively. + (pei_swap_scnhdr_out): Test for UNINIT section, not .bss. + (pe_print_idata): Code cleanup, print more info, get rid of (now) + extraneous ImageBase. + (pe_print_edata): Likewise. + (pe_print_pdata): Likewise. Print exception entries. + (pe_print_reloc): Likewise. Print MIPS_JMPADDR. + (tbl): Make const, add "UNKNOWN". + (_bfd_pe_print_private_bfd_data_common): Print timestamp. + (_bfd_pe_bfd_copy_private_bfd_data_common): Don't copy deleted + section data directory. + (_bfd_pe_bfd_copy_private_section_data): Copy pe_flags. + + * libpei.h (_bfd_pe_bfd_get_symbol_info): Declare. + * peigen.c (_bfd_pe_bfd_get_symbol_info): New function. + * peicode.h (coff_get_symbol_info): Define. + + * config.bfd (i[3456]86-*-interix*): Set targ_cflags to + -DSTRICT_PE_FORMAT. + * coffcode.h (styp_to_sec_flags): Check STRICT_PE_FORMAT rather + than __INTERIX. + (coff_classify_symbol): Re-revert 1999-08-08 patch if + STRICT_PE_FORMAT. + + * libpei.h: New file, broken out of peicode.h. + * peigen.c: New file, broken out of peicode.h. + * peicode.h: A bunch of code moved out to libpei.h and peigen.c. + * configure.in: Add peigen.lo to list of files required for each + PE target. + * Makefile.am: Rebuild dependencies. + (BFD32_BACKENDS): Add peigen.lo. + (BFD32_BACKENDS_CFILES): Add peigen.c. + (SOURCE_HFILES): Add libpei.h. + * configure, Makefile.in: Rebuild. + + * peicode.h (coff_swap_scnhdr_in): Don't check for a special + section name of _BSS; check IMAGE_SCN_CNT_UNINITIALIZED_DATA + instead. Don't clear the s_paddr field for an uninitialized data + section. + + * coffcode.h (coff_mkobject_hook): Set timestamp field in + coff_data_type to f_timdat. + * peicode.h (pe_mkobject_hook): Likewise. + + * peicode.h (coff_swap_filehdr_in): Check the NT executable magic + number if COFF_IMAGE_WITH_PE. + + * coffcode.h (coff_mkobject_hook): If COFF_WITH_PE, set HAS_DEBUG + to the reverse of IMAGE_FILE_DEBUG_STRIPPED. + (coff_write_object_contents): Set IMAGE_FILE_DEBUG_STRIPPED if + there is no SEC_DEBUGGING section. + * peicode.h (pe_mkobject_hook): Set HAS_DEBUG to the reverse of + IMAGE_FILE_DEBUG_STRIPPED. + + * pe-i386.c (COFF_LONG_FILENAMES): Define. + (COFF_SECTION_ALIGNMENT_ENTRIES): Define. + * pei-i386.c (COFF_LONG_FILENAMES): Define. + (COFF_SECTION_ALIGNMENT_ENTRIES): Define. + + * coffswap.h (IMAGE_BASE): Don't define. + * pei-arm.c (IMAGE_BASE): Don't define. + * pei-i386.c (IMAGE_BASE): Don't define. + * pei-mcore.c (IMAGE_BASE): Don't define. + * pei-ppc.c (IMAGE_BASE): Don't define. + + * cofflink.c (_bfd_coff_link_input_bfd): When writing out a + symbol, switch on the class when determining whether to modify the + value. For PE, don't modify the value of a C_FCN symbol not named + .bf. + + * libbfd-in.h (_bfd_abort): Declare. + (abort): Define. + * bfd.c (_bfd_abort): New function. + * libbfd.h: Rebuild. + + * coffcode.h (coff_set_alignment_hook): Delete POWERPC_LE_PE + special handling. + + * cofflink.c (_bfd_coff_link_input_bfd): If a symbol is stripped, + don't write out the associated line numbers. + + * cofflink.c (_bfd_coff_write_global_sym): Handle section symbol + aux entries. + + * cofflink.c (coff_link_add_symbols): Don't warn about symbol type + changes when the base type is unknown. + + * coffgen.c (coff_print_symbol): Fix printing of aux record for + function symbols. + + * syms.c (BSF_DEBUGGING_RELOC): Define. + * coffcode.h (coff_slurp_symbol_table): If PE, set BSF_DEBUGGING + for C_FCN/C_EFCN symbols, and set BSF_DEBUGGING_RELOC for such + symbols named .bf. + * coffgen.c (fixup_symbol_value): Relocate a symbol which has + BSF_DEBUGGING_RELOC set. + * bfd-in2.h: Rebuild. + +1999-09-10 Ian Lance Taylor + + * ecoff.c (bfd_debug_section): Update initialization for new + comdat_info field. + (_bfd_ecoff_styp_to_sec_flags): Add section parameter. + * libecoff.h (_bfd_ecoff_styp_to_sec_flags): Update declaration. + +1999-09-10 H.J. Lu + + * coff-alpha.c (alpha_ecoff_backend_data): Initialize the new + _bfd_filnmlen field. + * coff-mips.c (mips_ecoff_backend_data): Likewise. + +Fri Sep 10 00:35:14 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_final_link_relocate): Create .opd entries + for FPTR relocs involving local symbols. + + * elf-hppa.h (elf_hppa_final_link_relocate): Get the right + value for the stub address in a call through a stub. + Install the value for a local symbol directly into the DLT + instead of generating a reloc. Correctly handle FPTR64 relocs. + + * elf-hppa.h (elf_hppa_unmark_useless_dynamic_symbols): New function. + (elf_hppa_remark_useless_dynamic_symbols): Similarly. + (elf_hppa_final_link): Call them. + +1999-09-10 Ian Lance Taylor + + * elflink.h (elf_fix_symbol_flags): Move weakdef handling here... + (elf_adjust_dynamic_symbol): ...from here. + +Wed Sep 8 17:56:11 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_howto_table); There is no DIR64WR, DIR64DR + relocation, remove them. SECREL64->LTOFF16WF. + (elf_hppa_final_link_relocate): Handle LTOFF* relocations. Handle + DIR* relocations. + (elf_hppa_relocate_insn): Similarly. + + * elf-hppa.h (elf_hppa_final_link_relocate): Handle PLTOFF* relocs. + (elf_hppa_relocate_insn): Similarly. + + * elf-hppa.h (elf_hppa_final_link_relocate): Handle DPREL* and + GPREL* relocations. + (elf_hppa_relocate_insn): Similarly. + + * elf-hppa.h (elf_hppa_link_final_relocate): Fix typos. + Handle LTOFF_TP* relocs. + (elf_hppa_relocate_insn): Similarly. + + * elf-hppa.h (elf_hppa_final_link_relocate): Handle PCREL* relocs. + Consistently deal with addends. Handle DLTIND14F and DLTREL14F. + (elf_hppa_relocate_insn): Handle PCREL* relocs. + + * elf-hppa.h (elf_hppa_final_link_relocate): Handle LT_OFF_FPTR*, + DIR32, DIR64 and FPTR64 relocations. + (elf_hppa_relocate_insn): Similarly. + + * elf-hppa.h (elf_hppa_final_link): Set the value of __gp to the + address of the .PARISC.global section. + (elf_hppa_relocate_section): Lookup and pass the PA64 hash + table entry elf_hppa_final_link_relocate. Do not give a warning + for a reloc against an external symbol if it has a PA64 hash + table entry. + (elf_hppa_final_link_relocate): Significantly rework. Handle + DLTIND relocations. Compute the final value of the relocation + before passing the value of elf_hppa_relocate_insn. + (elf_hppa_relocate_insn): Revamp to handle just bit tiwiddling + relocation support. Handle DLTIND relocation requests just like + DLTREL relocation requests. Simplify branch handling. + +1999-09-08 Ulrich Drepper + + * elf-hppa.h (elf_hppa_relocate_section): Catch problems with + non-allocated section as done in i386 version. + (elf_hppa_final_link_relocate): Uncomment R_PARISC_14F in switch + statement since this is no know relocation. + +Tue Sep 7 17:25:12 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14F + relocs. + (elf_hppa_relocate_insn): Similarly. + + * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14WR and + DLTREL14WD relocs. + (elf_hppa_relocate_insn): Similarly. + + * elf-hppa.h (elf_hppa_final_link_relocate): Handle DLTREL14R and + DLTREL21L relocs. Pass the output bfd to elf_hppa_relocate_insn. + Pass the relocate type rather than the insn format to + elf_hppa_relocate_insn. + (elf_hppa_relocate_insn): Make switch dependent on relocation type + rather than the opcode. Handle DLTREL21L and DLTREL14R relocs. + +1999-09-07 Ian Lance Taylor + + * coffcode.h (bfd_coff_backend_data): Add _bfd_filnmlen field. + (bfd_coff_filnmlen): Define. + (bfd_coff_std_swap_table): Initialize new field. + * coffgen.c (coff_fix_symbol_name): Use bfd_coff_filnmlen rather + than FILNMLEN. + (coff_write_symbols): Likewise. + (coff_get_normalized_symtab): Likewise. + * coff-sh.c (bfd_coff_small_swap_table): Initialize new field. + * libcoff.h: Rebuild. + +1999-09-06 Donn Terry + + * coffcode.h (sort_by_secaddr): New static function if + COFF_IMAGE_WITH_PE. + (coff_compute_section_file_positions): If COFF_IMAGE_WITH_PE, sort + sections by VMA when assigning target_index values. Always set + virt_size. + + * libcoff-in.h (struct pei_section_tdata): Add pe_flags field. + * coffcode.h (coff_set_alignment_hook) [COFF_WITH_PE version]: Set + pe_flags field. + * libcoff.h: Rebuild. + + * coffcode.h (coff_set_custom_section_alignment): Add const to + declaration to match definition. + (coff_write_object_contents): Don't set F_AR32W(R)? if + COFF_WITH_PE. + + * coff-i386.c (in_reloc_p): Add declaration. + (i386coff_vec): Simplify initialization of + application_section_flags. + + * coffcode.h (sec_to_styp_flags): Write separate COFF_WITH_PE + version. Move COFF_WITH_PE specific code to new version. + (stype_to_sec_flags): Likewise. Add section parameter. + * coffgen.c (make_a_section_from_file): Set target_index before + calling styp_to_sec_flags. Pass section to styp_to_sec_flags. + * libcoff.h: Rebuild. + + * syms.c (stt): Add some PE/PEI section names. + (bfd_decode_symclass): Return 'w', not 'U', for a weak undefined + symbol. + (bfd_symbol_info): Check for 'w'. + + * section.c (struct bfd_comdat_info): Define. + (asection): Add comdat field. + (STD_SECTION): Initialize comdat field. + (bfd_make_section_anyway): Likewise. + * bfd-in2.h: Rebuild. + +1999-09-06 Andreas Schwab + + * elflink.h (elf_link_add_object_symbols): Copy NON_GOT_REF flag + to version symbols. + +1999-09-06 Nick Clifton + + * elflink.h (elf_gc_record_vtentry): Use bfd_zmalloc and + bfd_realloc instead of calloc and realloc. + +1999-09-04 Steve Chamberlain + + * cpu-pj.c: New file. + * elf32-pj.c: New file. + * config.bfd (pj*): New cpu. + (pj-*-*, pjl-*-*): New targets. + * configure.in (bfd_elf32_pj_vec): New target vector. + (bfd_elf32_pjl_vec): New target vector. + * archures.c (bfd_arch_pj): Define. + * elf.c (prep_headers): Handle bfd_arch_pj. + * reloc.c: Define BFD_RELOC_PJ_* relocations. + * targets.c (bfd_elf32_pj_vec, bfd_elf32_pjl_vec): Declare and add + to target vector list. + * Makefile.am: Rebuild dependencies. + (ALL_MACHINES): Add cpu-pj.lo. + (ALL_MACHINES_CFILES): Add cpu-pj.c. + (BFD32_BACKENDS): Add elf32-pj.lo. + (BFD32_BACKENDS_CFILES): Add elf32-pj.c. + * configure, Makefile.in, bfd-in2.h, libbfd.h: Rebuild. + +1999-09-04 Ian Lance Taylor + + * elf-bfd.h (ELF_LINK_NON_GOT_REF): Define. + * elflink.h (elf_adjust_dynamic_symbol): Copy REF_REGULAR_NONWEAK + and NON_GOT_REF from weak defined symbol to real symbol. + * elf32-i386.c (elf_i386_check_relocs): Set NON_GOT_REF. + (elf_i386_adjust_dynamic_symbol): If NON_GOT_REF is not set, don't + create a COPY reloc. + * elf32-sparc.c (elf32_sparc_check_relocs): Set NON_GOT_REF. + (elf32_sparc_adjust_dynamic_symbol): If NON_GOT_REF is not set, + don't create a COPY reloc. + +1999-09-03 Ian Lance Taylor + + * elflink.h (elf_bfd_final_link): When counting relocations, don't + count those in sections we are not including in the link. + +Thu Sep 2 17:41:20 1999 Jeffrey A Law (law@cygnus.com) + + * elflink.h (elf_link_add_object_symbols): Work around bogus SH_LINK + field in hpux11 shared libraries. + +1999-09-02 Nick Clifton + + * elflink.h (elf_gc_record_vtentry): Fix memory leak. + +Wed Sep 1 13:34:29 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_add_symbol_hook): New function. + (elf_hppa_final_link, elf_hppa_relocate_section): Likewise. + (elf_hppa_final_link_relocate, elf_hppa_relocate_insn): Likewise. + +1999-08-31 Alexandre Petit-Bianco + + * elflink.h (record_link_assignment): When possible, keep the + original type of the symbol. + +Mon Aug 30 15:26:48 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Allow both + R_PARISC_DIR32 and R_PARISC_DIR64 regardless of how the + tools were configured. + * elf32-hppa.h (_bfd_elf32_hppa_gen_reloc_type): Declare. + +1999-08-26 Mark Mitchell + + * elf32-mips.c (_bfd_mips_elf_check_relocs): Don't allocate local + GOT entries for GOT16 relocations; they're not required. + +1999-08-24 Nick Clifton + + From a patch submitted by Roland McGrath + + * config.bfd (arm-*-netbsd*): New target. + * configure.in (armnetbsd_vec): New target vector. + * configure: Regenerate + * targets.c (bfd_target_vector): Add &armnetbsd_vec. + + * Makefile.am (BFD32_BACKENDS): Add armnetbsd.lo. + (ALL_MACHINES_CFILES): Add armnetbsd.c. + (armnetbsd.lo): New rule with deps. + * Makefile.in: Regenerate. + + * armnetbsd.c: New file: Definitions specific to arm-netbsd + target. + +Tue Aug 24 00:25:58 1999 Jeffrey A Law (law@cygnus.com) + + * som.c (som_slurp_symbol_table): Fix typo in comment. + +Fri Aug 20 17:01:23 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_fake_sections): Compute section indices + here instead of using elf_section_data... + +1999-08-19 Nick Clifton + + * coff-mcore.c (mcore_emit_base_file_entry): New function: Emit + relocations into the base file. + (coff_mcore_relocate_section): Call mcore_emit_base_file_entry if + we are building a base file. + +1999-08-19 Nick Clifton + + * elf32-arm.h (arm_add_to_rel): New function. Add a value to + a REL style reloc. + (elf32_arm_relocate_section): Use arm_add_to_rel to increment + REL relocs when performing a partial relocation. + +1999-08-18 Donn Terry + + * cofflink.c: Move definitions of N_TMASK, et. al., out of + _bfd_coff_link_input_bfd into top level. + + * coff-i386.c (coff_i386_reloc): Handle R_IMAGEBASE. + (RTYPE2HOWTO): Return NULL if reloc type is out of range. + (coff_i386_rtype_to_howto): Likewise. + * coffcode.h (coff_slurp_symbol_table): Change a -2 to N_DEBUG. + Completely ignore symbols which are all zero. + (dummy_reloc16_estimate): Add return 0. + * cofflink.c (_bfd_coff_link_input_bfd): Rename inner scope + variable copy to name_copy to avoid shadowing outer scope + variable. + * libcoff-in.h (coff_data_type): Change raw_syment_count field + from unsigned int to unsigned long. Add timestamp field. + * libcoff.h: Rebuild. + +1999-08-17 H.J. Lu + + * elf32-hppa.c (bfd_elf32_bfd_is_local_label_name): Fix typo in + macro definition. + +1999-08-17 Ian Lance Taylor + + * elf32-mips.c (_bfd_mips_elf_add_symbol_hook): Set BSF_DYNAMIC + for special section symbols. + * elflink.h (elf_merge_symbol): If we have no old BFD, check + BSF_DYNAMIC on the section symbol to see whether the old BFD is + dynamic. + +1999-08-15 Mark Mitchell + + * elf32-mips.c (mips_elf_calculate_relocation): Fix unfortunate + coincidence of variable names between old and new code. + +1999-08-12 Nick Clifton + + * elf32-arm.h (elf32_arm_to_thumb_stub): Make 'offset' parameter + into a bfd_vma and 'addend' parameter a 'bfd_signed_vma'. + (elf32_thumb_to_arm_stub): Make 'offset' parameter into a bfd_vma + and 'addend' parameter a 'bfd_signed_vma'. + (elf32_arm_final_link_relocate): Do not involve stubs in + R_ARM_THM_PC22 relocs relative to section symbols, they are long + jumps, not function calls. + +1999-08-11 Robin Farine + + * elf32-arm.h (elf32_arm_final_link_relocate): Check for overflow + in R_ARM_PC24 relocs. + +Tue Aug 10 12:48:09 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (elf_hppa_fake_sections): New function. + * elf32-hppa.c (elf_backend_fake_sections): Define. + + * elf-hppa.h (elf_hppa_final_write_processing): Update for + recent changes to the arch_info structure. + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle + R_HPPA_SEGBASE and R_HPPA_SEGREL32. + * cpu-hppa.c (bfd_hppa20w_arch): New entry in architecture info + list. + +Tue Aug 10 00:34:29 1999 Mark P. Mitchell + Ralf Baechle + + * elf32-mips.c (_bfd_mips_elf_size_dynamic_sections): Always + output DT_MIPS_GOTSYM. + (_bfd_mips_elf_finish_dynamic_sections): Use the same value as + DT_MIPS_SYMTABNO if there are no global GOT symbols. + +Tue Aug 10 00:21:08 1999 Mark P. Mitchell + + * elf32-mips.c (mips_elf_create_dynamic_relocation): Change + prototype. Handle local symbols. Add commentary. + (mips_elf_calculate_relocation): Adjust accordingly. + (_bfd_mips_elf_check_relocs): Handle local symbols in R_MIPS_32 + relocations. + + * elflink.h (elf_bfd_final_link): Tweak last change. + +1999-08-09 Mark Mitchell + + * elflink.h (elf_link_size_reloc_section): Use the counts in the + elf-section data to allocate just the right amount of relocation + space. Don't allocate the hash space twice. + (elf_bfd_final_link): Calculate the amount of space to allocate in + each relocation section. + +Mon Aug 9 17:37:30 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type, case 32): When in + 64bit mode, generate a section relative relocation for a 32bit + wide relocation. + (elf_hppa_is_local_label_name): New function. + * elf32-hppa.c (elf_hppa_is_local_label_name): Deleted. To be + shared between 32bit and 64bit port. + +1999-08-09 Mark Mitchell + + * elf32-mips.c (elf_mips_howto_table): Fix src_mask for + R_MIPS_GOT16 and R_MIPS_CALL16. + (mips_elf_got16_entry): Use mips_elf_high to calculate the value + to use when looking for a preexisting GOT entry. + +1999-08-09 Jakub Jelinek + + * elf64-sparc.c (sparc64_elf_relocate_section): Back out part of + the Sep. 4th, 1998 change. glibc 2.0.x dynamic linker had bug, + not binutils. + * elf32-sparc.c (elf32_sparc_relocate_section): Likewise. + +1999-08-09 Geoff Keating + + * elflink.h (elf_link_output_extsym): Don't output a weak + reference to an undefined symbol just because it was defined weak + in a shared object. + +1999-08-09 Eli Zaretskii + + * coffgen.c (coff_find_nearest_line): When looking for file, use + last best match rather than first. If address is beyond last line + number record, don't return the last line as the correct value. + +1999-08-08 Ian Lance Taylor + + * section.c (SEC_SMALL_DATA): Rename from SEC_SHORT. + * bfd-in2.h: Rebuild. + +1999-08-08 Mark Elbrecht + + * libcoff-in.h (struct coff_section_alignment_entry): Define. + * coffcode.h (coff_set_custom_section_alignment): New static + function. + (coff_section_alignment_table): New static array. + (coff_new_section_hook): Use coff_set_customer_section_alignment. + * coff-go32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define. + * coff-stgo32.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define. + * libcoff.h: Rebuild. + +1999-08-08 Ian Lance Taylor + + * Makefile.am: Rename .dep* files to DEP*. Change DEP variable to + MKDEP. + * Makefile.in: Rebuild. + +1999-08-08 Mumit Khan + + * section.c (SEC_SHARED): Define. + * coffcode.h (sec_to_styp_flags): Handle SEC_SHARED. + (styp_to_sec_flags): Likewise. + * peicode.h (coff_swap_scnhdr_out): Likewise. + * bfd-in2.h: Rebuild. + +1999-08-08 Ian Lance Taylor + + * coffcode.h (coff_classify_symbol): Comment out part of + 1999-08-05 change which breaks cygwin DLLs. + + * acinclude.m4 (BFD_BINARY_FOPEN): Change -windows to -windows*. + * aclocal.m4, configure: Rebuild. + +1999-08-06 Ian Lance Taylor + + * section.c (global_syms): Only initialize union field if + __STDC__. + +1999-08-04 Mark Mitchell + + * elf32-mips.c (mips_elf_got16_entry): Don't multiply GOT index by + the size of a GOT entry here. + (mips_elf_calculate_relocation): Don't create a local GOT entry + for the symbol in a GOT16 relocation; just for it's high-order bit + (_bfd_mips_elf_relocate_section): Fix thinko. + +1999-08-05 Ian Lance Taylor + + Based on patches from Donn Terry : + * coffcode.h (enum coff_symbol_classification): Define. + (bfd_coff_backend_data): Rename _bfd_coff_sym_is_global to + _bfd_coff_classify_symbol. Change return type. + (bfd_coff_classify_symbol): Rename from bfd_coff_sym_is_global. + (coff_slurp_symbol_table): Use coff_classify_symbol. + (coff_classify_symbol): New static function. + (coff_sym_is_global): Never define. + (bfd_coff_std_swap_table): Initialize with coff_classify_symbol. + * cofflink.c (coff_link_check_ar_symbols): Use + bfd_coff_classify_symbol rather than bfd_coff_sym_is_global. + (coff_link_add_symbols): Likewise. + (_bfd_coff_link_input_bfd): Likewise. + * coff-sh.c (bfd_coff_small_swap_table): Initialize with + coff_classify_symbol. + * libcoff.h: Rebuild. + +Wed Aug 4 18:08:07 1999 Jeffrey A Law (law@cygnus.com) + + * libhppa.h (R_HPPA_LTPSEL, R_HPPA_RTPSEL): New field selectors + (e_ltpsel, e_rtpsel): Similarly. + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle 21bit e_ltpsel + and 14bit ertpsel. Handle 64bit psel. + +1999-08-04 Mark Mitchell + + * elf32-mips.c (_bfd_mips_elf_relocate_section): Tweak HI16/LO16 + handling for REL relocations. And only left-shift R_MIPS26 + relocation addends where necessary. + +1999-08-03 Mark Mitchell + + * elf32-mips.c (mips_elf_next_lo16_addend): Rename to ... + (mips_elf_next_lo16_relocation): Don't compute the addend here. + Just return the relocation found. + (mips_elf_relocate_section): Pull the LO16 addend out of the + section itself when using REL relocations. + + * elf32-mips.c (mips_elf_calculate_relocation): Restore + _DYNAMIC_LINK handling and handling of undefined symbols in shared + libraries. + +1999-08-03 Ian Lance Taylor + + * elf32-ppc.c (ppc_elf_relocate_section): Don't use the relocation + value of a symbol in a SEC_DEBUGGING section. Warn when doing a + relocation against a symbol in an input section with no output + section. From Daniel Jacobowitz . + + * coff-stgo32.c (go32_stubbed_coff_object_p): Remove; not used. + + * acinclude.m4 (BFD_CC_FOR_BUILD): Change to use conftest, and to + look for generated file correctly. + * aclocal.m4, configure: Rebuild. + +1999-08-02 Mark Mitchell + + * elf32-mips.c (_bfd_mips_elf_relocate_section): Handle R_MIPS_26 + and R_MIPS16_26 relocations correctly when relocating. + (_bfd_mips_elf_check_relocs): Don't assume that R_MIPS_CALL_HI16 + and R_MIPS_CALL_LO16 are for global symbols. + +1999-08-02 Jakub Jelinek + + * elflink.h (elf_bfd_final_link): Copy the whole isym, not just + some fields. + * elf64-sparc.c (sparc64_elf_output_arch_syms): Declare used + variables and initialize them. + +1999-08-01 Mark Mitchell + + * elf32-mips.c (_bfd_mips_elf_final_link): Handle the case where + there are no global symbols requiring GOT entries. + (_bfd_mips_elf_size_dynamic_sections): Likewise. + (_bfd_mips_elf_finish_dynamic_symbol): Likewise. + (_bfd_mips_elf_finish_dynamic_sections): Likewise. + + * elf32-mips.c (mips_elf_calculate_relocation): Undefined weak + symbols are considered to have the value zero. + (_bfd_mips_elf_relocate_section): Don't try to perform a + relocation for an undefined symbol. + (_bfd_mips_elf_check_relocs): Allocate locate GOT space for local + GOT16 relocations. + +1999-07-30 Jakub Jelinek + + * elf64-sparc.c (sparc64_elf_build_plt): Cosmetic change - ABI + wants ba,a,pt %xcc instead of %icc. + Emit correct .PLT0-(.PLTN+4) initial value into the pointer slots + of large PLT entries. + (sparc64_elf_plt_ptr_offset): Fix calculation. + (sparc64_elf_finish_dynamic_symbol): Negative value of R_SPARC_JMP_SLOT + addend should be relative to load address, not .plt section start. + (sparc64_elf_size_info): Sparc64 uses 32bit .hash entries. + +1999-07-30 Jakub Jelinek + + * elf-bfd.h (struct elf_backend_data): Add + print_symbol_all and output_arch_syms backend methods. + * elfxx-target.h: Likewise. + * elf64-sparc.c (sparc64_elf_bfd_link_hash_table_create, + sparc64_elf_add_symbol_hook, sparc64_elf_output_arch_syms, + sparc64_elf_get_symbol_type, sparc64_elf_symbol_processing): New + functions. + (sparc64_elf_size_dynamic_sections): Leave space for STT_REGISTER + symbols in .dynsym, add their names into .dynstr. Put those symbols + into dynlocal. + (sparc64_elf_finish_dynamic_sections): Fix up DT_SPARC_REGISTER + pointers to STT_REGISTER symbols in dynsym section. + (sparc64_elf_print_symbol_all): New function. + * elf.c (bfd_elf_print_symbol): Allow special backend symbol + printing using the print_symbol_all hook. + +1999-07-30 Catherine Moore + + * elf32-arm.h (elf32_arm_check_relocs): Use r_offset for + R_ARM_GNU_VTENTRY. + +1999-07-29 Richard Henderson + + * elf32-mips.c (_bfd_mips_elf_final_link): Only re-sort dynsyms if + dynamic_sections_created. + +1999-07-29 Richard Henderson + + * elf32-mips.c (mips_info_to_howto_rel): Split out switch to ... + (mips_rtype_to_howto): ... new function. + (_bfd_mips_elf_relocate_section): Use it. + +1999-07-28 Mark Mitchell + + * elf32-mips.c (_bfd_mips_elf_relocate_section): Fix typo. + +1999-07-27 Nick Clifton + + Patch generated by Bernd Schmidt. + + * coff-arm.c (coff_arm_is_local_label_name): Change to strip + out only symbols that start with LOCAL_LABEL_PREFIX followed by 'L'. + +1999-07-23 Donn Terry + + * libcoff-in.h (coff_link_hash_entry): Add coff_link_hash_flags + field, and define COFF_LINK_HASH_PE_SECTION_SYMBOL. + * cofflink.c (coff_link_add_symbols): If PE, handle section + symbols specially. + * libcoff.h: Rebuild. + + * config.bfd (i[3456]86-*-interix*): New target. + +1999-07-21 Mark Elbrecht + + * coffcode.h (styp_to_sec_flags): If COFF_LONG_SECTION_NAMES and + COFF_SUPPORT_GNU_LINKONCE, mark sections whose names begin with + .gnu.linkonce with SEC_LINKONCE and SEC_LINK_DUPLICATES_DISCARD. + * coff-go32.c: (COFF_LONG_SECTION_NAMES): Define. + (COFF_SUPPORT_GNU_LINKONCE): Define. + * coff-stgo32.c: (COFF_LONG_SECTION_NAMES): Define. + (COFF_SUPPORT_GNU_LINKONCE): Define. + +1999-07-21 Ian Lance Taylor + + From Mark Elbrecht: + * makefile.dos: Remove; obsolete. + * configure.bat: Remove; obsolete. + +1999-07-21 H.J. Lu + + * config.bfd (i[3456]86-*-vxworks*): Add targ_underscore=yes. + +1999-07-21 Philippe De Muyter + + * cofflink.c (_bfd_coff_generic_relocate_section): Issue an error + message and fail if a symbol index is out of range. + +1999-07-21 Ian Lance Taylor + + * elf32-mips.c (mips_elf_calculate_relocation): Get the GP value + when looking at a R_MIPS_GOT16 relocation. + +1999-07-20 Nick Clifton + + * coff-m88k.c: Use CREATE_BIG_COFF_TARGET_VEC. + +Mon Jul 19 14:03:44 1999 Mark P. Mitchell + + * elf32-mips.c (_bfd_mips_elf_final_link): Restore setting of GP + removed in previous change. + (_bfd_mips_elf_relocate_section): Adjust GP relative relocations + in relocateable output. + +1999-07-19 Ian Lance Taylor + + * coff-m88k.c (m88kbcs_vec): Initialize new field of bfd_target + structure. + + * elflink.h (elf_merge_symbol): Do merge symbols from the same BFD + if they appear to be specially created by the linker. + +1999-07-19 Nick Clifton + + * targets.c (alternative_target): New field in bfd_target + structure. + (bfd_search_for_target): New function: Find a target that + satisifies a search function. + * bfd-in2.h: Regenerate. + + * elfxx-target.h: Initialise the alternative_target field of + the bfd_target structures to point to the other target (if + defined). + * nlm-target.h: Initialise the alternative_target field of + the bfd_target structures to point to the other target (if + defined). + + * coffcode.h (CREATE_BIG_COFF_TARGET_VEC): New macro. + (CREATE_LITTLE_COFF_TARGET_VEC): New macro. + + * aix386-core.c: Initialise new field of bfd_target structure. + * aout-adobe.c: Initialise new field of bfd_target structure. + * aout-arm.c: Initialise new field of bfd_target structure. + * aout-target.h: Initialise new field of bfd_target structure. + * aout-tic30.c: Initialise new field of bfd_target structure. + * binary.c: Initialise new field of bfd_target structure. + * bout.c: Initialise new field of bfd_target structure. + * cisco-core.c: Initialise new field of bfd_target structure. + * coff-a29k.c: Use CREATE_BIG_COFF_TARGET_VEC. + * coff-alpha.c: Initialise new field of bfd_target structure. + * coff-apollo.c: Use CREATE_BIG_COFF_TARGET_VEC. + * coff-arm.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC. + * coff-h8300.c: Use CREATE_BIG_COFF_TARGET_VEC. + * coff-h8500.c: Use CREATE_BIG_COFF_TARGET_VEC. + * coff-i386.c: Initialise new field of bfd_target structure. + * coff-i860.c: Initialise new field of bfd_target structure. + * coff-i960.c: Use CREATE_LITTLE_COFF_TARGET_VEC. + * coff-m68k.c: Use CREATE_BIG_COFF_TARGET_VEC. + * coff-mcore.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC. + * coff-mips.c: Initialise new field of bfd_target structure. + * coff-ppc.c: Initialise new field of bfd_target structure. + * coff-rs6000.c: Initialise new field of bfd_target structure. + * coff-sh.c: Use CREATE_{BIG|LITTLE}_COFF_TARGET_VEC. + * coff-sparc.c: Use CREATE_BIG_COFF_TARGET_VEC. + * coff-tic30.c: Initialise new field of bfd_target structure. + * coff-tic80.c: Use CREATE_LITTLE_COFF_TARGET_VEC. + * coff-w65.c: Use CREATE_LITTLE_COFF_TARGET_VEC. + * coff-we32k.c: Use CREATE_BIG_COFF_TARGET_VEC. + * coff-z8k.c: Use CREATE_BIG_COFF_TARGET_VEC. + * hppabsd-core.c: Initialise new field of bfd_target structure. + * hpux-core.c: Initialise new field of bfd_target structure. + * i386msdos.c: Initialise new field of bfd_target structure. + * i386os9k.c: Initialise new field of bfd_target structure. + * ieee.c: Initialise new field of bfd_target structure. + * ihex.c: Initialise new field of bfd_target structure. + * irix-core.c: Initialise new field of bfd_target structure. + * mipsbsd.c: Initialise new field of bfd_target structure. + * netbsd-core.c: Initialise new field of bfd_target structure. + * oasys.c: Initialise new field of bfd_target structure. + * osf-core.c: Initialise new field of bfd_target structure. + * ppcboot.c: Initialise new field of bfd_target structure. + * ptrace-core.c: Initialise new field of bfd_target structure. + * sco5-core.c: Initialise new field of bfd_target structure. + * som.c: Initialise new field of bfd_target structure. + * srec.c: Initialise new field of bfd_target structure. + * tekhex.c: Initialise new field of bfd_target structure. + * trad-core.c: Initialise new field of bfd_target structure. + * versados.c: Initialise new field of bfd_target structure. + * vms.c: Initialise new field of bfd_target structure. + +1999-07-19 Andreas Schwab + + * elflink.h (elf_bfd_final_link): Remove unused variables rel_hash + and rel_hdr. + +Sat Jul 17 02:28:28 1999 Mark P. Mitchell + + * elflink.h (elf_link_adjust_relocs): New function. + (elf_bfd_final_link): Use it. + (elf_link_input_bfd): Deal with the fact that there can be + two relocation sections for a single section. + (elf_reloc_link_order): Likewise. + + * elf32-mips.c (_bfd_mips_elf_final_link): Don't set GP for + a relocateable object. + (_bfd_mips_elf_relocate_section): Handle relocateable links. + +1999-07-16 Jakub Jelinek + + * elf64-sparc.c (sparc64_elf_info_to_howto): Use ELF64_R_TYPE_ID. + (sparc64_elf_get_reloc_upper_bound, + sparc64_elf_get_dynamic_reloc_upper_bound, + sparc64_elf_slurp_one_reloc_table, sparc64_elf_slurp_reloc_table, + sparc64_elf_canonicalize_dynamic_reloc, sparc64_elf_write_relocs): + New functions. + (sparc64_elf_check_relocs, sparc64_elf_relocate_section): Use + ELF64_R_TYPE_ID/DATA where appropriate. + +1999-07-16 Jakub Jelinek + + * elf64-sparc.c (sparc64_elf_size_dynamic_sections): Remove + DT_SPARC_PLTFMT. + +1999-07-16 Ian Lance Taylor + + * elf32-mips.c (mips_elf_local_relocation_p): New static + function. + (mips_elf_next_lo16_addend): Call bfd_set_error on failure. + (mips_elf_calculate_relocation): Use mips_elf_local_relocation_p. + Always set *require_jalxp. + (mips_elf_stub_section_p): Mark abfd parameter as unused. + (_bfd_mips_elf_relocate_section): Only look for LO16 following + GOT16 if the GOT16 is against a local symbol. Don't return false + for an undefined symbol. If there is an overflow, assert that we + have a name. + +1999-07-16 Andreas Schwab + + * elflink.h (elf_link_record_local_dynamic_symbol): Remove unused + variables `link' and `elfsec'. + (elf_bfd_final_link): Remove unused variable `os'. + +Thu Jul 15 17:55:31 1999 Mark P. Mitchell + + * elf32-mips.c (_bfd_mips_elf_modify_segment_map): Don't require + a PT_PHDR program headers. + (_bfd_mips_elf_final_link): Don't assume there are going to be + section symbols when we're not building a shared object. + (_bfd_mips_elf_check_relocs): Make sure we have a GOT when + we need one. + +1999-07-15 J.T. Conklin + + * config.bfd (i[3456]86-*-vxworks*): New target. + +1999-07-15 Mark Mitchell + + * elf32-mips.c (mips_elf_stub_section_p): New function. + (mips_elf_calculate_relocation): Handle MIPS16 stub functions. + (mips_elf_relocate_section): Adjust calling sequence for + mips_elf_calculate_relocation and mips_elf_perform_relocation. + (mips_elf_perform_relocation): Turn `jal' into `jalx' where + required. + +1999-07-15 Ian Lance Taylor + + * configure.in: Bump version number to 2.9.5. + * configure: Rebuild. + +Thu Jul 15 02:56:15 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type, case R_HPPA): Handle + 64bit format. + (_bfd_elf_hppa_gen_reloc_type, case R_GOTOFF): Use base reloc type + to derive final type instead of hardwiring a selection. + +1999-07-14 Mark Mitchell + + * elf32-mips.c (mips_elf_obtain_contents): Swap 16-bit halves of + things relocated by R_MIPS16_GPREL. + (mips_elf_perform_relocation): Likewise. + +Wed Jul 14 15:23:19 1999 Jim Wilson + + * elfxx-target.h (elfNN_bed): Add elf_backend_want_dynbss. + +1999-07-14 Richard Henderson + + * elf32-mips.c (struct mips_got_info): Add global_gotno. + (_bfd_mips_elf_size_dynamic_sections): Set it. + (_bfd_mips_elf_final_link): Re-sort; verify the got did not grow. + (mips_elf_sort_hash_table): Set max_non_got_dynindex based off + new argument max_local. + +1999-07-14 Mark Mitchell + + * elf32-mips.c (mips_elf_obtain_contents): Swap the 16-bit + subwords when handling an R_MIPS16_26 relocation. + (mips_elf_perform_relocation): Don't be paranoid abour right-shift + semantics. + + * elf32-mips.c (elf_mips16_gprel_howto): Adjust src_mask and + dst_mask to match reality. + (_bfd_mips_elf_calculate_relocation): Handle R_MIPS16_GPREL. + (mips_elf_obtain_contents): Use bfd_get. + (mips_elf_perform_relocation): Handle R_MIPS16_GPREL. + (mips_elf_relocate_section): Likewise. + +1999-07-13 Mark Mitchell + + * elf32-mips.c (mips_elf_calculate_relocation): Handle R_MIPS16_26. + (mips_elf_relocate_section): Adjust calling sequence for + mips_elf_perform_relocation. + (mips_elf_perform_relocation): Take additional argument. Handle + R_MIPS16_26. Use bfd_put for convenience. + +1999-07-13 Richard Henderson + + * elf.c (assign_file_positions_for_segments): Thinko last change. + Always overwrite p_flags. + +1999-07-13 Richard Henderson + + * elf-bfd.h (struct elf_backend_data): Add want_dynbss. + * elflink.c (_bfd_elf_create_dynamic_sections): Only create + .dynbss and .rel[a].bss if want_dynbss. + * elfxx-target.h (elf_backend_want_dynbss): Provide default. + +1999-07-13 Richard Henderson + + * elf.c (assign_file_positions_for_segments): Don't overwrite p_flags. + +1999-07-13 Richard Henderson + + * elf-bfd.h (struct elf_link_local_dynamic_entry): New. + (struct elf_link_hash_table): Add dynlocal. + (_bfd_elf_link_lookup_local_dynindx): Prototype. + (_bfd_elf_link_adjust_dynindx): Delete. + (_bfd_elf_link_renumber_dynsyms): Prototype. + (_bfd_elf,link_record_local_dynamic_symbol): Prototype. + * elfcode.h (elf_link_record_local_dynamic_symbol): New alias. + * elflink.c (_bfd_elf_link_adjust_dynindx): Delete. + (_bfd_elf_link_lookup_local_dynindx): New function. + (elf_link_renumber_hash_table_dynsyms): New function. + (_bfd_elf_link_renumber_dynsyms): New function. + * elflink.h (elf_link_record_local_dynamic_symbol): New function. + (struct elf_assign_sym_version_info): Delete removed_dynamic. + (bfd_elf,size_dynamic_sections): Use _bfd_strip_section_from_output + instead of elf_link_remove_section_and_adjust_dynindices. + Remove removed_dynamic code. Use _bfd_elf_link_renumber_dynsyms. + (elf_link_assign_sym_version): Remove removed_dynamic code. + (elf_link_renumber_dynsyms): Delete. + (elf_bfd_final_link): Install section and local symbols into .dynsym. + + * elf32-m68k.c (elf_m68k_adjust_dynindx): Delete. + (elf_m68k_size_dynamic_sections): Don't set section dynindicies. + (elf_m68k_finish_dynamic_sections): Don't write section dynsyms. + * elf32-mips.c: Similarly. + * elf32-ppc.c: Similarly. + * elf32-sparc.c: Similarly. + * elf64-alpha.c: Similarly. + * elf64-sparc.c: Similarly. + +1999-07-13 Mark Mitchell + + * elf32-mips.c (mips_elf_calculate_relocation): Do not complain + when _gp_disp is undefined. Do not check R_MIPS_LO16 for overflow + when the relocation is against _gp_disp. + +1999-07-12 Mark Mitchell + + * dwarf2.c (read_attribute): Support DW_FORM_ref8. + * elf32-mips.c (mips_elf_link_hash_entry): Change mips_32_relocs + to possibly_dynamic_relocs. Adjust usage throughout code. + (elf_mips_howto_table): Handle R_MIPS_64 correctly. + (elf_mips_ctor64_howto): Likewise. + (mips_elf_calculate_relocation): Handle R_MIPS_64 like R_MIPS_32. + Adjust indentation. + (mips_elf_relocate_section): Handle R_MIPS_64 in 32-bit mode. + (_bfd_mips_elf_check_relocs): Handle R_MIPS_64 like R_MIPS_32. + Use MIPS_ELF_GOT_SIZE to calculate the size of GOT entries. + * elf64-mips.c (elf_backend_may_use_rel_p): Define. + +1999-07-12 Ian Lance Taylor + + * Makefile.am: Rebuild dependencies. + * Makefile.in: Rebuild. + + * bfd-in.h: Remove tests of COFF_IMAGE_WITH_PE. + * bfd-in2.h: Rebuild. + + * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED + as appropriate. Use EMPTY_HOWTO as appropriate. Fill in + structure initializations. Add casts. + * reloc.c (EMPTY_HOWTO): Define. + * bfd-in2.h: Rebuild. + * coff-h8300.c (h8300_reloc16_extra_cases): Remove useless + comparisons against 0. + * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Change + previous_ibfd_e_flags to unsigned long. + * vms.h (struct vms_private_data_struct): Change section_count to + unsigned. + * vms-gsd.c (_bfd_vms_slurp_gsd): Change psect_idx to unsigned. + (_bfd_vms_write_gsd): Change symnum to unsigned. + * vms-hdr.c (_bfd_vms_write_hdr): Change symnum to unsigned. + * vms-tir.c (etir_sta): Change psect to unsigned. + (alloc_section): Change idx to unsigned. + (tir_sta, tir_ctl): Change psect to unsigned. + (_bfd_vms_write_tir): Change len and before to bfd_size_type. + * vms.c (priv_section_count): Change to unsigned. + +1999-07-12 Andreas Schwab + + * elf32-m68k.c: Add some ATTRIBUTE_UNUSED. + * m68klinux.c: Likewise. + +1999-07-12 Ian Lance Taylor + + * Many files: Changes to avoid gcc warnings: Remove unused local + variables. Add default case to enum switches. + * coff-arm.c (bfd_arm_allocate_interworking_sections): Only + compile if not COFF_IMAGE_WITH_PE. + (record_arm_to_thumb_glue, record_thumb_to_arm_glue): Likewise. + (bfd_arm_get_bfd_for_interworking): Likewise. + (bfd_arm_process_before_allocation): Likewise. + * epoc-pei-arm.c: Don't rename bfd_arm functions. + * pei-arm.c: Likewise. + * elf32-mips.c (mips_elf_link_hash_table_create): Don't declare. + (MIPS_ELF_ADD_DYNAMIC_ENTRY): Correct last change. + (mips_elf_got16_entry): Put parens around & in body of ==. + (mips_elf_calculate_relocation): Correct test for empty string. + * vms-gsd.c: Use _bfd_error_handler rather than fprintf to + stderr. + * vms-misc.c (_bfd_vms_length_hash_symbol): Correct sprintf + format. + +1999-07-11 Ian Lance Taylor + + * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED + as appropriate. Fill in structure initializations. Add variable + initializations. Add casts. + * dwarf1.c (parse_line_table): Change eachLine to unsigned long. + (dwarf1_unit_find_nearest_line): Change i to unsigned long. + + * elf.c (bfd_elf_hash): Change parameter from unsigned char * to + char *. + * elf-bfd.h (bfd_elf_hash): Update declaration. + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Remove casts + when calling bfd_elf_hash. + +1999-07-11 Mark Mitchell + + * libbfd.c (bfd_put_8): Make it of type `void'. + * bfd-in2.h: Regenerated. + * elf32-mips.c (MIPS_ELF_ADD_DYNAMIC_ENTRY): Conditionalize + for 32-bit hosts. + (_bfd_mips_elf_final_link): Likewise. + + * elflink.h (elf_link_read_relocs_from_section): Be type-correct. + +Thu Jul 8 12:32:23 1999 John David Anglin + + * config.bfd (hppa*-*-linux-gnu*): New target + +1999-07-07 Mark Mitchell + + * elf-bfd.h (_bfd_mips_elf_section_from_shdr): Constify. + (_bfd_mips_elf_create_dynamic_sections): New function. + (_bfd_mips_elf_add_symbol_hook): Likewise. + (_bfd_mips_elf_adjust_dynamic_symbol): Likewise. + (_bfd_mips_elf_finish_dynamic_symbol): Likewise. + (_bfd_mips_elf_finish_dynamic_sections): Likewise. + (_bfd_mips_elf_gc_mark_hook): Likewise. + (_bfd_mips_elf_gc_sweep_hook): Likewise. + (_bfd_mips_elf_always_size_sections): Likewise. + (_bfd_mips_elf_size_dynamic_sections): Likewise. + (_bfd_mips_elf_check_relocs): Likewise. + (_bfd_mips_elf_link_hash_table_create): Likewise. + (_bfd_mips_elf_print_private_data): Likewise. + (_bfd_mips_elf_link_output_symbol_hook): Likewise. + (_bfd_mips_elf_final_link): Likewise. + (_bfd_mips_elf_additional_program_headers): Likewise. + (_bfd_mips_elf_modify_segment_map): Likewise. + (_bfd_mips_elf_relocate_section): Likewise. + * elf32-mips.c (mips_elf32_object_p): Move contents into + _bfd_mips_elf_object_p. + (mips_elf_additional_program_headers): Rename to + _bfd_mips_elf_additional_program_headers. + (mips_elf_modify_segment_map): Rename to + _bfd_mips_elf_modify_segment_map. + (elf_mips_abi_name): Change prototype. + (mips_elf32_section_from_shdr): Merge into + _bfd_mips_elf_section_from_shdr. + (mips_elf32_section_processing): Merge into + _bfd_mips_elf_section_processing. + (mips_elf_final_link): Rename to _bfd_mips_elf_final_link. Invoke + the right back-end ELF linker. + (mips_elf_relocate_section): Rename to + _bfd_mips_elf_relocate_section. Clean up. Adjust for 64-bit code. + (mips_elf_link_output_symbol_hook): Rename to + _bfd_mips_elf_link_output_symbol_hook. + (mips_elf_create_dynamic_section): Rename to + _bfd_mips_elf_create_dynamic_section. + (mips_elf_check_relocs): Rename to _bfd_mips_elf_check_relocs. + Adjust for 64-bit code. Use mips_elf_got_section. + (mips_elf_adjust_dynamic_symbol): Rename to + _bfd_mips_elf_adjust_dynamic_symbol. Use + mips_elf_allocate_dynamic_relocations. + (mips_elf_finish_dynamic_symbol): Rename to + _bfd_mips_elf_finish_dynamic_symbol. Use mips_elf_got_section. + Adjust for 64-bit code. + (mips_elf_finish_dynamic_sections): Rename to + _bfd_mips_elf_finish_dynamic_sections. Adjust for 64-bit code. + (mips_elf_always_size_sections): Rename to + _bfd_mips_elf_always_size_sections. + (mips_elf_add_symbol_hook): Rename to + _bfd_mips_elf_add_symbol_hook. + (mips_elf_next_lo16_addend): Constify. + (mips_elf_calculate_relocation): Likewise. + (mips_elf_obtain_contents): Likewise. + (mips_elf_perform_relocation): Likewise. + (mips_elf_create_dynamic_relocation): Likewise. + (mips_elf_allocate_dynamic_relocations): New function. + (MIPS_ELF_REL_DYN_SECTION_NAME): New macro. + (MIPS_ELF_REL_SIZE): Likewise. + (MIPS_ELF_DYN_SIZE): Likewise. + (MIPS_ELF_GOT_SIZE): Likewise. + (MIPS_ELF_SYM_SIZE): Likewise. + (MIPS_ELF_LOG_FILE_ALIGN): Likewise. + (MIPS_ELF_GET_WORD): Likewise. + (MIPS_ELF_PUT_WORD): Likewise. + (MIPS_ELF_ADD_DYNAMIC_ENTRY): Likewise. + (STUB_LW): Conditionalize for 64-bit value. + (elf_mips_howto_table): Add R_MIPS_HIGHER and R_MIPS_HIGHEST + entries. + (_bfd_mips_elf_merge_private_bfd_data): Merge e_ident[EI_CLASS]. + Check it for inconsistency. + (_bfd_mips_elf_print_private_bfd_data): Print ABI=64 for 64-bit + ABI. + (_bfd_mips_elf_fake_sections): Remove duplicate handling of + .msym. + (mips_elf_global_got_index): Use MIPS_ELF_GOT_SIZE. + (mips_elf_got_offset_from_index): Use misp_elf_got_section. + (mips_elf_create_local_got_entry): Use MIPS_ELF_GOT_SIZE. + (mips_elf_local_got_index): Likewise. + (mips_elf_got_page): Likewise. + (mips_elf_got_info): Likewise. + (mips_elf_create_dynamic_relocation): Handle 32-bit/64-bit split. + (ELF_DYNAMIC_INTERPRETER): Handle 64-bit code. + (mips_elf_create_dynamic_sections): Use MIPS_ELF_LOG_FILE_ALIGN, + instead of constant `2'. + (mips_elf_create_got_section): Tidy. Use MIPS_ELF_GOT_SIZE. + (mips_elf_create_msym_section): Use MIPS_ELF_LOG_FILE_ALIGN. + (mips_elf_size_dynamic_sections): Use + MIPS_ELF_REL_DYN_SECTION_NAME, MIPS_ELF_GOT_SIZE, + MIPS_ELF_ADD_DYNAMIC_ENTRY. Remove #if 0'd code. + Adjust all releveant entries in elf backend table. + * elf64-mips.c (mips_elf64_section_from_shdr): Remove. + (mips_elf64_section_processing): Likewise. + Adjust elf backend entries to use _bfd_mips_elf variants now + publicly available. + + * elflink.h (elf_link_create_dynamic_sections): Handle non-standard + hash-entry sizes. + (size_dynamic_sections): Likewise. + (elf_link_output_extsym): Likewise. + * elf.c: (elf_fake_sections): Likewise. + * libbfd.c (bfd_get): New macro. + (bfd_put): Likewise. + * bfd-in2.h: Regenerated. + +1999-07-07 Mark Mitchell + + * elf-bfd.h (elf_size_info): Add hash_entry_size, + int_rels_per_ext_rel, swap_dyn_out, swap_reloc_in, swap_reloc_out, + wap_reloca_in, and swap_reloca_out. + * elflink.h (elf_link_read_relocs_from_section): Adjust to handle + multiple internal relocations per external relocation. + (link_read_relocs): Likewise. + (elf_bfd_final_link): Likewise. + (elf_link_input_bfd): Likewise. + (elf_gc_mark): Likewise. + (elf_gc_smash_unused_vtentry_relocs): Likewise. + * elfcode.h (elf_swap_dyn_out): Adjust type to match + elf_swap_dyn_in. + (size_info): Add entries for new fields. + * elf64-mips.c (mips_elf64_swap_reloc_out): Enable. + (mips_elf64_be_swap_reloc_in): New function. + (mips_elf64_be_swap_reloc_out): Likewise. + (mips_elf64_be_swap_reloca_in): Likewise. + (mips_elf64_be_swap_reloca_out): Likewise. + (mips_elf64_size_info): Add entries for new fields. + +1999-07-07 Ian Lance Taylor + + * elflink.h (elf_bfd_final_link): Assert that section reloc_count + field equals the new rel_count field. + (elf_link_input_bfd): When doing a relocateable link, use the new + rel_count field rather than the reloc_count field. + (elf_reloc_link_order): Likewise. + (elf_finish_pointer_linker_section): Likewise. + + Based on patch from H.J. Lu : + * elflink.h (elf_merge_symbol): Permit a non-weak definition in a + shared library to override a weak definition in a regular object. + +Tue Jul 6 10:23:39 1999 Jeffrey A Law (law@cygnus.com) + + * libhppa.h: Revert July 2, 1999 patch. + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): T mode selectors + need to generate DLTIND relocations, not DLTREL relocations. + +1999-07-05 Nick Clifton + + * coffcode.h (coff_set_arch_mach_hook): Recognise arm 5 + architectures. + (coff_set_flags): Recognise arm 5 architectures. + + * cpu-arm.c: Add support for strongarm and arm9 cpus. + Add support for armv5 architecture. + + * archures.c: Add bfd_mach_arm_5 and bfd_mach_arm_5T. + + * reloc.c: Add new, assembler only, ARM reloc: + BFD_RELOC_ARM_ADRL_IMMEDIATE. + + * bfd-in2.h: Regenerate. + +1999-07-02 Mark Mitchell + + * dwarf2.c (parse_comp_unit): Add ABBREV_LENGTH parameter. + (_bfd_dwarf2_find_nearest_line): Add ADDR_SIZE parameter. + * elf.c (_bfd_elf_find_nearest_line): Pass it. + * elf32-arm.h (elf32_arm_find_nearest_line): Likewise. + * elf32-mips.c (ABI_64_P): New macro. + (IRIX_COMPAT): We are IRIX6-compatible if ABI_64_P. + (_bfd_mips_elf_find_nearest_line): Adjust call to + _bfd_dwarf2_find_nearest_line. + * libbfd-in.h (_bfd_dwarf2_find_nearest_line): Update prototype. + * libbfd.h: Regenerated. + +1999-07-02 Ian Lance Taylor + + * config.bfd: Add * at the end of i[3456]86-*-unixware. + +Fri Jul 2 12:21:10 1999 Jeffrey A Law (law@cygnus.com) + + * libhppa.h (HPPA_R_ARG_RELOC): Delete. + (HPPA_R_CONSTANT, HPPA_R_ADDEND): Likewise. + +1999-07-01 Mark Mitchell + + * elf-bfd.h (bfd_elf_section_data): Add rel_count and rel_count2 + fields. + (_bfd_elf_init_reloc_shdr): New function. + * elf.c (_bfd_elf_new_section_hook): Use bfd_zalloc, rather than + bfd_alloc followed by memset. + (_bfd_elf_init_reloc_shdr): New function, split out from ... + (elf_fake_sections): Here. + (assign_section_numbers): Assign section numbers for the second + relocation section, if required. + * elflink.h (elf_link_output_relocs): New function. + (elf_link_size_reloc_section): Likewise. + (elf_bfd_final_link): Use elf_link_size_reloc_section. + (elf_link_input_bfd): Use elf_link_output_relocs. + + * elf32-mips.c (_bfd_mips_elf_fake_sections): Use + _bfd_elf_init_reloc_shdr to initialize rel_hdr2. + +Thu Jul 1 13:58:48 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h (_bfd_elf_hppa_gen_reloc_type): Handle R_PCREL_CALL + with 22bit format. + +1999-06-28 Mark Mitchell + + * elf32-mips.c (mips_elf_got_info): Move declaration before + prototypes. Change global_gotsym to be a pointer to a hash entry, + rather than a number index. + (mips_elf_link_hash_entry): Move declaration before prototypes. + (mips_elf_irix6_finish_dynamic_symbol): New function. + (mips_elf_sign_extend): Likewise. + (mips_elf_high): Likewise. + (mips_elf_higher): Likewise. + (mips_elf_highest): Likewise. + (mips_elf_global_got_index): Likewise. + (mips_elf_local_got_index): Likewise. + (mips_elf_got_offset_from_index): Likeiwse. + (mips_elf_record_global_got_symbol): Likewise. + (mips_elf_got_page): Likewise. + (mips_elf_next_lo16_addend): Likewise. + (mips_elf_calculate_relocation): Likewise. + (mips_elf_obtain_contents): Likewise. + (mips_elf_perform_relocation): Likewise. + (mips_elf_assign_gp): Likewise. + (mips_elf_sort_hash_table_f): Likewise. + (mips_elf_sort_hash_table): Likewise. + (mips_elf_got_section): Likewise. + (mips_elf_got_info): Likewise. + (mips_elf_create_local_got_entry): Likewise. + (mips_elf_got16_entry): Likewise. + (mips_elf_create_dynamic_relocation): Likewise. + (elf_mips_howto_table): Add description of R_MIPS_SCN_DISP. + (mips_elf_final_gp): Use mips_elf_assign_gp. + (_bfd_mips_elf_symbol_processing): Don't move SHN_COMMON symbols + into SHN_SCOMMON automatically on IRIX6. + (mips_elf_add_symbol_hook): Likewise. + (mips_elf_relocate_section): Rewrite, using + mips_elf_calculate_relocation and mips_elf_perform_relocation. + (mips_elf_create_dynamic_section): Use MIPS_ELF_STUB_SECTION_NAME. + Don't deal with .rld_map on IRIX6. + (mips_elf_create_got_section): Adjust use of global_gotsym. Set + section flags appropriately for .got. + (mips_elf_check_relocs): Handle IRIX6 relocations making use of + the got. Call mips_elf_record_global_got_symbol and allocate + local got space appropriately. + (mips_elf_size_dynamic_sections): Use bfd_byte *, not unsigned + char *. Rework calculation of GOT size. Sort dynamic symbol + table entries so entries that do not require GOT entries appear at + the beginning. Don't use DT_MIPS_HIPAGENO on IRIX6. Remove dead + code dealing with DT_INIT and DT_FINI. Remove fiddling with + global_gotsym. + (mips_elf_finish_dynamic_symbol): Adjust creation of global GOT + entries. + (mips_elf_finish_dynamic_symbol): Use + mips_elf_irix6_finish_dynamic_symbol. + (mips_elf_finish_dynamic_sections): Correct off-by-one error + setting DT_MIPS_UNREFEXTNO. Adjust setting of DT_MIPS_GOTSYM for + change to global_gotsym. Set DT_MIPS_OPTIONS on IRIX6. + +1999-06-30 Ian Lance Taylor + + * elf32-mips.c (mips_elf_final_link): Don't set CPIC when doing a + relocateable link. From Ralf Baechle . + +1999-06-04 Philip Blundell + + * elf32-arm.h (elf_backend_got_header_size): Define. + (elf_backend_plt_header_size): Likewise. + +1999-06-28 Jim Pick + + * elf32-arm.h (elf32_arm_relocate_section): Mind no_undefined + +Tue Jun 29 02:25:03 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.c (elf_hppa_howto_table): Use bfd_elf_generic_reloc as + relocation function. + * elf32-hppa.c (hppa_elf_reloc): Kill unused/unwanted function. + +1999-06-27 Mark Mitchell + + * elf32-mips.c (MIPS_ELF_SRDATA_SECTION_NAME): New macro. + (MIPS_ELF_OPTIONS_SECTION_NAME): Likewise. + (MIPS_ELF_STUB_SECTION_NAME): Likewise. + (_bfd_mips_elf_section_from_shdr): Use them. + (_bfd_mips_elf_fake_sections): Likewise. Add .srdata to the list + of GP-relative sections. + (_bfd_mips_elf_set_section_contents): Use them. + (_bfd_mips_elf_section_processing): Share code between .sdata and + .lit4/.lit8 sections. Set appropriate flags for .srdata. + (mips_elf_additional_program_headers): Add handling for + PT_MIPS_OPTIONS segment on IRIX6. + (mips_elf_modify_segment_map): Likeiwse. + (mips_elf_final_link): Set EF_MIPS_CPIC when required by the ABI. + Include the options sections on IRIX6. Don't look for GP-relative + sections by name; use SHF_MIPS_GPREL instead. + (ELF_DYNAMIC_INTERPRETER): Adjust to use /usr/lib32/libc.so.1 for + the N32 ABI. + (mips_elf_create_dynamic_sections): Don't muck about with section + alignments and such on IRIX6. + (mips_elf_adjust_dynamic_symbol): Use MIPS_ELF_STUB_SECTION_NAME. + (mips_elf_size_dynamic_sections): Likewise. Adjust to handle the + fact that ELF_DYNAMIC_INTERPRETER is no longer a constant. Use + bfd_zalloc rather than bfd_alloc and memset. + (mips_elf_finish_dynamic_symbol): Use MIPS_ELF_STUB_SECTION_NAME. + Don't assert the existence of .rld_map on IRIX6. + (mips_elf_finish_dynamic_sections): Use MIPS_ELF_STUB_SECTION_NAME. + + * elf32-mips.c (mips_elf_adjust_dynindx): Remove. + (mips_elf_size_dynamic_sections): Use _bfd_elf_link_adjust_dynindx + instead. + +1999-06-26 Mark Mitchell + + * elf32-mips.c (mips_elf_swap_msym_in): New function. + (mips_elf_swap_msym_out): New function. + (mips_elf_create_msym_section): Likewise. + (MIPS_ELF_MSYM_SECTION_NAME): New macro. + (_bfd_mips_elf_final_write_processing): Set sh_link for .msym. + (_bfd_mips_elf_section_from_shdr): Reject an SHT_MIPS_MSYM + section not named .msym. + (_bfd_mips_elf_fake_sections): Use MIPS_ELF_MSYM_SECTION_NAME, not + .msym directly. Set appropriate attributes for the .msym + section. + (mips_elf_link_hash_entry): Add min_dyn_reloc_index field. + (mips_elf_link_hash_newfunc): Clear it. + (mips_elf_create_dynamic_sections): Create the .msym section + on IRIX6. + (mips_elf_size_dynamic_sections): Allocate space for the + .msym section. Add a DT_MIPS_MSYM entry. + (mips_elf_finish_dynamic_symbol): Write out a .msym entry for + the symbol. + (mips_elf_finish_dynamic_sections): Assign a value for + DT_MIPS_MSYM. Add .msym entries for the section symbols as well. + + * elf32-mips.c (irix_compat_t): New enumeration. + (ABI_N32_P): New macro. + (IRIX_COMPAT): Likewise. + (SGI_COMPAT): Implement in terms of IRIX_COMPAT. + (mips_elf_relocate_section): Fix typo. + +1999-06-26 Mumit Khan + + * peicode.h (coff_swap_scnhdr_out): Mark non readonly BFD sections + as writable PE sections. + +1999-06-26 David Mosberger + + * dwarf2.c (struct arange): New type. + (struct comp_unit): Replace LOW and HIGH by member ARANGE. + (arange_add): New function. + (decode_line_info): Keep track of address ranges that a compilation + unit covers. + (comp_unit_contains_address): Return true if address is contained + in _any_ of the address ranges associated with a compilation unit. + (_bfd_dwarf2_find_nearest_line): Call comp_unit_find_nearest_line + on the first comp_unit that contains the address. + +1999-06-26 David Mosberger + + * dwarf2.c (struct dwarf2_debug): Add member dwarf_line_buffer. + (decode_line_info): Add variable STASH and initialize it to point + to the per-bfd dwarf2_debug info. Remove static variable + dwarf_line_buffer and use stash->dwarf_line_buffer in its place. + +1999-06-26 Ian Lance Taylor + + * elflink.h (elf_link_output_extsym): It's OK for a -Bsymbolic + shared library to have an undefined symbol. + + From Franz Sirl : + * elf32-ppc.c (ppc_elf_relocate_section): Fix last patch. + +Thu Jun 24 20:59:11 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.c (elf_hppa_final_write_processing): New function. + * elf32-hppa.c: Remove everything related to symbol extension + sections & records. Use the common elf_hppa_final_write_processing. + +1999-06-22 Mark Mitchell + + * elflink.h (size_dynamic_sections): Use user-specified init/fini + functions instead of _init/_fini if requested. + +1999-06-23 Ian Lance Taylor + + * elf.c (bfd_section_from_shdr): Avoid crashing on a bogus sh_link + field. + +1999-06-22 Ian Lance Taylor + + From Franz Sirl : + * elf32-ppc.c (ppc_elf_size_dynamic_sections): Set unused dynindx + field to 0, not -1. + (ppc_elf_finish_dynamic_sections): Check for positive section + dynindx field, rather than comparing against -1. + (ppc_elf_relocate_section): Only return false if undefined_symbol + or reloc_overflow fail, not always upon encountering an error. + +1999-06-22 Mark Mitchell + + * elflink.h (link_read_relocs): Explicitly cast external_relocs to + bfd_byte * before performing pointer arithmetic. + +Tue Jun 22 13:06:25 1999 Jeffrey A Law (law@cygnus.com) + + * elf-hppa.h: New file. Common stuff for elf32 and elf64 PA + support. + * elf32-hppa.c: Include elf-hppa.h. + (ARCH_SIZE): Define. + (elf_hppa_reloc_type_lookup): Delete. Found in the common code + now. + (elf32_hppa_info_to_howto): Similarly. + (elf_hppa_howto_table): Similarly. + (elf_hppa_reloc_type_lookup): Similarly. + (hppa_elf_gen_reloc_type): Similarly. + * elf32-hppa.h (ELF_HOWTO_TALBE, N_PARISC_RELOCS): Delete. + +1999-06-22 Nick Clifton + + * elf32-v850.c (v850_elf_final_link_relocate): Catch overflow + handling R_V850_22_PCREL relocation. + +1999-06-21 Ian Lance Taylor + + * coff-arm.c (arm_emit_base_file_entry): Explicitly declare return + type. + +Sun Jun 20 14:13:57 1999 Richard Henderson + + * section.c (_bfd_strip_section_from_output): Ignore sections + DISCARDed by the link script. + +1999-06-19 Ian Lance Taylor + + * elflink.h (elf_link_remove_section_and_adjust_dynindices): + Remove unused local variable spp. + + * xcofflink.c (bfd_xcoff_size_dynamic_sections): Don't crash if + the entry symbol is not set. + +Fri Jun 18 04:24:57 1999 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relocate_section): Don't adjust + GPDISP or LITUSE in a relocatable link. + +Thu Jun 17 21:24:43 1999 J"orn Rennecke + + * dwarf1.c (alloc_dwarf1_unit): Allocate using bfd_zalloc. + * (alloc_dwarf1_func): Likewise. + +Wed Jun 16 03:09:57 1999 Jeffrey A Law (law@cygnus.com) + + * libhppa.h: Fix various formatting errors. + (assemble_3); Rewrite using CATENATE. + (assemble_17): Fix various bugs. + +1999-06-16 Nick Clifton + + * elf32-mcore.c (R_MCORE_RAW): Fix definition. + +1999-06-15 Richard Henderson + + * section.c (SEC_SHORT): Define. + * bfd-in2.h: Rebuild. + +1999-06-13 Mark Mitchell + + * elflink.h (elf_link_remove_section_and_adjust_dynindices): + Remove abfd parameter. Use _bfd_strip_section_from_output. + (bfd_elf_size_dynamic_sections): Adjust callers accordingly. + + * elf-bfd.h (_bfd_elf_link_adjust_dynindx): New function. + * elflink.c (_bfd_elf_link_adjust_dynindx): Define it. + * elflink.h (elf_link_remove_section_and_adjust_dynindices): New + function. + (bfd_elf_size_dynamic_sections): Use it. + +1999-06-13 Alan Modra + + * elf32-i386.c (elf_howto_table): Change R_386_PC8 from + complain_overflow_bitfield to complain_overflow_signed. + +1999-06-13 Mark Mitchell + + * elflink.h (elf_link_read_relocs_from_section): New function, + split out from ... + (elf_link_read_relocs): Here. Use it for both relocation + sections. + +1999-06-12 Mark Mitchell + + * elfcode.h (elf_slurp_reloc_table_from_section): Don't assume + asect->reloc_count is valid. + +1999-06-12 Ian Lance Taylor + + * elf32-mips.c (mips_elf32_section_processing): Permit a + SHT_MIPS_REGINFO section to have a size of 0. + +1999-06-12 David O'Brien + + * config.bfd (alpha*-*-freebsd*): New target. + (i[3456]86-*-freebsd*): Now defaults to ELF. + +1999-06-11 Ian Lance Taylor + + * reloc.c (_bfd_relocate_contents): Permit bitfield relocations to + wrap if the relocation covers the high bit of an address. + + * dwarf2.c (decode_line_info): Remove unused variable first_time. + +1999-06-10 Jakub Jelinek + + * 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_info_to_howto): Likewise; handle vtable relocations. + +1999-06-07 Richard Henderson + + * section.c (_bfd_strip_section_from_output): Remove output + sections with no initial link_order. + +1999-06-07 Nick Clifton + + * elf32-m88k.c (ELF_MAXPAGESIZE): Define. + +Mon Jun 7 11:49:43 1999 Andreas Schwab + + * Makefile.am (SOURCE_HFILES): Add missing headers. + * Makefile.in: Regenerated. + +1999-06-06 Mark Mitchell + + * elf32-mips.c (_bfd_mips_elf_print_private_data): Recognize + the N32 ABI. + +1999-06-04 Franz Sirl + + * elf32-ppc.c (ppc_elf_relocate_section): Don't barf on out of + range undefweak symbols. + * hash.c: Add missing comma after @xref{} + * linker.c: Likewise. + +1999-06-04 Nick Clifton + + * elfxx-target.h (ELF_MAXPAGESIZE): Produce an error message + if not defined. + * elf32-gen.c (ELF_MAXPAGESIZE): Define. + * elf32-i860.c (ELF_MAXPAGESIZE): Define. + * elf32-i960.c (ELF_MAXPAGESIZE): Define. + * elf64-gen.c (ELF_MAXPAGESIZE): Define. + +1999-06-04 Ian Lance Taylor + + * Makefile.am: Rebuild dependencies. + (BFD32_BACKENDS): Add dwarf1.lo. + (BFD32_BACKENDS_CFILES): Add dwarf1.c. + * Makefile.in: Rebuild. + +1999-06-04 Nick Clifton + + * Makefile.am: Add epoc-arm-pe target. + * Makefile.in: Regenerate. + * pe-arm.c: Only redefine interworking function names if they have + not already been redefined. + * pei-arm.c: Only redefine interworking function names if they have + not already been redefined. + * epoc-pe-arm.c: Redefine interworking function names to avoid a + name space clash. + * epoc-pei-arm.c: Redefine interworking function names to avoid a + name space clash. + +1999-06-03 Nick Clifton + + * elfxx-target.h (ELF_MAXPAGESIZE): Default to 0x1000 not 1. + +Fri Jun 4 10:05:11 1999 Andreas Schwab + + * elf.c (elf_fake_sections): Undo change of 1999-05-10. + +Fri Jun 4 03:10:49 1999 J"orn Rennecke + + * elf32-sh.c (sh_elf_relax_delete_bytes): Fix setting of + start / stop for recalculating of r_addend of R_SH_SWITCH*. + +Fri Jun 4 02:53:13 1999 J"orn Rennecke + + * elf32-sh.c (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH32 + in other text sections. + +Fri Jun 4 02:29:34 1999 J"orn Rennecke + + * libbfd.c (_bfd_generic_verify_endian_match): New function. + * libbfd-in.h (_bfd_generic_verify_endian_match): Declare. + * libbfd.h: Regenerate. + * coff-sh.c (sh_merge_private_data): Delete. + (coff_bfd_merge_private_bfd_data): Change to + _bfd_generic_verify_endian_match. + (elf32-sh.c): bfd_elf32_bfd_merge_private_bfd_data: Define. + +1999-06-03 Ulrich Drepper + + * elf32-arm.h: Fix typo: change ELF_MAXPAGE_SIZE to ELF_MAXPAGESIZE. + +1999-06-03 Ian Lance Taylor + + * bfd-in.h (bfd_elf32_arm_allocate_interworking_sections): Correct + prototype. + (bfd_elf32_arm_process_before_allocation): Likewise. + * bfd-in2.h: Rebuild. + +1999-06-03 David Mosberger + + * dwarf2.c (struct line_info): Add member END_SEQUENCE to keep + track of end_sequence markers. + (add_line_info): Add END_SEQUENCE arg. + (decode_line_info): Don't try to infer lo_pc and hi_pc from the + debug-line info---it doesn't work right if a compilation unit + consists of multiple discontiguous code-sequences. It would be + worthwhile to optimize for the common case where a compilation + unit results in a contiguous set of code sequences, but this is + quite tricky to get right for arbitrary DWARF2 files. + (lookup_address_in_line_info_table): Don't use the last line entry + for a compilation unit for anything with an address higher than + this line entry. Also, check for end_sequence markers to + correctly handle discontinuities. + (_bfd_dwarf2_find_nearest_line): When checking previously loaded + compilation units, check all compilation units with each->high==0 + just like when reading compilation units. + + * dwarf2.c (decode_line_info): Initialize table->files and + table->last_line to NULL to avoid segfaults due to random + values in these members. + (concat_filename): Check for out-of-range file number before + indexing filename table. Segfaults suck. + + * dwarf2.c (decode_line_info): Don't truncate address to least + significant 32 bits (breaks 64 bit targets). + (lookup_address_in_function_table): Ditto. + (comp_unit_contains_address): Ditto. + +1999-06-02 Mark Mitchell > + + * elf32-mips.c (elf_mips_howto_table): Add R_MIPS_JALR. + * elf64-mips.c (mips_elf64_howto_table_rel): Likewise. + (mips_elf64_howto_table_rela): Likewise. + + * elfcode.h (elf_slurp_reloc_table_from_section): New function, + split out from ... + (elf_slurp_reloc_table): Here. Use it to handle the case where a + single section has two associated relocation sections. + +1999-06-02 Mark Salter + + * coffcode.h (coff_set_alignment_hook): Set lma from s_vaddr if + COFF_WITH_PE defined. + +1999-06-02 Nick Clifton + + * pe-arm.c: Rename global arm interworking functions to avoid name + collision when all targets BFD is built. + * pei-arm.c: Ditto. + +1999-05-31 Mark Mitchell + + * elf-bfd.h (elf_backend_data): Remove use_rela_p. Add + may_use_rel_p, may_use_rela_p, default_use_rela_p. + (bfd_elf_section_data): Add use_rela_p. + * elf.c (bfd_section_from_shdr): Set use_rela_p appropriately. + (_bfd_elf_new_section_hook): Likewise. + (elf_fake_sections): Use may_use_rela_p, etc., instead of + use_rela_p. + (_bfd_elf_copy_private_section_data): Copy use_rela_p. + * elfcode.h (write_relocs): Determine whether or not use rela + relocs based on the relocation section header. + * elflink.c (_bfd_elf_create_dynamic_sections): Use default_use_rela_p + instead of use_rela_p. + * elfxx-target.h (elf_backend_may_use_relp): New macro. + (elf_backend_may_use_rela_p): Likewise. + (elf_backend_default_use_rela_p): Likewise. + (elfNN_bed): Use them. + +Wed Jun 2 12:38:49 1999 Miodrag Vallat + + * hosts/alphalinux.h (TRAD_CORE_EXTRA_SIZE_ALLOWED): Expand to 4096. + +Tue Jun 1 17:57:58 1999 Mark P. Mitchell + + * reloc.c (BFD_RELOC_MIPS_SUB): New relocation. + (BFD_RELOC_MIPS_GOT_PAGE): Likewise. + (BFD_RELOC_MIPS_GOT_OFST): Likewise. + (BFD_RELOC_MIPS_GOT_DISP): Likewise. + * bfd-in2.h: Regenerated. + * libbfd.h: Likewise. + * elf32-mips.c (mips_info_to_howto_rela): New function. + (USE_REL): Adjust for new conventions. + (MINUS_ONE): New macro. + (elf_mips_howto_table): Add R_MIPS_SUB. + (mips_r): Add entries for MIPS_SUB, MIPS_GOT_PAGE, MIPS_GOT_OFST, + and MIPS_GOT_DISP. + (mips_elf_final_write_processing): Set sh_link, not sh_info, for a + .MIPS.content section. + (_bfd_mips_elf_fake_sections): Treat all sections that begin + with .MIPS.content as .MIPS.content sections. Set + SHF_MNIPS_NOSTRIP for such section. + (elf_info_to_howto): Define to mips_info_to_howto_rela. + * elf64-mips.c (mips_r): Add entries for MIPS_SUB, MIPS_GOT_PAGE, + MIPS_GOT_OFST, and MIPS_GOT_DISP. + +Wed Jun 2 11:51:12 1999 Andreas Schwab + + * vms-misc.c (_bfd_vms_hash_newfunc): Fix use of uninitialized + variable. + + * elf32-m68k.c (elf_m68k_adjust_dynamic_symbol): Avoid ambigous + `else'. + +1999-05-30 Philip Blundell + + * elf32-arm.h (elf32_arm_relocate_section): Reinstate change of + 1993-03-25 (!!). Take into account the bitmasks for the reloc so + the addend does not overflow into the rest of the word. + +1999-05-29 Nick Clifton + + * bfd-in.h: Amend prototype for + bfd_elf32_arm_process_before_allocation . + * bfd-in.h: Regenerate. + + * elfarm-oabi.c (NUM_ELEM): New macro: Compute the number of + elements in a fixed sized array. + (ARM_ELF_ABI_VERSION): Define. + (ARM_ELF_OS_ABI_VERSION): Define. + (R_ARM_THM_ABS5): Fix rightshift and size. + (R_ARM_THM_PC22): Fix size. + (R_ARM_PLT32): Define Howto. + (find_howto): New function: Locate a howto based on a reloc + number. + (elf32_arm_info_to_howto): Use find_howto if necessary. + (elf32_arm_reloc_map): Change type of field bfd_reloc_val to + bfd_reloc_code_real_type. + (elf32_arm_reloc_map[]): Add entries for BFD_RELOC_VTABLE_INHERIT + and BFD_RELOC_VTABLE_ENTRY. + (elf32_arm_reloc_type_lookup): Use find_howto if necessary. + + * elfarm-nabi.c (NUM_ELEM): New macro: Compute the number of + elements in a fixed sized array. + (ARM_ELF_ABI_VERSION): Define. + (ARM_ELF_OS_ABI_VERSION): Define. + (R_ARM_THM_ABS5): Fix rightshift and size. + (R_ARM_THM_PC22): Fix size. + (elf32_arm_info_to_howto_rel): Rename to elf32_arm_info_to_howto. + (elf32_arm_reloc_map): Change type of field bfd_reloc_val to + bfd_reloc_code_real_type. + + * elf32-arm.h (struct elf32_arm_link_hash_table): Add new field: + no_pipeline_knowledge. + (elf32_arm_link_hash_create): Initialise new field to zero. + (bfd_elf32_arm_process_before_allocation): Add new paraemter: + no_pipeline_knowledge. Use this parameter to initialise the field + in the globals data structure. + (elf32_arm_final_link_relocate): Only add in pipeline offset if + no_pipeline_knowledge is false and the binary is from an old + toolchain. + (elf32_arm_merge_private_data): Generate an error if an attempt is + made to link together big endian and little endian code. + (elf32_arm_post_process_headers): New function: Initialise the + EI_OSABI and EI_ABIVERSION fields of the newly created ELF program + header. + (elf_backend_post_process_headers): Define. + +1999-05-28 Nick Clifton + + * elf-bfd.h (struct elf_backend_data): Add new field: + elf_backend_post_process_headers. + + * elfxx-target.h (elf_backend_post_process_headers): Define to + NULL if not already defined. + (elfNN_bed): Initialise elf_backend_post_process_headers field. + + * elf.c (prep_headers): Set the EI_OSABI and EI_ABIVERSION fields + to zero. + (_bfd_elf_compute_section_file_positions): Call + elf_backend_post_process_headers if defined. + +1999-05-28 Ian Lance Taylor + + * configure.in: Check whether getuid and getgid exist. + * archive.c: Define getuid and getgid as macros if HAVE_GETUID or + HAVE_GETGID are not defined, respectively. + (bfd_write_armap): Don't special case on _WIN32 for getuid and + getgid. + * configure.host: Set ac_cv_func_get{ug}id for *-*-windows*. + * configure, config.in: Rebuild. + +1999-05-28 Martin Dorey + + * elf32-i960.c: New file. + * elf.c (prep_headers): Handle bfd_arch_i960. + * targets.c (bfd_target_vector): Add &bfd_elf32_i960_vec. + * config.bfd (i960-*-elf*): New target. + * configure.in (bfd_elf32_i960_vec): New target vector. + * Makefile.am (BFD32_BACKENDS): Add elf32-i960.lo. + (BFD32_BACKENDS_CFILES): Add elf32-i960.c. + * Makefile.in, aclocal.m4, configure: Rebuild. + +1999-05-27 Nick Clifton + + * elfarm-oabi.c (elf32_arm_howto_table): Add entry for + R_ARM_PLT32. + (find_howto): New function: Find entries in the + elf32_arm_howto_table. + (elf32_arm_info_to_howto): Use find_howto if the entry cannot be + computed simply. + (elf32_arm_reloc_type_lookup): Add lookup for + BFD_RELOC_ARM_PLT32. + +1999-05-25 Philip Blundell + + * bfd/elf32-arm.h (elf32_arm_link_hash_newfunc): New function. + (elf32_arm_link_hash_table_create): Use above function as the + constructor for hash table entries. + (elf32_arm_relocate_section): Avoid crash when there is no output + section. + (elf32_arm_final_link_relocate): New parameter h. + (elf32_arm_relocate_section): Pass symbol hash entry to above + routine. + (elf32_arm_gc_sweep_hook, elf32_arm_check relocs): Correct + comments. + +1999-05-25 Catherine Moore + + * coff-arm.c (coff_arm_relocate_section): Don't emit + base file entries for pc-relative values. + +1999-05-25 DJ Delorie + + * peicode.h (coff_swap_sym_in): When we create the actual section + to reflect the not-there section C_SECTION symbols refer to, + change the symbol class to C_STAT as the section is now really + there. + +1999-05-24 Philip Blundell + + * elf32-arm.h (elf32_arm_relocate_section): Undo change of + 1999-03-25. + +Mon May 17 13:35:35 1999 Stan Cox + + * coff-arm.c (_bfd_coff_arm_set_private_flags): Changed + F_PIC_INT to F_PIC. + * coffcode.h (coff_set_arch_mach_hook): Added F_ARM_2a, and + F_ARM_3M labels. Changed F_PIC_INT to F_PIC. + +1999-05-16 Nick Clifton + + * coff-mcore.c (in_reloc_p): Reinstate. + +1999-05-15 Nick Clifton + + * reloc.c (BFD_RELOC_MCORE_RVA): Define. + * bfd-in2.h: Regenerate. + * coff-mcore.c (in_reloc_p): Remove defintion. + (mcore_coff_howto): Add IMAGE_REL_MCORE_RVA. + (mcore_coff_reloc_type_lookup): Map BFD_RELOC_RVA to + IMAGE_REL_MCORE_RVA. + (coff_mcore_rtype_to_howto): Add special processing for + IMAGE_REL_MCORE_RVA. + (coff_mcore_relocate_section): Add support for + IMAGE_REL_MCORE_RVA. + * elf32-mcore (mcore_elf_howto_): Add R_MCORE_RELATIVE. + (mcore_elf_reloc_type_lookup): Map BFD_RELOC_RVA to + R_MCORE_RELATIVE. + (mcore_elf_relocate_section): Delete redundant case labels. + +Fri May 14 10:59:55 1999 Andreas Schwab + + * elf32-arm.h (elf32_arm_relocate_section): Fix operator + precedence between bit-and and comparison. + +Thu May 13 09:45:23 1999 Joel Sherrill (joel@OARcorp.com) + + * config.bfd (i[3456]86*-*-rtems*, m68k*-*-rtems*): Added to + list of target formats (targ_selvecs). + (i[3456]86*-*-rtemself*, mips*el-*-rtems*): New targets. + (powerpcle*-*rtems*, sh-*-rtemself*): New targets. + +1999-05-10 DJ Delorie + + * ecoff.c (_bfd_ecoff_write_armap): give the symtab element a + reasonable mode until "ar x" is smart enough to skip it (fixes + gcc/libgcc.a builds on mips-ecoff targets + + * coffcode.h (styp_to_sec_flags): Explain how COMDATs are supposed + to work. Hack to support MS import libraries, which use different + COMDAT types than GNU. + (coff_slurp_symbol_table): C_SECTION symbols are local; they refer + to implied zero-length sections (see peicode below) + * coffgen.c (coff_get_normalized_symtab): Properly read long MS + filename symbols, which use one *or more* auxents. + * coffswap.h (coff_swap_aux_in): ditto + * peicode.h (coff_swap_sym_in): Build the implied zero-length + sections + +Tue May 11 15:51:58 1999 Jeffrey A Law (law@cygnus.com) + + * elf32-v850.c (v850_elf_howto_table): Make partial_inplace false + for all relocations. + +1999-05-10 Catherine Moore + + * bfd-in.h (bfd_arm_allocate_interworking_sections): Static + if COFF_IMAGE_WITH_PE. + (bfd_arm_process_before_allocation): Likewise. + (bfd_arm_get_bfd_for_interworking): Likewise. + * coff-arm.c: Likewise. + * bfd-in2.h: Regenerate. + * configure.in (armpe_little_vec): Remove coff-arm.lo. + (armpe_big_vec): Likewise. + * configure: Rebuild. + +1999-05-10 Nick Clifton + + * elf.c (elf_fake_sections): Check for .rel. as start of rel + section, not just .rel. Same for .rela. + +1999-05-07 Nick Clifton + + * coff-mcore.c (coff_mcore_relocate_section): Replace assert about + endianism with an error message. + +Thu May 6 17:09:09 1999 Fred Fish + + * dwarf2.c (read_abbrevs): Change cast of dwarf_abbrev_buffer + assignment from "unsigned char *" to "char *". + (decode_line_info): Likewise for dwarf_line_buffer assignment. + +1999-05-05 Catherine Moore + + * coff-arm.c (coff_arm_relocate_section): Add one to + address of ARM_RVA32 thumb functions. + +1999-05-05 Catherine Moore + + * elf32-m68k.c (elf32_m68k_set_private_flags): New. + (elf32_m68k_copy_private_bfd_data): New. + (elf32_m68k_merge_private_bfd_data): New. + (elf32_m68k_print_private_bfd_data): New. + (CPU32_FLAG): Define. + (PLT_CPU32_ENTRY_SIZE): Define. + (elf_cpu32_plt0_entry): Declare. + (elf_cpu32_plt_entry): Declare. + (elf_m68k_adjust_dynamic_symbol): Generate cpu32 plt entries. + (elf_m68k_finish_dynamic_symbol): Likewise. + (elf_m68k_finish_dynamic_sections): Likewise. + (elf_backend_plt_header_size): Remove definition. + (bfd_elf32_bfd_copy_private_bfd_data): Define. + (bfd_elf32_bfd_merge_private_bfd_data): Define. + (bfd_elf32_bfd_set_private_flags): Define. + (bfd_elf32_bfd_print_private_bfd_data): Define. + +Mon May 3 09:24:49 1999 Jeffrey A Law (law@cygnus.com) + + * som.c (som_fixup_formats): Fix comments for R_SHORT_PCREL_MODE + and R_LONG_PCREL_MODE. + +1999-04-29 Nick Clifton + + * coff-mcore.c (coff_mcore_relocate_section): Fix typos. + +Fri Apr 28 16:36:19 1999 Stan Cox + + * elf32-sh.c (sh_elf_relocate_section): Include relocation addend + in relocation calculation. + +1999-04-26 Tom Tromey + + * aclocal.m4, configure: Updated for new version of libtool. + +1999-04-21 Nick Clifton + + * coff-mcore.c: Add support for mcore relocs. + +1999-04-20 Gavin Romig-Koch + + * elf32-mips.c (_bfd_mips_elf_print_private_bfd_data): Scrap the + incorrect use EF_MIPS_xxBITPTRS. + +1999-04-18 Ian Lance Taylor + + * elf64-alpha.c (elf64_alpha_relax_section): Remove unused local + variable insn. + + * bfd-in2.h: Rebuild. + * libbfd.h: Rebuild. + +Sat Apr 17 20:55:15 1999 Catherine Moore + + * coff-arm.c (coff_arm_rtype_to_howto): Remove ARM26D transform. + (coff_arm_relocate_section): Add ARM26D transform. Only + change to ARM26D for relocateable links. + +1999-04-16 Gavin Romig-Koch + + * elf32-mips.c (_bfd_mips_elf_print_private_bfd_data): New. + (bfd_elf32_bfd_print_private_bfd_data): New. + +1999-04-15 Doug Evans + + * elf32-arm.h (elf32_arm_final_link_relocate): For R_ARM_THM_ABS5, + refetch addend if USE_REL, add many comments regarding current state. + For R_ARM_THM_PC22, refetch addend if USE_REL, simplify. + * elfarm-nabi.c (elf32_arm_howto_table): For R_ARM_THM_ABS5, fix + size and rightshift. For R_ARM_THM_PC22, fix bitsize. + * elfarm-oabi.c (elf32_arm_howto_table): Ditto. + +Wed Apr 14 14:33:08 1999 Richard Henderson + + * elf32-mips.c (_bfd_mips_elf_read_ecoff_info): Zero `debug'. + * elf64-alpha.c (elf64_alpha_read_ecoff_info): Likewise. + +1999-04-13 David Mosberger + + * dwarf2.c (decode_line_info): Don't truncate address to least + significant 32 bits (breaks 64 bit targets). + (lookup_address_in_function_table): Ditto. + (comp_unit_contains_address): Ditto. + +Tue Apr 13 21:27:19 1999 Catherine Moore + + * coff-arm.c (arm_emit_base_file_entry): New routine. + (A2T3_OFFSET): Define. + (T2A3_OFFSET): Define. + (coff_arm_relocate_section): Emit base file entries for interworking + stubs. + +1999-04-13 Philip Blundell + + * elfarm-nabi.c (elf32_arm_howto_table): Add dummy entries for + relocs 17 through 19. + +Sun Apr 11 01:25:17 1999 Richard Henderson + + * elfcode.h: Remove fnmatch.h. + * elflink.h (elf_link_assign_sym_version): Call back to ld + instead of calling fnmatch. + + * config.bfd (i?86-*-beoself): Include pe vecs. + +Sun Apr 11 01:14:06 1999 Richard Henderson + + * elf32-i386.c (elf_i386_finish_dynamic_sections): Allow .plt + to go missing. + +1999-04-10 Richard Henderson + + * elf32-i386.c (elf_i386_relocate_section): Mind no_undefined + when trying to resolve dynamic symbol references. + * elf32-m68k.c (elf_m68k_relocate_section): Likewise. + * elf32-mips.c (mips_elf_relocate_section): 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. + * elflink.h (elf_link_output_extsym): Likewise. + +Sat Apr 10 15:12:09 1999 Richard Henderson + + * section.c (_bfd_strip_section_from_output): New function moved from + * elf64-alpha.c (elf64_alpha_strip_section_from_output): ... here. + * elf32-i386.c (elf_i386_size_dynamic_sections): Use it. + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Likewise. + * elf32-mips.c (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-sparc.c (sparc64_elf_size_dynamic_sections): Likewise. + * bfd-in2.h: Update. + +1999-04-09 Ian Lance Taylor + + * elf64-sparc.c: Fix incorrect calls to bfd_check_overflow. + +1999-04-08 Nick Clifton + + * coff-mcore.c: New File: Support for mcore-pe targets. + * cpu-mcore.c: New File: Support for mcore targets. + * elf32-mcore.c: New File: Support for mcore-elf target. + * pe-mcore.c: New File: Definitions for mcore-pe target. + * pei-mcore.c: New File: Definitions for mcore-pei target. + * Makefile.am: Add support for MCore targets. + * Makefile.in: Regenerate. + * config.bfd: Add support for MCore targets. + * configure.in: Add support for MCore targets. + * configure: Regenerate. + * archures.c: Add support for MCore architecture. + * bfd-in2.h: Regenerate. + * coffcode.h: Add support for mcore-pe targets. + * elf.c: Add support for mcore-elf target. + * reloc.c: Add support for MCore relocs. + * targets.c: Add support for MCore targets. + +1999-04-07 Nick Clifton + + * elfarm-nabi.c (elf32_arm_howto_table): Add entries for + R_ARM_XPC25 and R_ARM_THM_XPC22. + (elf32_arm_reloc_map): Remove redundant entries. + +1999-04-06 Ian Lance Taylor + + * sysdep.h (LC_MESSAGES): Never define. + +1999-04-06 Chris Torek + + * reloc.c (bfd_check_overflow): Add addrsize parameter. Change + all callers. Rewrite completely. + (_bfd_relocate_contents): Rewrite overflow checking. + * bfd-in2.h: Rebuild. + +1999-04-05 Ian Lance Taylor + + From Gabriel Paubert : + * elf32-ppc.c (ppc_elf_howto_raw): Set R_PPC_GOT16_LO, + R_PPC_PLT16_LO and R_PPC_SECTOFF_LO to be complain_overflow_dont. + Set R_PPC_PLT16_HA, R_PPC_SECTOFF_HA and R_PPC_EMB_NADDR16_HA to + have a rightshift of 16 and use ppc_elf_addr16_ha_reloc. + * ppcboot.c (ppcboot_vec): Use little endian routines for + headers. + + * elf.c (elfcore_strndup): Only define if it will be used. + * elf32-ppc.c (ppc_elf_relax_section): Remove unused locals irel + and irelend. + (ppc_elf_check_relocs): Remove unused local i. + (ppc_elf_gc_mark_hook): Add default case to switch. + + From Bernd Nitzler : + * srec.c (srec_scan): Accept \r in symbol definitions. + (srec_object_p): Set HAS_SYMS if we saw any symbols. + (symbolsrec_object_p): Likewise. + +1999-04-04 Don Bowman + + * config.bfd: Add mips*el-*-vxworks* and mips*-*-vxworks*. + +1999-04-04 Ian Lance Taylor + + * dwarf1.c (parse_line_table): Remove unused locals last_pc and + last_line. + * elf-bfd.h (_bfd_elfcore_section_from_phdr): Declare. + * elf32-i386.c (elf_i386_gc_mark_hook): Add default case to + switch. + * elflink.h (NAME(bfd_elf,size_dynamic_sections)): Remove unused + local i. + * syms.c (_bfd_stab_section_find_nearest_line): Remove unused + local val. + +1999-03-31 Nick Clifton + + * config.bfd: Add support for arm-epoc-pe target. + * configure.in: Add support for arm-epoc-pe target. + * configure: Regenerate. + * 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 + TARGET_LITTLE_SYM and TARGET_BIG_SYM. + * pei-arm.h: 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. + +1999-03-30 Nick Clifton + + * elf.c (elf_map_symbols): Handle the case where section + symbols are generated for content-less sections which are + not mapped to the output file. + + * linker.c: Replace direct references to fields in BFD structure + with accessor macros. + + * elflink.h: Replace direct references to fields in BFD structure + with accessor macros. + +1999-03-25 Philip Blundell + + * config.bfd: Eliminate redundancy in checks for Linux/ARM. + + * elf32-arm.h (elf32_arm_relocate_section): Take the rightshift into + account when adjusting section symbols during a partial link. + +1999-03-24 Nick Clifton + + * coff-sparc.c (struct coff_reloc_map): Change type of field + 'bfd_reloc_val' to bfd_reloc_code_real_type. + * elf-m10200.c (struct mn10200_reloc_map): Ditto. + * elf-m10300.c (struct mn10300_reloc_map): Ditto. + * elf32-arc.c (struct arc_reloc_map): Ditto. + * elf32-d10v.c (struct d10v_reloc_map): Ditto. + * elf32-d30v.c (struct d30v_reloc_map): Ditto. + * elf32-fr30.c (struct fr30_reloc_map): Ditto. + * elf32-m32r.c (struct m32r_reloc_map): Ditto. + * elf32-sh.c (struct elf_reloc_map): Ditto. + * elf32-sparc.c (struct elf_reloc_map): Ditto. + * elf32-v850.c (struct v850_reloc_map): Ditto. + * elf64-sparc.c (struct elf_reloc_map): Ditto. + * elfarm-nabi.c (struct elf32_arm_reloc_map): Ditto. + * elfarm-oabi.c (struct elf32_arm_reloc_map): Ditto. + +1999-03-17 Martin Hunt + + * syms.c (_bfd_stab_section_find_nearest_line): Changed this + function so source-level assembly works. If multiple N_SOs + are seen without and N_FUNs, create an indextable entry with + a NULL function name. + +1999-03-16 Gavin Romig-Koch + + * elf32-mips.c (_bfd_mips_elf_merge_private_bfd_data) Allow merging + of certian similar cpus. + +1999-03-16 Gavin Romig-Koch + + * elf32-mips.c (_bfd_mips_elf_final_write_processing): + Add the 5000. Change the architecture for the 5400 to mips4. + (elf_mips_mach): Add r5000. + +1999-03-11 Doug Evans + + * cpu-i960.c (scan_i960_mach): Recognize i960:ka_sa and i960:kb_sb. + +1999-03-11 Nick Clifton + + * binary.c (binary_set_section_contents): Generate warning about + huge file offsets for any section that will occupy file space, not + just those that are loadable. + +1999-02-24 Jim Blandy + + * libbfd.h: Regenerate after Nick Clifton's Feb 17 changes. + +1999-02-22 Jim Lemke + + * elf32-ppc.c: Add ppc_elf_relax_section() for the ld option mpc860c0. + +Mon Feb 22 18:26:51 1999 Ian Lance Taylor + + * elf-bfd.h (ELF_LINK_HASH_REF_REGULAR_NONWEAK): Define. + * elflink.h: Revert all changes since Feb 16. Instead: + (elf_link_add_object_symbols): Set REF_REGULAR_NONWEAK flag if + appropriate. Copy it to version symbols. + (elf_fix_symbol_flags): Set REF_REGULAR_NONWEAK for non ELF + symbols if appropriate. + (elf_adjust_dynamic_symbol): Set REF_REGULAR_NONWEAK for weakdef + symbol if appropriate. + (elf_link_output_extsym): If symbol is marked as undefined, and + has no nonweak references, mark it as weak undefined. + +Fri Feb 19 16:01:12 1999 Ian Lance Taylor + + * elflink.h (elf_merge_symbol): When overriding a dynamic + definition with a weak undefined symbol, set NEEDS_PLT if it is a + function. + (elf_link_add_object_symbols): Don't copy the other field if we + are overridding. + +Thu Feb 18 18:07:43 1999 Ian Lance Taylor + + * elflink.h (elf_merge_symbol): Do not merge any symbol from a + shared object with a weak undefined symbol. + +1999-02-18 Nick Clifton + + * elfarm-nabi.c: Set partial_inplace back to false. + +1999-02-17 Nick Clifton + + * coff-arm.c (TARGET_UNDERSCORE): Re-enable. + (USER_LABEL_PREFIX): Set to "_". + + The following patches are from: Scott Bambrough + + + * libaout.h (M_ARM6_NETBSD): Set to 143. + + * reloc.c: Add ARM PIC relocs: BFD_RELOC_ARM_GOT12, + BFD_RELOC_ARM_GOT32, BFD_RELOC_ARM_JUMP_SLOT, BFD_RELOC_ARM_COPY, + BFD_RELOC_ARM_GLOB_DAT, BFD_RELOC_ARM_PLT32, + BFD_RELOC_ARM_RELATIVE, BFD_RELOC_ARM_GOTOFF, BFD_RELOC_ARM_GOTPC. + * bfd-in2.h: Regenerate. + + * elfarm-nabi.c (elf32_arm_howto_table): Set partial_inplace to + 'true' as REL relocs are now being used. Add new PIC relocs: + R_ARM_COPY, R_ARM_GLOB_DAT, R_ARM_JUMP_SLOT, R_ARM_RELATIVE, + R_ARM_GOTOFF, R_ARM_GOTPC, R_ARM_GOT32, R_ARM_PLT32. + + * elf32-arm.h (elf32_arm_merge_private_bfd_data): Check byte order + of targets. + (elf32_arm_final_link_relocate): Change parameters so that entire + reloc is passed. Add support for PIC relocs. + (elf32_arm_relocate_section): Pass entire reloc to + elf32_arm_final_link_relocate. + (elf32_arm_check_relocs): Handle new PIC relocs. + (elf32_arm_adjust_dynamic_symbol): New function. + (elf32_arm_size_dynamic_sections): New function. + (elf32_arm_discard_copies): New function. + (elf32_arm_finish_dynamic_symbol): New function. + (elf32_arm_finish_dynamic_sections): New function. + (ELF_MAXPAGE_SIZE): Define. + (bfd_elf32_bfd_reloc_type_lookup): Define. + (elf_backend_relocate_section): Define. + (elf_backend_adjust_dynamic_symbol): Define. + (elf_backend_create_dynamic_sections): Define. + (elf_backend_finish_dynamic_symbol): Define. + (elf_backend_finish_dynamic_sections): Define. + (elf_backend_size_dynamic_sections): Define. + (elf_backend_plt_readonly): Define. + (elf_backend_want_got_plt): Define. + (elf_backend_want_plt_sym): Define. + +Wed Feb 17 12:02:26 1999 Stan Cox + + * elf32-mips.c (_bfd_mips_elf_section_from_shdr): Make reginfo + sections SEC_LINK_ONCE and SEC_LINK_DUPLICATES_SAME_SIZE. + (_bfd_mips_elf_fake_sections): Likewise. + +Wed Feb 17 12:07:23 1999 Andreas Schwab + + * elfarm-oabi.c (bfd_elf32_arm_allocate_interworking_sections, + bfd_elf32_arm_get_bfd_for_interworking, + bfd_elf32_arm_process_before_allocation): Define to avoid clash + with elfarm-nabi.c. + + * elf32-arm.h: Don't declare elf32_arm_info_to_howto. + (elf32_thumb_to_arm_stub, elf32_arm_to_thumb_stub, + elf32_arm_find_nearest_line): Make them static. + +Tue Feb 16 22:44:37 1999 Ian Lance Taylor + + * elflink.h (elf_merge_symbol): Add pflags parameter. Change all + callers. Do not merge a definition from a shared object with a + weak undefined symbol. + (elf_link_add_object_symbols): Do not change the symbol type or + size if the old symbol overrides the new one. + +1999-02-08 Nick Clifton + + * config.bfd: Add support for strongarm target. + +Mon Feb 8 11:18:14 1999 Andreas Schwab + + * elf32-m68k.c (reloc_map): Use the correct types for the struct + fields instead of unsigned char. + +Fri Feb 5 00:22:36 1999 Ian Lance Taylor + + * Makefile.am: Rebuild dependencies. + * Makefile.in: Rebuild. + +Thu Feb 4 22:30:13 1999 Ian Lance Taylor + + * configure.in: Change AC_PREREQ to 2.13. Remove AM_CYGWIN32. + Change AM_EXEEXT to AC_EXEEXT and AM_PROG_INSTALL to + AC_PROG_INSTALL. Add comments to uses of AC_DEFINE. + * acinclude.m4: Add comments to uses of AC_DEFINE. + * acconfig.h: Remove. + * configure: Rebuild with current autoconf/automake. + * aclocal.m4: Likewise. + * config.in: Likewise. + * Makefile.in: Likewise. + +1999-02-04 DJ Delorie + + * libbfd.c (real_read): don't call fread for zero bytes. This + covers up a bug (or misuse of bfd) that's exposed by Solaris. + +Thu Feb 4 12:38:10 1999 Stan Cox + + * elf32-mips.c (mips_elf_relocate_section): Insure that the target + of a jump is in the current 256 MB region. + +Thu Feb 4 12:15:38 1999 Ian Lance Taylor + + * format.c (bfd_check_format_matches): Change last patch to only + take effect for the binary target. + +Wed Feb 3 19:40:12 1999 Ian Lance Taylor + + * elf32-i386.c (elf_i386_reloc_type_lookup): Add BFD_RELOC_CTOR. + +Wed Feb 3 15:02:44 1999 Catherine Moore + + * elf32-fr30.c (fr30_elf_check_relocs): New routine. + +Tue Feb 2 21:38:28 1999 Ian Lance Taylor + + * format.c (bfd_check_format_matches): If the target was + previously specified, don't check other targets when checking for + an archive file. + +Tue Feb 2 18:16:43 1999 Catherine Moore + + * elf32-arm.h (elf32_arm_reloc_map): Removed. + (elf32_arm_reloc_type_lookup): Removed + * elfarm-nabi.c (elf32_arm_reloc_map): New. + (elf32_arm_reloc_type_lookup): New. + * elfarm-oabi.c (elf32_arm_reloc_map): New. + (elf32_arm_reloc_type_lookup): New. + +Mon Feb 1 19:49:21 1999 Catherine Moore + + * elfarm-nabi.c: Renamed from elf32-arm-newabi.c. + * elfarm-oabi.c: Renamed from elf32-arm-oldabi.c + * Makefile.am: Use new files. + * Makefile.in: Regenerate. + * configure.in: Use new files. + * configure: Regenerate. + +1999-02-01 Nick Clifton + + * elf32-fr30.c (fr30_elf_gc_mark_hook): New function. + (fr30_elf_gc_sweep_hook): New function. + (elf_backend_can_gc_sections): Define. + +Mon Feb 1 12:21:47 1999 Catherine Moore + + * targets.c (bfd_target_vector): Add bfd_elf32_littlearm_oabi_vec + and bfd_elf32_bigarm_oabi_vec. + +Mon Feb 1 11:46:31 1999 Catherine Moore + + * Makefile.am (elf32-arm-oldabi.lo): New. + (elf32-arm-newabi.lo): New. + * Makefile.in: Regenerate. + * config.bfd (thumb-*-elf): Remove definition of targ_underscore. + (arm-*-elf): Likewise. + (arm-*-oabi): New. + (thumb-*-oabi): New. + * configure: Regenerate. + * configure.in (bfd_elf32_littlearm_oabi_vec): New. + (bfd_elf32_bigarm_oabi_vec): New. + * elf32-arm-newabi.c: New. + * elf32-arm-oldabi.c: New. + * elf32-arm.c: Removed. + * elf32-arm.h: New. + +Mon Feb 1 11:52:12 1999 Frank Ch. Eigler + + * binary.c (binary_set_section_contents): Omit warnings for + unloadable sections. + +1999-01-31 Michael Meissner + + * config.bfd (powerpc{,le}-*-vxworks*): Add aliases to + powerpc{,le}-*-eabi. + +1999-01-29 Nick Clifton + + * dwarf2.c (read_unsigned_leb128): Remove unused variables. + * dwarf2.c (read_signed_leb128): Remove unused variables. + +Fri Jan 29 00:47:21 1999 H.J. Lu + + * elf.c (assign_file_positions_for_segments): Only adjust + p_align when needed. + +Thu Jan 28 20:05:22 1999 Ian Lance Taylor + + * binary.c (binary_set_section_contents): Don't return early for a + non-loadable section, in case the first section is non-loadable. + Don't set the low lma for a SEC_NEVER_LOAD section. From Maciej + W. Rozycki . + +1999-01-28 Nick Clifton + + * elf32-fr30.c (fr30_reloc_map): Add R_FR30_GNU_VTINHERIT and + R_FR30_GNU_VTENTRY relocs. + +Thu Jan 28 11:08:16 1999 Catherine Moore + + * elflink.h (elf_link_output_sym): Zero syms which are + part of sections which have been excluded. + +Wed Jan 27 13:35:35 1999 Stan Cox + + * coff-arm.c (_bfd_coff_arm_set_private_flags): Changed F_PIC + to F_PIC_INT. + * coffcode.h (coff_set_arch_mach_hook): Removed F_ARM_2a and + F_ARM_3M labels. Changed F_PIC to F_PIC_INT. + +1999-01-27 Nick Clifton + + * elf32-fr30.c (fr30_elf_howto_table): Fix name of R_FR30_48 + relocation. + (fr30_final_link_relocate): Use computed value as result of + relocation. + +1999-01-26 Frank Ch. Eigler + + * binary.c (binary_set_section_contents): Emit warning for + huge file offsets due to widely-dispersed section LMAs. + +Mon Jan 18 03:35:35 1999 Ian Lance Taylor + + * elf.c (assign_file_positions_for_segments): If not D_PAGED, + align first section to largest section alignment, not first + section alignment. + +1999-01-04 Jason Molenda (jsm@bugshack.cygnus.com) + + * configure.in: Require autoconf 2.12.1 or higher. + +Tue Dec 22 15:21:41 1998 Catherine Moore + + * archures.c (bfd_mach_i386_i386_intel_syntax): Define. + * bfd-in2.h: Likewise. + * cpu-i386.c (bfd_i386_arch_intel_syntax): New. + +1998-12-16 Gavin Romig-Koch + + * archures.c,bfd-in2.h (bfd_mach_mips4111): New. + * 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): + bfd_mach_mips4111 -> E_MIPS_ARCH_3 | E_MIPS_MACH_4111. + +1998-12-15 Gavin Romig-Koch + + * elf32-mips.c (elf_mips_abi_name): New. + (_bfd_mips_elf_merge_private_bfd_data): Compare EF_MIPS_ABI flags. + +1998-12-12 Gavin Romig-Koch + + * elf32-mips.c (_bfd_mips_elf_final_write_processing): + Handle bfd_mach_mips4300. + +1998-12-11 Ulrich Drepper + + * elf32-i386.c: Remove leaked development code from patch + 1998-12-10 by Richard Henderson. + +1998-12-10 Richard Henderson + + * elf32-i386.c (elf_i386_relocate_section): Don't fail relocations + in debug sections for symbol defined externally. + +Thu Dec 10 10:58:38 1998 Andreas Schwab + + * targets.c (bfd_target_vector): Remove duplicate entry for + tekhex_vec. + +1998-12-09 Nick Clifton + + * elf32-fr30.c (fr30_elf_howto_table): Set src_mask fields to 0 + since we are using RELAs. + +Tue Dec 8 22:15:48 1998 Ian Lance Taylor + + SCO Open Server Release 5 core file support, from Jouke Numan + : + * sco5-core.c: New file. + * configure.in (i[3456]86-*-sco3.2v5*): Use sco5-core.lo. + (sco5-core.lo): Define SCO5_CORE in COREFLAG. + * Makefile.am: Rebuild dependencies. + (OPTIONAL_BACKENDS): Add sco5-core.lo. + (OPTIONAL_BACKENDS_CFILES): Add sco5-core.c. + * bfd.c (struct _bfd): Add sco5_core_data field to tdata. + * targets.c (sco5_core_vec): Add to target list if SCO5_CORE. + * bfd-in2.h, configure, Makefile.in: Rebuild. + +Tue Dec 8 19:38:42 1998 Mark Klein + + * config.bfd (hppa*-*-mpeix*): New target. + * configure.in: Add AC_HEADER_DIRENT. + (hppa*-*-mpeix*): New target. + * configure.host (hppa*-*-mpeix*): New host. + * hpux-core.c: Check HOST_HPPAMPEIX. Use HAVE_DIRENT_H and + friends rather than just including . + * som.h (struct som_symbol): Add hppa_priv_level and apto + tc_data. Change all users. + (struct somdata): Add comp_unit field. + (obj_som_compilation_unit): Define. + (bfd_som_attach_compilation_unix): Declare. + * som.c: Check HOST_HPPAMPEIX. + (struct som_misc_symbol_info): Add new field priv_level. + (som_object_setup): Add current_offset parameter. Change all + callers. + (setup_sections): Likewise. + (som_object_p): For EXECLIBMAGIC, read the lst header. + (som_write_symbol_strings): Add compilation_unit parameter. + Change all callers. + (som_finish_writing): Write out compilation_unit. + (som_bfd_derive_misc_symbol_info): Set priv_level. + (som_build_and_write_symbol_table): Set xleast field to 3. + (som_slurp_symbol_table): Set symbol priv_level. + (bfd_som_attach_compilation_unit): New function. + (som_bfd_ar_write_symbol_stuff): Set xleast field to 3. Set + priv_level into symbol_value. + * configure, config.in: Rebuild. + +Tue Dec 8 16:21:35 1998 Ian Lance Taylor + + * hpux-core.c (hpux_core_core_file_p): Change call to nonexistent + warning function to call _bfd_error_handler instead. + + * libbfd.c (COERCE32): Cast through unsigned long and long to + avoid bug in old version of gcc. + + * elf64-alpha.c (elf64_alpha_additional_program_headers): Remove. + (elf_backend_additional_program_headers): Don't define. + +1998-12-08 Nick Clifton + + * elf32-fr30.c (fr30_final_link_relocate): Fix PC relative + relocations to include offset of 2 included in the insns, and the + offset of the relocs within the section. + +Wed Dec 2 15:03:59 1998 David Taylor + + The following changes were made by David Taylor + , Edith Epstein + , Jim Blandy + , and Elena Zannoni + as part of the project to merge in + changes originally made by HP; HP did not create ChangeLog + entries. + + * aclocal.m4, configure, Makefile.in: Rebuilt using latest + automake macro library. + + * hpux-core.c (hpux_core_core_file_p): this function now + understands HPUX 10.30 thread info. Yes, the thread stacks can be + found in the corefile! Also, in hpux_core_core_file_p, if we + encounter a section with an unknown type, don't punt. Instead, + just skip it. Also, count the number of sections of known type + that we encounter. If we encounter at least one good one, then + we'll declare that the file is a core file. If we encounter any + unknown ones but some known ones, then we'll issue a warning (but + still declare it to be a core file). Also, correctly decide when a + file is not a core. + (PROC_INFO_HAS_THREAD_ID): define if CORE_ANON_SHMEM defined. + (CORE_ANON_SHMEM): define if not defined. + (hpux_core_struct): add members lwpid and user_tid. + (core_kernel_thread_id, core_user_thread_id): new macros. + (make_bfd_asection): use bfd_alloc to allocate room for a copy of + the name before storing it in the bfd. + (hpux_core_core_file_p): handle threads. + + * libhppa.h (GET_FIELD): protect against redefinition. + (HPPA_WIDE): define. + (GET_FIELD): define. + (GET_BIT): define. + (MASK): define. + (CATENATE): define. + (ELEVEN): define. + (sign_extend): redefine. + (assemble_6): define. + (assemble_12): rewrite. + (assemble_16): define. + (assemble_16a): define. + (assemble_17): rewrite. + (assemble_22): define. + +1998-12-07 Nick Clifton + + * elf32-fr30.c (fr30_final_link_relocate): Using signed + relocations for signed values. + +Sun Dec 6 16:30:33 1998 Ian Lance Taylor + + * mipsbsd.c (MY(set_arch_mach)): Make static. + * aoutx.h (NAME(aout,machine_type)): For bfd_arch_mips, use + bfd_mach_mips* macros rather than simple numbers. + + COFF weak symbol support, based on patches from Mark Elbrecht + : + * coffcode.h (coff_slurp_symbol_table): Handle C_WEAKEXT. + * coffgen.c (coff_renumber_symbols): Handle weak symbols. + (coff_write_alien_symbol): Likewise. + * cofflink.c (coff_link_check_ar_symbols): Likewise. + (coff_link_add_symbols): Likewise. + (_bfd_coff_link_input_bfd): Likewise. + (_bfd_coff_write_global_sym): Likewise. + + * elf.c (copy_private_bfd_data): Always initialize the + includes_phdrs field. + + * elflink.h (elf_fix_symbol_flags): Check for case where a non-ELF + file defines a symbol first mentioned in an ELF file. + + * bfd-in.h: Always define BFD_HOST_64_BIT and BFD_HOST_U_64_BIT if + possible, rather than only if BFD64. + * elflink.h (compute_bucket_count): Just check BFD_HOST_U_64_BIT, + not __GNUC__. + * bfd-in2.h: Rebuild. + + * srec.c (srec_set_section_contents): Correct test to avoid + switching to 4 byte addresses after seeing a second section which + requires 3 byte addresses. From Joel Schantz + . + + * config.bfd (m68*-*-gnu*): New target. From Aymeric Vincent + . + +1998-12-04 Jim Blandy + + * elf32-ppc.c (ppc_elf_merge_private_bfd_data): Fix logic to + decide whether the output file is -mrelocatable-lib, + -mrelocatable, or neither. (gdb.base/nodebug.exp) + +1998-12-03 Nick Clifton + + * elf32-fr30.c: Add support for R_FR30_48 reloc. + * reloc.c: Add BFD_RELOC_FR30_48 relocation. + * bfd-in2.h: Regenerate. + * libbfd.h: Regenerate + +Wed Dec 2 00:58:37 1998 Ian Lance Taylor + + * elflink.h (elf_adjust_dynamic_symbol): Warn on an attempt to + link against a dynamic symbol with no type or size. + +1998-12-01 Ulrich Drepper + + * elf32-i386.c (i386_check_relocs) [R_386_32]: Don't emit + relocation for section which does not get loaded. + (elf_i386_relocate_section) [R_386_32]: Likewise. + +Tue Dec 1 11:33:33 1998 Jim Wilson + + * coff-h8300.c (h8300_bfd_link_add_symbols): Make reloc_size, + reloc_count and i long instead of unsigned long. Handle error + return from bfd_canonicalize_reloc. + +1998-12-01 Nick Clifton + + * elf32-v850.c (v850_elf_relocate_section): Detect the absence of + a hash table. + +Mon Nov 30 15:28:09 1998 J"orn Rennecke + + * elf32-sh.c (elf/sh.h): Include. + sh_reloc_type: Delete. Changed all references to elf_sh_reloc_type. + (sh_elf_howto_tab): Add HOWTO for R_SH_SWITCH8. + (sh_reloc_map): Map BFD_RELOC_8_PCREL to R_SH_SWITCH8. + (sh_elf_relax_delete_bytes): Handle R_SH_SWITCH8. + * Makefile.in: Add dependency of elf32-sh.lo on $(INCDIR)/elf/sh.h. + +Fri Nov 27 17:51:38 1998 Geoff Keating + + * elflink.h (compute_bucket_count): Don't allow minsize==0, it + causes division by zero later on. + +Thu Nov 26 11:19:35 1998 Dave Brolley + + * elf32-fr30.c (fr30_elf_pc9_reloc,fr30_elf_pc12_reloc): Not + needed. + +1998-11-25 DJ Delorie + + * coff-i386.c (i3coff_object_p): Remove hack. Use new emulation + hook now. + +Tue Nov 24 10:25:27 1998 Nick Clifton + + * elf32-fr30.c (fr30_elf_relocate_section): Call + fr30_final_link_relocate. + (fr30_final_link_relocate): New function: Handle I20 and I32 + relocs. + (fr30_elf_i32_reloc): New function: Handle I32 relocs. + (fr30_elf_pc9_reloc): New function: Handle 9_PCREL relocs. + (fr30_elf_pc12_reloc): New function: Handle 12_PCREL relocs. + + * elf32-v850.c (v850_elf_relocate_section): Reset hi16s reloc + chain to empty. + + The following changes are based on a patch submitted by Gianluca + Moro : + + (v850_elf_perform_relocation): Only update a hi16s reloc if it has + not already been updated. + (find_remembered_hi16s_reloc): New parameter 'already_found' + returns state of remembered hi16s reloc. + (remember_hi16s_reloc): Set 'found' field to false. + (hi16s_location): Add 'found' field. + +1998-11-23 DJ Delorie + + * coff-i386.c (bfd_pe_dll_not_recognized_hack): the linker wants + to see .DLL files as unrecognized. + (i3coff_object_p): Sorry, had to hack it to not recognize these + files (pei-i386) on request. + +1998-11-23 DJ Delorie + + * opncls.c (bfd_make_readable): need more cleanup for symbols and + relents. Call bfd_check_format to reinitialize. + +Fri Nov 20 14:21:36 1998 Nick Clifton + + * elf32-fr30.c (fr30_elf_relocate_section): Remove spurious + warnings. + +Thu Nov 19 14:42:15 1998 Geoffrey Noer + + * aclocal.m4: regenerate + * configure: regenerate + +Tue Nov 17 20:23:35 1998 Richard Henderson + + * elf-bfd.h (struct elf_link_hash_entry): Add vtable_entries_size. + * elf.c (_bfd_elf_link_hash_newfunc): Clear it. + * elflink.h (elf_gc_propagate_vtable_entries_used): Copy it, and + respect it as an upper bound on what memory to reference. + (elf_gc_smash_unused_vtentry_relocs): Likewise. + (elf_gc_record_vtentry): Handle as-yet undefined vtables. Set and + update vtable_entries_size appropriately. + +Tue Nov 17 15:28:31 1998 Nick Clifton + + * elf32-fr30.c (fr30_reloc_type_lookup): Used integers to hold + reloc number. + +Mon Nov 16 22:19:21 1998 DJ Delorie + + * archive.c (bfd_ar_hdr_from_filesystem): support BFD_IN_MEMORY + bfds; they have no "file" so we fake it. + * bfd-in2.h: add bfd_make_writable and bfd_make_readable (regen) + * libbfd.c (bfd_write): Allow writing to BFD_IN_MEMORY bfds by + resizing the memory buffer. + * opncls.c (bfd_make_writable): New function; lets you write a + bfd_create'd bfd to an in-memory buffer. + (bfd_make_readable): New function; lets you read back that buffer + as if it were from bfd_openr. Used to build generated archive + members (winsup's ld's dlltool) + +Mon Nov 16 19:15:19 1998 Dave Brolley + + * po/bfd.pot: Regenerated. + +Mon Nov 16 10:57:06 1998 Nick Clifton + + * elf32-v850.c (hi16s_location): Replaced fixed size array with + linked list. + +Sun Nov 15 20:28:25 1998 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relax_section): Search for the proper + element of the gotentry list for local symbols too. + (elf64_alpha_relocate_section): Unify local and global handling. + Assert that gotent->use_count > 0. + +Sat Nov 14 15:16:01 1998 Ian Lance Taylor + + * configure.in (vms_alpha_vec): Rename from evax_alpha_vec, and + update for file name changes of July 2, 1998. + (vms_vax_vec): New. + * configure: Rebuild. + +Thu Nov 12 19:19:54 1998 Dave Brolley + + * po/bfd.pot: Regenerated. + +Tue Nov 10 16:17:06 1998 Geoffrey Noer + + * acinclude.m4, config.bfd: detect cygwin* instead of cygwin32*. + * aclocal.m4, configure: regenerate + +Tue Nov 10 15:13:59 1998 Nick Clifton + + * elf.c (prep_headers): Add support for bfd_arch_fr30. + +Tue Nov 10 13:37:36 1998 Felix Lee + + * acinclude.m4 (BFD_HAVE_SYS_PROCFS_TYPE, + BFD_HAVE_SYS_PROCFS_TYPE_MEMBER): didn't define macro when value + was cached. + * aclocal.m4, configure: regenerated. + +Tue Nov 10 14:31:01 1998 Catherine Moore + + * elf32-d10v.c (reloc_type): Add R_D10V_GNU_VTINHERIT and + R_D10V_GNU_VTENTRY relocs. + (elf_d10v_howto_table): Likewise. + (d10v_reloc_map d10v_reloc_map): Likewise. + (elf32_d10v_gc_mark_hook): New. + (elf32_d10v_gc_sweep_hook): New. + (elf32_d10v_check_relocs): New. + (elf32_d10v_relocate_section): New. + (elf_backend_relocate_section): Define. + (elf_backend_can_gc_sections): Define. + +Sat Nov 7 18:07:51 1998 Peter Schauer + + * Makefile.am (BFD32_BACKENDS): Move vms files here... + (BFD64_BACKENDS): ...from here. + (BFD32_BACKENDS_CFILES): Move vms files here... + (BFD64_BACKENDS_CFILES): ...from here. + * Makefile.in: Rebuild. + +Wed Nov 4 15:58:48 1998 Nick Clifton + + * Makefile.am: Add FR30 target. + * Makefile.in: Add FR30 target. + * archures.c: Add support for FR30. + * config.bfd: Add support for FR30. + * configure.in: Add support for FR30. + * reloc.c: Add support for FR30 relocations. + * targets.c: Add support for FR30 relocations. + * bfd-in2.h: Regenerate. + * configure: Regenerate. + * libbfd.h: Regenerate. + * cpu-fr30.c: New file. + * elf32-fr30.c: New file. + +Mon Nov 2 14:59:33 1998 Geoffrey Noer + + * configure.in: detect cygwin* instead of cygwin32* + * configure: regenerate + +Sun Nov 1 19:32:28 1998 Jeffrey A Law (law@cygnus.com) + + * elf-m10300.c (mn10300_elf_relax_section): Do not use alloca, + use bfd_malloc and free instead and check return value from bfd_malloc. + +Sun Nov 1 16:20:35 1998 Ian Lance Taylor + + * libbfd-in.h (_bfd_dwarf1_find_nearest_line): Declare. + * libbfd.h: Rebuild. + + * elf32-mips.c (mips_elf_dynsym_sec_names): Comment out. + (SIZEOF_MIPS_DYNSYM_SECNAMES): Likewise. + (MIPS_TEXT_DYNSYM_SECN): Likewise. + (_bfd_mips_elf_fake_sections): Don't set sh_info field of a .hash + section. + (struct mips_elf_link_hash_table): Remove dynsym_sec_strindex + field. + (mips_elf_link_hash_table_create): Don't initialize + dynsym_sec_strindex. + (mips_elf_gc_mark_hook): Add default case to avoid warning. + (mips_elf_size_dynamic_sections): Generate a section symbol for + every output section. + (mips_elf_finish_dynamic_sections): Count all sections for + DT_MIPS_UNREFEXTNO. + (mips_elf_finish_dynamic_sections): Use dynamic symbols for all + output sections. + +Sun Nov 1 12:46:53 1998 Geoff Keating + + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Allocate two slots + for later PLT entries in large PLTs. + (ppc_elf_finish_dynamic_symbol): Allow for the extra slots. + +Sat Oct 31 20:10:09 1998 Jeffrey A Law (law@cygnus.com) + + * elf32-ppc.c (ppc_elf_reload_section): Fix typo. + +1998-10-26 15:58 Ulrich Drepper + + * elf-bfd.h (struct elf_link_hash_entry): Add new field elf_hash_value. + * elflink.h (elf_collect_hash_codes): New function. This function is + called for each exported symbol and we compute the ELF hash value for + it. + (compute_bucket_value): New function. It is called from + size_dynamic_sections to determine the hash table size. When we are + optimizing a better, but slower, algorithm is used. + (size_dynamic_sections): Call compute_bucket_value. + + * elf.c (bfd_elf_hash): Optimize the hash function a bit. + +Mon Oct 19 20:03:21 1998 Catherine Moore + + * elf32-sh.c: Add HOWTO entries for R_SH_GNU_VTINHERIT and + R_SH_GNU_VTENTRY. + (sh_elf_gc_mark_hook): New. + (sh_elf_gc_sweep_hook): New. + (sh_elf_check_relocs): New. + (elf_backend_can_gc_sections): Define. + +Mon Oct 19 16:57:05 1998 Felix Lee + + * acinclude.m4: undo previous gettext change + * aclocal.m4: rebuild with right version of aclocal. + +Mon Oct 19 01:47:21 1998 Felix Lee + + * acinclude.m4, aclocal.m4: move gettext-related fragments from + aclocal.m4 to acinclude.m4, so they don't get lost. + + * elfcore.h: rewrite for better corefile support. + * elf.c (elfcore_*): new functions. + * elf-bfd.h (elf_obj_tdata): new structure members. + * acconfig.h, acinclude.m4, configure.in: add feature-tests for + flavor of procfs. + * aclocal.m4, config.in, configure, Makefile.in: regenerated. + +Fri Oct 16 14:07:45 1998 Catherine Moore + + * elf32-m32r.c: Add HOWTO entries for R_M32R_GNU_VTINHERIT + and R_M32R_GNU_VTENTRY. + (elf_backend_can_gc_sections): Define. + (m32r_elf_check_relocs): New. + (m32r_elf_gc_mark_hook): New. + (m32r_elf_gc_sweep_hook): New. + (m32r_elf_relocate_section): Handle VT relocs. + +Mon Oct 12 14:18:40 1998 Nick Clifton + + * coff-arm.c (arm_relocate_section): Remove redundant test. + + * bfd-in2.h (struct reloc_howto_struct): Improve comment to make + cleat that the 'bitsize' field is the size of the bitfield AFTER + relocation not before. + + * elf32-m32r.c (R_M32R_18_PCREL): Fix size of bitfield. + + * coff-mips.c (mips_relocate_hi): Cope with missing refhi or reflo + relocs. + +Tue Oct 6 09:20:44 1998 Catherine Moore + + * elf32-sparc.c: Add HOWTO entries for R_SPARC_GNU_VTINHERIT and + R_SPARC_GNU_VTENTRY. + (elf32_sparc_check_relocs): Handle them. + (elf32_sparc_reloc_type_lookup): Likewise. + (elf32_sparc_relocate_section): Likewise. + (elf32_sparc_gc_mark_hook): New. + (elf32_sparc_gc_sweep_hook): New. + +Mon Oct 5 14:55:30 1998 Jeffrey A Law (law@cygnus.com) + + * som.c (som_finish_writing): Perform some sanity checks when + writing an executable or shared library. + +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.c (_bfd_elf_find_nearest_line): Add call to + _bfd_dwarf1_find_nearest_line. + * elf32-mips.c (_bfd_mips_elf_find_nearest_line): + Add call to _bfd_dwarf1_find_nearest_line. + * configure: Rebuilt. + +Mon Oct 5 10:06:22 1998 Catherine Moore + + * elflink.h (elf_gc_sections): Do not allow garbage + collection if dynamic sections have been created. + +Mon Oct 5 09:07:37 1998 Catherine Moore + + * elf32-v850.c: Add HOWTO entries for R_V850_GNU_VTINHERIT and + R_V850_GNU_VTENTRY. + (v850_elf_check_relocs): Handle VTINHERIT and VTENTRY relocs. + (v850_elf_perform_relocation): Likewise. + (v850_elf_final_link_relocate): Likewise. + (v850_elf_relocate_section): Likewise. + (v850_elf_gc_sweep_hook): New routine. + (v850_elf_gc_mark_hook): New routine. + (elf_backend_can_gc_sections): Define. + +Mon Oct 5 09:04:25 1998 Catherine Moore + + * elf32-m68k.c (elf_m68k_gc_sweep_hook): Don't assume + that dynobj exists. + +Sun Oct 4 23:29:34 1998 David Edelsohn + + * rs6000-core.c (rs6000coff_core_file_matches_executable_p): + Declare size as bfd_size_type. + (rs6000coff_get_section_contents): Declare count as bfd_size_type. + +Sun Oct 4 20:38:29 1998 Jeffrey A Law (law@cygnus.com) + + * cpu-hppa.c (bfd_hppa20_arch): Define. Link it into the bfd_hppa_arch + structure. + * som.c (CPU_PA_RISC2_0): Define. + (_PA_RISC2_0_ID): Likewise. + (som_finish_writing): Use CPU_PA_RISC2_0 for the system_id as needed. + +Sun Oct 4 21:19:09 1998 Ian Lance Taylor + + * elflink.h (elf_link_add_object_symbols): When a versioned symbol + has a base which is already defined, only add the referenced + symbol to the dynamic symbol table if it is defined or referenced + by a regular file. + + * elf32-i386.c (elf_i386_info_to_howto_rel): Handle vtable relocs + correctly. + +1998-09-27 Andreas Schwab + + * elflink.h (elf_link_add_object_symbols): Undo last change. + +Wed Sep 23 16:09:31 1998 Richard Henderson + + * elflink.h (elf_link_add_object_symbols): Don't record a dynamic + symbol for the indirect alias to a versioned symbol. + +Mon Sep 21 12:15:22 1998 Catherine Moore + + * elf32-i386.c (elf32_i386_vtinherit_howto): New. + (elf32_i386_vtentry_howto): New. + (elf_i386_reloc_type_lookup): Return elf32_i386_vtentry_howto + or elf32_i386_vtinherit_howto on lookup. + +Sun Sep 20 00:48:07 1998 Andreas Schwab + + * elf32-m68k.c: Include "elf/m68k.h". Remove definition of enum + reloc_type. Rename R_68K__max to R_68K_max. + (howto_table): Use _bfd_elf_rel_vtable_reloc_fn for a VTENTRY + reloc. + +Sun Sep 20 00:09:25 1998 Chris Torek + + * libbfd.c (bfd_getb32): Rewrite expression to get better code. + (bfd_getl32, bfd_getb_signed_32, bfd_getl_signed_32): Likewise. + + * libbfd.c (bfd_log2): Cast to bfd_vma before shifting, not + after. + +Sat Sep 19 22:42:23 1998 Doug Rabson + + * elflink.h (elf_link_add_object_symbols): Ensure that the warning + message has a null byte terminator. + +Fri Sep 18 14:35:29 1998 Nick Clifton + + * elf32-v850.c (v850_elf_perform_relocation): Ignore contents of + word subject to R_V850_32 relocation. + +Thu Sep 17 17:20:36 1998 Nick Clifton + + * dwarf2.c: Add comment describing problem computing line numbers + for undefined symbols at link time. + +Thu Sep 17 16:03:28 1998 Richard Henderson + + * elf64-alpha.c (elf64_alpha_adjust_dynamic_symbol): Don't + transform a defweak into a plt entry. + (elf64_alpha_calc_dynrel_sizes): Allow room for secondary + plt entry references to receive a RELATIVE reloc. + (elf64_alpha_finish_dynamic_symbol): Fill them in. + (elf64_alpha_relocate_section): Assert we don't overrun + the allocated relocation space. + +Wed Sep 16 18:03:13 1998 Nick Clifton + + * elf.c (swap_out_syms): Always treat section symbols as + special, even if they are attached to a common section. + +Wed Sep 16 10:34:13 1998 Nick Clifton + + * elf32-v850.c (v850_elf_symbol_processing): Move symbols in + sections with v850 common section attributes into named v850 + common sections. + (v850_elf_add_symbol_hook): Move symbols in sections with v850 + common section attributes into named v850 common sections. + +Wed Sep 16 11:26:49 CDT 1998 Catherine Moore + + * elf32-arm.c (elf32_arm_gc_mark_hook): Remove print + statement. + +1998-09-15 Geoff Keating + + * elf32-ppc.c (ppc_elf_relocate_section): Reverse output_offset + part of Vladimir's change of 1998-08-19. Make a R_PPC_SDAREL16 + reloc to the wrong section a warning, not an error. .dynsbss + is not an output section, so there is no need to check for it. + +Tue Sep 15 12:40:05 1998 Catherine Moore + + * elf-bfd.h: Add argument to elf_backend_get_symbol_type. + +Tue Sep 15 08:34:40 1998 Catherine Moore + + * elf.c (swap_out_syms): Pass type to elf_backend_get_symbol_type. + * elf32-arm.c: Add HOWTO entries for R_ARM_GNU_VTINHERIT and + R_ARM_GNU_VTENTRY. + (elf32_arm_gc_mark_hook): New. + (elf32_arm_gc_sweep_hook): New. + (elf32_arm_check_relocs): New. + (elf32_arm_final_link_relocate): Handle VTINHERIT and VTENTRY + relocations. + (elf32_arm_relocate_section): Handle VTINHERIT and VTENTRY + relocations. + +1998-09-10 Geoff Keating + + * elf32-ppc.c (ppc_elf_relocate_section): If dynobj is NULL, + assume there is no PLT or GOT. + +Wed Sep 9 14:24:12 1998 Nick Clifton + + * elf32-arm.c (elf32_arm_find_nearest_line): New function: just + like _elf_bfd_find_nearest_line() except that STT_ARM_TFUNC is + also accepted as a function symbol type. + +Mon Sep 7 13:24:03 1998 Peter Schauer + + * rs6000-core.c (_LONG_LONG): Define for AIX 4.x only. + +Sat Sep 5 20:40:18 1998 Ian Lance Taylor + + * libbfd-in.h (_bfd_nolink_bfd_gc_sections): Correct definition to + match definition of _bfd_gc_sections field. + * libbfd.h: Rebuild. + +Fri Sep 4 13:54:23 1998 David Miller + + * elf32-sparc.c (elf32_sparc_relocate_section): Properly adjust + the addend of a dynamic relocation referencing a section. + * elf64-sparc.c (sparc64_elf_relocate_section): Likewise. + (sparc64_elf_finish_dynamic_symbol): Fix the PLT relocation offset. + +Thu Sep 3 17:28:50 1998 Richard Henderson + + * elflink.h (bfd_elfNN_size_dynamic_sections): Verify that the + bed has a size_dynamic_sections routine before trying to use it. + +Mon Aug 31 14:49:22 1998 Richard Henderson + + * elf32-mips.c (elf_mips_gnu_vtentry_howto): Use + _bfd_elf_rel_vtable_reloc_fn. + +Mon Aug 31 10:23:40 1998 Catherine Moore + + * Makefile.am: Add elf32-arm.c. + * Makefile.in: Rebuild. + * elf-bfd.h: Add elf_backend_get_symbol_type. + * elf.c (swap_out_syms): If defined, call + elf_backend_get_symbol_type. + * elf32-arm.c: Define elf_backend_get_symbol_type. + (elf32_arm_get_symbol-type): New routine. + (record_thumb_to_arm_glue): Change to use STT_ARM_TFUNC. + (bfd_elf32_arm_process_before_allocation): Change to + check for STT_ARM_TFUNC. + (elf32_arm_final_link_relocate): Likewise. + * elfxx-target.h: Add elf_backend_get_symbol_type. + +Fri Aug 28 19:44:07 1998 Richard Henderson + + * archures.c (bfd_mach_alpha_ev[456]): New. + * cpu-alpha.c: Rework to match these types. + * bfd-in2.h: Rebuild. + +Fri Aug 28 19:38:53 1998 Richard Henderson + + * elf-bfd.h (_bfd_elf_rel_vtable_reloc_fn): Declare. + * elf.c (_bfd_elf_rel_vtable_reloc_fn): New. + + * elf32-i386.c (elf_howto_table): Add vtable relocs. + (elf_i386_reloc_type_lookup): Recognize them. + (elf_i386_check_relocs): Pass them off to generic code. + (elf_i386_relocate_section): Ignore them. + (elf_i386_gc_mark_hook, elf_i386_gc_sweep_hook): New. + (elf_backend_can_gc_sections): True. + +Thu Aug 20 15:03:45 1998 Nick Clifton + + * elf32-arm.c (elf32_thumb_to_arm_stub): Check sym_sec is not NULL + before looking at owner field. + (elf32_arm_to_thumb_stub): Ditto. + (elf32_arm_relocate_section): Compute name before calling + elf32_arm_final_link_relocate(). + +Thu Aug 20 11:30:17 1998 Michael Snyder + + * elf.c: comment and formatting cleanups. + * elfcore.h: ditto. + +Wed Aug 19 15:43:26 1998 Michael Snyder + + * elfcode.h (elf_object_p): Reject files of header type ET_CORE + (core files are treated differently than object files). + * elf-bfd.h (_bfd_elf_write_corefile_contents, + bfd_elf_mkcorefile): declare. + * elfxx-target.h (_bfd_elf_write_corefile_contents, + bfd_elf_mkcorefile): add to bfd_target vector. + * elfcore.h (elf_core_file_p): save the program header table, + and set the bfd architecture from the elf file header. + * elf.c (bfd_elf_mkcorefile): new function. + (_bfd_elf_write_corefile_contents): new function. + (assign_file_positions_for_segments): add cases for handling + PT_NOTE segments. (assign_file_positions_except_relocs): + core files should be handled the same as exec files. + (prep_headers): identify core files as type ET_CORE. + (copy_private_bfd_data): identify the sections belonging to + the PT_NOTE segment. + + * elf32-sparc.c (elf32_sparc_final_write_processing): + add break statement to default case. + +1998-08-19 Vladimir N. Makarov + + * elf32-ppc.c (ppc_elf_relocate_section): Check that output + section (not input) will be in sections ".sbss", ".sbss2", + ".sdata", and ".sdata" for R_PPC_SDAREL16, R_PPC_EMB_SDA2REL, + R_PPC_EMB_SDA21, R_PPC_EMB_RELSDA. In all these cases also ignore + output_offset for correct evaluation of addend. + +Tue Aug 18 11:48:12 1998 Catherine Moore + + * elf32-arm.c: Add prefix bfd_ to elf32_arm_get_bfd_for_interworking, + elf32_arm_allocate_interworking_sections and + elf32_arm_process_before_allocation. + +Tue Aug 18 11:46:00 1998 Nick Clifton + + * bfd-in.h: Ammend prototype for + elf32_arm_process_before_allocation to remove surplus third + argument. + + * bfd-in2.h: Regenerate. + +Sat Aug 15 20:55:08 1998 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relax_section): Handle indirect symbols. + +Fri Aug 14 09:12:28 1998 Stan Cox + + * aoutx.h (aout_link_input_section_ext): Use the relocation already + calculated for RELOC_SPARC_REV32 case. + +Thu Aug 13 14:02:02 1998 Catherine Moore + + * bfd-in.h: Add prototypes for elf32_arm_get_bfd_for_interworking, + elf32_arm_allocate_interworking_sections and + elf32_arm_process_before_allocation. + * bfd-in2.h: Regenerated. + * elf32-arm.c Define elf32_arm_link_hash_table. + (insert_thumb_branch): New routine. + (find_thumb_glue): New routine. + (find_arm_glue): New routine. + (record_arm_to_thumb_glue): New routine. + (record_thumb_to_arm_glue): New routine. + (elf32_arm_link_hash_table_create): New routine. + (elf32_arm_get_bfd_for_interworking): New routine. + (elf32_arm_allocate_interworking_sections) New routine. + (elf32_arm_process_before_allocation) New routine. + (elf32_thumb_to_arm_stub): New routine. + (elf32_arm_to_thumb_stub): New routine. + (elf32_print_private_bfd_data): Fix typo. + (elf32_arm_final_link_relocate): Add argument sym_sec. + Check for branches to thumb symbols in case R_ARM_PC24. + Check for branches to arm symbols in case R_ARM_THM_PC22. + (elf32_arm_relocate_section): Pass symbol section to + elf32_arm_final_link_relocate. + +Wed Aug 12 19:00:39 1998 Geoff Keating + + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Generate PLT + entries unless the symbol is defined in the executable; in + particular, undefined weak symbols get a PLT entry. + +Wed Aug 12 14:48:33 1998 Ian Lance Taylor + + * libaout.h: Remove nested comment to avoid warning. + +Wed Aug 12 08:10:11 1998 Catherine Moore + + * elf32-arm.c (elf32_arm_final_link_relocate): Rework + R_ARM_PC24 relocation. + +Tue Aug 11 14:42:26 1998 Catherine Moore + + * elf32-arm.c (elf32_arm_final_link_relocate): Remove unused + argument is_local. Add argument sym_flags. Check sym_flags + in R_ARM_ABS32 case. Include addend for R_ARM_THM_PC22 case. + (elf32_arm_relocate_section): Don't pass local sym and pass + sym_flags to elf32_arm_final_link_relocate. + +Mon Aug 10 20:38:39 1998 Richard Henderson + + * elf64-alpha.c (elf64_alpha_calc_dynrel_sizes): Correct last change + to not count too few relocs for dynamicly linked executables. + +Mon Aug 10 15:35:34 1998 Richard Henderson + + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Never consider + symbols without a dynamic index dynamic. Consider all weak + symbols dynamic. + (elf64_alpha_strip_section_from_output): Don't assume 1-1 + correspondance between input and output sections. + +Mon Aug 10 15:31:39 1998 Andreas Schwab + + * elflink.h (elf_gc_common_finalize_got_offsets): For backends + that use a .got.plt section start the got offset at zero. + +Mon Aug 10 17:31:21 1998 Ian Lance Taylor + + * ieee.c (ieee_write_processor): Correct the processor ID written + out for bfd_arch_m68k, accommodating change of March 25. + +Sun Aug 9 20:55:44 1998 Catherine Moore + + * elf32-arm.c (elf32_arm_final_link_relocate): Rework + R_ARM_THM_RPC22 relocations. + +Sat Aug 8 15:15:30 1998 Richard Henderson + + * elf64-alpha.c (alpha_elf_dynamic_symbol_p): Undef weak symbols + are always dynamic. + (elf64_alpha_calc_dynrel_sizes): Allow enough room for RELATIVE + .got relocs in -Bsymbolic shared objects. + +Wed Aug 5 15:48:08 1998 Nick Clifton + + * elf32-arm.c: Add private flags to ELF header. + (elf32_arm_print_private_bfd_data): New Function. + (elf32_arm_set_private_flags): New Function. + (elf32_arm_copy_private_flags): New Function. + (elf32_arm_merge_private_bfd_data): New Function. + +Mon Aug 3 17:10:15 1998 Ian Lance Taylor + + * elf32-sparc.c (elf32_sparc_check_relocs): Permit WPLT30 against + a local symbol. + (elf32_sparc_relocate_section): Likewise. + +Sun Aug 2 03:19:23 1998 Richard Henderson + + * elf32-ppc.c (ppc_elf_check_relocs): Init sgot to NULL. Create the + .got if any relocation referrs to _GLOBAL_OFFSET_TABLE_. + (ppc_elf_relocate_section): Pull sgot and splt search to the start + of the function. Recognize no .plt as static linking. + +1998-08-01 Ulrich Drepper + + * elf32-mips.c (_bfd_mips_elf_section_from_shdr): Don't pass + ".liblist" string through gettext. + +Fri Jul 31 16:38:14 1998 Catherine Moore + + * Makefile.am: Add support for elf32-arm.lo. + * Makefile.in: Rebuild. + * config.bfd (arm-*-elf): Define targ_defvec and targ_selvecs. + (thumb-*-elf): Define targ_defvec and targ_selvecs. + * configure.in: Handle bfd_elf32_littlearm_vec and bfd_elf32_bigarm_vec. + * configure: Regenerate. + * elf.c: (prep_headers): Support arch_type of EM_ARM. + * targets.c: Support new targets bfd_elf32_bigarm_vec and + bfd_target bfd_elf32_littlearm_vec. + * elf32-arm.c: New file. + +Tue Jun 28 19:05:28 1998 Stan Cox + + * libaout.h (M_SPARCLITE_LE): New machine. + * sunos.c (MACHTYPE_OK): Add machine M_SPARCLITE_LE. + * aoutf1.h (sunos_set_arch_mach): Add machine M_SPARCLITE_LE. + (sunos_write_object_contents): Add machine bfd_mach_sparc_sparclite_le + * aoutx.h (howto_table_ext): Add relocation R_SPARC_REV32. + (NAME(aout,machine_type)) Add machine bfd_mach_sparc_sparclite_le + (aout_link_input_section_ext): Add RELOC_SPARC_REV32 support. + * elf32-sparc.c (_bfd_sparc_elf_howto_table, sparc_reloc_map, + elf32_sparc_relocate_section): Rename R_SPARC_32LE to be R_SPARC_REV32 + * libbfd.h (bfd_reloc_code_real_names): Rename BFD_RELOC_SPARC_32LE to + be BFD_RELOC_SPARC_REV32. + * reloc.c: Ditto. + * config.bfd (sparc86x-*-aout): New + +Fri Jul 24 13:54:19 1998 Nick Clifton + + * linker.c (_bfd_generic_final_link): Allocate NULL symbol before + actually mapping the output sections. + +Fri Jul 24 11:24:29 1998 Jeffrey A Law (law@cygnus.com) + + + * elf-m10300.c (mn10300_elf_howto): Add R_MN10300_24 entry. + (mn10300_elf_reloc_map): Similarly. + (mn10300_elf_final_link_relocate): Handle R_MN10300_24. + +Fri Jul 24 12:36:04 1998 Ian Lance Taylor + + * elf32-mips.c (elf_mips_howto_table): Add reloc types used on + Irix 6. + (bfd_elf32_bfd_reloc_type_lookup): Add default case. + * elf64-mips.c: Replace all uses of mips_elf64_reloc_type with + elf_mips_reloc_type defined in elf/mips.h. + +1998-07-24 Ulrich Drepper + + * elf64-mips.c: Remove reloc_type definition completely. It's now + in elf/mips.h. + +Thu Jul 23 13:33:19 1998 Doug Evans + + * elf64-mips.c (mips_elf64_reloc_type): #if 0 out more relocations + as they are defined in elf/mips.h now. + +Thu Jul 23 11:29:43 1998 Jeffrey A Law (law@cygnus.com) + + + * Re-add lost change: + * elf-m10300.c (elf32_mn10300_link_hash_entry): Add new field + "movm_stack_size". + (mn10300_elf_relax_section): Include stack space for register saves + in the imm8 field of a "call" instruction. + (compute_function_info): Determine how much stack is allocated by + the movm instruction. Fix typo. + (elf32_mn10300_link_hash_newfunc): Initialize movm_stack_size. + +Thu Jul 23 11:38:05 1998 Ian Lance Taylor + + * elf32-sparc.c (elf_backend_got_header_size): Define as 4. + * elf64-sparc.c (elf_backend_got_header_size): Define as 8. + +1998-07-22 Ulrich Drepper + + * elf32-ppc.c: Change use of pp_reloc_type to elf_ppc_reloc_type. + +Wed Jul 22 16:27:18 1998 Nick Clifton + + * elf32-hppa.h: Let ELF header define the enum containing the + external reloc numbers. + * elf32-i386.h: Likewise. + +1998-07-22 14:57 Ulrich Drepper + + * elf-m10300.c: Let ELF header now define the macros to get the enum. + * elf32-mips.c: Likewise. + * elf32-ppc.c: Likewise. + +Wed Jul 22 13:53:52 1998 Nick Clifton + + * bfd-in2.h: Change type of 'class' parameter to 'unsigned int' in + bfd_coff_set_symbol_class(), in order to avoid K&R compatability + prblems. + * bfd-in.h: Regenerate. + * coffgen.c (bfd_coff_set_symbol_class): Change type of 'class' + parameter to 'unsigned int' to avoid K&R compatability problems. + +Wed Jul 22 16:43:24 1998 Ian Lance Taylor + + * ieee.c (ieee_find_nearest_line): Change filename_ptr and + functionname_ptr to be const. Change line_ptr to be unsigned. + + * coffcode.h (coff_link_output_has_begun): Simplify handling when + macro is not defined. Change second parameter from bfd_link_info + to coff_final_link_info. Add prototype. + (coff_final_link_postscript): Simplify handling when macro is not + defined. Add prototype. + +1998-07-22 13:08 Ulrich Drepper + + * elf-mn10300.c: Before include system specific ELF header define + START_RELOC_NUMBERS, RELOC_NUMBER, and END_RELOC_NUMBERS. + * elf32-mips.c: Likewise. + * elf32-ppc.c: Likewise. + +Wed Jul 22 13:46:51 1998 Ian Lance Taylor + + * elf64-mips.c (mips_elf64_reloc_type): Copy Ulrich's elf32-mips.c + temporary patch over to elf64-mips.c as well. + +1998-07-21 Ulrich Drepper + + * elf32-mips.c (reloc_type): Temporarily disable definition of + standard relocation since they are now defined in elf/mips.h. + +Tue Jul 21 09:47:00 1998 Catherine Moore + + * elf-m10200.c (mn10200_elf_final_link_relocate): + Modify range test for case R_MN10200_8. + + * elf-m10300.c (mn10300_elf_final_link_relocate): + Modify range test for case R_MN10300_8. + +Mon Jul 20 18:50:54 1998 Richard Henderson + + * elf-bfd.h (struct elf_backend_data): Add got_ & plt_header_size. + * elf32-i386.c (elf_backend_got_header_size): Define. + (elf_backend_plt_header_size): Define. + * elf32-m68k.c, elf32-mips.c, elf32-ppc.c: Likewise. + * elf32-sparc.c, elf64-alpha.c, elf64-sparc.c: Likewise. + * elfxx-target.h: Provide a default of zero. + * elflink.c (_bfd_elf_create_got_section): Use got_header_size. + * elflink.h (elf_gc_common_finalize_got_offsets): Likewise. + + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't remove a PLT + entry from an executable, even if the plt refcount goes to 0. + +Mon Jul 20 12:47:26 1998 Andreas Schwab + + * aoutx.h (NAME(aout,find_nearest_line)): Also remember the + directory name at the line number. + + * elf.c (_bfd_elf_find_nearest_line): Also consider symbols + with an unspecified type. + +Wed Jul 15 11:20:01 1998 Ian Lance Taylor + + * sunos.c: Add undef of valid to avoid problem on SunOS. + +Tue Jul 14 15:30:59 1998 Richard Henderson + + * config.bfd (i?86-pc-beos{pe,elf,}*): Recognize. + +Tue Jul 14 11:22:21 1998 Andreas Schwab + + * elf32-m68k.c (elf_m68k_check_relocs): Also reference count + R_68K_PCxx and R_68K_xx relocations. Make sure that + ELF_LINK_HASH_NEEDS_PLT is always set for a PLT reloc reference. + (elf_m68k_gc_sweep_hook): Also reference count R_68K_PCxx and + R_68K_xx relocations. + (elf_m68k_adjust_dynamic_symbol): Reset the plt offset of a symbol + that has no plt entry. + (elf_m68k_relocate_section): Ignore the plt offset in a static + link. + * elflink.h (elf_adjust_dynamic_symbol): Reset the plt offset for + an ignored symbol. + (elf_gc_common_finalize_got_offsets): Set the got offsets also in + a static link. + + * elf32-m68k.c (R_68K_GNU_VTINHERIT, R_68K_GNU_VTENTRY): New reloc + types. + (howto_table, reloc_map): Add entries for them. + (elf_m68k_check_relocs): Handle them. Implement reference + counting for got and plt entries. + (elf_m68k_gc_mark_hook, elf_m68k_gc_sweep_hook): New functions. + (elf_m68k_adjust_dynamic_symbol): Handle unreferenced plt + symbols. + (rtype_to_howto_rel, elf_info_to_howto_rel): Delete. + (elf_m68k_relocate_section): Handle the new reloc types. + (bfd_elf32_bfd_final_link, elf_backend_gc_mark_hook, + elf_backend_gc_sweep_hook, elf_backend_can_gc_sections): Define. + * elflink.h (elf_link_add_object_symbols): When creating an + indirect reference for symbol versioning also copy the plt + offset. + (elf_fix_symbol_flags): When clearing the ELF_LINK_HASH_NEEDS_PLT + flag also reset the plt offset. + (elf_link_assign_sym_version): Likewise. + (elf_gc_common_finalize_got_offsets): Increment the got offset by + the size of the entry in bytes. + (elf_gc_allocate_got_offsets): Likewise. + +Tue Jul 14 11:18:14 1998 Ian Lance Taylor + + * elflink.h (elf_gc_sections): Return true rather than falling off + the bottom. + + * coffgen.c (bfd_coff_set_symbol_class): Call bfd_alloc, not + xmalloc. + +Mon Jul 13 11:06:31 1998 Nick Clifton + + * coff-arm.c: Supress definition of TARGET_UNDERSCORE and add a + comment describing when it should be enabled. + Changed definition of USER_LABEL_PREFIX to "", to fall into line + with GCC sources. + +Mon Jul 13 13:06:54 1998 Ian Lance Taylor + + * ieee.c (ieee_slurp_external_symbols): Handle call optimization + information ATN records. + +Fri Jul 10 16:31:06 1998 Ian Lance Taylor + + * ieee.c (ieee_slurp_external_symbols): Select an appropriate + section for an absolute symbol in a fully linked file. Based on + patch from Christian Holland . + +Wed Jul 8 11:29:56 1998 Manfred Hollstein + + * coff-m88k.c (m88k_special_reloc): Don't lose the information + that a symbol is undefined. + +Tue Jul 7 21:47:02 1998 Jeffrey A Law (law@cygnus.com) + + * som.c (som_bfd_gc_sections): Define. + +Mon Jul 6 11:35:50 1998 Nick Clifton + + * coff-arm.c (aoutarm_std_reloc_howto): Do not complain about + overflows in ARM_26D patches, since they have already been + implmented. Patch submitted by Dr. R.J. Black + +Sat Jul 4 12:25:36 1998 Ian Lance Taylor + + * coffcode.h (coff_write_object_contents): If we have any long + section names, call coff_write_symbols even if there are no + symbols. + +Fri Jul 3 13:11:35 1998 Ian Lance Taylor + + * elf.c (copy_private_bfd_data): Only set phdr_included once for a + PT_LOAD segment, rather than only setting it once for the entire + file. + + * elf.c (_bfd_elf_make_section_from_shdr): When setting the LMA, + rather than ignoring every phdr with a p_paddr of 0, ignore all + the phdrs if they all have a p_paddr of 0. + + * stabs.c (_bfd_write_stab_strings): Check whether the .stabstr + section was discarded from the link. + +Fri Jul 3 14:39:05 1998 J"orn Rennecke + + * coff-sh.c (sh_insn_uses_freg): Ignore lowest bit of register number. + +Fri Jul 3 14:35:48 1998 J"orn Rennecke + + * coff-sh.c (sh_insns_conflict): Load of fpscr conflicts with + floating point operations. + +Thu Jul 2 18:37:25 1998 Ian Lance Taylor + + * cofflink.c (_bfd_coff_link_input_bfd): Skip undefined global + function symbols. + +Thu Jul 2 14:59:42 1998 Klaus Kaempf + + Merge of vax/vms (read-only) support + * configure.com: Support Vax target. + * makefile.vms: Support Vax target. + * vms.h: Renamed from evax.h, merged vax/vms (read-only) support. + * vms.c: Renamed from evax-alpha.c, merged vax/vms (read-only) + support. + * vms-hdr.c: Renamed from evax-emh.c, merged vax/vms (read-only) + support. + * vms-gsd.c: Renamed from evax-egsd.c, merged vax/vms (read-only) + support. + * vms-tir.c: Renamed from evax-etir.c, merged vax/vms (read-only) + support. + * vms-misc.c: Renamed from evax-misc.c, merged vax/vms (read-only) + support. + * libbfd.c (real_read): Use unbuffered read on VMS/Vax. + * targets.c (bfd_target_ovax_flavour): New flavour. + (vms_alpha_vec): Renamed from evax_alpha_vec. + (vms_vax_vec): New. + (target_vector): Update accordingly. + * config.bfd (alpha*-*-*vms*): Use vms_alpha_vec, not + evax_alpha_vec. + (vax*-*-*vms*): New target. + * Makefile.am: Update for renamed files. Rebuild dependencies. + * bfd-in2.h: Rebuild. + * configure.in, Makefile.in, aclocal.m4: Rebuild. + +Thu Jul 2 13:31:55 1998 Ian Lance Taylor + + Based on patch from Matt Semersky : + * linker.c (_bfd_generic_final_link): Force a trailing NULL + pointer on abfd->outsymbols. + (generic_add_output_symbol): Handle NULL sym parameter. + +Wed Jul 1 17:05:53 1998 Nick Clifton + + * elf.c (copy_private_bfd_data): Add support for changing VMA or + LMA of sections. + +Wed Jul 1 16:58:50 1998 Ian Lance Taylor + + * coff-sh.c (sh_relax_delete_bytes): Correct address comparisons + when handling 32 bit immediate relocs. + * elf32-sh.c (sh_elf_relax_delete_bytes): Likewise. + +Tue Jun 30 09:55:03 1998 Jeffrey A Law (law@cygnus.com) + + * section.c (STD_SECTION): Account for recently added gc_mark + field in struct asection. + + * elf-m10300.c (bfd_mn10300_elf_merge_private_bfd_data): New function. + (bfd_elf32_bfd_merge_private_bfd_data): Define. + +Thu Jun 25 18:31:41 1998 Richard Henderson + + ELF Section-level Garbage Collection: + * bfd.c (bfd_gc_sections): New. + * 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. + * 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. + * targets.c (BFD_JUMP_TABLE_LINK): Add _bfd_gc_sections. + + * reloc.c (BFD_RELOC_VTABLE_INHERIT, BFD_RELOC_VTABLE_ENTRY): New. + (bfd_generic_gc_sections): New. + * section.c (SEC_KEEP): New. + (asection): Add gc_mark member. + + * elfcode.h (elf_gc*): New name remappings. + * elflink.h (elf_link_input_bfd): Don't set contents on stabs + sections to be excluded. + (elf_gc_mark, elf_gc_sweep, elf_gc_sweep_symbol): New. + (elf_gc_propogate_vtable_entries_used): New. + (elf_gc_smash_unused_vtentry_relocs): New. + (elf_gc_sections, elf_gc_record_vtinherit, elf_gc_record_vtentry): New. + (elf_gc_common_finalize_got_offsets): New. + (elf_gc_allocate_got_offsets, elf_gc_common_final_link): New. + * elfxx-target.h: Add and default gc hooks. + + * elf-bfd.h (struct elf_link_hash_entry): Swap got_offset/plt_offset + for unions. + (struct elf_obj_tdata): Likewise for local_got_offsets. + * elf.c, elf-i386.c, elf32-m68k.c, elf32-mips.c: Update all uses. + * elf32-ppc.c, elf32-sparc.c, elf64-alpha.c: Likewise. + * elf64-sparc.c, elflink.h: Likewise. + + * elf-bfd.h (struct elf_link_hash_entry): Add vtable members. + (ELF_LINK_HASH_MARK): Define. + (struct elf_backend_data): Add GC hooks. + * elf.c (_bfd_elf_link_hash_newfunc): Zero vtable members. + + * elf-m10300.c (mn10300_elf_check_relocs): New. + (mn10300_elf_gc_mark_hook): New. + (R_MN10300_GNU_VTINHERIT, R_MN10300_GNU_VTENTRY): New. + (elf_mn10300_howto, mn10300_reloc_map): Handle them. + (mn10300_elf_final_link_relocate): Likewise. + (mn10300_elf_relocate_section): Likewise. + (elf_backend_can_gc_sections): Define. + * elf32-mips.c (R_MIPS_GNU_VTINHERIT, R_MIPS_GNU_VTENTRY): New. + (elf_mips_gnu_vtinherit_howto, elf_mips_gnu_vtentry_howto): New. + (bfd_elf32_bfd_reloc_type_lookup): Handle them. + (mips_info_to_howto_rel): Likewise. + (mips_elf_relocate_section): Likewise. + (mips_elf_check_relocs): Likewise. + (mips_elf_gc_mark_hook, mips_elf_gc_sweep_hook): New. + (elf_backend_can_gc_sections): Define. + * elf32-ppc.c (R_PPC_GNU_VTINHERIT, R_PPC_GNU_VTENTRY): New. + (ppc_elf_howto_raw): Handle them. + (ppc_elf_reloc_type_lookup): Likewise. + (ppc_elf_relocate_section): Likewise. + (ppc_elf_check_relocs): Reference count .got and .plt entries. + Handle new vtable relocs. + (ppc_elf_adjust_dynamic_symbol): Recognize unused .plt entries. + (ppc_elf_gc_mark_hook, ppc_elf_gc_sweep_hook): New. + (elf_backend_can_gc_sections): Define. + +Fri Jun 26 10:48:23 1998 Jeffrey A Law (law@cygnus.com) + + * archures.c (bfd_mach_mn10300): Define. + * elf-m10300.c: Include elf/mn10300.h + (elf_mn10300_mach): New function. + (_bfd_mn10300_elf_final_write_processing): Likewise. + (_bfd_mn10300_elf_object_p): Likewise. + (elf_backendfinal_write_processing): Define. + (elf_backend_object_p): Likewise. + +Thu Jun 25 18:31:08 1998 Nick Clifton + + * elf32-v850.c (v850_elf_perform_relocation): Fix HI16_S + relocation. + +Wed Jun 24 17:17:57 1998 Ian Lance Taylor + + * elflink.h (elf_bfd_final_link): Loop over input_bfds using the + link_next field, not the next field. + +Sun Jun 21 19:38:39 1998 Ian Lance Taylor + + * elf.c (map_sections_to_segments): Check the section address + against the phdr size both with and without a modulo of + maxpagesize. + +Fri Jun 19 17:08:18 1998 Ian Lance Taylor + + * elf32-mips.c (mips_elf_size_dynamic_sections): Only strip a + linker created empty input section if the output section has the + same name. + + * elflink.h (elf_link_output_extsym): Print an error message if + _bfd_elf_section_from_bfd_section fails. + + * elf.c (_bfd_elf_section_from_bfd_section): Call bfd_set_error on + failure. + +Tue Jun 16 11:55:55 1998 Ian Lance Taylor + + * elf.c (copy_private_bfd_data): Improve handling of Solaris + native linker output. Avoid putting an empty section in more than + one segment. + +Fri Jun 12 13:30:17 1998 Tom Tromey + + * po/Make-in (all-yes): If maintainer mode, depend on .pot file. + ($(PACKAGE).pot): Unconditionally depend on POTFILES. + +Fri Jun 12 13:34:02 1998 Doug Evans + + * elf.c (swap_out_syms): New arg relocatable_p. + Don't add section VMA to symbols for relocatable output. + (_bfd_elf_compute_section_file_positions): Update call to + swap_out_syms. + +Mon Jun 8 15:20:57 1998 Nick Clifton + + * elf32-v850.c (v850_elf_perform_relocation): Make comparisons + against 'addend' be signed rather than unsigned. + +Sat Jun 6 00:31:21 1998 Nick Clifton + + * elf32-m32r.c: Add prototyps for static functions. + + * coff-arm.c: Add prototypes for static functions. + +Fri Jun 5 17:21:51 1998 Nick Clifton + + * elf.c (elf_sort_sections): Sort by LMA first then VMA, since the + LMA is used to order sections in a segment. + + * elf32-v850.c: Add prototypes for static functions. + Change type of addend parameter to bfd_vma in various functions. + +Fri Jun 5 18:09:58 1998 Ian Lance Taylor + + * aoutx.h (howto_table_ext): Change RELOC_BASE13 to use + complain_overflow_signed instead of complain_overflow_bitfield. + +Fri Jun 5 15:11:11 1998 Andreas Schwab + + * elf.c (elf_map_symbols): Don't add section VMA to symbol value + when comparing against 0. + +Wed Jun 3 17:52:49 1998 Ian Lance Taylor + + * Makefile.am (config.status): New target. + * Makefile.in: Rebuild. + +Wed Jun 3 12:18:24 1998 Stan Cox + + * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Give an + error if previous object endianness doesn't match current object. + +Tue Jun 2 17:50:59 1998 Nick Clifton + + * elf32-v850.c (v850_elf_print_private_bfd_data): Call + _bfd_elf_print_private)bfd_data (). + +Tue Jun 2 15:29:35 1998 Ian Lance Taylor + + * elflink.h (elf_merge_symbol): Don't always set type_change_ok + and size_change_ok. + (elf_link_add_object_symbols): Set type_change_ok and + size_change_ok before calling elf_merge_symbol. + + * elf32-mips.c (mips_elf_relocate_section): If we issue an + undefined symbol error, don't also issue an overflow error. + +Tue Jun 2 13:51:00 1998 Geoff Keating + + * elf32-ppc.c (ppc_elf_relocate_section): The target of an + R_PPC_LOCAL24PC relocation should be local; if not, print an error + message instead of crashing. + +Mon Jun 1 18:23:12 1998 Yuli Barcohen + + * archures.c (bfd_mach_cpu32): Define. + (bfd_default_scan): Add case for 68060. Fix 68332 case to use + bfd_mach_cpu32. + * cpu-m68k.c (arch_info_struct): Add m68k:cpu32. + * ieee.c: Include . + (ieee_object_p): Parse out process ID string to make it more + likely to be acceptable for bfd_scan_arch. + * bfd-in2.h: Rebuild. + +Mon Jun 1 11:12:02 1998 Nick Clifton + + * elf32-m32r.c (m32r_elf_print_private_bfd_data): Also call + _bfd_elf_print_private_bfd_data() so that the program header will + be displayed. + +Mon Jun 1 12:14:28 1998 Ian Lance Taylor + + * peicode.h (coff_swap_sym_in): Check for C_SECTION rather than + 0x68. Reindent. Add some comments. + +Fri May 29 09:58:08 1998 Nick Clifton + + * elf.c (copy_private_bfd_data): Adjust physical address of + segment in output BFD to contain LMAs of its sections. + +Tue May 26 19:37:47 1998 Stan Cox + + * elf32-sparc.c (_bfd_sparc_elf_howto_table, sparc_reloc_map, + elf32_sparc_relocate_section): Added R_SPARC_32LE for little + endian data 32 bit relocations. + (elf32_sparc_merge_private_bfd_data): Check if linking little + endian objects with big endian objects. + (elf32_sparc_object_p): Set bfd_mach_sparc_sparclite_le. + (elf32_sparc_final_write_processing): Set EF_SPARC_LEDATA in e_flags. + * libbfd.h (bfd_reloc_code_real_names): Added BFD_RELOC_SPARC_32LE. + * reloc.c: Same. + * cpu-sparc.c (arch_info_struct): Added sparc:sparclite_le + * archures.c (bfd_mach_sparc_sparclite_le): New. + * bfd-in2.h (BFD_RELOC_SPARC_32LE, bfd_mach_sparc_sparclite_le): New. + +Thu May 21 16:59:28 1998 Nick Clifton + + * peicode.h (add_data_entry): Fix precedence of operators in if () + statement. + +Tue May 19 18:41:19 1998 Ian Lance Taylor + + * bfd-in.h: Move over patch to bfd-in2.h. + + * reloc.c (bfd_check_overflow): Add casts before shifts which may + not fit in 32 bits. + (_bfd_relocate_contents): Likewise. + +Mon May 18 14:44:15 1998 Nick Clifton + + * peicode.h (add_data_entry): If the section has no private data + then do not create a Data Dictionary entry for it. + +Mon May 18 00:09:28 1998 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relax_section): Set again on changes. + (elf64_alpha_can_merge_gots, elf64_alpha_merge_gots, + elf64_alpha_size_got_sections): Rewrite, handling multiple got + subsections during relaxation more correctly. + +Thu May 14 14:22:58 1998 Nick Clifton + + * bfd-in2.h: Add new prototype: bfd_coff_set_symbol_class (). + Add extra argument to bfd_arm_process_before_allocation (). + * bfd-in.h: Reflect changes made in bfd-in2.h. + * coffgen.c (bfd_coff_set_symbol_class): New function. Set the + coff class of a BFD symbol. + * coff-arm.c: Add support for interworking between Thumb code and + non-interworking aware ARM code. + +Sun May 10 22:33:59 1998 Jeffrey A Law (law@cygnus.com) + + * po/Make-in (install-info): New target. + +Thu May 7 17:40:56 1998 Ian Lance Taylor + + * filemode.c: Remove; not used. + + If sysdep.h includes a header file, don't include it again: + * aix386-core.c: Don't include , , or + . + * aoutx.h: Don't include . Use "sysdep.h" rather than + . + * archive.c: Don't include or . + * evax-alpha.c; Don't include . + * evax-egsd.c: Likewise. + * evax-etir.c: Likewise. + * evax-misc.c: Likewise. + * evax-emh.c: Likewise. Also, don't include . + * hppabsd-core.c: Don't include , , or + . + * hpux-core.c: Likewise. + * netbsd-core.c: Likewise. + * som.c: Likewise. + * libbfd.c: Don't include . + * nlmcode.h: Don't include . + * osf-core.c: Don't include or . + * ptrace-core.c: Don't include , , + , or . + * trad-core.c: Don't include or . + +Thu May 7 13:12:50 1998 Klaus Kaempf + + * configure.com: If the version number can not be found in + configure.in, set it to "unknown" rather than "2.8.1". + +Wed May 6 09:46:05 1998 Gavin Koch + + * elf32-mips.c (elf_mips_mach): New. + (_bfd_mips_elf_object_p): Use elf_mips_mach. + (_bfd_mips_elf_final_write_processing): Use the names + of machines, rather than the numbers. Set both the ARCH + and MACH in e_flags. Handle a few more specific machines. + (_bfd_mips_elf_merge_private_bfd_data): Merge both + EF_MIPS_ARCH and EF_MIPS_MACH. + +Tue May 5 21:01:53 1998 Richard Henderson + + * syms.c (bfd_is_local_label): Revert last change. + * srec.c (srec_write_symbols): Discard debugging symbols. + +Tue May 5 23:36:06 1998 Ian Lance Taylor + + * som.c: Include . + * som.h: Don't include sysdep.h. + +Tue May 5 18:29:24 1998 Tom Tromey + + * libbfd.h: Rebuilt. + * libbfd-in.h: Removed gettext includes and defines. + * sysdep.h: Moved gettext-related includes and defines here. + +Tue May 5 16:47:54 1998 Richard Henderson + + * srec.c (srec_write_symbols): Use bfd_is_local_label rather than + an ad-hoc test. Kill bogus #if 0 code. + * syms.c (bfd_is_local_label): Consider BSF_DEBUGGING symbols local. + +Mon May 4 16:10:33 1998 Ian Lance Taylor + + * sunos.c (sunos_check_dynamic_reloc): Don't use the PLT address + when generating a normal executable for a symbol defined in a + regular file. When copying a reloc into the output file, adjust + the addend for a PC relative reloc against a global symbol. + +Mon May 4 10:08:18 1998 Tom Tromey + + * libbfd.h: Rebuilt. + * libbfd-in.h (_): Define as dgettext. + +Mon May 4 11:02:23 1998 Ian Lance Taylor + + * coff-arm.c (coff_arm_relocate_section): Cast to bfd_signed_vma, + not signed. + * peicode.h (pe_saved_coff_bfd_print_private_bfd_data): Use PARAMS + when declaring parameter types. + (pe_saved_coff_bfd_copy_private_bfd_data): Likewise. + +Wed Apr 29 15:35:03 1998 Ian Lance Taylor + + * config.bfd: If we include any ELF targets in targ_defvec and/or + targ_selvecs, then add the generic ELF targets to targ_selvecs. + * elf32-gen.c (dummy): New static const variable. + (elf_generic_info_to_howto): New static function. + (elf_generic_info_to_howto_rel): New static function. + (elf_info_to_howto): Define as elf_generic_info_to_howto. + (elf_info_to_howto_rel): Define as elf_generic_info_to_howto_rel. + * elf64-gen.c: Same changes as elf32-gen.c. + * elfcode.h (elf_object_p): For the generic target, ignore a + failure of bfd_default_set_arch_mach. Fix indentation a bit. + +Tue Apr 28 20:05:52 1998 Ian Lance Taylor + + * configure.in (WIN32LIBADD): Add -lintl on cygwin32. + * configure: Rebuild. + +Tue Apr 28 12:16:57 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * config.bfd: Update OSR5/Unixware patterns. + +Mon Apr 27 18:02:24 1998 Richard Henderson + + * elf.c (assign_file_positions_for_segments): Allow for holes + between sections added by a link script. + +Mon Apr 27 11:49:55 1998 Ian Lance Taylor + + * configure.in: Change version number to 2.9.4 + * configure: Rebuild. + + Based on patch from H.J. Lu : + * elf.c (bfd_elf_get_bfd_needed_list): New function. + * bfd-in.h (bfd_elf_get_bfd_needed_list): Declare. + * bfd-in2.h: Rebuild. + +Sat Apr 25 20:07:53 1998 Richard Henderson + + * elf64-alpha.c (struct alpha_relax_info): Replace elfsym with other. + Change all users. + +Sat Apr 25 18:29:07 1998 Richard Henderson + + * elf64-alpha.c (struct alpha_relax_info): Add tsec & elfsym members. + (elf64_alpha_relax_section): Fill them in. + (elf64_alpha_relax_opt_call): Implement more than a stub. + (elf64_alpha_add_symbol_hook): Don't set SEC_LOAD or default + alignment on .scommon. + (elf64_alpha_merge_gots): Merge use counts as well. + +Sat Apr 25 14:07:29 1998 Richard Henderson + + * elf64-alpha.c (elf64_alpha_relax_section): Use the proper section + for calculating a local symbol's address. + (elf64_alpha_calc_got_offsets): Skip entries with 0 use count. + Set the .got's cooked size as well as the raw size. + +Fri Apr 24 09:16:00 1998 Nick Clifton + + * elf32-v850.c (v850_elf_print_private_bfd_data): Add + internationalisation of printed information. + + * coff-arm.c (coff_arm_print_private_bfd_data): Add + internationalisation of printed information. + +Fri Apr 24 12:09:18 1998 Ian Lance Taylor + + * syms.c (struct indexentry): Change directory_name, file_name, + and function_name fields to char *. + (struct stab_find_info): Change cached_file_name field to char *. + +Thu Apr 23 08:13:04 1998 Nick Clifton + + * peicode.h (dir_names): Add missing N_() macros to dir_names array. + +Wed Apr 22 13:06:15 1998 Tom Tromey + + * po/Make-in (MKINSTALLDIRS): Don't look in $(top_srcdir). + +Wed Apr 22 17:48:48 1998 Ian Lance Taylor + + * Makefile.am (install-data-local): Make $(includedir). + * Makefile.in: Rebuild. + +Wed Apr 22 13:06:15 1998 Tom Tromey + + * libbfd-in.h: Use `gettext' and not `dgettext' for now. + +Wed Apr 22 12:53:40 1998 Ian Lance Taylor + + * Makefile.am (INCLUDES): Add -I$(srcdir)/../intl -I../intl. + * Makefile.in: Rebuild. + + * bfd-in2.h: Rebuild for Nick's changes. + +Tue Apr 21 23:11:51 1998 Richard Henderson + + * archive.c (_bfd_generic_read_ar_hdr_mag): Fix lossage in last + change wrt length == max_namelen. + +Tue Apr 21 21:19:36 1998 Tom Tromey + + * Many files: Added gettext invocations around user-visible + strings. + * libbfd-in.h: Added gettext includes and defines. + * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY, + HAVE_LC_MESSAGES): Define. + * configure.in: Call CY_GNU_GETTEXT. Create po/Makefile.in and + po/Makefile. + * Makefile.am (SUBDIRS): Added po. + (POTFILES): New macro. + (po/POTFILES.in): New target. + (SOURCE_HFILES): New macro. + (HFILES): Use it. + * po/Make-in, po/POTFILES.in, po/bfd.pot: New files. + +Tue Apr 21 13:38:18 1998 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) + + * elfcore.h (bfd_prstatus): Copy core_prstatus from the first + NT_PRSTATUS note section encountered, it contains the status of + the currently executing thread when the core file was written. + +Tue Apr 21 10:00:12 1998 Nick Clifton + + * libcoff.h: Add extra parameter to + bfd_coff_link_output_has_begun overrideable function. + * cofflink.c: Pass extra parameter to + bfd_coff_link_output_has_begun function. + * bfd-in.h: Add prototypes for exported ARM interworking + functions. + * peicode.h: ARM specific code reorganised to conform to BFD + coding conventions. + * coffcode.h: ARM specific code reorganised to conform to BFD + coding conventions. + * coff-arm.c: Code reorganised to conform to the BFD coding + conventions. Global variables have been moved into an ARM + specific hash table structure and a new function: + bfd_arm_get_bfd_for_interworking() has been created which is + called from the linker scripts. + +Tue Apr 21 00:11:51 1998 Richard Henderson + + * archive.c (_bfd_generic_read_ar_hdr_mag): Simplify end-of-name test. + + * elf64-alpha.c (elf64_alpha_find_reloc_at_ofs): Renamed from + elf64_alpha_relax_find_reloc_ofs. Changed all callers. + (elf64_alpha_add_symbol_hook): Put small commons in .scommon not .sbss. + (elf64_alpha_size_got_sections): Don't merge .got sections twice. + +Sat Apr 18 01:21:04 1998 Stan Cox + + * config.bfd: Added sparc86x support. + +Fri Apr 17 22:29:04 1998 Ian Lance Taylor + + * elf32-mips.c (mips_elf_relocate_section): Do not complain about + an out of range pc-relative jump/call to an undefined weak symbol. + +Thu Apr 16 13:49:00 1998 Richard Henderson + + * elf64-alpha.c (elf64_alpha_do_reloc_gpdisp): Do all gpdisp + comparisons signed. + +Thu Apr 16 11:43:33 1998 Ian Lance Taylor + + * archive.c (bfd_generic_archive_p): If a slurp subroutine returns + an error other than bfd_error_system_call, set the error to + bfd_error_wrong_format. + + * targets.c (bfd_target_vector) [SELECT_VECS not defined]: Add + bfd_elf32_powerpcle_vec. + + * elf.c (copy_private_bfd_data): If all the p_paddr fields in the + program segments are zero, don't set p_paddr_valid. + +Wed Apr 15 22:15:16 1998 Richard Henderson + + * elf64-alpha.c: Initial implementation of relaxation -- + (struct alpha_elf_link_hash_entry): Add use_count member. + (elf64_alpha_check_relocs): Initialize and increment it. + (elf64_alpha_can_merge_gots): Check it when considering merging. + (elf64_alpha_merge_gots): Drop entries with zero use. + (elf64_alpha_calc_got_offsets_for_symbol): Likewise. + (elf64_alpha_always_size_sections): Split out got sizing ... + (elf64_alpha_size_got_sections): ... here. New function. + (elf64_alpha_relax_find_reloc_ofs): New function. + (elf64_alpha_relax_with_lituse): Likewise. + (elf64_alpha_relax_without_lituse): Likewise. + (elf64_alpha_relax_opt_call): Likewise. + (elf64_alpha_relax_section): Likewise. + (elf64_alpha_add_symbol_hook): Likewise. + (elf64_alpha_howto_table): Implement GPRELHIGH/LOW & IMMED_GP_16. + (elf64_alpha_relocate_section): Likewise. + (bfd_elf64_bfd_relax_section): Define. + (elf_backend_add_symbol_hook): Likewise. + +Wed Apr 15 16:08:46 1998 Richard Henderson + + * elf.c (prep_headers): Use new EM_SPARCV9 symbol. + * elf64-sparc.c (ELF_MACHINE_CODE): Likewise. + (ELF_MACHINE_ALT1): New. Set to EM_OLD_SPARC64. + +Wed Apr 15 11:34:33 1998 Ian Lance Taylor + + * configure.in: Add -lkernel32 to WIN32LIBADD on cygwin32. + * configure: Rebuild. + +Mon Apr 13 16:46:27 1998 Ian Lance Taylor + + * Makefile.am (libbfd_la_LIBADD): Add @WIN32LIBADD@. + (libbfd_la_LDFLAGS): Add @WIN32LDFLAGS@. + * configure.in: Define and substitute WIN32LDFLAGS and + WIN32LIBADD. + * aclocal.m4: Rebuild with new libtool. + * configure, Makefile.in: Rebuild. + +Fri Apr 10 13:44:27 1998 Ian Lance Taylor + + * coffcode.h (coff_write_object_contents): Move a PE COMDAT symbol + before any other symbols in the same section. + +Wed Apr 8 14:50:23 1998 Michael Meissner + + * config.bfd (powerpc*-*-*): Remove PowerPC NT support from ELF + systems. + +Tue Apr 7 16:25:31 1998 Gavin Romig-Koch + + * dwarf2.c (comp_unit): Move it earlier in the source. Add + addr_size. + (read_address): Replace 'bdf*' argument with 'comp_unit*' argument. + Use addr_size for address size, rather than sizeof(bfd_vma). + (read_attribute): Replace bdf* argument with 'comp_unit*' argument. + Fix call to read_address. + (decode_line_info): Replace bdf* argument with 'comp_unit*' argument. + Scrap other unneeded arguments. Fix call to read_address. + (scan_unit_for_functions): Fix call to read_attribute. + (parse_comp_unit): We now handle more values for addr_size. + Set addr_size in unit. Fix call to read_attribute and + decode_line_info. + +Tue Apr 7 15:44:47 1998 Gavin Romig-Koch + + * dwarf2.c (parse_comp_unit): Drop use of unit->name when it is null. + +Tue Apr 7 12:35:18 1998 Ian Lance Taylor + + * archures.c (bfd_default_scan): Add m68k cases back to default + switch, reverting patch of March 25, since IEEE support depends + upon them. + +Mon Apr 6 14:06:40 1998 Ian Lance Taylor + + * Makefile.am (diststuff): New target. + * Makefile.in: Rebuild. + +Sun Apr 5 16:21:44 1998 Jeffrey A Law (law@cygnus.com) + + * som.c (som_bfd_ar_write_symbol_stuff): Fix computation of + som_offset when we have an extended name table. + +Sun Apr 5 16:04:39 1998 H.J. Lu + + * Makefile.am (stamp-lib): Check that .libs/libbfd.a exists before + trying to copy it. + * Makefile.in: Rebuild. + +Fri Apr 3 11:09:42 1998 Andreas Schwab + + * elf32-m68k.c (elf_m68k_size_dynamic_sections): Generate section + symbols when creating a shared library. + (elf_m68k_adjust_dynindx): New function, used by above code. + (elf_m68k_finish_dynamic_sections): Initialize the section + symbols. + (elf_m68k_relocate_section): Change abort to BFD_ASSERT. + +Wed Apr 1 16:04:02 1998 Nick Clifton + + * coff-arm.c (in_reloc_p): Use ARM_RVA32 in place of constant + value 11. + +Wed Apr 1 13:36:58 1998 Andreas Schwab + + * elf32-m68k.c (elf_m68k_relocate_section, case R_68K_PLT*O): Fix + assertion. + +Tue Mar 31 00:12:12 1998 Jeffrey A Law (law@cygnus.com) + + * elf-m10300.c (mn10300_elf_relax_section): Correctly handle + absolute symbols. + +Mon Mar 30 12:46:15 1998 Ian Lance Taylor + + * configure.in: Set version to 2.9.1. + * configure: Rebuild. + + * Branched binutils 2.9. + +Mon Mar 30 12:20:50 1998 Brent Baccala + + * syms.c (ENABLE_CACHING): Define. + (struct indexentry): Define. + (struct stab_cache): Remove. + (cmpindexentry): New static function. + (struct stab_find_info): Add new fields: indextable, + indextablesize, cached_indexentry, cached_offset, cached_stab, and + cached_file_name. Remove fields: file_cache, function_cache, and + line_cache. + (_bfd_stab_section_find_nearest_line): Rewrite to build a sorted + index table and search it. + +Mon Mar 30 10:39:34 1998 Ian Lance Taylor + + * elf.c (_bfd_elf_copy_private_section_data): Call + copy_private_bfd_data once we've seen the last SEC_ALLOC section. + + * cpu-mips.c: Remove trailing comma at end of enumeration list. + +Sat Mar 28 16:33:02 1998 Ian Lance Taylor + + * coff-arm.c: Define all globally visible variables and functions + only when COFF_WITH_PE is not defined. + * configure.in (armpe_little_vec, armpe_big_vec): Add + coff-arm.lo. + * configure: Rebuild. + +Fri Mar 27 16:06:02 1998 Ian Lance Taylor + + Fix some gcc -Wall warnings: + * aout-arm.c (MY(fix_pcrel_26)): Add casts to avoid warnings. + * archive.c (_bfd_generic_read_ar_hdr_mag): Likewise. + * archures.c (bfd_default_scan): Likewise. + * bfd.c (bfd_scan_vma): Likewise. + * binary.c (mangle_name): Likewise + * coff-arm.c (aoutarm_fix_pcrel_26): Likewise. + * coff-sh.c (sh_relocate_section): Likewise. + * coff-stgo32.c (create_go32_stub): Likewise. + * coffcode.h (coff_slurp_line_table): Likewise. + * ecoff.c (_bfd_ecoff_write_armap): Likewise. + * elf.c (_bfd_elf_make_section_from_shdr): Likewise. + (assign_file_positions_for_segments): Likewise. + * elf32-mips.c (mips_elf_relocate_section): Likewise. + * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise. + * oasys.c (oasys_write_sections): Likewise. + * ppcboot.c (ppcboot_object_p): Likewise. + (mangle_name): Likewise. + * riscix.c (riscix_fix_pcrel_26): Likewise. + * srec.c (srec_scan): Likewise. + * stabs.c (_bfd_write_section_stabs): Likewise. + * sunos.c (sunos_add_dynamic_symbols): Likewise. + * aout-ns32k.c (_bfd_ns32k_relocate_contents): Add default case to + switch. Declare parameters for function pointers. + * archures.c (bfd_default_scan): Add braces to avoid ambiguous if + warning. + * elf.c (elf_sort_sections): Likewise. + * coff-arm.c (coff_thumb_pcrel_common): Initialize relocation. + Add default cases to switches. + (coff_arm_relocate_section): Remove unused local variables. + Always set rstat. + (coff_arm_bfd_set_private_flags): Change flag variable to type + flagword. + * coff-mips.c (mips_relocate_section): Initialize use_lo. + * coff-ppc.c (ppc_record_toc_entry): Change i to unsigned int. + (dump_toc): Change cat to const, and initialize it. + * coff-sh.c (sh_relax_delete_bytes): Initialize start and voff. + * elf32-sh.c (sh_elf_relax_delete_bytes): Likewise. + (sh_elf_relocate_section): Initialize r_symndx. + * coffcode.h (coff_compute_section_file_positions): Only declare + old_sofar if ALIGN_SECTIONS_IN_FILE. + (coff_write_object_contents): Initialize csym. + * coffgen.c (coff_pointerize_aux): Make type and class unsigned. + * cpu-ns32k.c (_bfd_ns32k_get_displacement): Add default case to + switch. + * dwarf2.c: Include libiberty.h. + (read_2_signed_bytes, read_4_signed_bytes): Comment out. + (decode_line_info): Remove unused local variables. + * elf32-m32r.c (m32r_elf_sda16_reloc): Likewise. + (m32r_elf_relocate_section): Likewise. + * elf32-v850.c (v850_elf_store_addend_in_insn): Likewise. + (v850_elf_reloc): Likewise. + * elf-bfd.h (elf_linker_section_t): Make alignment unsigned. + (struct elf_obj_tdata): Make cverdefs and cverrefs unsigned. + * elf.c (assign_file_positions_for_segments): Always set adjust. + * elf32-d30v.c (bfd_elf_d30v_reloc): Initialize tmp_addr. Fully + parenthesize expression. + * elf32-m32r.c (m32r_elf_relocate_section): Always initialize h. + (m32r_elf_object_p): Return a value. + (m32r_elf_print_private_bfd_data): Change fprintf format string. + * elf32-mips.c (mips_elf_final_link): Initialize last. + (mips_elf_finish_dynamic_sections): Initialize last and dindx. + * elf32-v850.c (v850_elf_object_p): Return a value. + (v850_elf_print_private_bfd_data): Change fprintf format string. + * elfcode.h (elf_slurp_symbol_table): Change symcount and i to + unsigned long. + * elflink.h (elf_link_add_object_symbols): Change vernum to + unsigned int, and initialize it. Change fprintf format string. + (NAME(bfd_elf,size_dynamic_sections)): Cast -1 to bfd_size_type + when setting or comparing to soname_indx. + (elf_create_pointer_linker_section): Change num_symbols to + unsigned int. + * libcoff-in.h (coff_data_type): Change flags to flagword. + * peicode.h (pe_print_idata): Initialize idx. Change j to + bfd_size_type. Initialize hint_member. Remove useless test to + time_stamp. + (pe_print_edata): Change num_functions and num_names in struct + EDT_type to unsigned long. Remove cast. Change fprintf format + string. + * ppcboot.c (ppcboot_object_p): Change i to size_t. + * reloc.c (bfd_get_reloc_size): Change return type to unsigned + int. + * reloc16.c (bfd_coff_reloc16_relax_section): Change shrinks to + int *. Update uses. Change j to long. + * bfd-in2.h, libcoff.h: Rebuild. + +Fri Mar 27 10:10:46 1998 Catherine Moore + + * elf32-v850.c Remove definition of USE_REL. + (v850_elf_info_to_howto_rela): New function. + (v850_elf_perform_relocation): Renamed from + v850_elf_store_addend_in_insn. Removed replace argument. + (v850_elf_reloc): store the relocation in the addend field instead + of the insn. + (v850_elf_final_link_relocate): Now calls + v850_elf_perform_relocation. + (v850_elf_relocate_section): Remove code to generate REL + relocations. + +Thu Mar 26 13:32:17 1998 Ian Lance Taylor + + * coffcode.h (coff_new_section_hook): Set the type and storage + class in the native symbol information allocated for a new section + symbol. + +Thu Mar 26 10:13:41 1998 Nick Clifton + + * peicode.h: Chain together calls to + coff_bfd_copy_private_bfd_data and + coff_bfd_print_private_bfd_data. + + * coff-arm.c: Add prototypes for + coff_arm_bfd_print_private_bfd_data and + coff_arm_bfd_copy_private_bfd_data. + +Wed Mar 25 15:45:55 1998 Nick Clifton + + * coffcode.h (coff_mkobject_hook): Set private falgs even for a PE + build. + + * peicode.h: Call arm-coff private data functions after handling + pe private data. + + * coff-arm.c: Turn statics into globals so that they can be shared + both pe and pei backends. + +Wed Mar 25 15:19:38 1998 Ian Lance Taylor + + * aoutf1.h (sunos_set_arch_mach): Use bfd_mach_m68* rather than + plain numbers. + (sunos_write_object_contents): Likewise. + * aoutx.h (NAME(aout,machine_type)): Likewise. + * coffcode.h (coff_set_arch_mach_hook): Likewise. + +Wed Mar 25 13:59:24 1998 Andreas Schwab + + * archures.c (bfd_mach_m68*): Add definitions for various m68k + variants. + (bfd_default_scan): Remove m68k special cases. + * bfd-in2.h: Rebuild. + * mipsbsd.c (MY(write_object_contents)): Use bfd_mach_m68* rather + than plain numbers. + * sparclynx.c (NAME(lynx,set_arch_mach)): Likewise. + * cpu-m68k.c (arch_info_struct): Likewise. Add entry for + m68k:68000. + (bfd_m68k_arch): Set mach field to zero to signal no explicit + selection, change printable_name to just "m68k" and make that the + default instead of m68k:68020. + + * aout-tic30.c (NAME): Define this to avoid multiple definitions + from aoutx.h. + (MY_get_section_contents): Define as aout_32_get_section_contents + rather than NAME(aout,get_section_contents). + + * elf-m10300.c (elf32_mn10300_link_hash_table_create): Fix cast. + + * evax-alpha.c (evax_set_arch_mach): Only accept bfd_arch_alpha + and call bfd_default_set_arch_mach to do the real work. + +Wed Mar 25 10:41:35 1998 Richard Henderson + + * bout.c (BALX): Include return register g14 as part of the insn. + (BALX_MASK): New. + (calljx_callback): Use it. + +Wed Mar 25 11:19:28 1998 Ian Lance Taylor + + * libbfd-in.h (BFD_ALIGN): Cast this parameter to bfd_vma. + * libbfd.h: Rebuild. + + * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Change + byte_count to unsigned int. + (mn10300_elf_relax_section): Initialize internal_relocs. Remove + unused local variables. + + * evax-alpha.c (evax_close_and_cleanup): Remove unused local + variables er and er1. + + * cpu-v850.c: Include . + (scan): Case isdigit argument to unsigned char. + + From Yan Meroth : + * ihex.c (ihex_scan): Add extbase variable so that getting an + extended linear address record does not ignore any previous + extended address. + (ihex_write_object_contents): When writing out an extended linear + address record, zero out any previous extended address. + +Tue Mar 24 16:09:43 1998 Manfred Hollstein + + * ieee.c (do_one): Check section before dereferencing it. + (ieee_canonicalize_reloc): Likewise with src->relent.sym_ptr_ptr. + (ieee_generic_stat_arch_elt): Likewise with abfd->my_archive. + +Mon Mar 23 18:51:47 1998 Joel Sherrill + + * config.bfd: (sh*-*-rtems*): Switched from ELF to COFF. + +Mon Mar 23 14:23:36 1998 Nick Clifton + + * coff-arm.c: Add interworking functions to pe backends. + +Fri Mar 20 18:47:20 1998 Ian Lance Taylor + + * configure.in: Use AM_DISABLE_SHARED. + * aclocal.m4, configure: Rebuild with libtool 1.2. + +Fri Mar 20 11:25:41 1998 Nick Clifton + + * coff-arm.c (coff_arm_relocate_section): Better error messages + when interowrking conflucts occur. Courtesy of Jonathan Walton + and Tony Thompson. + (aoutarm_std_reloc_howto): Fixed bitsize fields of rightshifted + relocations. Patch courtesy of Jonathan Walton and Tony + Thompson. + +Fri Mar 20 02:26:43 1998 Richard Henderson + + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Revert + part of Feb 22 change controling when to override the existing + symbol with the .plt entry. + +Wed Mar 18 09:26:25 1998 Nick Clifton + + * config.bfd (targ_cpu): Add thumb-pe target. + + * coffcode.h (OTHER_GLOBAL_CLASS): Support thumb external + functions in PE build. + +Sun Mar 8 23:37:26 1998 Stan Cox + + * config.bfd (sparclite-*-elf*): Added. + +Mon Feb 23 19:31:19 1998 Ian Lance Taylor + + * configure.in: Add elf.lo to elf shell variable. + * Makefile.am (BFD_LIBS): Remove elf.lo. + (BFD_LIBS_CFILES): Remove elf.c. + (BFD32_BACKENDS): Add elf.lo. + (BFD32_BACKENDS_CFILES): Add elf.c. + * configure, Makefile.in: Rebuild. + +1998-02-23 15:53 Richard Henderson + + * elf32-i386.c (elf_i386_relocate_section): A pc-relative + relocation against a non-local symbol should not have a dynamic + relocation. + +Mon Feb 23 16:17:08 1998 Ian Lance Taylor + + * peicode.h (coff_swap_filehdr_in): Don't set BFD flag HAS_SYMS in + COFF filehdr flags. + (pe_print_private_bfd_data): Print PE flags. From Mikey + . + +Sun Feb 22 20:39:00 1998 Richard Henderson + + * elf32-sparc.c (elf32_sparc_adjust_dynamic_symbol): Don't create + a plt entry when we can determine that we authoritatively define + the symbol. + +Sun Feb 22 20:33:05 1998 Richard Henderson + + * configure.in (COREFILE selection): Remove sparc-*-linux*. They + don't actually use trad-core, but a SunOS-style core file handled + by gdb directly. + * hosts/sparclinux.h: Remove. + +Wed Feb 18 15:31:06 1998 Ian Lance Taylor + + * peicode.h (pe_print_idata): If there is no .idata section, look + for the import tables in some other section. Make the initial + label line up better with the data. Print the import address + table even if there is no import name table. If the import + address table holds actual addresses, print them. + +Tue Feb 17 12:58:34 1998 Ian Lance Taylor + + * libbfd.c (bfd_seek): If fseek fails, save errno around call to + bfd_tell. If errno is EINVAL, set bfd_error_file_truncated, not + bfd_error_system_call. + +Fri Feb 13 13:11:33 1998 Ian Lance Taylor + + * Makefile.am (AUTOMAKE_OPTIONS): Define. + * configure, Makefile.in, aclocal.m4: Rebuild with automake 1.2e. + + From H.J. Lu : + * Makefile.am (libbfd_la_LDFLAGS): Define. + * Makefile.in: Rebuild. + +Thu Feb 12 17:31:11 1998 Ian Lance Taylor + + NetBSD patches from Gordon W. Ross : + * netbsd.h (MACHTYPE_OK): Define. + (MY(write_object_contents)): Use DEFAULT_ARCH and DEFAULT_MID when + calling N_SET_MACHTYPE, rather than having a switch. + * libaout.h (enum machine_type): Add M_PMAX_NETBSD, M_VAX_NETBSD, + and M_ALPHA_NETBSD. + * i386netbsd.c (MACHTYPE_OK): Don't define. + (DEFAULT_MID): Define. + * m68k4knetbsd.c (SEGMENT_SIZE): Don't define. + (MACHTYPE_OK): Don't define. + (DEFAULT_MID): Define. + * m68knetbsd.c: (MACHTYPE_OK): Don't define. + (DEFAULT_MID): Define. + * ns32knetbsd.c (MACHTYPE_OK): Don't define. + (DEFAULT_MID): Define. + * sparcnetbsd.c (MACHTYPE_OK): Don't define. + (DEFAULT_MID): Define. + + NetBSD patches from Gordon W. Ross : + * vaxnetbsd.c: New file. + * netbsd-core.c: Clean up. Remove unused macros. Use netbsd + rather than netbsd_core. + * targets.c (vaxnetbsd_vec): Declare. + (bfd_target_vector): Add vaxnetbsd_vec. If NETBSD_CORE is + defined, add netbsd_core_vec. + * configure.in: Set COREFILE for alpha*-*-netbsd* and + powerpc-*-netbsd* to netbsd-core.lo. If COREFILE is + netbsd-core.lo, set COREFLAG to -DNETBSD_CORE. + * config.bfd (alpha*-*-netbsd*): New target. + * Makefile.am: Rebuild dependencies. + (BFD32_BACKENDS): Add vaxnetbsd.lo. + (BFD32_BACKENDS_CFILES): Add vaxnetbsd.c. + * configure, Makefile.in: Rebuild. + + * configure.host: Remove the old shared library build stuff. We + now use libtool instead. + +Wed Feb 11 17:13:09 1998 Richard Henderson + + * tekhex.c (tekhex_write_object_contents): Call tekhex_init. + +Tue Feb 10 19:23:28 1998 H.J. Lu + + * configure.in: Take stab-syms.lo out of sparclinux_vec list. + * configure: Rebuild. + +Tue Feb 10 15:16:38 1998 Nick Clifton + * elf32-v850.c (remember_hi16s_reloc): New function. + (find_remembered_hi16s_reloc): New function. + (v850_elf_store_addend_in_insn): Use the above new functions to + match up HI6S relocs with LO16 relocs. + +Tue Feb 10 15:01:39 1998 Ian Lance Taylor + + * configure.in: Change -linux* to -linux-gnu*. + * config.bfd, configure.host: Likewise. + * configure: Rebuild. + +Mon Feb 9 19:40:59 1998 Nick Clifton + + * elf32-v850.c (v850_elf_store_addend_in_insn): Fix another + LO16/HI16S bug and improve comments about what is going on. + +Sat Feb 7 15:27:03 1998 Ian Lance Taylor + + * configure, aclocal.m4: Rebuild with new libtool. + +Fri Feb 6 14:48:20 1998 Nick Clifton + + * elf32-v850.c (v850_elf_merge_private_bfd_data): Do not complain + when merging v850 code into v850e/v850ea code. Do not initialise + output flags if the input is the default architecture. + +Fri Feb 6 11:50:22 1998 Jeffrey A Law (law@cygnus.com) + + * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): For BFD_RELOC_CTOR + get the size from bfd_arch_bits_per_address instead of directly + from the isa. + +Thu Feb 5 14:21:34 1998 Michael Meissner + + * libbfd-in.h (BFD_ALIGN): If rounding up would cause the address + to wrap, just return all 1's bits instead. + * libbfd.h: Regenerate. + +Thu Feb 5 11:51:05 1998 Ian Lance Taylor + + * coff-i386.c (coff_pe_i386_relocate_section): New static function + if COFF_WITH_PE. + (coff_relocate_section): If COFF_WITH_PE, define as + coff_pe_i386_relocate_section. + * coffcode.h (coff_write_object_contents): If COFF_IMAGE_WITH_PE, + skip empty sections, to match coff_write_object_contents. + + * elf64-mips.c (mips_elf64_swap_reloca_out): Swap out r_addend, + rather than swapping out r_offset twice. From Luke Deller + . + +Wed Feb 4 19:11:28 1998 Ian Lance Taylor + + * configure.in: Set libtool_enable_shared rather than + libtool_shared. Remove diversion hack. + * configure, Makefile.in, doc/Makefile.in, aclocal.m4: Rebuild + with new libtool. + +Wed Feb 4 16:10:21 1998 Brent Baccala + + * syms.c (struct stab_cache): Define. + (struct stab_find_info): Remove cached_offset, cached_stab, + cached_str, and cached_stroff fields. Add file_cache, + function_cache, and line_cache fields. + (_bfd_stab_section_find_nearest_line): Use extensive caching to + speed up searches. + +Wed Feb 4 13:34:22 1998 Ian Lance Taylor + + * peicode.h (pe_print_idata): Check for import of ordinal rather + than name. + (pe_print_edata): If there is no .edata section, look for the + export data in some other section. + +Mon Feb 2 20:05:42 1998 Jason Molenda (crash@bugshack.cygnus.com) + + * configure.in: Change version to 2.8.4. + * configure: Regenerated. + +Mon Feb 2 17:39:39 1998 Steve Haworth + + Add tms320c30 support: + * cpu-tic30.c: New file. + * aout-tic30.c: New file. + * coff-tic30.c: New file. + * archures.c (bfd_arch_tic30): Define. + (bfd_tic30_arch): Declare. + (bfd_archures_list): Add bfd_tic30_arch. + * targets.c (bfd_target_vector): Add tic30_aout_vec and + tic30_coff_vec. + * reloc.c (BFD_RELOC_TIC30_LDP): Define. + * coffcode.h (coff_set_arch_mach_hook): Add tic30 case. + (coff_set_flags): Likewise. + * config.bfd (tic30-*-*aout*, tic30-*-*coff*): New targets. + * configure.in (tic30_aout_vec, tic30_coff_vec): New vectors. + * Makefile.am: Rebuild dependencies. + (ALL_MACHINES): Add cpu-tic30.lo. + (ALL_MACHINES_CFILES): Add cpu-tic30.c. + (BFD32_BACKENDS): Add aout-tic30.lo and coff-tic30.lo. + (BFD32_BACKENDS_CFILES): Add aout-tic30.c and coff-tic30.c. + * configure, Makefile.in, bfd-in2.h, libbfd.h: Rebuild. + +Mon Feb 2 12:25:12 1998 Nick Clifton + + * elf32-v850.c (v850_elf_store_addend_in_insn): Allow HI16_S reloc + to lag behind LO16 reloc by a couple of instructions. + +Mon Feb 2 14:09:46 1998 Ian Lance Taylor + + * Makefile.am ($(srcdir)/bfd-in2.h): Add dummy command to force + make to reexamine the file timestamp. + ($(srcdir)/libbfd.h, $(srcddir)/libcoff.h): Likewise. + + * elf64-alpha.c (ELF_MAXPAGESIZE): Change to 0x10000 from + 0x100000. + +Fri Jan 30 19:07:07 1998 Geoff Keating + + * elf32-ppc.c (ppc_elf_create_dynamic_sections): New procedure + to create .dynsbss and .rela.sbss sections. + (ppc_elf_adjust_dynamic_symbol): Put space for small data to be + copied from dynamic objects into .sbss. + (ppc_elf_size_dynamic_sections): Strip .rela.sbss if we don't + use it. Correct typo of .rela.sdata2. + (ppc_elf_finish_dynamic_symbol): Generate reloc to where we + put the data, which may now be in .sbss. + (ppc_elf_relocate_section): A SDAREL16 reloc can be in dynsbss. + (elf_backend_create_dynamic_sections): Define as + ppc_elf_create_dynamic_sections. + + * elf32-ppc.c (ppc_elf_check_relocs): Don't emit R_PPC_REL* relocs + against _GLOBAL_OFFSET_TABLE_. + (ppc_elf_relocate_section): Don't emit R_PPC_REL32 relocs in + shared libraries which refer to local symbols. Make sure that the + test for allocating space for a reloc in a shared object is the + same as the test for emitting a reloc. + +Thu Jan 29 15:55:35 1998 J.J. van der Heijden + + * config.bfd (i[3456]-*-mingw32*): New target. + * acinclude.m4 (BFD_BINARY_OPEN): Check for mingw32. + * aclocal.m4, configure: Rebuild. + +Wed Jan 28 13:41:26 1998 Ian Lance Taylor + + * elf.c (_bfd_elf_close_and_cleanup): Only check the strtab if we + have a bfd_object. + +Tue Jan 27 21:43:55 1998 Richard Henderson + + Sparc v9 ABI compliant PLT: + * elf64-sparc.c (PLT_HEADER_SIZE): V9 ABI uses 4 entries. + (plt_templates, sparc64_elf_build_plt_entry): Delete. + (LARGE_PLT_THRESHOLD): New define. + (GOT_RESERVED_ENTRIES): V9 ABI only uses 1. + (sparc64_elf_build_plt): New function. + (sparc64_elf_plt_entry_offset): Likewise. + (sparc64_elf_plt_ptr_offset): Likewise. + (sparc64_elf_adjust_dynamic_symbol): Change h->plt_offset to + contain the index for convenience. Skip the initial entries + in .rela.plt. + (sparc64_elf_size_dynamic_sections): Zero the allocated contents + memory for the benefit of .rela.plt. + (sparc64_elf_relocate_section): Call sparc64_elf_plt_entry_offset. + (sparc64_elf_finish_dynamic_symbol): Kill template stuff. Use + sparc64_elf_plt_entry_offset & sparc64_elf_plt_ptr_offset for reloc. + (sparc64_elf_finish_dynamic_sections): DT_PLTGOT points to .plt. + Call sparc64_elf_build_plt. + (elf_backend_want_got_plt): No. + (elf_backend_plt_readonly): No. + (elf_backend_plt_alignment): 8. + + * elf.c (_bfd_elf_close_and_cleanup): New function; free the shstrtab. + * elf-bfd.h (_bfd_elf_close_and_cleanup): Declare it. + * elfxx-target.h (bfd_elfNN_close_and_cleanup): Arrange for it + to be called. + +Tue Jan 27 21:45:15 1998 Jeffrey A Law (law@cygnus.com) + + * archures.c (bfd_mach_mips*): Add definitions for various MIPS + processors. + * cpu-mips.c (arch_info_struct): Add mips variants. + * bfd-in2.h: Rebuilt. + +Tue Jan 27 15:06:04 1998 Nick Clifton + + * coff-arm.c (coff_arm_relocate_section): Preserve the contents of + t2a3_b_insn. + +Tue Jan 27 12:47:27 1998 Robert Lipe + + * config.bfd (i[3456]86-sco3.2v5*): ELF now the default. + (i[3456]86sco3.2v5*coff): New target. + +Mon Jan 26 15:41:30 1998 Ian Lance Taylor + + * bfd-in2.h: Rebuild with changes to chew--tab expansion. + +Thu Jan 22 21:26:48 1998 Richard Henderson + + * bfd.c (bfd_get_error_handler): Add orthogonal function. + * bfd-in2.h: Regenerate. + +Thu Jan 22 21:13:39 1998 Richard Henderson + + * tekhex.c (tekhex_write_object_contents): Check for no symbols. + +Wed Jan 21 21:19:03 1998 Ian Lance Taylor + + * coff-i386.c (coff_i386_rtype_to_howto): If COFF_WITH_PE, don't + adjust addend for an output common symbol (from Jimmy Blair + ). If COFF_WITH_PE, adjust addend for PC relative + defined symbol to counteract adjustment made in generic relocation + code. + + * dwarf2.c: Include sysdep.h, not stdio.h and stdlib.h. + +Wed Jan 21 21:16:06 1998 Manfred Hollstein + + * coff-m88k.c (GET_SCNDHR_NRELOC): Fix typo in macro name. + (GET_SCNDHR_NLNNO): Likewise. + +Mon Jan 19 12:49:52 1998 Ian Lance Taylor + + * cpu-sh.c (arch_info_struct): Correct next field of sh3e. + +Wed Jan 14 17:23:27 1998 Nick Clifton + + * elf32-m32r.c: Add macros to handle NOP insertion. + +Wed Jan 14 16:15:22 1998 Richard Henderson + + * xcofflink.c (xcoff_mark_symbol): Don't mark the absolute section. + (xcoff_mark): Likewise. + (xcoff_build_ldsyms): Mark absolute symbols. + +Wed Jan 14 16:03:11 1998 Richard Henderson + + * bout.c (b_out_write_object_contents): Sort symbols before output + to keep {CALL,BAL}NAME symbols adjacent. + (b_out_symbol_cmp): New function. + +For older changes see ChangeLog-9697 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/gnu/dist/toolchain/bfd/MAINTAINERS b/gnu/dist/toolchain/bfd/MAINTAINERS new file mode 100644 index 000000000000..d59a3bd7f889 --- /dev/null +++ b/gnu/dist/toolchain/bfd/MAINTAINERS @@ -0,0 +1 @@ +See ../binutils/MAINTAINERS diff --git a/gnu/dist/toolchain/bfd/README b/gnu/dist/toolchain/bfd/README index 51ce133355fc..992c28552f40 100644 --- a/gnu/dist/toolchain/bfd/README +++ b/gnu/dist/toolchain/bfd/README @@ -34,7 +34,7 @@ BFD supports the following configure options: Use mmap when accessing files. This is faster on some hosts, but slower on others. It may not work on all hosts. -Report bugs with BFD to bug-gnu-utils@gnu.org. +Report bugs with BFD to bug-binutils@gnu.org. Patches are encouraged. When sending patches, always send the output of diff -u or diff -c from the original file to the new file. Do not diff --git a/gnu/dist/toolchain/bfd/acinclude.m4 b/gnu/dist/toolchain/bfd/acinclude.m4 index cac26e8e7dd5..53912943d2c3 100644 --- a/gnu/dist/toolchain/bfd/acinclude.m4 +++ b/gnu/dist/toolchain/bfd/acinclude.m4 @@ -74,7 +74,9 @@ dnl Check for existence of a type $1 in sys/procfs.h AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE, [AC_MSG_CHECKING([for $1 in sys/procfs.h]) AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1, - [AC_TRY_COMPILE([#include ], + [AC_TRY_COMPILE([ +#define _SYSCALL32 +#include ], [$1 avar], bfd_cv_have_sys_procfs_type_$1=yes, bfd_cv_have_sys_procfs_type_$1=no @@ -92,7 +94,9 @@ dnl Check for existence of member $2 in type $1 in sys/procfs.h AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER, [AC_MSG_CHECKING([for $1.$2 in sys/procfs.h]) AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2, - [AC_TRY_COMPILE([#include ], + [AC_TRY_COMPILE([ +#define _SYSCALL32 +#include ], [$1 avar; void* aref = (void*) &avar.$2], bfd_cv_have_sys_procfs_type_member_$1_$2=yes, bfd_cv_have_sys_procfs_type_member_$1_$2=no @@ -104,4 +108,18 @@ AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER, AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2) ]) +sinclude(../libtool.m4) +dnl The lines below arrange for aclocal not to bring libtool.m4 +dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake +dnl to add a definition of LIBTOOL to Makefile.in. +ifelse(yes,no,[ +AC_DEFUN([AM_PROG_LIBTOOL],) +AC_DEFUN([AM_DISABLE_SHARED],) +AC_SUBST(LIBTOOL) +]) +sinclude(../gettext.m4) +ifelse(yes,no,[ +AC_DEFUN([CY_WITH_NLS],) +AC_SUBST(INTLLIBS) +]) diff --git a/gnu/dist/toolchain/bfd/aclocal.m4 b/gnu/dist/toolchain/bfd/aclocal.m4 index ca9d432d712f..45cc33930d9a 100644 --- a/gnu/dist/toolchain/bfd/aclocal.m4 +++ b/gnu/dist/toolchain/bfd/aclocal.m4 @@ -86,7 +86,9 @@ dnl Check for existence of a type $1 in sys/procfs.h AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE, [AC_MSG_CHECKING([for $1 in sys/procfs.h]) AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_$1, - [AC_TRY_COMPILE([#include ], + [AC_TRY_COMPILE([ +#define _SYSCALL32 +#include ], [$1 avar], bfd_cv_have_sys_procfs_type_$1=yes, bfd_cv_have_sys_procfs_type_$1=no @@ -104,7 +106,9 @@ dnl Check for existence of member $2 in type $1 in sys/procfs.h AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER, [AC_MSG_CHECKING([for $1.$2 in sys/procfs.h]) AC_CACHE_VAL(bfd_cv_have_sys_procfs_type_member_$1_$2, - [AC_TRY_COMPILE([#include ], + [AC_TRY_COMPILE([ +#define _SYSCALL32 +#include ], [$1 avar; void* aref = (void*) &avar.$2], bfd_cv_have_sys_procfs_type_member_$1_$2=yes, bfd_cv_have_sys_procfs_type_member_$1_$2=no @@ -116,7 +120,39 @@ AC_DEFUN(BFD_HAVE_SYS_PROCFS_TYPE_MEMBER, AC_MSG_RESULT($bfd_cv_have_sys_procfs_type_member_$1_$2) ]) +sinclude(../libtool.m4) +dnl The lines below arrange for aclocal not to bring libtool.m4 +dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake +dnl to add a definition of LIBTOOL to Makefile.in. +ifelse(yes,no,[ +AC_DEFUN([AM_PROG_LIBTOOL],) +AC_DEFUN([AM_DISABLE_SHARED],) +AC_SUBST(LIBTOOL) +]) +sinclude(../gettext.m4) +ifelse(yes,no,[ +AC_DEFUN([CY_WITH_NLS],) +AC_SUBST(INTLLIBS) +]) + +#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. @@ -210,415 +246,6 @@ else fi AC_SUBST($1)]) - -# serial 40 AC_PROG_LIBTOOL -AC_DEFUN(AC_PROG_LIBTOOL, -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl - -# Save cache, so that ltconfig can load it -AC_CACHE_SAVE - -# Actually configure libtool. ac_aux_dir is where install-sh is found. -CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ -LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ -LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ -DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ -${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ -|| AC_MSG_ERROR([libtool configure failed]) - -# Reload cache, that may have been modified by ltconfig -AC_CACHE_LOAD - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log -]) - -AC_DEFUN(AC_LIBTOOL_SETUP, -[AC_PREREQ(2.13)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_RANLIB])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_NM])dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -dnl - -case "$target" in -NONE) lt_target="$host" ;; -*) lt_target="$target" ;; -esac - -# Check for any special flags to pass to ltconfig. -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" -ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], -[libtool_flags="$libtool_flags --enable-dlopen"]) -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[libtool_flags="$libtool_flags --enable-win32-dll"]) -AC_ARG_ENABLE(libtool-lock, - [ --disable-libtool-lock avoid locking (might break parallel builds)]) -test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" -test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case "$lt_target" in -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; - -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -]) -esac -]) - -# AC_LIBTOOL_DLOPEN - enable checks for dlopen support -AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) - -# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's -AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) - -# AC_ENABLE_SHARED - implement the --enable-shared flag -# Usage: AC_ENABLE_SHARED[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_SHARED, [dnl -define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(shared, -changequote(<<, >>)dnl -<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_shared=yes ;; -no) enable_shared=no ;; -*) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl -]) - -# AC_DISABLE_SHARED - set the default shared flag to --disable-shared -AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no)]) - -# AC_ENABLE_STATIC - implement the --enable-static flag -# Usage: AC_ENABLE_STATIC[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_STATIC, [dnl -define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(static, -changequote(<<, >>)dnl -<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_static=yes ;; -no) enable_static=no ;; -*) - enable_static=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_static=AC_ENABLE_STATIC_DEFAULT)dnl -]) - -# AC_DISABLE_STATIC - set the default static flag to --disable-static -AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no)]) - - -# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag -# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl -define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(fast-install, -changequote(<<, >>)dnl -<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_fast_install=yes ;; -no) enable_fast_install=no ;; -*) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl -]) - -# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install -AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no)]) - -# AC_PROG_LD - find the path to the GNU or non-GNU linker -AC_DEFUN(AC_PROG_LD, -[AC_ARG_WITH(gnu-ld, -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$ac_cv_prog_gcc" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - ac_prog=`($CC -print-prog-name=ld) 2>&5` - case "$ac_prog" in - # Accept absolute paths. -changequote(,)dnl - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' -changequote([,])dnl - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(ac_cv_path_LD, -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - 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" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" -else - ac_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$ac_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_PROG_LD_GNU -]) - -AC_DEFUN(AC_PROG_LD_GNU, -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - ac_cv_prog_gnu_ld=yes -else - ac_cv_prog_gnu_ld=no -fi]) -]) - -# AC_PROG_NM - find the path to a BSD-compatible name lister -AC_DEFUN(AC_PROG_NM, -[AC_MSG_CHECKING([for BSD-compatible nm]) -AC_CACHE_VAL(ac_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - ac_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 - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -B" - break - elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -p" - break - else - ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm -fi]) -NM="$ac_cv_path_NM" -AC_MSG_RESULT([$NM]) -]) - -# AC_CHECK_LIBM - check for math library -AC_DEFUN(AC_CHECK_LIBM, -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case "$lt_target" in -*-*-beos* | *-*-cygwin*) - # These system don't have libm - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, main, LIBM="-lm") - ;; -esac -]) - -# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl convenience library, adds --enable-ltdl-convenience to -# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor -# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed -# to be `${top_builddir}/libltdl'. Make sure you start DIR with -# '${top_builddir}/' (note the single quotes!) if your package is not -# flat, and, if you're not using automake, define top_builddir as -# appropriate in the Makefiles. -AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case "$enable_ltdl_convenience" in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la - INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) -]) - -# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl installable library, and adds --enable-ltdl-install to -# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor -# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed -# to be `${top_builddir}/libltdl'. Make sure you start DIR with -# '${top_builddir}/' (note the single quotes!) if your package is not -# flat, and, if you're not using automake, define top_builddir as -# appropriate in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, main, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la - INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - INCLTDL= - fi -]) - -dnl old names -AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl -AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl -AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl -AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl -AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl -AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl -AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl - -dnl This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL])dnl - # Like AC_CONFIG_HEADER, but automatically create stamp file. AC_DEFUN(AM_CONFIG_HEADER, @@ -675,348 +302,3 @@ else $1_FALSE= fi]) -# This file is derived from `gettext.m4'. The difference is that the -# included macros assume Cygnus-style source and build trees. - -# Macro to add for using GNU gettext. -# Ulrich Drepper , 1995. -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -# serial 3 - -AC_DEFUN(CY_WITH_NLS, - [AC_MSG_CHECKING([whether NLS is requested]) - dnl Default is enabled NLS - AC_ARG_ENABLE(nls, - [ --disable-nls do not use Native Language Support], - USE_NLS=$enableval, USE_NLS=yes) - AC_MSG_RESULT($USE_NLS) - AC_SUBST(USE_NLS) - - USE_INCLUDED_LIBINTL=no - - dnl If we use NLS figure out what method - if test "$USE_NLS" = "yes"; then - AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested]) - AC_MSG_CHECKING([whether included gettext is requested]) - AC_ARG_WITH(included-gettext, - [ --with-included-gettext use the GNU gettext library included here], - nls_cv_force_use_gnu_gettext=$withval, - nls_cv_force_use_gnu_gettext=no) - AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) - - nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" - if test "$nls_cv_force_use_gnu_gettext" != "yes"; then - dnl User does not insist on using GNU NLS library. Figure out what - dnl to use. If gettext or catgets are available (in this order) we - dnl use this. Else we have to fall back to GNU NLS library. - dnl catgets is only used if permitted by option --with-catgets. - nls_cv_header_intl= - nls_cv_header_libgt= - CATOBJEXT=NONE - - AC_CHECK_HEADER(libintl.h, - [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, - [AC_TRY_LINK([#include ], [return (int) gettext ("")], - gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) - - if test "$gt_cv_func_gettext_libc" != "yes"; then - AC_CHECK_LIB(intl, bindtextdomain, - [AC_CACHE_CHECK([for gettext in libintl], - gt_cv_func_gettext_libintl, - [AC_TRY_LINK([], [return (int) gettext ("")], - gt_cv_func_gettext_libintl=yes, - gt_cv_func_gettext_libintl=no)])]) - fi - - if test "$gt_cv_func_gettext_libc" = "yes" \ - || test "$gt_cv_func_gettext_libintl" = "yes"; then - AC_DEFINE(HAVE_GETTEXT, 1, - [Define as 1 if you have gettext and don't want to use GNU gettext.]) - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl - if test "$MSGFMT" != "no"; then - AC_CHECK_FUNCS(dcgettext) - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) - AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; - return _nl_msg_cat_cntr], - [CATOBJEXT=.gmo - DATADIRNAME=share], - [CATOBJEXT=.mo - DATADIRNAME=lib]) - INSTOBJEXT=.mo - fi - fi - ]) - - dnl In the standard gettext, we would now check for catgets. - dnl However, we never want to use catgets for our releases. - - if test "$CATOBJEXT" = "NONE"; then - dnl Neither gettext nor catgets in included in the C library. - dnl Fall back on GNU gettext library. - nls_cv_use_gnu_gettext=yes - fi - fi - - if test "$nls_cv_use_gnu_gettext" = "yes"; then - dnl Mark actions used to generate GNU NLS library. - INTLOBJS="\$(GETTOBJS)" - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) - AC_SUBST(MSGFMT) - USE_INCLUDED_LIBINTL=yes - CATOBJEXT=.gmo - INSTOBJEXT=.mo - DATADIRNAME=share - INTLDEPS='$(top_builddir)/../intl/libintl.a' - INTLLIBS=$INTLDEPS - LIBS=`echo $LIBS | sed -e 's/-lintl//'` - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - dnl Test whether we really found GNU xgettext. - if test "$XGETTEXT" != ":"; then - dnl If it is no GNU xgettext we define it as : so that the - dnl Makefiles still can work. - if $XGETTEXT --omit-header /dev/null 2> /dev/null; then - : ; - else - AC_MSG_RESULT( - [found xgettext programs is not GNU xgettext; ignore it]) - XGETTEXT=":" - fi - fi - - # We need to process the po/ directory. - POSUB=po - else - DATADIRNAME=share - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - # If this is used in GNU gettext we have to set USE_NLS to `yes' - # because some of the sources are only built for this goal. - if test "$PACKAGE" = gettext; then - USE_NLS=yes - USE_INCLUDED_LIBINTL=yes - fi - - dnl These rules are solely for the distribution goal. While doing this - dnl we only have to keep exactly one list of the available catalogs - dnl in configure.in. - for lang in $ALL_LINGUAS; do - GMOFILES="$GMOFILES $lang.gmo" - POFILES="$POFILES $lang.po" - done - - dnl Make all variables we use known to autoconf. - AC_SUBST(USE_INCLUDED_LIBINTL) - AC_SUBST(CATALOGS) - AC_SUBST(CATOBJEXT) - AC_SUBST(DATADIRNAME) - AC_SUBST(GMOFILES) - AC_SUBST(INSTOBJEXT) - AC_SUBST(INTLDEPS) - AC_SUBST(INTLLIBS) - AC_SUBST(INTLOBJS) - AC_SUBST(POFILES) - AC_SUBST(POSUB) - ]) - -AC_DEFUN(CY_GNU_GETTEXT, - [AC_REQUIRE([AC_PROG_MAKE_SET])dnl - AC_REQUIRE([AC_PROG_CC])dnl - AC_REQUIRE([AC_PROG_RANLIB])dnl - AC_REQUIRE([AC_ISC_POSIX])dnl - AC_REQUIRE([AC_HEADER_STDC])dnl - AC_REQUIRE([AC_C_CONST])dnl - AC_REQUIRE([AC_C_INLINE])dnl - AC_REQUIRE([AC_TYPE_OFF_T])dnl - AC_REQUIRE([AC_TYPE_SIZE_T])dnl - AC_REQUIRE([AC_FUNC_ALLOCA])dnl - AC_REQUIRE([AC_FUNC_MMAP])dnl - - AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ -unistd.h values.h sys/param.h]) - AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ -__argz_count __argz_stringify __argz_next]) - - if test "${ac_cv_func_stpcpy+set}" != "set"; then - AC_CHECK_FUNCS(stpcpy) - fi - if test "${ac_cv_func_stpcpy}" = "yes"; then - AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function]) - fi - - AM_LC_MESSAGES - CY_WITH_NLS - - if test "x$CATOBJEXT" != "x"; then - if test "x$ALL_LINGUAS" = "x"; then - LINGUAS= - else - AC_MSG_CHECKING(for catalogs to be installed) - NEW_LINGUAS= - for lang in ${LINGUAS=$ALL_LINGUAS}; do - case "$ALL_LINGUAS" in - *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; - esac - done - LINGUAS=$NEW_LINGUAS - AC_MSG_RESULT($LINGUAS) - fi - - dnl Construct list of names of catalog files to be constructed. - if test -n "$LINGUAS"; then - for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done - fi - fi - - dnl The reference to in the installed file - dnl must be resolved because we cannot expect the users of this - dnl to define HAVE_LOCALE_H. - if test $ac_cv_header_locale_h = yes; then - INCLUDE_LOCALE_H="#include " - else - INCLUDE_LOCALE_H="\ -/* The system does not provide the header . Take care yourself. */" - fi - AC_SUBST(INCLUDE_LOCALE_H) - - dnl Determine which catalog format we have (if any is needed) - dnl For now we know about two different formats: - dnl Linux libc-5 and the normal X/Open format - if test -f $srcdir/po2tbl.sed.in; then - if test "$CATOBJEXT" = ".cat"; then - AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) - - dnl Transform the SED scripts while copying because some dumb SEDs - dnl cannot handle comments. - sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed - fi - dnl po2tbl.sed is always needed. - sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ - $srcdir/po2tbl.sed.in > po2tbl.sed - fi - - dnl In the intl/Makefile.in we have a special dependency which makes - dnl only sense for gettext. We comment this out for non-gettext - dnl packages. - if test "$PACKAGE" = "gettext"; then - GT_NO="#NO#" - GT_YES= - else - GT_NO= - GT_YES="#YES#" - fi - AC_SUBST(GT_NO) - AC_SUBST(GT_YES) - - MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" - AC_SUBST(MKINSTALLDIRS) - - dnl *** For now the libtool support in intl/Makefile is not for real. - l= - AC_SUBST(l) - - dnl Generate list of files to be processed by xgettext which will - dnl be included in po/Makefile. But only do this if the po directory - dnl exists in srcdir. - if test -d $srcdir/po; then - test -d po || mkdir po - if test "x$srcdir" != "x."; then - if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then - posrcprefix="$srcdir/" - else - posrcprefix="../$srcdir/" - fi - else - posrcprefix="../" - fi - rm -f po/POTFILES - sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ - < $srcdir/po/POTFILES.in > po/POTFILES - fi - ]) - -# Search path for a program which passes the given test. -# Ulrich Drepper , 1996. -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -# serial 1 - -dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, -dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) -AC_DEFUN(AM_PATH_PROG_WITH_TEST, -[# Extract the first word of "$2", so it can be a program name with args. -set dummy $2; ac_word=[$]2 -AC_MSG_CHECKING([for $ac_word]) -AC_CACHE_VAL(ac_cv_path_$1, -[case "[$]$1" in - /*) - ac_cv_path_$1="[$]$1" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in ifelse([$5], , $PATH, [$5]); do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if [$3]; then - ac_cv_path_$1="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" -dnl If no 4th arg is given, leave the cache variable unset, -dnl so AC_PATH_PROGS will keep looking. -ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" -])dnl - ;; -esac])dnl -$1="$ac_cv_path_$1" -if test -n "[$]$1"; then - AC_MSG_RESULT([$]$1) -else - AC_MSG_RESULT(no) -fi -AC_SUBST($1)dnl -]) - -# Check whether LC_MESSAGES is available in . -# Ulrich Drepper , 1995. -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -# serial 1 - -AC_DEFUN(AM_LC_MESSAGES, - [if test $ac_cv_header_locale_h = yes; then - AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, - [AC_TRY_LINK([#include ], [return LC_MESSAGES], - am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) - if test $am_cv_val_LC_MESSAGES = yes; then - AC_DEFINE(HAVE_LC_MESSAGES, 1, - [Define if your locale.h file contains LC_MESSAGES.]) - fi - fi]) - diff --git a/gnu/dist/toolchain/bfd/aix386-core.c b/gnu/dist/toolchain/bfd/aix386-core.c index fb67b17081f8..da86b58a1e4e 100644 --- a/gnu/dist/toolchain/bfd/aix386-core.c +++ b/gnu/dist/toolchain/bfd/aix386-core.c @@ -1,7 +1,7 @@ /* BFD back-end for AIX on PS/2 core files. This was based on trad-core.c, which was written by John Gilmore of Cygnus Support. - Copyright 1988, 89, 91, 92, 93, 94, 95, 96, 97, 1998 + Copyright 1988, 89, 91, 92, 93, 94, 95, 96, 97, 98, 2000 Free Software Foundation, Inc. Written by Minh Tran-Le . Converted to back end form by Ian Lance Taylor . @@ -32,13 +32,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #if defined (_AIX) && defined (_I386) -#define NOCHECKS /* this is for coredump.h */ -#define _h_USER /* avoid including user.h from coredump.h */ +#define NOCHECKS /* This is for coredump.h. */ +#define _h_USER /* Avoid including user.h from coredump.h. */ #include #include #endif /* _AIX && _I386 */ -/* maybe this could work on some other i386 but I have not tried it +/* Maybe this could work on some other i386 but I have not tried it * mtranle@paris - Tue Sep 24 12:49:35 1991 */ @@ -46,7 +46,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ # define COR_MAGIC "core" #endif -/* need this cast because ptr is really void * */ +/* Need this cast because ptr is really void *. */ #define core_hdr(bfd) \ (((bfd->tdata.trad_core_data))->hdr) #define core_section(bfd,n) \ @@ -56,7 +56,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define core_reg2sec(bfd) \ (((bfd)->tdata.trad_core_data)->reg2_section) -/* These are stored in the bfd's tdata */ +/* These are stored in the bfd's tdata. */ struct trad_core_struct { struct corehdr *hdr; /* core file header */ asection *reg_section; @@ -70,7 +70,7 @@ static const bfd_target * aix386_core_file_p (abfd) bfd *abfd; { - int i,n; + int i, n; unsigned char longbuf[4]; /* Raw bytes of various header fields */ int core_size = sizeof (struct corehdr); struct corehdr *core; @@ -79,18 +79,20 @@ aix386_core_file_p (abfd) struct corehdr internal_core; } *mergem; - if (bfd_read ((PTR)longbuf, 1, sizeof (longbuf), abfd) != sizeof (longbuf)) + if (bfd_read ((PTR) longbuf, 1, sizeof (longbuf), abfd) != sizeof (longbuf)) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); return 0; } - if (strncmp(longbuf,COR_MAGIC,4)) return 0; + if (strncmp (longbuf, COR_MAGIC, 4)) + return 0; - if (bfd_seek (abfd, 0L, false) < 0) return 0; + if (bfd_seek (abfd, 0L, false) < 0) + return 0; - mergem = (struct mergem *)bfd_zalloc (abfd, sizeof (struct mergem)); + mergem = (struct mergem *) bfd_zalloc (abfd, sizeof (struct mergem)); if (mergem == NULL) return 0; @@ -100,45 +102,45 @@ aix386_core_file_p (abfd) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); - bfd_release (abfd, (char *)mergem); + bfd_release (abfd, (char *) mergem); return 0; } set_tdata (abfd, &mergem->coredata); core_hdr (abfd) = core; - /* create the sections. This is raunchy, but bfd_close wants to reclaim - them */ + /* Create the sections. This is raunchy, but bfd_close wants to + reclaim them. */ core_regsec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection)); if (core_regsec (abfd) == NULL) { loser: - bfd_release (abfd, (char *)mergem); + bfd_release (abfd, (char *) mergem); return 0; } core_reg2sec (abfd) = (asection *) bfd_zalloc (abfd, sizeof (asection)); if (core_reg2sec (abfd) == NULL) { loser1: - bfd_release (abfd, core_regsec (abfd)); + bfd_release (abfd, core_regsec (abfd)); goto loser; } - for (i=0, n=0 ; (i < MAX_CORE_SEGS) && (core->cd_segs[i].cs_type) ; i++) + for (i = 0, n = 0; (i < MAX_CORE_SEGS) && (core->cd_segs[i].cs_type); i++) { if (core->cd_segs[i].cs_offset == 0) continue; - core_section (abfd,n) = + core_section (abfd, n) = (asection *) bfd_zalloc (abfd, sizeof (asection)); - if (core_section (abfd,n) == NULL) + if (core_section (abfd, n) == NULL) { int j; if (n > 0) { - for (j=0; j < n; j++) - bfd_release (abfd, core_section(abfd, j)); + for (j = 0; j < n; j++) + bfd_release (abfd, core_section (abfd, j)); } - bfd_release (abfd, (char *)mergem); + bfd_release (abfd, (char *) mergem); goto loser1; } @@ -177,7 +179,7 @@ aix386_core_file_p (abfd) core_section (abfd, n)->alignment_power = 2; core_section (abfd, n)->next = NULL; if (n > 0) - core_section (abfd, (n-1))->next = core_section (abfd, n); + core_section (abfd, (n - 1))->next = core_section (abfd, n); abfd->section_count = ++n; } @@ -188,18 +190,19 @@ aix386_core_file_p (abfd) core_regsec (abfd)->flags = SEC_HAS_CONTENTS; core_reg2sec (abfd)->flags = SEC_HAS_CONTENTS; - core_regsec (abfd)->_raw_size = sizeof(core->cd_regs); - core_reg2sec (abfd)->_raw_size = sizeof(core->cd_fpregs); + core_regsec (abfd)->_raw_size = sizeof (core->cd_regs); + core_reg2sec (abfd)->_raw_size = sizeof (core->cd_fpregs); core_regsec (abfd)->vma = -1; core_reg2sec (abfd)->vma = -1; - /* We'll access the regs afresh in the core file, like any section: */ - core_regsec (abfd)->filepos = (file_ptr)offsetof(struct corehdr,cd_regs[0]); - core_reg2sec (abfd)->filepos = (file_ptr)offsetof(struct corehdr, - cd_fpregs); + /* We'll access the regs afresh in the core file, like any section. */ + core_regsec (abfd)->filepos = + (file_ptr) offsetof (struct corehdr, cd_regs[0]); + core_reg2sec (abfd)->filepos = + (file_ptr) offsetof (struct corehdr, cd_fpregs); - /* add the 2 reg fake sections to abfd */ + /* Add the 2 reg fake sections to abfd. */ abfd->section_count += 2; abfd->sections = core_regsec (abfd); core_regsec (abfd)->next = core_reg2sec (abfd); @@ -227,59 +230,61 @@ aix386_core_file_matches_executable_p (core_bfd, exec_bfd) bfd *core_bfd; bfd *exec_bfd; { - return true; /* FIXME, We have no way of telling at this - point */ + /* FIXME: We have no way of telling at this point. */ + return true; } /* If somebody calls any byte-swapping routines, shoot them. */ + static void -swap_abort() +swap_abort () { - abort(); /* This way doesn't require any declaration for ANSI to fuck up */ + /* This way doesn't require any declaration for ANSI to fuck up. */ + abort (); } + #define NO_GET ((PROTO(bfd_vma, (*), ( const bfd_byte *))) swap_abort ) #define NO_GETS ((PROTO(bfd_signed_vma, (*), (const bfd_byte *))) swap_abort ) #define NO_PUT ((PROTO(void, (*), (bfd_vma, bfd_byte *))) swap_abort ) -const bfd_target aix386_core_vec = - { - "aix386-core", - bfd_target_unknown_flavour, - BFD_ENDIAN_BIG, /* target byte order */ - BFD_ENDIANG_BIG, /* target headers byte order */ +const bfd_target aix386_core_vec = { + "aix386-core", + bfd_target_unknown_flavour, + BFD_ENDIAN_BIG, /* target byte order */ + BFD_ENDIANG_BIG, /* target headers byte order */ (HAS_RELOC | EXEC_P | /* object flags */ HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | WP_TEXT), (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ - 0, /* leading underscore */ - ' ', /* ar_pad_char */ - 16, /* ar_max_namelen */ - NO_GET, NO_GETS, NO_PUT, - NO_GET, NO_GETS, NO_PUT, - NO_GET, NO_GETS, NO_PUT, /* data */ - NO_GET, NO_GETS, NO_PUT, - NO_GET, NO_GETS, NO_PUT, - NO_GET, NO_GETS, NO_PUT, /* hdrs */ + 0, /* leading underscore */ + ' ', /* ar_pad_char */ + 16, /* ar_max_namelen */ + NO_GET, NO_GETS, NO_PUT, + NO_GET, NO_GETS, NO_PUT, + NO_GET, NO_GETS, NO_PUT, /* data */ + NO_GET, NO_GETS, NO_PUT, + NO_GET, NO_GETS, NO_PUT, + NO_GET, NO_GETS, NO_PUT, /* hdrs */ - {_bfd_dummy_target, _bfd_dummy_target, - _bfd_dummy_target, aix386_core_file_p}, - {bfd_false, bfd_false, /* bfd_create_object */ - bfd_false, bfd_false}, - {bfd_false, bfd_false, /* bfd_write_contents */ - bfd_false, bfd_false}, + {_bfd_dummy_target, _bfd_dummy_target, + _bfd_dummy_target, aix386_core_file_p}, + {bfd_false, bfd_false, /* bfd_create_object */ + bfd_false, bfd_false}, + {bfd_false, bfd_false, /* bfd_write_contents */ + bfd_false, bfd_false}, - BFD_JUMP_TABLE_GENERIC (_bfd_generic), - BFD_JUMP_TABLE_COPY (_bfd_generic), - BFD_JUMP_TABLE_CORE (aix386), - 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), + BFD_JUMP_TABLE_GENERIC (_bfd_generic), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (aix386), + 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 + NULL, + + (PTR) 0 }; diff --git a/gnu/dist/toolchain/bfd/aout-adobe.c b/gnu/dist/toolchain/bfd/aout-adobe.c index 8216c7ea5091..a23b57de9041 100644 --- a/gnu/dist/toolchain/bfd/aout-adobe.c +++ b/gnu/dist/toolchain/bfd/aout-adobe.c @@ -1,5 +1,5 @@ /* BFD back-end for a.out.adobe binaries. - Copyright 1990, 91, 92, 93, 94, 95, 96, 98, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 96, 98, 99, 2000 Free Software Foundation, Inc. Written by Cygnus Support. Based on bout.c. @@ -28,7 +28,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "aout/stab_gnu.h" #include "libaout.h" /* BFD a.out internal data structures */ -extern const bfd_target a_out_adobe_vec; /* Forward decl */ +/* Forward decl. */ +extern const bfd_target a_out_adobe_vec; static const bfd_target *aout_adobe_callback PARAMS ((bfd *)); @@ -42,14 +43,14 @@ static void aout_adobe_write_section PARAMS ((bfd *abfd, sec_ptr sect)); void aout_adobe_swap_exec_header_in PARAMS ((bfd *abfd, struct external_exec *raw_bytes, struct internal_exec *execp)); - + void aout_adobe_swap_exec_header_in (abfd, raw_bytes, execp) bfd *abfd; struct external_exec *raw_bytes; struct internal_exec *execp; { - struct external_exec *bytes = (struct external_exec *)raw_bytes; + struct external_exec *bytes = (struct external_exec *) raw_bytes; /* 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); @@ -75,9 +76,10 @@ aout_adobe_swap_exec_header_out (abfd, execp, raw_bytes) struct internal_exec *execp; struct external_exec *raw_bytes; { - struct external_exec *bytes = (struct external_exec *)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. */ + /* 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); PUT_WORD (abfd, execp->a_text , bytes->e_text); PUT_WORD (abfd, execp->a_data , bytes->e_data); @@ -88,7 +90,6 @@ aout_adobe_swap_exec_header_out (abfd, execp, raw_bytes) PUT_WORD (abfd, execp->a_drsize, bytes->e_drsize); } - static const bfd_target * aout_adobe_object_p (abfd) bfd *abfd; @@ -98,11 +99,12 @@ aout_adobe_object_p (abfd) char *targ; 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; - } + != EXEC_BYTES_SIZE) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return 0; + } anexec.a_info = bfd_h_get_32 (abfd, exec_bytes.e_info); @@ -112,22 +114,23 @@ aout_adobe_object_p (abfd) If the environment variable GNUTARGET is set to "a.out.adobe", we will take just about any a.out file as an Adobe a.out file. FIXME! */ - if (N_BADMAG (anexec)) { - targ = getenv ("GNUTARGET"); - if (targ && !strcmp (targ, a_out_adobe_vec.name)) - ; /* Just continue anyway, if specifically set to this format */ - else - { - bfd_set_error (bfd_error_wrong_format); - return 0; - } - } + if (N_BADMAG (anexec)) + { + targ = getenv ("GNUTARGET"); + if (targ && !strcmp (targ, a_out_adobe_vec.name)) + /* Just continue anyway, if specifically set to this format. */ + ; + else + { + bfd_set_error (bfd_error_wrong_format); + return 0; + } + } aout_adobe_swap_exec_header_in (abfd, &exec_bytes, &anexec); return aout_32_some_aout_object_p (abfd, &anexec, aout_adobe_callback); } - /* Finish up the opening of a b.out file for reading. Fill in all the fields that are not handled by common code. */ @@ -145,7 +148,7 @@ aout_adobe_callback (abfd) flagword flags; /* Architecture and machine type -- unknown in this format. */ - bfd_set_arch_mach(abfd, bfd_arch_unknown, 0); + bfd_set_arch_mach (abfd, bfd_arch_unknown, 0); /* The positions of the string table and symbol table. */ obj_str_filepos (abfd) = N_STROFF (*execp); @@ -153,97 +156,106 @@ aout_adobe_callback (abfd) /* Suck up the section information from the file, one section at a time. */ - for (;;) { - if (bfd_read ((PTR) ext, 1, sizeof (*ext), abfd) != sizeof (*ext)) { - if (bfd_get_error () != bfd_error_system_call) - bfd_set_error (bfd_error_wrong_format); - return 0; + for (;;) + { + if (bfd_read ((PTR) ext, 1, sizeof (*ext), abfd) != sizeof (*ext)) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return 0; + } + switch (ext->e_type[0]) + { + case N_TEXT: + section_name = ".text"; + flags = SEC_CODE | SEC_LOAD | SEC_ALLOC | SEC_HAS_CONTENTS; + break; + + case N_DATA: + section_name = ".data"; + flags = SEC_DATA | SEC_LOAD | SEC_ALLOC | SEC_HAS_CONTENTS; + break; + + case N_BSS: + section_name = ".bss"; + flags = SEC_DATA | SEC_HAS_CONTENTS; + break; + + case 0: + goto no_more_sections; + + default: + (*_bfd_error_handler) + (_("%s: Unknown section type in a.out.adobe file: %x\n"), + bfd_get_filename (abfd), ext->e_type[0]); + goto no_more_sections; + } + + /* First one is called ".text" or whatever; subsequent ones are + ".text1", ".text2", ... */ + + bfd_set_error (bfd_error_no_error); + sect = bfd_make_section (abfd, section_name); + trynum = 0; + while (!sect) + { + if (bfd_get_error () != bfd_error_no_error) + /* Some other error -- slide into the sunset. */ + return 0; + sprintf (try_again, "%s%d", section_name, ++trynum); + sect = bfd_make_section (abfd, try_again); + } + + /* Fix the name, if it is a sprintf'd name. */ + if (sect->name == try_again) + { + newname = (char *) bfd_zalloc (abfd, strlen (sect->name)); + if (newname == NULL) + return 0; + strcpy (newname, sect->name); + sect->name = newname; + } + + /* Now set the section's attributes. */ + bfd_set_section_flags (abfd, sect, flags); + /* Assumed big-endian. */ + sect->_raw_size = ((ext->e_size[0] << 8) + | ext->e_size[1] << 8) + | ext->e_size[2]; + sect->_cooked_size = sect->_raw_size; + sect->vma = bfd_h_get_32 (abfd, ext->e_virtbase); + sect->filepos = bfd_h_get_32 (abfd, ext->e_filebase); + /* FIXME XXX alignment? */ + + /* Set relocation information for first section of each type. */ + if (trynum == 0) + switch (ext->e_type[0]) + { + case N_TEXT: + sect->rel_filepos = N_TRELOFF (*execp); + sect->reloc_count = execp->a_trsize; + break; + + case N_DATA: + sect->rel_filepos = N_DRELOFF (*execp); + sect->reloc_count = execp->a_drsize; + break; + } } - switch (ext->e_type[0]) { - case N_TEXT: - section_name = ".text"; - flags = SEC_CODE | SEC_LOAD | SEC_ALLOC | SEC_HAS_CONTENTS; - break; + no_more_sections: - case N_DATA: - section_name = ".data"; - flags = SEC_DATA | SEC_LOAD | SEC_ALLOC | SEC_HAS_CONTENTS; - break; - - case N_BSS: - section_name = ".bss"; - flags = SEC_DATA | SEC_HAS_CONTENTS; - break; - - case 0: - goto no_more_sections; - - default: - (*_bfd_error_handler) - (_("%s: Unknown section type in a.out.adobe file: %x\n"), - bfd_get_filename (abfd), ext->e_type[0]); - goto no_more_sections; - } - - /* First one is called ".text" or whatever; subsequent ones are - ".text1", ".text2", ... */ - - bfd_set_error (bfd_error_no_error); - sect = bfd_make_section (abfd, section_name); - trynum = 0; - while (!sect) { - if (bfd_get_error () != bfd_error_no_error) - return 0; /* Some other error -- slide into the sunset */ - sprintf (try_again, "%s%d", section_name, ++trynum); - sect = bfd_make_section (abfd, try_again); - } - - /* Fix the name, if it is a sprintf'd name. */ - if (sect->name == try_again) { - newname = (char *) bfd_zalloc(abfd, strlen (sect->name)); - if (newname == NULL) - return 0; - strcpy (newname, sect->name); - sect->name = newname; - } - - /* Now set the section's attributes. */ - bfd_set_section_flags (abfd, sect, flags); - sect->_raw_size = ((ext->e_size[0] << 8) /* Assumed big-endian */ - | ext->e_size[1] << 8) - | ext->e_size[2]; - sect->_cooked_size = sect->_raw_size; - sect->vma = bfd_h_get_32 (abfd, ext->e_virtbase); - sect->filepos = bfd_h_get_32 (abfd, ext->e_filebase); - /* FIXME XXX alignment? */ - - /* Set relocation information for first section of each type. */ - if (trynum == 0) switch (ext->e_type[0]) { - case N_TEXT: - sect->rel_filepos = N_TRELOFF (*execp); - sect->reloc_count = execp->a_trsize; - break; - - case N_DATA: - sect->rel_filepos = N_DRELOFF (*execp); - sect->reloc_count = execp->a_drsize; - break; - } - } -no_more_sections: - - adata(abfd).reloc_entry_size = sizeof (struct reloc_std_external); - adata(abfd).symbol_entry_size = sizeof (struct external_nlist); - adata(abfd).page_size = 1; /* Not applicable. */ - adata(abfd).segment_size = 1; /* Not applicable. */ - adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE; + adata (abfd).reloc_entry_size = sizeof (struct reloc_std_external); + adata (abfd).symbol_entry_size = sizeof (struct external_nlist); + adata (abfd).page_size = 1; /* Not applicable. */ + adata (abfd).segment_size = 1; /* Not applicable. */ + adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE; return abfd->xvec; } struct bout_data_struct { - struct aoutdata a; - struct internal_exec e; + struct aoutdata a; + struct internal_exec e; }; static boolean @@ -254,32 +266,31 @@ aout_adobe_mkobject (abfd) rawptr = (struct bout_data_struct *) bfd_zalloc (abfd, sizeof (struct bout_data_struct)); if (rawptr == NULL) - return false; + return false; abfd->tdata.bout_data = rawptr; exec_hdr (abfd) = &rawptr->e; - adata(abfd).reloc_entry_size = sizeof (struct reloc_std_external); - adata(abfd).symbol_entry_size = sizeof (struct external_nlist); - adata(abfd).page_size = 1; /* Not applicable. */ - adata(abfd).segment_size = 1; /* Not applicable. */ - adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE; + adata (abfd).reloc_entry_size = sizeof (struct reloc_std_external); + adata (abfd).symbol_entry_size = sizeof (struct external_nlist); + adata (abfd).page_size = 1; /* Not applicable. */ + adata (abfd).segment_size = 1; /* Not applicable. */ + adata (abfd).exec_bytes_size = EXEC_BYTES_SIZE; return true; } - static boolean aout_adobe_write_object_contents (abfd) bfd *abfd; { struct external_exec swapped_hdr; - static struct external_segdesc sentinel[1]; /* Initialized to zero */ + static struct external_segdesc sentinel[1]; /* Initialized to zero. */ asection *sect; exec_hdr (abfd)->a_info = ZMAGIC; - /* Calculate text size as total of text sections, etc. */ + /* Calculate text size as total of text sections, etc. */ exec_hdr (abfd)->a_text = 0; exec_hdr (abfd)->a_data = 0; @@ -287,22 +298,28 @@ aout_adobe_write_object_contents (abfd) exec_hdr (abfd)->a_trsize = 0; exec_hdr (abfd)->a_drsize = 0; - for (sect = abfd->sections; sect; sect = sect->next) { - if (sect->flags & SEC_CODE) { - exec_hdr (abfd)->a_text += sect->_raw_size; - exec_hdr (abfd)->a_trsize += sect->reloc_count * - sizeof (struct reloc_std_external); - } else if (sect->flags & SEC_DATA) { - exec_hdr (abfd)->a_data += sect->_raw_size; - exec_hdr (abfd)->a_drsize += sect->reloc_count * - sizeof (struct reloc_std_external); - } else if (sect->flags & SEC_ALLOC && !(sect->flags & SEC_LOAD)) { - exec_hdr (abfd)->a_bss += sect->_raw_size; + for (sect = abfd->sections; sect; sect = sect->next) + { + if (sect->flags & SEC_CODE) + { + exec_hdr (abfd)->a_text += sect->_raw_size; + exec_hdr (abfd)->a_trsize += sect->reloc_count * + sizeof (struct reloc_std_external); + } + else if (sect->flags & SEC_DATA) + { + exec_hdr (abfd)->a_data += sect->_raw_size; + exec_hdr (abfd)->a_drsize += sect->reloc_count * + sizeof (struct reloc_std_external); + } + else if (sect->flags & SEC_ALLOC && !(sect->flags & SEC_LOAD)) + { + exec_hdr (abfd)->a_bss += sect->_raw_size; + } } - } exec_hdr (abfd)->a_syms = bfd_get_symcount (abfd) - * sizeof (struct external_nlist); + * sizeof (struct external_nlist); exec_hdr (abfd)->a_entry = bfd_get_start_address (abfd); aout_adobe_swap_exec_header_out (abfd, exec_hdr (abfd), &swapped_hdr); @@ -315,58 +332,68 @@ aout_adobe_write_object_contents (abfd) /* Now write out the section information. Text first, data next, rest afterward. */ - for (sect = abfd->sections; sect; sect = sect->next) { - if (sect->flags & SEC_CODE) { - aout_adobe_write_section (abfd, sect); + for (sect = abfd->sections; sect; sect = sect->next) + { + if (sect->flags & SEC_CODE) + { + aout_adobe_write_section (abfd, sect); + } } - } - for (sect = abfd->sections; sect; sect = sect->next) { - if (sect->flags & SEC_DATA) { - aout_adobe_write_section (abfd, sect); + for (sect = abfd->sections; sect; sect = sect->next) + { + if (sect->flags & SEC_DATA) + { + aout_adobe_write_section (abfd, sect); + } } - } - for (sect = abfd->sections; sect; sect = sect->next) { - if (!(sect->flags & (SEC_CODE|SEC_DATA))) { - aout_adobe_write_section (abfd, sect); + for (sect = abfd->sections; sect; sect = sect->next) + { + if (!(sect->flags & (SEC_CODE | SEC_DATA))) + { + aout_adobe_write_section (abfd, sect); + } } - } /* Write final `sentinel` section header (with type of 0). */ if (bfd_write ((PTR) sentinel, 1, sizeof (*sentinel), abfd) != sizeof (*sentinel)) return false; - /* Now write out reloc info, followed by syms and strings */ - if (bfd_get_symcount (abfd) != 0) + /* Now write out reloc info, followed by syms and strings. */ + if (bfd_get_symcount (abfd) != 0) { - if (bfd_seek (abfd, (file_ptr)(N_SYMOFF(*exec_hdr(abfd))), SEEK_SET) + if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (*exec_hdr (abfd))), SEEK_SET) != 0) return false; if (! aout_32_write_syms (abfd)) return false; - if (bfd_seek (abfd, (file_ptr)(N_TRELOFF(*exec_hdr(abfd))), SEEK_SET) + if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (*exec_hdr (abfd))), SEEK_SET) != 0) return false; - for (sect = abfd->sections; sect; sect = sect->next) { - if (sect->flags & SEC_CODE) { - if (!aout_32_squirt_out_relocs (abfd, sect)) - return false; - } - } + for (sect = abfd->sections; sect; sect = sect->next) + { + if (sect->flags & SEC_CODE) + { + if (!aout_32_squirt_out_relocs (abfd, sect)) + return false; + } + } - if (bfd_seek (abfd, (file_ptr)(N_DRELOFF(*exec_hdr(abfd))), SEEK_SET) + if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*exec_hdr (abfd))), SEEK_SET) != 0) return false; - for (sect = abfd->sections; sect; sect = sect->next) { - if (sect->flags & SEC_DATA) { - if (!aout_32_squirt_out_relocs (abfd, sect)) - return false; - } - } + for (sect = abfd->sections; sect; sect = sect->next) + { + if (sect->flags & SEC_DATA) + { + if (!aout_32_squirt_out_relocs (abfd, sect)) + return false; + } + } } return true; } @@ -390,46 +417,55 @@ aout_adobe_set_section_contents (abfd, section, location, offset, count) file_ptr section_start; sec_ptr sect; - if (abfd->output_has_begun == false) { /* set by bfd.c handler */ + /* Set by bfd.c handler. */ + if (abfd->output_has_begun == false) + { + /* Assign file offsets to sections. Text sections are first, and + are contiguous. Then data sections. Everything else at the end. */ - /* Assign file offsets to sections. Text sections are first, and - are contiguous. Then data sections. Everything else at the end. */ + section_start = N_TXTOFF (ignore<-->me); - section_start = N_TXTOFF (ignore<-->me); + for (sect = abfd->sections; sect; sect = sect->next) + { + if (sect->flags & SEC_CODE) + { + sect->filepos = section_start; + /* FIXME: Round to alignment. */ + section_start += sect->_raw_size; + } + } - for (sect = abfd->sections; sect; sect = sect->next) { - if (sect->flags & SEC_CODE) { - sect->filepos = section_start; - /* FIXME: Round to alignment */ - section_start += sect->_raw_size; - } + for (sect = abfd->sections; sect; sect = sect->next) + { + if (sect->flags & SEC_DATA) + { + sect->filepos = section_start; + /* FIXME: Round to alignment. */ + section_start += sect->_raw_size; + } + } + + for (sect = abfd->sections; sect; sect = sect->next) + { + if (sect->flags & SEC_HAS_CONTENTS && + !(sect->flags & (SEC_CODE | SEC_DATA))) + { + sect->filepos = section_start; + /* FIXME: Round to alignment. */ + section_start += sect->_raw_size; + } + } } - for (sect = abfd->sections; sect; sect = sect->next) { - if (sect->flags & SEC_DATA) { - sect->filepos = section_start; - /* FIXME: Round to alignment */ - section_start += sect->_raw_size; - } - } - - for (sect = abfd->sections; sect; sect = sect->next) { - if (sect->flags & SEC_HAS_CONTENTS && - !(sect->flags & (SEC_CODE|SEC_DATA))) { - sect->filepos = section_start; - /* FIXME: Round to alignment */ - section_start += sect->_raw_size; - } - } - } - - /* regardless, once we know what we're doing, we might as well get going */ + /* Regardless, once we know what we're doing, we might as well get + going. */ if (bfd_seek (abfd, section->filepos + offset, SEEK_SET) != 0) return false; - if (count != 0) { - return (bfd_write ((PTR)location, 1, count, abfd) == count) ?true:false; - } + if (count != 0) + { + return (bfd_write ((PTR) location, 1, count, abfd) == count) ? true : false; + } return true; } @@ -449,17 +485,14 @@ aout_adobe_set_arch_mach (abfd, arch, machine) return false; } -static int +static int aout_adobe_sizeof_headers (ignore_abfd, ignore) bfd *ignore_abfd ATTRIBUTE_UNUSED; boolean ignore ATTRIBUTE_UNUSED; { - return sizeof(struct internal_exec); + return sizeof (struct internal_exec); } - - - /* Build the transfer vector for Adobe A.Out files. */ #define aout_32_close_and_cleanup aout_32_bfd_free_cached_info @@ -486,8 +519,7 @@ aout_adobe_sizeof_headers (ignore_abfd, ignore) #define aout_32_bfd_final_link _bfd_generic_final_link #define aout_32_bfd_link_split_section _bfd_generic_link_split_section -const bfd_target a_out_adobe_vec = -{ +const bfd_target a_out_adobe_vec = { "a.out.adobe", /* name */ bfd_target_aout_flavour, BFD_ENDIAN_BIG, /* data byte order is unknown (big assumed) */ @@ -502,29 +534,29 @@ const bfd_target a_out_adobe_vec = 16, /* ar_max_namelen */ bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ + bfd_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, aout_adobe_object_p, /* bfd_check_format */ + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + {_bfd_dummy_target, aout_adobe_object_p, /* bfd_check_format */ bfd_generic_archive_p, _bfd_dummy_target}, - {bfd_false, aout_adobe_mkobject, /* bfd_set_format */ + {bfd_false, aout_adobe_mkobject, /* bfd_set_format */ _bfd_generic_mkarchive, bfd_false}, - {bfd_false, aout_adobe_write_object_contents, /* bfd_write_contents */ + {bfd_false, aout_adobe_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - BFD_JUMP_TABLE_GENERIC (aout_32), - BFD_JUMP_TABLE_COPY (_bfd_generic), - BFD_JUMP_TABLE_CORE (_bfd_nocore), - BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd), - BFD_JUMP_TABLE_SYMBOLS (aout_32), - BFD_JUMP_TABLE_RELOCS (aout_32), - BFD_JUMP_TABLE_WRITE (aout_32), - BFD_JUMP_TABLE_LINK (aout_32), - BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + BFD_JUMP_TABLE_GENERIC (aout_32), + BFD_JUMP_TABLE_COPY (_bfd_generic), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_bsd), + BFD_JUMP_TABLE_SYMBOLS (aout_32), + BFD_JUMP_TABLE_RELOCS (aout_32), + BFD_JUMP_TABLE_WRITE (aout_32), + BFD_JUMP_TABLE_LINK (aout_32), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 }; diff --git a/gnu/dist/toolchain/bfd/aout-arm.c b/gnu/dist/toolchain/bfd/aout-arm.c index 7365f9d8e35e..182c1c6590cd 100644 --- a/gnu/dist/toolchain/bfd/aout-arm.c +++ b/gnu/dist/toolchain/bfd/aout-arm.c @@ -1,7 +1,7 @@ /* BFD back-end for raw ARM a.out binaries. Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) - + This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify @@ -18,7 +18,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. */ - #define N_TXTADDR(x) \ ((N_MAGIC(x) == NMAGIC) ? 0x8000 : \ (N_MAGIC(x) != ZMAGIC) ? 0 : \ @@ -44,7 +43,7 @@ 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 +/* Avoid multiple defininitions from aoutx if supporting standarad a.out as well as our own. */ #define NAME(x,y) CAT3(aoutarm,_32_,y) @@ -63,7 +62,7 @@ MY(fix_pcrel_26) PARAMS ((bfd *, arelent *, asymbol *, PTR, 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 *, +void MY(swap_std_reloc_out) PARAMS ((bfd *, arelent *, struct reloc_std_external *)); reloc_howto_type MY(howto_table)[] = @@ -98,7 +97,7 @@ reloc_howto_type MY(howto_table)[] = #define RELOC_ARM_BITS_NEG_LITTLE ((unsigned int) 0x10) reloc_howto_type * -MY(reloc_howto)(abfd, rel, r_index, r_extern, r_pcrel) +MY(reloc_howto) (abfd, rel, r_index, r_extern, r_pcrel) bfd *abfd; struct reloc_std_external *rel; int *r_index; @@ -139,12 +138,12 @@ MY(reloc_howto)(abfd, rel, r_index, r_extern, r_pcrel) return MY(howto_table) + index; } - + #define MY_reloc_howto(BFD, REL, IN, EX, PC) \ MY(reloc_howto) (BFD, REL, &IN, &EX, &PC) void -MY(put_reloc)(abfd, r_extern, r_index, value, howto, reloc) +MY(put_reloc) (abfd, r_extern, r_index, value, howto, reloc) bfd *abfd; int r_extern; int r_index; @@ -159,7 +158,7 @@ MY(put_reloc)(abfd, r_extern, r_index, value, howto, reloc) PUT_WORD (abfd, value, reloc->r_address); r_length = howto->size ; /* Size as a power of two */ - /* Special case for branch relocations. */ + /* Special case for branch relocations. */ if (howto->type == 3 || howto->type == 7) r_length = 3; @@ -188,12 +187,12 @@ MY(put_reloc)(abfd, r_extern, r_index, value, howto, reloc) | (r_length << RELOC_STD_BITS_LENGTH_SH_LITTLE)); } } - + #define MY_put_reloc(BFD, EXT, IDX, VAL, HOWTO, RELOC) \ - MY(put_reloc)(BFD, EXT, IDX, VAL, HOWTO, RELOC) + MY(put_reloc) (BFD, EXT, IDX, VAL, HOWTO, RELOC) void -MY(relocatable_reloc)(howto, abfd, reloc, amount, r_addr) +MY(relocatable_reloc) (howto, abfd, reloc, amount, r_addr) reloc_howto_type *howto; bfd *abfd; struct reloc_std_external *reloc; @@ -202,11 +201,11 @@ MY(relocatable_reloc)(howto, abfd, reloc, amount, r_addr) { if (howto->type == 3) { - if (reloc->r_type[0] + if (reloc->r_type[0] & (bfd_header_big_endian (abfd) ? RELOC_STD_BITS_EXTERN_BIG : RELOC_STD_BITS_EXTERN_LITTLE)) { - /* The reloc is still external, so don't modify anything. */ + /* The reloc is still external, so don't modify anything. */ *amount = 0; } else @@ -225,7 +224,7 @@ MY(relocatable_reloc)(howto, abfd, reloc, amount, r_addr) } #define MY_relocatable_reloc(HOW, BFD, REL, AMOUNT, ADDR) \ - MY(relocatable_reloc)(HOW, BFD, REL, &(AMOUNT), ADDR) + MY(relocatable_reloc) (HOW, BFD, REL, &(AMOUNT), ADDR) static bfd_reloc_status_type MY(fix_pcrel_26_done) (abfd, reloc_entry, symbol, data, input_section, @@ -257,7 +256,7 @@ MY(fix_pcrel_26) (abfd, reloc_entry, symbol, data, input_section, bfd_size_type addr = reloc_entry->address; 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 (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) @@ -297,12 +296,12 @@ MY(fix_pcrel_26) (abfd, reloc_entry, symbol, data, input_section, /* 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 = &MY(howto_table)[7]; - + return flag; } reloc_howto_type * -MY(bfd_reloc_type_lookup)(abfd,code) +MY(bfd_reloc_type_lookup) (abfd,code) bfd *abfd; bfd_reloc_code_real_type code; { @@ -392,11 +391,10 @@ MY_swap_std_reloc_out (abfd, g, natptr) r_pcrel = 0; } else if (g->howto->type == 7) - { + { r_length = 3; r_pcrel = 1; } - #if 0 /* For a standard reloc, the addend is in the object file. */ @@ -506,7 +504,7 @@ const bfd_target aout_arm_little_vec = BFD_JUMP_TABLE_DYNAMIC (MY), & aout_arm_big_vec, - + (PTR) MY_backend_data, }; @@ -547,6 +545,6 @@ const bfd_target aout_arm_big_vec = BFD_JUMP_TABLE_DYNAMIC (MY), & aout_arm_little_vec, - + (PTR) MY_backend_data, }; diff --git a/gnu/dist/toolchain/bfd/aout-cris.c b/gnu/dist/toolchain/bfd/aout-cris.c new file mode 100644 index 000000000000..896c2b2d1bb4 --- /dev/null +++ b/gnu/dist/toolchain/bfd/aout-cris.c @@ -0,0 +1,305 @@ +/* BFD backend for CRIS a.out binaries. + Copyright (C) 2000 Free Software Foundation, Inc. + Contributed by Axis Communications AB. + Written by Hans-Peter Nilsson. + +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. */ + +/* See info in the file PORTING for documentation of these macros and + functions. Beware; some of the information there is outdated. */ + +#define N_HEADER_IN_TEXT(x) 0 +#define BYTES_IN_WORD 4 +#define N_TXTOFF(x) 32 +#define ENTRY_CAN_BE_ZERO +#define TEXT_START_ADDR 0 + +/* Without reading symbols to get the text start symbol, there is no way + to know where the text segment starts in an a.out file. Defaulting to + anything as constant as TEXT_START_ADDR is bad. But we can guess from + the entry point, which is usually within the first 64k of the text + segment. We also assume here that the text segment is 64k-aligned. + FIXME: It is also wrong to assume that data and bss follow immediately + after text, but with those, we don't have any choice besides reading + symbol info, and luckily there's no pressing need for correctness for + those vma:s at this time. */ +#define N_TXTADDR(x) ((x).a_entry & ~0xffff) + +/* If you change this to 4, you can not link to an address N*4+2. */ +#define SEGMENT_SIZE 2 + +/* For some reason, if the a.out file has Z_MAGIC, then + adata(abfd).exec_bytes_size is not used, but rather + adata(abfd).zmagic_disk_block_size, even though the exec_header is + *not* included in the text segment. A simple workaround is to + #define ZMAGIC_DISK_BLOCK_SIZE, which is used if defined; otherwise + TARGET_PAGE_SIZE is used. */ +#define ZMAGIC_DISK_BLOCK_SIZE N_TXTOFF (0) + +/* It seems odd at first to set a page-size this low, but gives greater + freedom in where things can be linked. The drawback is that you have + to set alignment and padding in linker scripts. */ +#define TARGET_PAGE_SIZE SEGMENT_SIZE +#define TARGETNAME "a.out-cris" + +/* N_SHARED_LIB gets this reasonable default as of 1999-07-12, but we + have to work with 2.9.1. Note that N_SHARED_LIB is used in a + SUN-specific context, not applicable to CRIS. */ +#define N_SHARED_LIB(x) 0 + +/* The definition here seems not used; just provided as a convention. */ +#define DEFAULT_ARCH bfd_arch_cris + +/* ??? Spacing might be essential for the parameters in this macro. + Do Not Change. */ +#define MY(OP) CAT (cris_aout_,OP) +#define NAME(x,y) CAT3(cris_aout,_32_,y) + +#include "bfd.h" + +/* Version 1 of the header. */ +#define MY_exec_hdr_flags 1 + +#define MY_write_object_contents MY(write_object_contents) +static boolean MY(write_object_contents) PARAMS ((bfd *)); + +/* Forward this, so we can use a pointer to it in PARAMS. */ +struct reloc_ext_external; + +#define MY_swap_ext_reloc_out MY(swap_ext_reloc_out) +static void MY(swap_ext_reloc_out) PARAMS ((bfd *, arelent *, + struct reloc_ext_external *)); + +#define MY_swap_ext_reloc_in MY(swap_ext_reloc_in) +static void MY(swap_ext_reloc_in) PARAMS ((bfd *, struct + reloc_ext_external *, + arelent *, asymbol **, + bfd_size_type)); + +#define MY_set_sizes MY(set_sizes) +static boolean MY(set_sizes) PARAMS ((bfd *)); + +/* To set back reloc_size to ext, we make MY(set_sizes) be called + through this construct. Note that MY_set_arch_mach is only called + through SET_ARCH_MACH. The default bfd_default_set_arch_mach will + not call set_sizes. */ + +#define MY_set_arch_mach NAME (aout, set_arch_mach) +#define SET_ARCH_MACH(BFD, EXEC) \ + MY_set_arch_mach (BFD, DEFAULT_ARCH, N_MACHTYPE (EXEC)) + +/* These macros describe the binary layout of the reloc information we + use in a file. */ +#define RELOC_EXT_BITS_EXTERN_LITTLE 0x80 +#define RELOC_EXT_BITS_TYPE_LITTLE 3 +#define RELOC_EXT_BITS_TYPE_SH_LITTLE 0 + +#ifndef MY_get_section_contents +#define MY_get_section_contents aout_32_get_section_contents +#endif + +/* Include generic functions (some are overridden above). */ +#include "aout32.c" +#include "aout-target.h" + +/* We need our own version to set header flags. */ + +static boolean +MY(write_object_contents) (abfd) + bfd *abfd; +{ + struct external_exec exec_bytes; + struct internal_exec *execp = exec_hdr (abfd); + + /* We set the reloc type to RELOC_EXT_SIZE, although setting it at all + seems unnecessary when inspecting as and ld behavior (not an + exhaustive inspection). The default write_object_contents + definition sets RELOC_EXT_SIZE, so we follow suite and set it too. */ + obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE; + + /* Setting N_SET_MACHTYPE and using N_SET_FLAGS is not performed by + the default definition. */ + if (bfd_get_arch(abfd) == bfd_arch_cris) + N_SET_MACHTYPE(*execp, M_CRIS); + + N_SET_FLAGS (*execp, aout_backend_info (abfd)->exec_hdr_flags); + + WRITE_HEADERS (abfd, execp); + + return true; +} + +/* We need our own for these reasons: + - Assert that a normal 8, 16 or 32 reloc is output. + - Fix what seems to be a weak-bug (perhaps there for valid reasons). */ + +static void +MY(swap_ext_reloc_out) (abfd, g, natptr) + bfd *abfd; + arelent *g; + struct reloc_ext_external *natptr; +{ + int r_index; + int r_extern; + unsigned int r_type; + unsigned int r_addend; + asymbol *sym = *(g->sym_ptr_ptr); + asection *output_section = sym->section->output_section; + + PUT_WORD (abfd, g->address, natptr->r_address); + + r_type = (unsigned int) g->howto->type; + + r_addend = g->addend; + if ((sym->flags & BSF_SECTION_SYM) != 0) + r_addend += (*(g->sym_ptr_ptr))->section->output_section->vma; + + /* If this relocation is relative to a symbol then set the + r_index to the symbols index, and the r_extern bit. + + Absolute symbols can come in in two ways, either as an offset + from the abs section, or as a symbol which has an abs value. + check for that here. */ + + if (bfd_is_abs_section (bfd_get_section (sym))) + { + r_extern = 0; + r_index = N_ABS; + } + else if ((sym->flags & BSF_SECTION_SYM) == 0) + { + if (bfd_is_und_section (bfd_get_section (sym)) + /* Remember to check for weak symbols; they count as global. */ + || (sym->flags & (BSF_GLOBAL | BSF_WEAK)) != 0) + r_extern = 1; + else + r_extern = 0; + r_index = (*(g->sym_ptr_ptr))->KEEPIT; + } + else + { + /* Just an ordinary section. */ + r_extern = 0; + r_index = output_section->target_index; + } + + /* The relocation type is the same as the canonical ones, but only + the first 3 are used: RELOC_8, RELOC_16, RELOC_32. + We may change this later, but assert this for the moment. */ + if (r_type > 2) + { + (*_bfd_error_handler) (_("%s: Invalid relocation type exported: %d"), + bfd_get_filename (abfd), r_type); + + bfd_set_error (bfd_error_wrong_format); + } + + /* Now the fun stuff. */ + 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); +} + +/* We need our own to assert that a normal 8, 16 or 32 reloc is input. */ + +static void +MY(swap_ext_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount) + bfd *abfd; + struct reloc_ext_external *bytes; + arelent *cache_ptr; + asymbol **symbols; + bfd_size_type symcount; +{ + unsigned int r_index; + int r_extern; + unsigned int r_type; + struct aoutdata *su = &(abfd->tdata.aout_data->a); + + cache_ptr->address = (GET_SWORD (abfd, bytes->r_address)); + + /* Now the fun stuff. */ + 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_SH_LITTLE) + & RELOC_EXT_BITS_TYPE_LITTLE; + + if (r_type > 2) + { + (*_bfd_error_handler) (_("%s: Invalid relocation type imported: %d"), + bfd_get_filename (abfd), r_type); + + bfd_set_error(bfd_error_wrong_format); + } + + cache_ptr->howto = howto_table_ext + r_type; + + if (r_extern && r_index > symcount) + { + (*_bfd_error_handler) + (_("%s: Bad relocation record imported: %d"), + bfd_get_filename (abfd), r_index); + + bfd_set_error (bfd_error_wrong_format); + + /* We continue, so we can catch further errors. */ + r_extern = 0; + r_index = N_ABS; + } + + /* Magically uses r_extern, symbols etc. Ugly, but it's what's in the + default. */ + MOVE_ADDRESS (GET_SWORD (abfd, bytes->r_addend)); +} + +/* We use the same as the default, except that we also set + "obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE;", to avoid changing + NAME (aout, set_arch_mach) in aoutx. */ + +static boolean +MY(set_sizes) (abfd) + bfd *abfd; +{ + /* Just as the default in aout-target.h (with some #ifdefs folded)... */ + + adata(abfd).page_size = TARGET_PAGE_SIZE; + adata(abfd).segment_size = SEGMENT_SIZE; + adata(abfd).zmagic_disk_block_size = ZMAGIC_DISK_BLOCK_SIZE; + adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE; + + /* ... except for that we have the extended reloc. The alternative + would be to add a check on bfd_arch_cris in NAME (aout, + set_arch_mach) in aoutx.h, but I don't want to do that since + target-specific things should not be added there. */ + + obj_reloc_entry_size (abfd) = RELOC_EXT_SIZE; + + return true; +} + +/* + * Local variables: + * eval: (c-set-style "gnu") + * indent-tabs-mode: t + * End: + */ diff --git a/gnu/dist/toolchain/bfd/aout-encap.c b/gnu/dist/toolchain/bfd/aout-encap.c index c25f9037dce0..5f8a511a72e0 100644 --- a/gnu/dist/toolchain/bfd/aout-encap.c +++ b/gnu/dist/toolchain/bfd/aout-encap.c @@ -53,12 +53,12 @@ encap_object_p (abfd) bfd_set_error (bfd_error_wrong_format); return 0; } - + coff_magic = bfd_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) + __header_offset_temp==COFF_MAGIC ? sizeof (struct coffheader) : 0) (fseek ((f), HEADER_OFFSET((f)), 1)) magic = bfd_h_get_32 (abfd, magicbuf); @@ -72,7 +72,7 @@ encap_object_p (abfd) bfd_set_error (bfd_error_wrong_format); return 0; } - NAME(aout,swap_exec_header_in)(abfd, &exec_bytes, &exec); + NAME(aout,swap_exec_header_in) (abfd, &exec_bytes, &exec); return aout_32_some_aout_object_p (abfd, &exec, encap_realcallback); } @@ -83,9 +83,9 @@ encap_real_callback (abfd) bfd *abfd; { struct internal_exec *execp = exec_hdr (abfd); - - MY(callback)(abfd, execp); - + + MY(callback) (abfd, execp); + /* If we have a coff header, it can give us better values for text_start and exec_data_start. This is particularly useful for remote debugging of embedded systems. */ diff --git a/gnu/dist/toolchain/bfd/aout-ns32k.c b/gnu/dist/toolchain/bfd/aout-ns32k.c index 05ac84e86bfb..e094a8cd761e 100644 --- a/gnu/dist/toolchain/bfd/aout-ns32k.c +++ b/gnu/dist/toolchain/bfd/aout-ns32k.c @@ -89,7 +89,7 @@ MY_swap_std_reloc_out PARAMS ((bfd *abfd, arelent *g, * */ -reloc_howto_type MY(howto_table)[] = +reloc_howto_type MY(howto_table)[] = { /* ns32k immediate operands */ HOWTO (BFD_RELOC_NS32K_IMM_8, 0, 0, 8, false, 0, true, @@ -146,7 +146,6 @@ reloc_howto_type MY(howto_table)[] = "PCREL_32", true, 0xffffffff,0xffffffff, false), }; - #define CTOR_TABLE_RELOC_HOWTO(BFD) (MY(howto_table) + 14) #define RELOC_STD_BITS_NS32K_TYPE_BIG 0x06 @@ -155,7 +154,7 @@ reloc_howto_type MY(howto_table)[] = #define RELOC_STD_BITS_NS32K_TYPE_SH_LITTLE 5 reloc_howto_type * -MY(reloc_howto)(abfd, rel, r_index, r_extern, r_pcrel) +MY(reloc_howto) (abfd, rel, r_index, r_extern, r_pcrel) bfd *abfd ATTRIBUTE_UNUSED; struct reloc_std_external *rel; int *r_index; @@ -177,10 +176,10 @@ MY(reloc_howto)(abfd, rel, r_index, r_extern, r_pcrel) return (MY(howto_table) + r_length + 3 * (*r_pcrel) + 6 * r_ns32k_type); } -#define MY_reloc_howto(BFD,REL,IN,EX,PC) MY(reloc_howto)(BFD, REL, &IN, &EX, &PC) +#define MY_reloc_howto(BFD,REL,IN,EX,PC) MY(reloc_howto) (BFD, REL, &IN, &EX, &PC) void -MY(put_reloc)(abfd, r_extern, r_index, value, howto, reloc) +MY(put_reloc) (abfd, r_extern, r_index, value, howto, reloc) bfd *abfd; int r_extern; int r_index; @@ -207,7 +206,7 @@ MY(put_reloc)(abfd, r_extern, r_index, value, howto, reloc) } #define MY_put_reloc(BFD, EXT, IDX, VAL, HOWTO, RELOC) \ - MY(put_reloc)(BFD, EXT, IDX, VAL, HOWTO, RELOC) + MY(put_reloc) (BFD, EXT, IDX, VAL, HOWTO, RELOC) #define STAT_FOR_EXEC @@ -217,7 +216,7 @@ MY(put_reloc)(abfd, r_extern, r_index, value, howto, reloc) #include reloc_howto_type * -MY(bfd_reloc_type_lookup)(abfd,code) +MY(bfd_reloc_type_lookup) (abfd,code) bfd *abfd; bfd_reloc_code_real_type code; { @@ -259,7 +258,6 @@ MY(bfd_reloc_type_lookup)(abfd,code) #undef ENTRY } - static void MY_swap_std_reloc_in (abfd, bytes, cache_ptr, symbols, symcount) bfd *abfd; @@ -295,10 +293,10 @@ MY_swap_std_reloc_out (abfd, g, natptr) asection *output_section = sym->section->output_section; r_addend = g->addend + (*(g->sym_ptr_ptr))->section->output_section->vma; - + /* name was clobbered by aout_write_syms to be symbol index */ - /* If this relocation is relative to a symbol then set the + /* If this relocation is relative to a symbol then set the r_index to the symbols index, and the r_extern bit. Absolute symbols can come in in two ways, either as an offset @@ -307,7 +305,7 @@ MY_swap_std_reloc_out (abfd, g, natptr) if (bfd_is_com_section (output_section) || output_section == &bfd_abs_section - || output_section == &bfd_und_section) + || output_section == &bfd_und_section) { if (bfd_abs_section.symbol == sym) { @@ -316,21 +314,21 @@ MY_swap_std_reloc_out (abfd, g, natptr) r_index = 0; r_extern = 0; } - else + else { /* Fill in symbol */ r_extern = 1; #undef KEEPIT #define KEEPIT udata.i r_index = (*(g->sym_ptr_ptr))->KEEPIT; -#undef KEEPIT +#undef KEEPIT } } - else + else { /* Just an ordinary section */ r_extern = 0; - r_index = output_section->target_index; + r_index = output_section->target_index; } MY_put_reloc (abfd, r_extern, r_index, g->address, g->howto, natptr); diff --git a/gnu/dist/toolchain/bfd/aout-tic30.c b/gnu/dist/toolchain/bfd/aout-tic30.c index 686c15942f8d..f0f4d3d50b50 100644 --- a/gnu/dist/toolchain/bfd/aout-tic30.c +++ b/gnu/dist/toolchain/bfd/aout-tic30.c @@ -128,7 +128,7 @@ static CONST struct aout_backend_data tic30_aout_backend_data = /* This table lists the relocation types for the TMS320C30. There are only a few relocations required, and all must be divided by 4 (>> 2) to get the 32-bit addresses in the format the TMS320C30 likes - it. */ + it. */ reloc_howto_type tic30_aout_howto_table[] = { EMPTY_HOWTO (-1), @@ -210,7 +210,7 @@ tic30_aout_reloc_howto (abfd, relocs, r_index, r_extern, r_pcrel) requires that any relocations for the data section should point to the end of the aligned text section, plus an offset. By default, this does not happen, therefore this function takes care of - that. */ + that. */ static bfd_reloc_status_type tic30_aout_fix_16 (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) @@ -224,11 +224,11 @@ tic30_aout_fix_16 (abfd, reloc_entry, symbol, data, input_section, output_bfd, e { bfd_vma relocation; - /* Make sure that the symbol's section is defined. */ + /* Make sure that the symbol's section is defined. */ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined; /* Get the size of the input section and turn it into the TMS320C30 - 32-bit address format. */ + 32-bit address format. */ relocation = (symbol->section->vma >> 2); relocation += bfd_get_16 (abfd, (bfd_byte *) data + reloc_entry->address); bfd_put_16 (abfd, relocation, (bfd_byte *) data + reloc_entry->address); @@ -236,7 +236,7 @@ tic30_aout_fix_16 (abfd, reloc_entry, symbol, data, input_section, output_bfd, e } /* This function does the same thing as tic30_aout_fix_16 except for 32 - bit relocations. */ + bit relocations. */ static bfd_reloc_status_type tic30_aout_fix_32 (abfd, reloc_entry, symbol, data, input_section, @@ -251,11 +251,11 @@ tic30_aout_fix_32 (abfd, reloc_entry, symbol, data, input_section, { bfd_vma relocation; - /* Make sure that the symbol's section is defined. */ + /* Make sure that the symbol's section is defined. */ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined; /* Get the size of the input section and turn it into the TMS320C30 - 32-bit address format. */ + 32-bit address format. */ relocation = (symbol->section->vma >> 2); relocation += bfd_get_32 (abfd, (bfd_byte *) data + reloc_entry->address); bfd_put_32 (abfd, relocation, (bfd_byte *) data + reloc_entry->address); @@ -267,7 +267,7 @@ tic30_aout_fix_32 (abfd, reloc_entry, symbol, data, input_section, useless for a relocation, so we just get the offset value and place a version of this within the object code. tic30_aout_final_link_relocate will then calculate the required - relocation to add on to the value in the object code. */ + relocation to add on to the value in the object code. */ static bfd_reloc_status_type tic30_aout_fix_pcrel_16 (abfd, reloc_entry, symbol, data, input_section, @@ -285,7 +285,7 @@ tic30_aout_fix_pcrel_16 (abfd, reloc_entry, symbol, data, input_section, /* The byte before the location of the fix contains bits 23-16 of the pcrel instruction. Bit 21 is set for a delayed instruction - which requires on offset of 3 instead of 1. */ + which requires on offset of 3 instead of 1. */ if (offset_data & 0x20) relocation -= 3; else @@ -295,14 +295,16 @@ tic30_aout_fix_pcrel_16 (abfd, reloc_entry, symbol, data, input_section, } /* These macros will get 24-bit values from the bfd definition. - Big-endian only. */ -#define bfd_getb_24(BFD,ADDR) (bfd_get_8(BFD,ADDR) << 16) | \ - (bfd_get_8(BFD,ADDR+1) << 8) | \ - (bfd_get_8(BFD,ADDR+2)) + Big-endian only. */ +#define bfd_getb_24(BFD,ADDR) \ + (bfd_get_8 (BFD, ADDR ) << 16) | \ + (bfd_get_8 (BFD, ADDR + 1) << 8) | \ + (bfd_get_8 (BFD, ADDR + 2) ) -#define bfd_putb_24(BFD,DATA,ADDR) bfd_put_8(BFD,(bfd_byte)((DATA >> 16) & 0xFF),ADDR); \ - bfd_put_8(BFD,(bfd_byte)((DATA >> 8) & 0xFF),ADDR+1); \ - bfd_put_8(BFD,(bfd_byte)(DATA & 0xFF),ADDR+2) +#define bfd_putb_24(BFD,DATA,ADDR) \ + bfd_put_8 (BFD, (bfd_byte) ((DATA >> 16) & 0xFF), ADDR ); \ + bfd_put_8 (BFD, (bfd_byte) ((DATA >> 8) & 0xFF), ADDR + 1); \ + bfd_put_8 (BFD, (bfd_byte) ( DATA & 0xFF), ADDR + 2) /* Set parameters about this a.out file that are machine-dependent. This routine is called from some_aout_object_p just before it returns. */ @@ -563,7 +565,7 @@ tic30_aout_object_p (abfd) * means that it isn't obvious if EXEC_P should be set. * All of the following must be true for an executable: * There must be no relocations, the bfd can be neither an - * archive nor an archive element, and the file must be executable. */ + * archive nor an archive element, and the file must be executable. */ if (exec.a_trsize + exec.a_drsize == 0 && bfd_get_format (abfd) == bfd_object && abfd->my_archive == NULL) @@ -586,7 +588,6 @@ tic30_aout_object_p (abfd) section contents, and copy_private_bfd_data is not called until after the section contents have been set. */ -/*ARGSUSED */ static boolean MY_bfd_copy_private_section_data (ibfd, isec, obfd, osec) bfd *ibfd; @@ -720,7 +721,7 @@ MY_bfd_final_link (abfd, info) int pad; /* Set the executable header size to 0, as we don't want one for an - output. */ + output. */ adata (abfd).exec_bytes_size = 0; pos = adata (abfd).exec_bytes_size; /* Text. */ @@ -765,7 +766,7 @@ MY_bfd_final_link (abfd, info) obj_bsssec (abfd)->vma = vma; obj_bsssec (abfd)->user_set_vma = 1; - /* We are fully resized, so don't readjust in final_link. */ + /* We are fully resized, so don't readjust in final_link. */ adata (abfd).magic = z_magic; return NAME (aout, final_link) (abfd, info, MY_final_link_callback); @@ -961,7 +962,6 @@ tic30_aout_set_arch_mach (abfd, arch, machine) #define MY_bfd_link_split_section _bfd_generic_link_split_section #endif - #ifndef MY_bfd_copy_private_bfd_data #define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data #endif @@ -1058,7 +1058,7 @@ const bfd_target tic30_aout_vec = BFD_JUMP_TABLE_DYNAMIC (MY), NULL, - + (PTR) MY_backend_data }; #endif /* MY_BFD_TARGET */ diff --git a/gnu/dist/toolchain/bfd/aoutf1.h b/gnu/dist/toolchain/bfd/aoutf1.h index fdf95b5b1175..4ad49a11534b 100644 --- a/gnu/dist/toolchain/bfd/aoutf1.h +++ b/gnu/dist/toolchain/bfd/aoutf1.h @@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This is needed to reject a NewsOS file, e.g. in gdb/testsuite/gdb.t10/crossload.exp. I needed to add M_UNKNOWN to recognize a 68000 object, so this will - probably no longer reject a NewsOS object. . */ + probably no longer reject a NewsOS object. . */ #ifndef MACHTYPE_OK #define MACHTYPE_OK(mtype) \ (((mtype) == M_SPARC && bfd_lookup_arch (bfd_arch_sparc, 0) != NULL) \ @@ -123,7 +123,7 @@ sunos_set_arch_mach (abfd, machtype) case M_UNKNOWN: /* Some Sun3s make magic numbers without cpu types in them, so - we'll default to the 68000. */ + we'll default to the 68000. */ arch = bfd_arch_m68k; machine = bfd_mach_m68000; break; @@ -180,7 +180,7 @@ sunos_set_arch_mach (abfd, machtype) } #define SET_ARCH_MACH(ABFD, EXEC) \ - NAME(sunos,set_arch_mach)(ABFD, N_MACHTYPE (EXEC)); \ + NAME(sunos,set_arch_mach) (ABFD, N_MACHTYPE (EXEC)); \ choose_reloc_size(ABFD); /* Determine the size of a relocation entry, based on the architecture */ @@ -275,11 +275,11 @@ sunos_write_object_contents (abfd) Unfortunately, they don't document the FPA structure, or at least I can't find it easily. Fortunately the core header contains its own length. So this shouldn't cause problems, except for c_ucode, which - so far we don't use but is easy to find with a little arithmetic. */ + so far we don't use but is easy to find with a little arithmetic. */ /* But the reg structure can be gotten from the SPARC processor handbook. This really should be in a GNU include file though so that gdb can use - the same info. */ + the same info. */ struct regs { int r_psr; @@ -439,7 +439,7 @@ swapcore_sun3 (abfd, ext, intcore) intcore->c_ssize = bfd_h_get_32 (abfd, (unsigned char *) &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. */ + /* 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 */ @@ -449,7 +449,6 @@ swapcore_sun3 (abfd, ext, intcore) intcore->c_stacktop = 0x0E000000; /* By experimentation */ } - /* byte-swap in the Sparc core structure */ static void swapcore_sparc (abfd, ext, intcore) @@ -476,7 +475,7 @@ swapcore_sparc (abfd, ext, intcore) intcore->c_ssize = bfd_h_get_32 (abfd, (unsigned char *) &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. */ + /* 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 */ @@ -544,7 +543,7 @@ swapcore_solaris_bcp (abfd, ext, intcore) memcpy (intcore->c_cmdname, extcore->c_cmdname, sizeof (intcore->c_cmdname)); intcore->fp_stuff_pos = (long) (((struct external_solaris_bcp_core *) 0)->fp_stuff); - /* FP stuff takes up whole rest of struct, except c_ucode. */ + /* 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_solaris_bcp_core *) 0)->fp_stuff); /* Ucode is the last thing in the struct -- just before the end */ @@ -764,7 +763,7 @@ sunos4_core_file_matches_executable_p (core_bfd, exec_bfd) return false; } - /* Solaris core files do not include an aouthdr. */ + /* Solaris core files do not include an aouthdr. */ if ((core_hdr (core_bfd)->hdr)->c_len == SOLARIS_BCP_CORE_LEN) return true; diff --git a/gnu/dist/toolchain/bfd/archures.c b/gnu/dist/toolchain/bfd/archures.c index 7462592742f6..84b774495121 100644 --- a/gnu/dist/toolchain/bfd/archures.c +++ b/gnu/dist/toolchain/bfd/archures.c @@ -31,7 +31,7 @@ SECTION BFD keeps one atom in a BFD describing the architecture of the data attached to the BFD: a pointer to a - <>. + <>. Pointers to structures can be requested independently of a BFD so that an architecture's information can be interrogated @@ -41,13 +41,13 @@ SECTION The set of default architectures is selected by the macro <>. This is normally set up in the @file{config/@var{target}.mt} file of your choice. If the name is not - defined, then all the architectures supported are included. + defined, then all the architectures supported are included. When BFD starts up, all the architectures are called with an initialize method. It is up to the architecture back end to insert as many items into the list of architectures as it wants to; generally this would be one for each machine and one for the - default case (an item with a machine field of 0). + default case (an item with a machine field of 0). BFD's idea of an architecture is implemented in @file{archures.c}. */ @@ -64,9 +64,9 @@ DESCRIPTION the family is in use. The machine gives a number which distinguishes different versions of the architecture, containing, for example, 2 and 3 for Intel i960 KA and i960 KB, - and 68020 and 68030 for Motorola 68020 and 68030. + and 68020 and 68030 for Motorola 68020 and 68030. -.enum bfd_architecture +.enum bfd_architecture .{ . bfd_arch_unknown, {* File arch not known *} . bfd_arch_obscure, {* Arch known, not one of these *} @@ -79,14 +79,14 @@ DESCRIPTION .#define bfd_mach_m68040 6 .#define bfd_mach_m68060 7 .#define bfd_mach_cpu32 8 -. bfd_arch_vax, {* DEC Vax *} +. bfd_arch_vax, {* DEC Vax *} . bfd_arch_i960, {* Intel 960 *} . {* The order of the following is important. -. lower number indicates a machine type that +. lower number indicates a machine type that . only accepts a subset of the instructions . available to machines with higher numbers. . The exception is the "ca", which is -. incompatible with all other machines except +. incompatible with all other machines except . "core". *} . .#define bfd_mach_i960_core 1 @@ -109,9 +109,12 @@ DESCRIPTION .#define bfd_mach_sparc_sparclite_le 6 .#define bfd_mach_sparc_v9 7 .#define bfd_mach_sparc_v9a 8 {* with ultrasparc add'ns *} +.#define bfd_mach_sparc_v8plusb 9 {* with cheetah add'ns *} +.#define bfd_mach_sparc_v9b 10 {* with cheetah add'ns *} .{* Nonzero if MACH has the v9 instruction set. *} .#define bfd_mach_sparc_v9_p(mach) \ -. ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a) +. ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ +. && (mach) != bfd_mach_sparc_sparclite_le) . bfd_arch_mips, {* MIPS Rxxxx *} .#define bfd_mach_mips3000 3000 .#define bfd_mach_mips3900 3900 @@ -128,10 +131,17 @@ DESCRIPTION .#define bfd_mach_mips8000 8000 .#define bfd_mach_mips10000 10000 .#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 *} . bfd_arch_i386, {* Intel 386 *} .#define bfd_mach_i386_i386 0 .#define bfd_mach_i386_i8086 1 .#define bfd_mach_i386_i386_intel_syntax 2 +.#define bfd_mach_x86_64 3 +.#define bfd_mach_x86_64_intel_syntax 4 . bfd_arch_we32k, {* AT&T WE32xxx *} . bfd_arch_tahoe, {* CCI/Harris Tahoe *} . bfd_arch_i860, {* Intel 860 *} @@ -146,13 +156,36 @@ DESCRIPTION .#define bfd_mach_h8300h 2 .#define bfd_mach_h8300s 3 . bfd_arch_powerpc, {* PowerPC *} +.#define bfd_mach_ppc 0 +.#define bfd_mach_ppc_403 403 +.#define bfd_mach_ppc_403gc 4030 +.#define bfd_mach_ppc_505 505 +.#define bfd_mach_ppc_601 601 +.#define bfd_mach_ppc_602 602 +.#define bfd_mach_ppc_603 603 +.#define bfd_mach_ppc_ec603e 6031 +.#define bfd_mach_ppc_604 604 +.#define bfd_mach_ppc_620 620 +.#define bfd_mach_ppc_630 630 +.#define bfd_mach_ppc_750 750 +.#define bfd_mach_ppc_860 860 +.#define bfd_mach_ppc_a35 35 +.#define bfd_mach_ppc_rs64ii 642 +.#define bfd_mach_ppc_rs64iii 643 +.#define bfd_mach_ppc_7400 7400 . bfd_arch_rs6000, {* IBM RS/6000 *} +.#define bfd_mach_rs6k 0 +.#define bfd_mach_rs6k_rs1 6001 +.#define bfd_mach_rs6k_rsc 6003 +.#define bfd_mach_rs6k_rs2 6002 . bfd_arch_hppa, {* HP PA RISC *} . bfd_arch_d10v, {* Mitsubishi D10V *} .#define bfd_mach_d10v 0 .#define bfd_mach_d10v_ts2 2 .#define bfd_mach_d10v_ts3 3 . bfd_arch_d30v, {* Mitsubishi D30V *} +. bfd_arch_m68hc11, {* Motorola 68HC11 *} +. bfd_arch_m68hc12, {* Motorola 68HC12 *} . bfd_arch_z8k, {* Zilog Z8000 *} .#define bfd_mach_z8001 1 .#define bfd_mach_z8002 2 @@ -178,16 +211,22 @@ DESCRIPTION .#define bfd_mach_arm_4T 6 .#define bfd_mach_arm_5 7 .#define bfd_mach_arm_5T 8 +.#define bfd_mach_arm_5TE 9 +.#define bfd_mach_arm_XScale 10 . bfd_arch_ns32k, {* National Semiconductors ns32000 *} . bfd_arch_w65, {* WDC 65816 *} . bfd_arch_tic30, {* Texas Instruments TMS320C30 *} +. bfd_arch_tic54x, {* Texas Instruments TMS320C54X *} . bfd_arch_tic80, {* TI TMS320c80 (MVP) *} . bfd_arch_v850, {* NEC V850 *} .#define bfd_mach_v850 0 .#define bfd_mach_v850e 'E' .#define bfd_mach_v850ea 'A' -. bfd_arch_arc, {* Argonaut RISC Core *} -.#define bfd_mach_arc_base 0 +. bfd_arch_arc, {* ARC Cores *} +.#define bfd_mach_arc_5 0 +.#define bfd_mach_arc_6 1 +.#define bfd_mach_arc_7 2 +.#define bfd_mach_arc_8 3 . bfd_arch_m32r, {* Mitsubishi M32R/D *} .#define bfd_mach_m32r 0 {* backwards compatibility *} .#define bfd_mach_m32rx 'x' @@ -198,20 +237,22 @@ DESCRIPTION . bfd_arch_fr30, .#define bfd_mach_fr30 0x46523330 . bfd_arch_mcore, +. bfd_arch_ia64, {* HP/Intel ia64 *} +.#define bfd_mach_ia64_elf64 0 +.#define bfd_mach_ia64_elf32 1 . bfd_arch_pj, . bfd_arch_avr, {* Atmel AVR microcontrollers *} .#define bfd_mach_avr1 1 .#define bfd_mach_avr2 2 .#define bfd_mach_avr3 3 .#define bfd_mach_avr4 4 +.#define bfd_mach_avr5 5 +. bfd_arch_cris, {* Axis CRIS *} . bfd_arch_last . }; - - */ /* - SUBSECTION bfd_arch_info @@ -220,7 +261,7 @@ DESCRIPTION within BFD. . -.typedef struct bfd_arch_info +.typedef struct bfd_arch_info .{ . int bits_per_word; . int bits_per_address; @@ -230,8 +271,8 @@ DESCRIPTION . const char *arch_name; . const char *printable_name; . unsigned int section_align_power; -. {* true if this is the default machine for the architecture *} -. boolean the_default; +. {* True if this is the default machine for the architecture. *} +. boolean the_default; . const struct bfd_arch_info * (*compatible) . PARAMS ((const struct bfd_arch_info *a, . const struct bfd_arch_info *b)); @@ -246,6 +287,7 @@ extern const bfd_arch_info_type bfd_a29k_arch; extern const bfd_arch_info_type bfd_alpha_arch; extern const bfd_arch_info_type bfd_arc_arch; extern const bfd_arch_info_type bfd_arm_arch; +extern const bfd_arch_info_type bfd_cris_arch; extern const bfd_arch_info_type bfd_d10v_arch; extern const bfd_arch_info_type bfd_d30v_arch; extern const bfd_arch_info_type bfd_h8300_arch; @@ -256,6 +298,8 @@ extern const bfd_arch_info_type bfd_i386_arch; extern const bfd_arch_info_type bfd_i860_arch; extern const bfd_arch_info_type bfd_i960_arch; extern const bfd_arch_info_type bfd_m32r_arch; +extern const bfd_arch_info_type bfd_m68hc11_arch; +extern const bfd_arch_info_type bfd_m68hc12_arch; extern const bfd_arch_info_type bfd_m68k_arch; extern const bfd_arch_info_type bfd_m88k_arch; extern const bfd_arch_info_type bfd_mips_arch; @@ -267,6 +311,7 @@ extern const bfd_arch_info_type bfd_pj_arch; extern const bfd_arch_info_type bfd_sh_arch; extern const bfd_arch_info_type bfd_sparc_arch; extern const bfd_arch_info_type bfd_tic30_arch; +extern const bfd_arch_info_type bfd_tic54x_arch; extern const bfd_arch_info_type bfd_tic80_arch; extern const bfd_arch_info_type bfd_vax_arch; extern const bfd_arch_info_type bfd_we32k_arch; @@ -277,9 +322,9 @@ extern const bfd_arch_info_type bfd_v850_arch; 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; -static const bfd_arch_info_type * const bfd_archures_list[] = -{ +static const bfd_arch_info_type * const bfd_archures_list[] = { #ifdef SELECT_ARCHITECTURES SELECT_ARCHITECTURES, #else @@ -287,6 +332,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_alpha_arch, &bfd_arc_arch, &bfd_arm_arch, + &bfd_cris_arch, &bfd_d10v_arch, &bfd_d30v_arch, &bfd_h8300_arch, @@ -297,6 +343,8 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_i860_arch, &bfd_i960_arch, &bfd_m32r_arch, + &bfd_m68hc11_arch, + &bfd_m68hc12_arch, &bfd_m68k_arch, &bfd_m88k_arch, &bfd_mips_arch, @@ -307,6 +355,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_sh_arch, &bfd_sparc_arch, &bfd_tic30_arch, + &bfd_tic54x_arch, &bfd_tic80_arch, &bfd_vax_arch, &bfd_we32k_arch, @@ -317,6 +366,7 @@ static const bfd_arch_info_type * const bfd_archures_list[] = &bfd_fr30_arch, &bfd_mcore_arch, &bfd_avr_arch, + &bfd_ia64_arch, #endif 0 }; @@ -341,8 +391,6 @@ bfd_printable_name (abfd) return abfd->arch_info->printable_name; } - - /* FUNCTION bfd_scan_arch @@ -354,7 +402,6 @@ DESCRIPTION Figure out if BFD supports any cpu which could be described with the name @var{string}. Return a pointer to an <> structure if a machine is found, otherwise NULL. - */ const bfd_arch_info_type * @@ -363,7 +410,7 @@ bfd_scan_arch (string) { const bfd_arch_info_type * const *app, *ap; - /* Look through all the installed architectures */ + /* Look through all the installed architectures. */ for (app = bfd_archures_list; *app != NULL; app++) { for (ap = *app; ap != NULL; ap = ap->next) @@ -376,8 +423,6 @@ bfd_scan_arch (string) return NULL; } - - /* FUNCTION bfd_arch_list @@ -388,7 +433,6 @@ SYNOPSIS DESCRIPTION Return a freshly malloced NULL-terminated vector of the names of all the valid BFD architectures. Do not modify the names. - */ const char ** @@ -399,7 +443,7 @@ bfd_arch_list () const char **name_list; const bfd_arch_info_type * const *app; - /* Determine the number of architectures */ + /* Determine the number of architectures. */ vec_length = 0; for (app = bfd_archures_list; *app != NULL; app++) { @@ -410,12 +454,12 @@ bfd_arch_list () } } - name_list = (CONST char **) + name_list = (const char **) bfd_malloc ((vec_length + 1) * sizeof (char **)); if (name_list == NULL) return NULL; - /* Point the list at each of the names */ + /* Point the list at each of the names. */ name_ptr = name_list; for (app = bfd_archures_list; *app != NULL; app++) { @@ -431,8 +475,6 @@ bfd_arch_list () return name_list; } - - /* FUNCTION bfd_arch_get_compatible @@ -458,15 +500,14 @@ bfd_arch_get_compatible (abfd, bbfd) /* If either architecture is unknown, then all we can do is assume the user knows what he's doing. */ if (abfd->arch_info->arch == bfd_arch_unknown) - return bbfd->arch_info; + return bbfd->arch_info; if (bbfd->arch_info->arch == bfd_arch_unknown) - return abfd->arch_info; + return abfd->arch_info; /* Otherwise architecture-specific code has to decide. */ return abfd->arch_info->compatible (abfd->arch_info, bbfd->arch_info); } - /* INTERNAL_DEFINITION bfd_default_arch_struct @@ -479,15 +520,13 @@ DESCRIPTION architecture of the file. .extern const bfd_arch_info_type bfd_default_arch_struct; - */ -const bfd_arch_info_type bfd_default_arch_struct = -{ - 32,32,8,bfd_arch_unknown,0,"unknown","unknown",2,true, - bfd_default_compatible, - bfd_default_scan, - 0, +const bfd_arch_info_type bfd_default_arch_struct = { + 32, 32, 8, bfd_arch_unknown, 0, "unknown", "unknown", 2, true, + bfd_default_compatible, + bfd_default_scan, + 0, }; /* @@ -522,7 +561,7 @@ DESCRIPTION Set the architecture and machine type in BFD @var{abfd} to @var{arch} and @var{mach}. Find the correct pointer to a structure and insert it into the <> - pointer. + pointer. */ boolean @@ -552,7 +591,6 @@ bfd_default_set_arch_mach (abfd, arch, mach) return false; } - /* FUNCTION bfd_get_arch @@ -563,14 +601,13 @@ SYNOPSIS DESCRIPTION Return the enumerated type which describes the BFD @var{abfd}'s architecture. - */ enum bfd_architecture bfd_get_arch (abfd) bfd *abfd; { - return abfd->arch_info->arch; + return abfd->arch_info->arch; } /* @@ -585,11 +622,11 @@ DESCRIPTION machine. */ -unsigned long +unsigned long bfd_get_mach (abfd) bfd *abfd; { - return abfd->arch_info->mach; + return abfd->arch_info->mach; } /* @@ -602,7 +639,6 @@ SYNOPSIS DESCRIPTION Return the number of bits in one of the BFD @var{abfd}'s architecture's bytes. - */ unsigned int @@ -631,9 +667,8 @@ bfd_arch_bits_per_address (abfd) return abfd->arch_info->bits_per_address; } - /* -INTERNAL_FUNCTION +INTERNAL_FUNCTION bfd_default_compatible SYNOPSIS @@ -646,7 +681,7 @@ DESCRIPTION */ const bfd_arch_info_type * -bfd_default_compatible (a,b) +bfd_default_compatible (a, b) const bfd_arch_info_type *a; const bfd_arch_info_type *b; { @@ -662,7 +697,6 @@ bfd_default_compatible (a,b) return a; } - /* INTERNAL_FUNCTION bfd_default_scan @@ -675,7 +709,7 @@ DESCRIPTION architecture hit and a machine hit. */ -boolean +boolean bfd_default_scan (info, string) const struct bfd_arch_info *info; const char *string; @@ -687,17 +721,17 @@ bfd_default_scan (info, string) const char *printable_name_colon; /* Exact match of the architecture name (ARCH_NAME) and also the - default architecture? */ + default architecture? */ if (strcasecmp (string, info->arch_name) == 0 && info->the_default) return true; - /* Exact match of the machine name (PRINTABLE_NAME)? */ + /* Exact match of the machine name (PRINTABLE_NAME)? */ if (strcasecmp (string, info->printable_name) == 0) return true; - + /* Given that printable_name contains no colon, attempt to match: - ARCH_NAME [ ":" ] PRINTABLE_NAME? */ + ARCH_NAME [ ":" ] PRINTABLE_NAME? */ printable_name_colon = strchr (info->printable_name, ':'); if (printable_name_colon == NULL) { @@ -720,7 +754,7 @@ bfd_default_scan (info, string) } /* Given that PRINTABLE_NAME has the form: ":" ; - Attempt to match: ? */ + Attempt to match: ? */ if (printable_name_colon != NULL) { int colon_index = printable_name_colon - info->printable_name; @@ -732,48 +766,61 @@ bfd_default_scan (info, string) /* Given that PRINTABLE_NAME has the form: ":" ; Do not attempt to match just , it could be ambigious. This test - is left until later. */ + is left until later. */ - /* NOTE: The below is retained for compatibility only. Please do not - add to this code */ + /* NOTE: The below is retained for compatibility only. Please do + not add to this code. */ /* See how much of the supplied string matches with the architecture, eg the string m68k:68020 would match the 68k entry - up to the :, then we get left with the machine number */ + up to the :, then we get left with the machine number. */ - for (ptr_src = string, ptr_tst = info->arch_name; + for (ptr_src = string, ptr_tst = info->arch_name; *ptr_src && *ptr_tst; - ptr_src++, ptr_tst++) + ptr_src++, ptr_tst++) { - if (*ptr_src != *ptr_tst) break; + if (*ptr_src != *ptr_tst) + break; } /* Chewed up as much of the architecture as will match, skip any - colons */ + colons. */ if (*ptr_src == ':') ptr_src++; - + if (*ptr_src == 0) { - /* nothing more, then only keep this one if it is the default - machine for this architecture */ + /* Nothing more, then only keep this one if it is the default + machine for this architecture. */ return info->the_default; } number = 0; while (isdigit ((unsigned char) *ptr_src)) { - number = number * 10 + *ptr_src - '0'; + number = number * 10 + *ptr_src - '0'; ptr_src++; } /* NOTE: The below is retained for compatibility only. - PLEASE DO NOT ADD TO THIS CODE. */ + PLEASE DO NOT ADD TO THIS CODE. */ - switch (number) + switch (number) { /* FIXME: These are needed to parse IEEE objects. */ - case 68000: + /* The following seven case's are here only for compatibility with + older binutils (at least IEEE objects from binutils 2.9.1 require + them). */ + case bfd_mach_m68000: + case bfd_mach_m68010: + case bfd_mach_m68020: + case bfd_mach_m68030: + case bfd_mach_m68040: + case bfd_mach_m68060: + case bfd_mach_cpu32: + arch = bfd_arch_m68k; + break; + case 68000: arch = bfd_arch_m68k; number = bfd_mach_m68000; break; @@ -840,11 +887,11 @@ bfd_default_scan (info, string) number = bfd_mach_sh4; break; - default: + default: return false; } - if (arch != info->arch) + if (arch != info->arch) return false; if (number != info->mach) @@ -853,7 +900,6 @@ bfd_default_scan (info, string) return true; } - /* FUNCTION bfd_get_arch_info @@ -872,7 +918,6 @@ bfd_get_arch_info (abfd) return abfd->arch_info; } - /* FUNCTION bfd_lookup_arch @@ -890,7 +935,7 @@ DESCRIPTION default. */ -const bfd_arch_info_type * +const bfd_arch_info_type * bfd_lookup_arch (arch, machine) enum bfd_architecture arch; unsigned long machine; @@ -911,7 +956,6 @@ bfd_lookup_arch (arch, machine) return NULL; } - /* FUNCTION bfd_printable_arch_mach @@ -922,7 +966,7 @@ SYNOPSIS DESCRIPTION Return a printable string representing the architecture and - machine type. + machine type. This routine is depreciated. */ @@ -932,11 +976,11 @@ bfd_printable_arch_mach (arch, machine) enum bfd_architecture arch; unsigned long machine; { - const bfd_arch_info_type * ap = bfd_lookup_arch (arch, machine); + const bfd_arch_info_type *ap = bfd_lookup_arch (arch, machine); - if (ap) - return ap->printable_name; - return "UNKNOWN!"; + if (ap) + return ap->printable_name; + return "UNKNOWN!"; } /* @@ -950,15 +994,14 @@ DESCRIPTION Return the number of octets (8-bit quantities) per target byte (minimum addressable unit). In most cases, this will be one, but some DSP targets have 16, 32, or even 48 bits per byte. - */ unsigned int bfd_octets_per_byte (abfd) - bfd * abfd; + bfd *abfd; { - return bfd_arch_mach_octets_per_byte (bfd_get_arch (abfd), - bfd_get_mach (abfd)); + return bfd_arch_mach_octets_per_byte (bfd_get_arch (abfd), + bfd_get_mach (abfd)); } /* @@ -971,19 +1014,19 @@ SYNOPSIS DESCRIPTION See bfd_octets_per_byte. - + This routine is provided for those cases where a bfd * is not available */ unsigned int bfd_arch_mach_octets_per_byte (arch, mach) - enum bfd_architecture arch; - unsigned long mach; + enum bfd_architecture arch; + unsigned long mach; { - const bfd_arch_info_type * ap = bfd_lookup_arch (arch, mach); - - if (ap) - return ap->bits_per_byte / 8; - return 1; + const bfd_arch_info_type *ap = bfd_lookup_arch (arch, mach); + + if (ap) + return ap->bits_per_byte / 8; + return 1; } diff --git a/gnu/dist/toolchain/bfd/armnetbsd.c b/gnu/dist/toolchain/bfd/armnetbsd.c index 3e6ee4707081..05d8ad0f8a67 100644 --- a/gnu/dist/toolchain/bfd/armnetbsd.c +++ b/gnu/dist/toolchain/bfd/armnetbsd.c @@ -15,7 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define BYTES_IN_WORD 4 #undef TARGET_IS_BIG_ENDIAN_P diff --git a/gnu/dist/toolchain/bfd/bfd.c b/gnu/dist/toolchain/bfd/bfd.c index e04172fb016a..2e172c98b01e 100644 --- a/gnu/dist/toolchain/bfd/bfd.c +++ b/gnu/dist/toolchain/bfd/bfd.c @@ -33,10 +33,10 @@ SECTION CODE_FRAGMENT . -.struct _bfd +.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; @@ -69,7 +69,7 @@ CODE_FRAGMENT . {* When a file is closed by the caching routines, BFD retains . state information on the file here: *} . -. file_ptr where; +. file_ptr where; . . {* and here: (``once'' means at least once) *} . @@ -82,7 +82,7 @@ CODE_FRAGMENT . . {* File modified time, if mtime_set is true: *} . -. long mtime; +. long mtime; . . {* Reserved for an unimplemented file locking extension.*} . @@ -101,13 +101,13 @@ CODE_FRAGMENT . . {* Format_specific flags*} . -. flagword flags; +. flagword flags; . . {* Currently my_archive is tested before adding origin to . anything. I believe that this can become always an add of . origin, with origin set to 0 for non archive files. *} . -. file_ptr origin; +. file_ptr origin; . . {* Remember when output has begun, to stop strange things . from happening. *} @@ -119,7 +119,7 @@ CODE_FRAGMENT . {* The number of sections *} . unsigned int section_count; . -. {* Stuff only useful for object files: +. {* Stuff only useful for object files: . The start address. *} . bfd_vma start_address; . @@ -127,17 +127,17 @@ CODE_FRAGMENT . unsigned int symcount; . . {* Symbol table for output BFD (with symcount entries) *} -. struct symbol_cache_entry **outsymbols; +. struct symbol_cache_entry **outsymbols; . . {* Pointer to structure which contains architecture information*} . const struct bfd_arch_info *arch_info; . . {* Stuff only useful for archives:*} -. PTR arelt_data; +. PTR arelt_data; . struct _bfd *my_archive; {* The containing archive BFD. *} . struct _bfd *next; {* The next BFD in the archive. *} . struct _bfd *archive_head; {* The first BFD in the archive. *} -. boolean has_armap; +. boolean has_armap; . . {* A chain of BFD structures involved in a link. *} . struct _bfd *link_next; @@ -148,7 +148,7 @@ CODE_FRAGMENT . . {* Used by the back end to hold private data. *} . -. union +. union . { . struct aout_data_struct *aout_data; . struct artdata *aout_ar_data; @@ -180,7 +180,7 @@ CODE_FRAGMENT . struct netbsd_core_struct *netbsd_core_data; . PTR any; . } tdata; -. +. . {* Used by the application to hold private data*} . PTR usrdata; . @@ -218,8 +218,6 @@ CODE_FRAGMENT struct which ultimately gets passed in to the bfd. When it arrives, copy it to the following struct so that the data will be available in coffcode.h where it is needed. The typedef's used are defined in bfd.h */ - - /* SECTION @@ -376,7 +374,7 @@ bfd_perror (message) CONST char *message; { if (bfd_get_error () == bfd_error_system_call) - perror((char *)message); /* must be system error then... */ + perror((char *)message); /* must be system error then... */ else { if (message == NULL || *message == '\0') fprintf (stderr, "%s\n", bfd_errmsg (bfd_get_error ())); @@ -510,7 +508,6 @@ bfd_set_error_program_name (name) _bfd_error_program_name = name; } - /* FUNCTION bfd_get_error_handler @@ -547,7 +544,6 @@ DESCRIPTION */ - long bfd_get_reloc_upper_bound (abfd, asect) bfd *abfd; @@ -584,7 +580,6 @@ DESCRIPTION The @var{syms} table is also needed for horrible internal magic reasons. - */ long bfd_canonicalize_reloc (abfd, asect, location, symbols) @@ -615,7 +610,7 @@ DESCRIPTION The argument @var{abfd} is ignored. */ -/*ARGSUSED*/ + void bfd_set_reloc (ignore_abfd, asect, location, count) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -704,6 +699,65 @@ _bfd_abort (file, line, fn) xexit (EXIT_FAILURE); } +/* +FUNCTION + bfd_get_arch_size + +SYNOPSIS + int bfd_get_arch_size (bfd *abfd); + +DESCRIPTION + Returns the architecture address size, in bits, as determined + by the object file's format. For ELF, this information is + included in the header. + +RETURNS + Returns the arch size in bits if known, <<-1>> otherwise. +*/ + +int +bfd_get_arch_size (abfd) + bfd *abfd; +{ + if (abfd->xvec->flavour == bfd_target_elf_flavour) + return (get_elf_backend_data (abfd))->s->arch_size; + + bfd_set_error (bfd_error_wrong_format); + return -1; +} + +/* +FUNCTION + bfd_get_sign_extend_vma + +SYNOPSIS + int bfd_get_sign_extend_vma (bfd *abfd); + +DESCRIPTION + Indicates if the target architecture "naturally" sign extends + an address. Some architectures implicitly sign extend address + values when they are converted to types larger than the size + of an address. For instance, bfd_get_start_address() will + return an address sign extended to fill a bfd_vma when this is + the case. + +RETURNS + Returns <<1>> if the target architecture is known to sign + extend addresses, <<0>> if the target architecture is known to + not sign extend addresses, and <<-1>> otherwise. +*/ + +int +bfd_get_sign_extend_vma (abfd) + bfd *abfd; +{ + if (bfd_get_flavour (abfd) == bfd_target_elf_flavour) + return (get_elf_backend_data (abfd)->sign_extend_vma); + + bfd_set_error (bfd_error_wrong_format); + return -1; +} + /* FUNCTION bfd_set_start_address @@ -727,7 +781,6 @@ bfd_vma vma; return true; } - /* FUNCTION bfd_get_mtime @@ -779,7 +832,7 @@ DESCRIPTION Instead, we want to ask questions like "is this NNN byte sized object I'm about to try read from file offset YYY reasonable?" As as example of where we might do this, some object formats - use string tables for which the first <> bytes of the + use string tables for which the first <> bytes of the table contain the size of the table itself, including the size bytes. If an application tries to read what it thinks is one of these string tables, without some way to validate the size, and for @@ -926,7 +979,7 @@ bfd_scan_vma (string, end, base) int digit; /* Let the host do it if possible. */ - if (sizeof(bfd_vma) <= sizeof(unsigned long)) + if (sizeof (bfd_vma) <= sizeof (unsigned long)) return (bfd_vma) strtoul (string, (char **) end, base); /* A negative base makes no sense, and we only need to go as high as hex. */ @@ -950,7 +1003,7 @@ bfd_scan_vma (string, end, base) (string[0] == '0') && ((string[1] == 'x') || (string[1] == 'X'))) string += 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) \ @@ -978,7 +1031,7 @@ SYNOPSIS boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd); DESCRIPTION - Copy private BFD information from the BFD @var{ibfd} to the + Copy private BFD information from the BFD @var{ibfd} to the the BFD @var{obfd}. Return <> on success, <> on error. Possible error returns are: @@ -999,7 +1052,7 @@ SYNOPSIS boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd); DESCRIPTION - Merge private BFD information from the BFD @var{ibfd} to the + Merge private BFD information from the BFD @var{ibfd} to the the output file BFD @var{obfd} when linking. Return <> on success, <> on error. Possible error returns are: diff --git a/gnu/dist/toolchain/bfd/binary.c b/gnu/dist/toolchain/bfd/binary.c index c2980b02621a..771e4312f730 100644 --- a/gnu/dist/toolchain/bfd/binary.c +++ b/gnu/dist/toolchain/bfd/binary.c @@ -255,6 +255,9 @@ binary_set_section_contents (abfd, sec, data, offset, size) file_ptr offset; bfd_size_type size; { + if (size == 0) + return true; + if (! abfd->output_has_begun) { boolean found_low; @@ -270,6 +273,7 @@ binary_set_section_contents (abfd, sec, data, offset, size) if (((s->flags & (SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC | SEC_NEVER_LOAD)) == (SEC_HAS_CONTENTS | SEC_LOAD | SEC_ALLOC)) + && (s->_raw_size > 0) && (! found_low || s->lma < low)) { low = s->lma; @@ -281,17 +285,18 @@ binary_set_section_contents (abfd, sec, data, offset, size) s->filepos = s->lma - low; /* Skip following warning check for sections that will not - occupy file space. */ + occupy file space. */ if ((s->flags & (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_NEVER_LOAD)) - != (SEC_HAS_CONTENTS | SEC_ALLOC)) + != (SEC_HAS_CONTENTS | SEC_ALLOC) + || (s->_raw_size == 0)) continue; /* If attempting to generate a binary file from a bfd with LMA's all over the place, huge (sparse?) binary files may result. This condition attempts to detect this situation and print a warning. Better heuristics would be nice to - have. */ + have. */ if (s->filepos < 0) (*_bfd_error_handler) @@ -383,6 +388,6 @@ const bfd_target binary_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + NULL }; diff --git a/gnu/dist/toolchain/bfd/bout.c b/gnu/dist/toolchain/bfd/bout.c index c230e18c0ea6..b1978310a0a5 100644 --- a/gnu/dist/toolchain/bfd/bout.c +++ b/gnu/dist/toolchain/bfd/bout.c @@ -19,7 +19,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. */ - #include "bfd.h" #include "sysdep.h" #include "libbfd.h" @@ -30,7 +29,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "aout/stab_gnu.h" #include "libaout.h" /* BFD a.out internal data structures */ - static int aligncode PARAMS ((bfd *abfd, asection *input_section, arelent *r, unsigned int shrink)); static void perform_slip PARAMS ((bfd *abfd, unsigned int slip, @@ -97,7 +95,7 @@ bout_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. */ + /* 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); PUT_WORD (abfd, execp->a_text , bytes->e_text); PUT_WORD (abfd, execp->a_data , bytes->e_data); @@ -114,7 +112,6 @@ bout_swap_exec_header_out (abfd, execp, raw_bytes) bytes->e_relaxable[0] = execp->a_relaxable; } - static const bfd_target * b_out_object_p (abfd) bfd *abfd; @@ -140,7 +137,6 @@ b_out_object_p (abfd) return aout_32_some_aout_object_p (abfd, &anexec, b_out_callback); } - /* Finish up the opening of a b.out file for reading. Fill in all the fields that are not handled by common code. */ @@ -189,8 +185,8 @@ b_out_callback (abfd) obj_textsec (abfd)->rel_filepos = N_TROFF(*execp); obj_datasec (abfd)->rel_filepos = N_DROFF(*execp); - adata(abfd).page_size = 1; /* Not applicable. */ - adata(abfd).segment_size = 1; /* Not applicable. */ + adata(abfd).page_size = 1; /* Not applicable. */ + adata(abfd).segment_size = 1; /* Not applicable. */ adata(abfd).exec_bytes_size = EXEC_BYTES_SIZE; if (execp->a_relaxable) @@ -310,22 +306,22 @@ b_out_write_object_contents (abfd) } if (q > outsyms) - qsort (outsyms, q - outsyms, sizeof(asymbol*), b_out_symbol_cmp); + qsort (outsyms, q - outsyms, sizeof (asymbol*), b_out_symbol_cmp); /* Back to your regularly scheduled program. */ - if (bfd_seek (abfd, (file_ptr)(N_SYMOFF(*exec_hdr(abfd))), SEEK_SET) + if (bfd_seek (abfd, (file_ptr) (N_SYMOFF(*exec_hdr(abfd))), SEEK_SET) != 0) return false; if (! aout_32_write_syms (abfd)) return false; - if (bfd_seek (abfd, (file_ptr)(N_TROFF(*exec_hdr(abfd))), SEEK_SET) != 0) + if (bfd_seek (abfd, (file_ptr) (N_TROFF(*exec_hdr(abfd))), SEEK_SET) != 0) return false; if (!b_out_squirt_out_relocs (abfd, obj_textsec (abfd))) return false; - if (bfd_seek (abfd, (file_ptr)(N_DROFF(*exec_hdr(abfd))), SEEK_SET) + if (bfd_seek (abfd, (file_ptr) (N_DROFF(*exec_hdr(abfd))), SEEK_SET) != 0) return false; @@ -344,7 +340,6 @@ b_out_write_object_contents (abfd) #define CALL 0x09000000 #define PCREL13_MASK 0x1fff - #define output_addr(sec) ((sec)->output_offset+(sec)->output_section->vma) /* Magic to turn callx into calljx */ @@ -380,11 +375,10 @@ calljx_callback (abfd, link_info, reloc_entry, src, dst, input_section) word += value + reloc_entry->addend; - bfd_put_32(abfd, word, dst); + bfd_put_32 (abfd, word, dst); return bfd_reloc_ok; } - /* Magic to turn call into callj */ static bfd_reloc_status_type callj_callback (abfd, link_info, reloc_entry, data, srcidx, dstidx, @@ -417,7 +411,7 @@ callj_callback (abfd, link_info, reloc_entry, data, srcidx, dstidx, /* The next symbol should be an N_BALNAME. */ BFD_ASSERT(IS_BALNAME(balsym->other)); - + /* We are calling a leaf, so replace the call instruction with a bal. */ word = BAL | ((word @@ -445,7 +439,7 @@ callj_callback (abfd, link_info, reloc_entry, data, srcidx, dstidx, - output_addr (input_section)) & BAL_MASK); } - bfd_put_32(abfd, word, (bfd_byte *) data + dstidx); + bfd_put_32 (abfd, word, (bfd_byte *) data + dstidx); return bfd_reloc_ok; } @@ -472,7 +466,6 @@ HOWTO(PCREL24, 0, 2, 24, true, 0, complain_overflow_signed,0,"pcrel24", true, 0x static reloc_howto_type howto_reloc_pcrel13 = HOWTO(PCREL13, 0, 2, 13, true, 0, complain_overflow_signed,0,"pcrel13", true, 0x00001fff,0x00001fff,false); - static reloc_howto_type howto_reloc_abs32codeshrunk = HOWTO(ABS32CODE_SHRUNK, 0, 2, 24, true, 0, complain_overflow_signed, 0,"callx->callj", true, 0x00ffffff, 0x00ffffff,false); @@ -556,7 +549,7 @@ b_out_slurp_reloc_table (abfd, asect, symbols) return false; doit: - if (bfd_seek (abfd, (file_ptr)(asect->rel_filepos), SEEK_SET) != 0) + if (bfd_seek (abfd, (file_ptr) (asect->rel_filepos), SEEK_SET) != 0) return false; count = reloc_size / sizeof (struct relocation_info); @@ -577,8 +570,6 @@ b_out_slurp_reloc_table (abfd, asect, symbols) return false; } - - if (bfd_header_big_endian (abfd)) { /* big-endian bit field allocation order */ pcrel_mask = 0x80; @@ -728,17 +719,14 @@ b_out_slurp_reloc_table (abfd, asect, symbols) } } - if (relocs != NULL) free (relocs); asect->relocation = reloc_cache; asect->reloc_count = count; - return true; } - static boolean b_out_squirt_out_relocs (abfd, section) bfd *abfd; @@ -956,7 +944,7 @@ b_out_set_section_contents (abfd, section, location, offset, count) if (! aout_32_make_sections (abfd)) return false; - obj_textsec (abfd)->filepos = sizeof(struct internal_exec); + obj_textsec (abfd)->filepos = sizeof (struct internal_exec); obj_datasec(abfd)->filepos = obj_textsec(abfd)->filepos + obj_textsec (abfd)->_raw_size; @@ -1005,11 +993,9 @@ b_out_sizeof_headers (ignore_abfd, ignore) bfd *ignore_abfd ATTRIBUTE_UNUSED; boolean ignore ATTRIBUTE_UNUSED; { - return sizeof(struct internal_exec); + return sizeof (struct internal_exec); } - - /************************************************************************/ static bfd_vma get_value (reloc, link_info, input_section) @@ -1125,7 +1111,6 @@ abs32code (abfd, input_section, r, shrink, link_info) gap = value - (dot - shrink); - if (-1<<23 < (long)gap && (long)gap < 1<<23 ) { /* Change the reloc type from 32bitcode possible 24, to 24bit @@ -1425,7 +1410,7 @@ b_out_bfd_get_relocated_section_contents (output_bfd, link_info, link_order, break; default: - abort(); + abort (); } } } @@ -1494,11 +1479,10 @@ const bfd_target b_out_vec_big_host = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), & b_out_vec_little_host, - + (PTR) 0, }; - const bfd_target b_out_vec_little_host = { "b.out.little", /* name */ @@ -1537,6 +1521,6 @@ const bfd_target b_out_vec_little_host = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), & b_out_vec_big_host, - + (PTR) 0 }; diff --git a/gnu/dist/toolchain/bfd/cache.c b/gnu/dist/toolchain/bfd/cache.c index 91b6c610854b..063373c7f425 100644 --- a/gnu/dist/toolchain/bfd/cache.c +++ b/gnu/dist/toolchain/bfd/cache.c @@ -1,5 +1,5 @@ /* BFD library -- caching of file descriptors. - Copyright 1990, 91, 92, 93, 94, 95, 1996, 2000 + Copyright 1990, 91, 92, 93, 94, 95, 1996, 2000, 2001 Free Software Foundation, Inc. Hacked by Steve Chamberlain of Cygnus Support (steve@cygnus.com). @@ -32,7 +32,7 @@ SECTION <>, which runs around and makes sure that the required BFD is open. If not, then it chooses a file to close, closes it and opens the one wanted, returning its file - handle. + handle. */ @@ -79,19 +79,18 @@ bfd *bfd_last_cache; /* INTERNAL_FUNCTION bfd_cache_lookup - + DESCRIPTION Check to see if the required BFD is the same as the last one looked up. If so, then it can use the stream in the BFD with impunity, since it can't have changed since the last lookup; otherwise, it has to perform the complicated lookup function. - + .#define bfd_cache_lookup(x) \ . ((x)==bfd_last_cache? \ - . (FILE*)(bfd_last_cache->iostream): \ + . (FILE*) (bfd_last_cache->iostream): \ . bfd_cache_lookup_worker(x)) - - + */ /* Insert a BFD into the cache. */ @@ -262,7 +261,7 @@ FILE * bfd_open_file (abfd) bfd *abfd; { - abfd->cacheable = true; /* Allow it to be closed later. */ + abfd->cacheable = true; /* Allow it to be closed later. */ if (open_files >= BFD_CACHE_MAX_OPEN) { @@ -312,7 +311,7 @@ bfd_open_file (abfd) if (stat (abfd->filename, &s) == 0 && s.st_size != 0) unlink (abfd->filename); #endif - abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WB); + abfd->iostream = (PTR) fopen (abfd->filename, FOPEN_WUB); abfd->opened_once = true; } break; @@ -339,7 +338,7 @@ DESCRIPTION quick answer. Find a file descriptor for @var{abfd}. If necessary, it open it. If there are already more than <> files open, it tries to close one first, to - avoid running out of file descriptors. + avoid running out of file descriptors. */ FILE * @@ -349,7 +348,7 @@ bfd_cache_lookup_worker (abfd) if ((abfd->flags & BFD_IN_MEMORY) != 0) abort (); - if (abfd->my_archive) + if (abfd->my_archive) abfd = abfd->my_archive; if (abfd->iostream != NULL) diff --git a/gnu/dist/toolchain/bfd/cisco-core.c b/gnu/dist/toolchain/bfd/cisco-core.c index 3492e75369c1..9d1fb6f20f75 100644 --- a/gnu/dist/toolchain/bfd/cisco-core.c +++ b/gnu/dist/toolchain/bfd/cisco-core.c @@ -72,7 +72,7 @@ struct cisco_core_struct }; /* Examine the file for a crash info struct at the offset given by - CRASH_INFO_LOC. */ + CRASH_INFO_LOC. */ static const bfd_target * cisco_core_file_validate (abfd, crash_info_loc) @@ -236,7 +236,7 @@ cisco_core_file_validate (abfd, crash_info_loc) abfd->section_count = 0; /* Create a ".reg" section to allow access to the saved - registers. */ + registers. */ asect = (asection *) bfd_zmalloc (sizeof (asection)); if (asect == NULL) @@ -247,7 +247,7 @@ cisco_core_file_validate (abfd, crash_info_loc) asect->filepos = bfd_get_32 (abfd, crashinfo.registers) - rambase; /* Since we don't know the exact size of the saved register info, choose a register section size that is either the remaining part - of the file, or 1024, whichever is smaller. */ + of the file, or 1024, whichever is smaller. */ nread = statbuf.st_size - asect->filepos; asect->_raw_size = (nread < 1024) ? nread : 1024; asect->next = abfd->sections; @@ -255,7 +255,7 @@ cisco_core_file_validate (abfd, crash_info_loc) ++abfd->section_count; /* Create a ".crash" section to allow access to the saved - crash information. */ + crash information. */ asect = (asection *) bfd_zmalloc (sizeof (asection)); if (asect == NULL) @@ -270,7 +270,7 @@ cisco_core_file_validate (abfd, crash_info_loc) ++abfd->section_count; /* Create a ".data" section that maps the entire file, which is - essentially a dump of the target system's RAM. */ + essentially a dump of the target system's RAM. */ asect = (asection *) bfd_zmalloc (sizeof (asection)); if (asect == NULL) @@ -288,7 +288,7 @@ cisco_core_file_validate (abfd, crash_info_loc) return abfd->xvec; /* Get here if we have already started filling out the BFD - and there is an error of some kind. */ + and there is an error of some kind. */ error_return: { @@ -378,7 +378,7 @@ const bfd_target cisco_core_big_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 (cisco), @@ -390,7 +390,7 @@ const bfd_target cisco_core_big_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), & cisco_core_little_vec, - + (PTR) 0 /* backend_data */ }; @@ -428,7 +428,7 @@ const bfd_target cisco_core_little_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 (cisco), @@ -440,6 +440,6 @@ const bfd_target cisco_core_little_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), &cisco_core_big_vec, - + (PTR) 0 /* backend_data */ }; diff --git a/gnu/dist/toolchain/bfd/coff-a29k.c b/gnu/dist/toolchain/bfd/coff-a29k.c index 0374b20b473b..343b81ebfcaa 100644 --- a/gnu/dist/toolchain/bfd/coff-a29k.c +++ b/gnu/dist/toolchain/bfd/coff-a29k.c @@ -1,5 +1,5 @@ /* BFD back-end for AMD 29000 COFF binaries. - Copyright 1990, 91, 92, 93, 94, 95, 97, 98, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 97, 98, 99, 2000 Free Software Foundation, Inc. Contributed by David Wood at New York University 7/8/91. @@ -43,27 +43,27 @@ static boolean coff_a29k_adjust_symndx #define INSERT_HWORD(WORD,HWORD) \ (((WORD) & 0xff00ff00) | (((HWORD) & 0xff00) << 8) | ((HWORD)& 0xff)) #define EXTRACT_HWORD(WORD) \ - ((((WORD) & 0x00ff0000) >> 8) | ((WORD)& 0xff)) + ((((WORD) & 0x00ff0000) >> 8) | ((WORD) & 0xff)) #define SIGN_EXTEND_HWORD(HWORD) \ - ((HWORD) & 0x8000 ? (HWORD)|(~0xffffL) : (HWORD)) + (((HWORD) ^ 0x8000) - 0x8000) /* Provided the symbol, returns the value reffed */ static long -get_symbol_value (symbol) +get_symbol_value (symbol) asymbol *symbol; -{ +{ long relocation = 0; if (bfd_is_com_section (symbol->section)) - { - relocation = 0; - } - else - { - relocation = symbol->value + - symbol->section->output_section->vma + - symbol->section->output_offset; - } + { + relocation = 0; + } + else + { + relocation = symbol->value + + symbol->section->output_section->vma + + symbol->section->output_offset; + } return(relocation); } @@ -93,130 +93,130 @@ a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, long signed_value; unsigned long addr = reloc_entry->address ; /*+ input_section->vma*/ - bfd_byte *hit_data =addr + (bfd_byte *)(data); - + bfd_byte *hit_data =addr + (bfd_byte *) (data); + r_type = reloc_entry->howto->type; - if (output_bfd) { - /* Partial linking - do nothing */ - reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; + if (output_bfd) + { + /* Partial linking - do nothing */ + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; - } + } if (symbol_in != NULL && bfd_is_und_section (symbol_in->section)) - { - /* Keep the state machine happy in case we're called again */ - if (r_type == R_IHIHALF) { - part1_consth_active = true; - part1_consth_value = 0; + /* Keep the state machine happy in case we're called again */ + if (r_type == R_IHIHALF) + { + part1_consth_active = true; + part1_consth_value = 0; + } + return(bfd_reloc_undefined); } - return(bfd_reloc_undefined); - } - - if ((part1_consth_active) && (r_type != R_IHCONST)) - { - part1_consth_active = false; - *error_message = (char *) _("Missing IHCONST"); - return(bfd_reloc_dangerous); - } + if ((part1_consth_active) && (r_type != R_IHCONST)) + { + part1_consth_active = false; + *error_message = (char *) _("Missing IHCONST"); + return(bfd_reloc_dangerous); + } sym_value = get_symbol_value(symbol_in); - switch (r_type) - { - case R_IREL: - insn = bfd_get_32(abfd, hit_data); - /* Take the value in the field and sign extend it */ - signed_value = EXTRACT_HWORD(insn); - signed_value = SIGN_EXTEND_HWORD(signed_value); - signed_value <<= 2; - - /* See the note on the R_IREL reloc in coff_a29k_relocate_section. */ - if (signed_value == - (long) reloc_entry->address) - signed_value = 0; - - signed_value += sym_value + reloc_entry->addend; - if ((signed_value & ~0x3ffff) == 0) - { /* Absolute jmp/call */ - insn |= (1<<24); /* Make it absolute */ - /* FIXME: Should we change r_type to R_IABS */ - } - else + switch (r_type) { - /* Relative jmp/call, so subtract from the value the - address of the place we're coming from */ - signed_value -= (reloc_entry->address - + input_section->output_section->vma - + input_section->output_offset); - if (signed_value>0x1ffff || signed_value<-0x20000) - return(bfd_reloc_overflow); - } - signed_value >>= 2; - insn = INSERT_HWORD(insn, signed_value); - bfd_put_32(abfd, insn ,hit_data); - break; - case R_ILOHALF: - insn = bfd_get_32(abfd, hit_data); - unsigned_value = EXTRACT_HWORD(insn); - unsigned_value += sym_value + reloc_entry->addend; - insn = INSERT_HWORD(insn, unsigned_value); - bfd_put_32(abfd, insn, hit_data); - break; - case R_IHIHALF: - insn = bfd_get_32(abfd, hit_data); - /* consth, part 1 - Just get the symbol value that is referenced */ - part1_consth_active = true; - part1_consth_value = sym_value + reloc_entry->addend; - /* Don't modify insn until R_IHCONST */ - break; - case R_IHCONST: - insn = bfd_get_32(abfd, hit_data); - /* consth, part 2 - Now relocate the reference */ - if (part1_consth_active == false) { - *error_message = (char *) _("Missing IHIHALF"); - return(bfd_reloc_dangerous); - } - /* sym_ptr_ptr = r_symndx, in coff_slurp_reloc_table() */ - unsigned_value = 0; /*EXTRACT_HWORD(insn) << 16;*/ - unsigned_value += reloc_entry->addend; /* r_symndx */ - unsigned_value += part1_consth_value; - unsigned_value = unsigned_value >> 16; - insn = INSERT_HWORD(insn, unsigned_value); - part1_consth_active = false; - bfd_put_32(abfd, insn, hit_data); - break; - case R_BYTE: - insn = bfd_get_8(abfd, hit_data); - unsigned_value = insn + sym_value + reloc_entry->addend; - if (unsigned_value & 0xffffff00) - return(bfd_reloc_overflow); - bfd_put_8(abfd, unsigned_value, hit_data); - break; - case R_HWORD: - insn = bfd_get_16(abfd, hit_data); - unsigned_value = insn + sym_value + reloc_entry->addend; - if (unsigned_value & 0xffff0000) - return(bfd_reloc_overflow); - bfd_put_16(abfd, insn, hit_data); - break; - case R_WORD: - insn = bfd_get_32(abfd, hit_data); - insn += sym_value + reloc_entry->addend; - bfd_put_32(abfd, insn, hit_data); - break; - default: - *error_message = _("Unrecognized reloc"); - return (bfd_reloc_dangerous); - } + case R_IREL: + insn = bfd_get_32 (abfd, hit_data); + /* Take the value in the field and sign extend it */ + signed_value = EXTRACT_HWORD(insn); + signed_value = SIGN_EXTEND_HWORD(signed_value); + signed_value <<= 2; + /* See the note on the R_IREL reloc in coff_a29k_relocate_section. */ + if (signed_value == - (long) reloc_entry->address) + signed_value = 0; - return(bfd_reloc_ok); + signed_value += sym_value + reloc_entry->addend; + if ((signed_value & ~0x3ffff) == 0) + { /* Absolute jmp/call */ + insn |= (1<<24); /* Make it absolute */ + /* FIXME: Should we change r_type to R_IABS */ + } + else + { + /* Relative jmp/call, so subtract from the value the + address of the place we're coming from */ + signed_value -= (reloc_entry->address + + input_section->output_section->vma + + input_section->output_offset); + if (signed_value>0x1ffff || signed_value<-0x20000) + return(bfd_reloc_overflow); + } + signed_value >>= 2; + insn = INSERT_HWORD(insn, signed_value); + bfd_put_32 (abfd, insn ,hit_data); + break; + case R_ILOHALF: + insn = bfd_get_32 (abfd, hit_data); + unsigned_value = EXTRACT_HWORD(insn); + unsigned_value += sym_value + reloc_entry->addend; + insn = INSERT_HWORD(insn, unsigned_value); + bfd_put_32 (abfd, insn, hit_data); + break; + case R_IHIHALF: + insn = bfd_get_32 (abfd, hit_data); + /* consth, part 1 + Just get the symbol value that is referenced */ + part1_consth_active = true; + part1_consth_value = sym_value + reloc_entry->addend; + /* Don't modify insn until R_IHCONST */ + break; + case R_IHCONST: + insn = bfd_get_32 (abfd, hit_data); + /* consth, part 2 + Now relocate the reference */ + if (part1_consth_active == false) + { + *error_message = (char *) _("Missing IHIHALF"); + return(bfd_reloc_dangerous); + } + /* sym_ptr_ptr = r_symndx, in coff_slurp_reloc_table() */ + unsigned_value = 0; /*EXTRACT_HWORD(insn) << 16;*/ + unsigned_value += reloc_entry->addend; /* r_symndx */ + unsigned_value += part1_consth_value; + unsigned_value = unsigned_value >> 16; + insn = INSERT_HWORD(insn, unsigned_value); + part1_consth_active = false; + bfd_put_32 (abfd, insn, hit_data); + break; + case R_BYTE: + insn = bfd_get_8 (abfd, hit_data); + unsigned_value = insn + sym_value + reloc_entry->addend; + if (unsigned_value & 0xffffff00) + return(bfd_reloc_overflow); + bfd_put_8 (abfd, unsigned_value, hit_data); + break; + case R_HWORD: + insn = bfd_get_16 (abfd, hit_data); + unsigned_value = insn + sym_value + reloc_entry->addend; + if (unsigned_value & 0xffff0000) + return(bfd_reloc_overflow); + bfd_put_16 (abfd, insn, hit_data); + break; + case R_WORD: + insn = bfd_get_32 (abfd, hit_data); + insn += sym_value + reloc_entry->addend; + bfd_put_32 (abfd, insn, hit_data); + break; + default: + *error_message = _("Unrecognized reloc"); + return (bfd_reloc_dangerous); + } + + return(bfd_reloc_ok); } /* type rightshift @@ -228,12 +228,12 @@ a29k_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, complain_on_overflow special_function relocation name - partial_inplace + partial_inplace src_mask */ /*FIXME: I'm not real sure about this table */ -static reloc_howto_type howto_table[] = +static reloc_howto_type howto_table[] = { {R_ABS, 0, 3, 32, false, 0, complain_overflow_bitfield,a29k_reloc,"ABS", true, 0xffffffff,0xffffffff, false}, EMPTY_HOWTO (1), @@ -282,49 +282,49 @@ reloc_processing (relent,reloc, symbols, abfd, section) bfd *abfd; asection *section; { - static bfd_vma ihihalf_vaddr = (bfd_vma) -1; + static bfd_vma ihihalf_vaddr = (bfd_vma) -1; - relent->address = reloc->r_vaddr; - relent->howto = howto_table + reloc->r_type; - if (reloc->r_type == R_IHCONST) - { + relent->address = reloc->r_vaddr; + relent->howto = howto_table + reloc->r_type; + if (reloc->r_type == R_IHCONST) + { /* The address of an R_IHCONST should always be the address of the immediately preceding R_IHIHALF. relocs generated by gas are correct, but relocs generated by High C are different (I can't figure out what the address means for High C). We can handle both gas and High C by ignoring the address here, and simply reusing the address saved for R_IHIHALF. */ - if (ihihalf_vaddr == (bfd_vma) -1) - abort (); - relent->address = ihihalf_vaddr; - ihihalf_vaddr = (bfd_vma) -1; - relent->addend = reloc->r_symndx; - relent->sym_ptr_ptr= bfd_abs_section_ptr->symbol_ptr_ptr; + if (ihihalf_vaddr == (bfd_vma) -1) + abort (); + relent->address = ihihalf_vaddr; + ihihalf_vaddr = (bfd_vma) -1; + relent->addend = reloc->r_symndx; + relent->sym_ptr_ptr= bfd_abs_section_ptr->symbol_ptr_ptr; } - else + else { asymbol *ptr; relent->sym_ptr_ptr = symbols + obj_convert(abfd)[reloc->r_symndx]; ptr = *(relent->sym_ptr_ptr); - if (ptr - && bfd_asymbol_bfd(ptr) == abfd + if (ptr + && bfd_asymbol_bfd(ptr) == abfd - && ((ptr->flags & BSF_OLD_COMMON)== 0)) - { + && ((ptr->flags & BSF_OLD_COMMON)== 0)) + { relent->addend = 0; - } + } else - { - relent->addend = 0; - } + { + relent->addend = 0; + } relent->address-= section->vma; if (reloc->r_type == R_IHIHALF) ihihalf_vaddr = relent->address; else if (ihihalf_vaddr != (bfd_vma) -1) abort (); - } + } } /* The reloc processing routine for the optimized COFF linker. */ @@ -570,7 +570,7 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section, rel->r_vaddr - input_section->vma))) return false; } - } + } return true; } @@ -580,7 +580,6 @@ coff_a29k_relocate_section (output_bfd, info, input_bfd, input_section, /* We don't want to change the symndx of a R_IHCONST reloc, since it is actually an addend, not a symbol index at all. */ -/*ARGSUSED*/ static boolean coff_a29k_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp) bfd *obfd ATTRIBUTE_UNUSED; diff --git a/gnu/dist/toolchain/bfd/coff-alpha.c b/gnu/dist/toolchain/bfd/coff-alpha.c index 6bbc279aeead..41e4710e5e44 100644 --- a/gnu/dist/toolchain/bfd/coff-alpha.c +++ b/gnu/dist/toolchain/bfd/coff-alpha.c @@ -924,7 +924,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, does not cause anything to happen, itself. */ rel->address += input_section->output_offset; break; - + case ALPHA_R_GPDISP: /* This marks the ldah of an ldah/lda pair which loads the gp register with the difference of the gp value and the @@ -980,7 +980,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, rel->address += input_section->output_offset; } break; - + case ALPHA_R_OP_PUSH: /* Push a value on the reloc evaluation stack. */ { @@ -1106,7 +1106,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, stack[tos - 1] >>= relocation; } break; - + case ALPHA_R_GPVALUE: /* I really don't know if this does the right thing. */ gp = rel->addend; @@ -1126,7 +1126,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, os->reloc_count++; } - if (r != bfd_reloc_ok) + if (r != bfd_reloc_ok) { switch (r) { @@ -1136,7 +1136,7 @@ alpha_ecoff_get_relocated_section_contents (abfd, link_info, link_order, input_bfd, input_section, rel->address, true))) goto error_return; break; - case bfd_reloc_dangerous: + case bfd_reloc_dangerous: if (! ((*link_info->callbacks->reloc_dangerous) (link_info, err, input_bfd, input_section, rel->address))) @@ -1332,7 +1332,7 @@ alpha_convert_external_reloc (output_bfd, info, input_bfd, ext_rel, h) r_symndx = RELOC_SECTION_XDATA; break; } - + if (r_symndx == -1) abort (); @@ -1437,7 +1437,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, pointer. To support large programs, we need to allow multiple global pointers. This works as long as each input .lita section is <64KB big. This implies that when producing relocatable - output, the .lita section is limited to 64KB. . */ + output, the .lita section is limited to 64KB. . */ lita_sec = symndx_to_section[RELOC_SECTION_LITA]; gp = _bfd_get_gp_value (output_bfd); @@ -1619,7 +1619,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, /* See ALPHA_R_LITERAL above for the uses of this reloc. It does not cause anything to happen, itself. */ break; - + case ALPHA_R_GPDISP: /* This marks the ldah of an ldah/lda pair which loads the gp register with the difference of the gp value and the @@ -1679,7 +1679,7 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, gp_usedp = true; } break; - + case ALPHA_R_OP_PUSH: case ALPHA_R_OP_PSUB: case ALPHA_R_OP_PRSHIFT: @@ -2008,7 +2008,6 @@ alpha_relocate_section (output_bfd, info, input_bfd, input_section, /* Do final adjustments to the filehdr and the aouthdr. This routine sets the dynamic bits in the file header. */ -/*ARGSUSED*/ static boolean alpha_adjust_headers (abfd, fhdr, ahdr) bfd *abfd; @@ -2136,7 +2135,7 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos) left = size; - /* I don't know what the next eight bytes are for. */ + /* I don't know what the next eight bytes are for. */ if (bfd_read (ab, 1, 8, nbfd) != 8) goto error_return; @@ -2201,7 +2200,7 @@ alpha_ecoff_get_elt_at_filepos (archive, filepos) error_return: if (nbfd != NULL) bfd_close (nbfd); - return NULL; + return NULL; } /* Open the next archived file. */ @@ -2229,7 +2228,7 @@ alpha_ecoff_openr_next_archived_file (archive, last_file) /* Pad to an even boundary... Note that last_file->origin can be odd in the case of - BSD-4.4-style element with a long odd size. */ + BSD-4.4-style element with a long odd size. */ filestart = last_file->origin + size; filestart += filestart % 2; } @@ -2266,7 +2265,7 @@ static const struct ecoff_backend_data alpha_ecoff_backend_data = (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */ alpha_ecoff_swap_filehdr_out, alpha_ecoff_swap_aouthdr_out, alpha_ecoff_swap_scnhdr_out, - FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4, + FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4, false, 2, alpha_ecoff_swap_filehdr_in, alpha_ecoff_swap_aouthdr_in, alpha_ecoff_swap_scnhdr_in, NULL, alpha_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook, @@ -2400,6 +2399,6 @@ const bfd_target ecoffalpha_little_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) &alpha_ecoff_backend_data }; diff --git a/gnu/dist/toolchain/bfd/coff-apollo.c b/gnu/dist/toolchain/bfd/coff-apollo.c index 6075d52b1e9e..7a28efa59fbd 100644 --- a/gnu/dist/toolchain/bfd/coff-apollo.c +++ b/gnu/dist/toolchain/bfd/coff-apollo.c @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifdef ONLY_DECLARE_RELOCS extern reloc_howto_type apollocoff_howto_table[]; #else -reloc_howto_type apollocoff_howto_table[] = +reloc_howto_type apollocoff_howto_table[] = { HOWTO(R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, 0, "8", true, 0x000000ff,0x000000ff, false), HOWTO(R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, 0, "16", true, 0x0000ffff,0x0000ffff, false), @@ -59,7 +59,7 @@ apollo_rtype2howto(internal, relocentry) arelent *internal; int relocentry; { - switch (relocentry) + switch (relocentry) { case R_RELBYTE: internal->howto = apollocoff_howto_table + 0; break; case R_RELWORD: internal->howto = apollocoff_howto_table + 1; break; @@ -71,13 +71,13 @@ apollo_rtype2howto(internal, relocentry) } } -int +int apollo_howto2rtype (internal) reloc_howto_type *internal; { - if (internal->pc_relative) + if (internal->pc_relative) { - switch (internal->bitsize) + switch (internal->bitsize) { case 32: return R_PCRLONG; case 16: return R_PCRWORD; @@ -93,7 +93,7 @@ apollo_howto2rtype (internal) case 8: return R_RELBYTE; } } - return R_RELLONG; + return R_RELLONG; } #endif /* not ONLY_DECLARE_RELOCS */ diff --git a/gnu/dist/toolchain/bfd/coff-arm.c b/gnu/dist/toolchain/bfd/coff-arm.c index 2b89b848c8cd..7ec7b8e7224f 100644 --- a/gnu/dist/toolchain/bfd/coff-arm.c +++ b/gnu/dist/toolchain/bfd/coff-arm.c @@ -51,13 +51,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef NUM_ELEM #define NUM_ELEM(a) ((sizeof (a)) / sizeof ((a)[0])) #endif - + typedef enum {bunknown, b9, b12, b23} thumb_pcrel_branchtype; /* some typedefs for holding instructions */ typedef unsigned long int insn32; typedef unsigned short int insn16; - /* Forward declarations for stupid compilers. */ static boolean coff_arm_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, @@ -77,7 +76,7 @@ static bfd_reloc_status_type coff_arm_reloc static boolean coff_arm_adjust_symndx PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, struct internal_reloc *, boolean *)); -static reloc_howto_type * coff_arm_rtype_to_howto +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 *)); static bfd_reloc_status_type coff_thumb_pcrel_common @@ -119,14 +118,14 @@ static boolean coff_arm_final_link_postscript 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. */ - + #define THUMB2ARM_GLUE_SECTION_NAME ".glue_7t" #define THUMB2ARM_GLUE_ENTRY_NAME "__%s_from_thumb" #define ARM2THUMB_GLUE_SECTION_NAME ".glue_7" #define ARM2THUMB_GLUE_ENTRY_NAME "__%s_from_arm" -/* Used by the assembler. */ +/* Used by the assembler. */ static bfd_reloc_status_type coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) @@ -232,14 +231,14 @@ coff_arm_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, #define ARM_SECREL 15 #endif -static reloc_howto_type aoutarm_std_reloc_howto[] = +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, + HOWTO (ARM_32, 0, - 2, + 2, 32, false, 0, @@ -250,9 +249,9 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 0xffffffff, 0xffffffff, PCRELOFFSET), - HOWTO (ARM_RVA32, + HOWTO (ARM_RVA32, 0, - 2, + 2, 32, false, 0, @@ -274,7 +273,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = "ARM_26", false, 0x00ffffff, - 0x00ffffff, + 0x00ffffff, PCRELOFFSET), HOWTO (ARM_THUMB12, 1, @@ -287,16 +286,16 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = "ARM_THUMB12", false, 0x000007ff, - 0x000007ff, + 0x000007ff, PCRELOFFSET), - HOWTO (ARM_26D, - 2, + HOWTO (ARM_26D, + 2, 2, 24, false, 0, complain_overflow_dont, - aoutarm_fix_pcrel_26_done, + aoutarm_fix_pcrel_26_done, "ARM_26D", true, 0x00ffffff, @@ -310,22 +309,22 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), EMPTY_HOWTO (-1), - HOWTO (ARM_SECTION, - 0, - 1, - 16, + HOWTO (ARM_SECTION, + 0, + 1, + 16, false, 0, complain_overflow_bitfield, coff_arm_reloc, - "ARM_16", + "ARM_16", true, 0x0000ffff, - 0x0000ffff, + 0x0000ffff, PCRELOFFSET), - HOWTO (ARM_SECREL, + HOWTO (ARM_SECREL, 0, - 2, + 2, 32, false, 0, @@ -350,22 +349,22 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 0x000000ff, /* src_mask */ 0x000000ff, /* dst_mask */ PCRELOFFSET /* pcrel_offset */), - HOWTO(ARM_16, - 0, - 1, - 16, + HOWTO(ARM_16, + 0, + 1, + 16, false, 0, complain_overflow_bitfield, coff_arm_reloc, - "ARM_16", + "ARM_16", true, 0x0000ffff, - 0x0000ffff, + 0x0000ffff, PCRELOFFSET), - HOWTO(ARM_32, + HOWTO(ARM_32, 0, - 2, + 2, 32, false, 0, @@ -387,28 +386,28 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = "ARM_26", false, 0x00ffffff, - 0x00ffffff, + 0x00ffffff, PCRELOFFSET), - HOWTO(ARM_DISP8, + HOWTO(ARM_DISP8, 0, 0, - 8, + 8, true, 0, - complain_overflow_signed, + complain_overflow_signed, coff_arm_reloc, - "ARM_DISP8", + "ARM_DISP8", true, 0x000000ff, 0x000000ff, true), - HOWTO( ARM_DISP16, + HOWTO( ARM_DISP16, 0, 1, 16, true, 0, - complain_overflow_signed, + complain_overflow_signed, coff_arm_reloc, "ARM_DISP16", true, @@ -421,21 +420,21 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 32, true, 0, - complain_overflow_signed, + complain_overflow_signed, coff_arm_reloc, "ARM_DISP32", true, 0xffffffff, 0xffffffff, true), - HOWTO( ARM_26D, - 2, + HOWTO( ARM_26D, + 2, 2, 24, false, 0, complain_overflow_dont, - aoutarm_fix_pcrel_26_done, + aoutarm_fix_pcrel_26_done, "ARM_26D", true, 0x00ffffff, @@ -448,16 +447,16 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = -1, 16, false, - 0, + 0, complain_overflow_bitfield, coff_arm_reloc, "ARM_NEG16", - true, + true, + 0x0000ffff, 0x0000ffff, - 0x0000ffff, false), - HOWTO( ARM_NEG32, - 0, + HOWTO( ARM_NEG32, + 0, -2, 32, false, @@ -469,9 +468,9 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = 0xffffffff, 0xffffffff, false), - HOWTO( ARM_RVA32, + HOWTO( ARM_RVA32, 0, - 2, + 2, 32, false, 0, @@ -493,7 +492,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = "ARM_THUMB9", false, 0x000000ff, - 0x000000ff, + 0x000000ff, PCRELOFFSET), HOWTO( ARM_THUMB12, 1, @@ -506,7 +505,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = "ARM_THUMB12", false, 0x000007ff, - 0x000007ff, + 0x000007ff, PCRELOFFSET), HOWTO( ARM_THUMB23, 1, @@ -519,7 +518,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = "ARM_THUMB23", false, 0x07ff07ff, - 0x07ff07ff, + 0x07ff07ff, PCRELOFFSET) #endif /* not ARM_WINCE */ }; @@ -528,7 +527,7 @@ static reloc_howto_type aoutarm_std_reloc_howto[] = #ifdef COFF_WITH_PE /* Return true if this relocation should - appear in the output .reloc section. */ + appear in the output .reloc section. */ static boolean in_reloc_p (abfd, howto) @@ -536,7 +535,7 @@ in_reloc_p (abfd, howto) reloc_howto_type * howto; { return !howto->pc_relative && howto->type != ARM_RVA32; -} +} #endif #define RTYPE2HOWTO(cache_ptr, dst) \ @@ -560,7 +559,7 @@ coff_arm_rtype_to_howto (abfd, sec, rel, h, sym, addendp) if (rel->r_type >= NUM_RELOCS) return NULL; - + howto = aoutarm_std_reloc_howto + rel->r_type; if (rel->r_type == ARM_RVA32) @@ -568,7 +567,7 @@ coff_arm_rtype_to_howto (abfd, sec, rel, h, sym, addendp) return howto; } -/* Used by the assembler. */ +/* Used by the assembler. */ static bfd_reloc_status_type aoutarm_fix_pcrel_26_done (abfd, reloc_entry, symbol, data, input_section, @@ -585,7 +584,7 @@ aoutarm_fix_pcrel_26_done (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_ok; } -/* Used by the assembler. */ +/* Used by the assembler. */ static bfd_reloc_status_type aoutarm_fix_pcrel_26 (abfd, reloc_entry, symbol, data, input_section, @@ -602,7 +601,7 @@ aoutarm_fix_pcrel_26 (abfd, reloc_entry, symbol, data, input_section, bfd_size_type addr = reloc_entry->address; 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 (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) @@ -623,7 +622,7 @@ aoutarm_fix_pcrel_26 (abfd, reloc_entry, symbol, data, input_section, relocation -= input_section->output_section->vma; relocation -= input_section->output_offset; relocation -= addr; - + if (relocation & 3) return bfd_reloc_overflow; @@ -693,7 +692,7 @@ coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, input_section, default: abort (); } - + /* If this is an undefined symbol, return error */ if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) @@ -768,7 +767,7 @@ coff_thumb_pcrel_common (abfd, reloc_entry, symbol, data, input_section, /* 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 */ return flag; } @@ -818,14 +817,13 @@ coff_thumb_pcrel_9 (abfd, reloc_entry, symbol, data, input_section, input_section, output_bfd, error_message, b9); } - static CONST struct reloc_howto_struct * coff_arm_reloc_type_lookup (abfd, code) bfd * abfd; bfd_reloc_code_real_type code; { #define ASTD(i,j) case i: return aoutarm_std_reloc_howto + j - + if (code == BFD_RELOC_CTOR) switch (bfd_get_arch_info (abfd)->bits_per_address) { @@ -847,6 +845,7 @@ coff_arm_reloc_type_lookup (abfd, code) ASTD (BFD_RELOC_16, ARM_16); ASTD (BFD_RELOC_32, ARM_32); ASTD (BFD_RELOC_ARM_PCREL_BRANCH, ARM_26); + ASTD (BFD_RELOC_ARM_PCREL_BLX, ARM_26); ASTD (BFD_RELOC_8_PCREL, ARM_DISP8); ASTD (BFD_RELOC_16_PCREL, ARM_DISP16); ASTD (BFD_RELOC_32_PCREL, ARM_DISP32); @@ -854,7 +853,7 @@ coff_arm_reloc_type_lookup (abfd, code) ASTD (BFD_RELOC_THUMB_PCREL_BRANCH9, ARM_THUMB9); ASTD (BFD_RELOC_THUMB_PCREL_BRANCH12, ARM_THUMB12); ASTD (BFD_RELOC_THUMB_PCREL_BRANCH23, ARM_THUMB23); -#endif +#endif default: return (CONST struct reloc_howto_struct *) 0; } } @@ -874,17 +873,17 @@ struct coff_arm_link_hash_table { /* 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 ARM-to-Thumb glue. */ long int arm_glue_size; /* An arbitary input BFD chosen to hold the glue sections. */ bfd * bfd_of_glue_owner; - /* Support interworking with old, non-interworking aware ARM code. */ + /* Support interworking with old, non-interworking aware ARM code. */ int support_old_code; }; @@ -939,16 +938,16 @@ arm_emit_base_file_entry (info, output_bfd, input_section, reloc_offset) /* The thumb form of a long branch is a bit finicky, because the offset encoding is split over two fields, each in it's own instruction. They - can occur in any order. So given a thumb form of long branch, and an + can occur in any order. So given a thumb form of long branch, and an offset, insert the offset into the thumb branch and return finished - instruction. + instruction. - It takes two thumb instructions to encode the target address. Each has + It takes two thumb instructions to encode the target address. Each has 11 bits to invest. The upper 11 bits are stored in one (identifed by - H-0.. see below), the lower 11 bits are stored in the other (identified - by H-1). + H-0.. see below), the lower 11 bits are stored in the other (identified + by H-1). - Combine together and shifted left by 1 (it's a half word address) and + Combine together and shifted left by 1 (it's a half word address) and there you have it. Op: 1111 = F, @@ -956,7 +955,7 @@ arm_emit_base_file_entry (info, output_bfd, input_section, reloc_offset) Op: 1111 = F, H-1, lower address-0 = 800 - They can be ordered either way, but the arm tools I've seen always put + They can be ordered either way, but the arm tools I've seen always put the lower one first. It probably doesn't matter. krk@cygnus.com XXX: Actually the order does matter. The second instruction (H-1) @@ -976,7 +975,6 @@ insert_thumb_branch (br_insn, rel_off) unsigned int low_bits; unsigned int high_bits; - BFD_ASSERT((rel_off & 1) != 1); rel_off >>= 1; /* half word aligned address */ @@ -988,13 +986,12 @@ 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 */ + abort (); /* error - not a valid branch instruction form */ /* FIXME: abort is probably not the right call. krk@cygnus.com */ return br_insn; } - static struct coff_link_hash_entry * find_thumb_glue (info, name, input_bfd) @@ -1011,15 +1008,15 @@ find_thumb_glue (info, name, input_bfd) BFD_ASSERT (tmp_name); sprintf (tmp_name, THUMB2ARM_GLUE_ENTRY_NAME, name); - + myh = coff_link_hash_lookup (coff_hash_table (info), tmp_name, false, false, true); - + 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); - + free (tmp_name); return myh; @@ -1040,7 +1037,7 @@ find_arm_glue (info, name, input_bfd) BFD_ASSERT (tmp_name); sprintf (tmp_name, ARM2THUMB_GLUE_ENTRY_NAME, name); - + myh = coff_link_hash_lookup (coff_hash_table (info), tmp_name, false, false, true); @@ -1048,7 +1045,7 @@ find_arm_glue (info, name, input_bfd) /* xgettext:c-format */ _bfd_error_handler (_("%s: unable to find ARM glue '%s' for `%s'"), bfd_get_filename (input_bfd), tmp_name, name); - + free (tmp_name); return myh; @@ -1085,7 +1082,7 @@ static const insn32 a2t3_func_addr_insn = 0x00000001; ldmia r13! {r6, lr} bx lr __func_addr: - .word func + .word func */ #define THUMB2ARM_GLUE_SIZE (globals->support_old_code ? 20 : 8) @@ -1128,10 +1125,10 @@ static const insn32 t2a6_bx_insn = 0xe12fff1e; instruction we should generate a trampoline stub (needed to address the complete 32bit address space). */ -/* The standard COFF backend linker does not cope with the special +/* The standard COFF backend linker does not cope with the special Thumb BRANCH23 relocation. The alternative would be to split the BRANCH23 into seperate HI23 and LO23 relocations. However, it is a - bit simpler simply providing our own relocation driver. */ + bit simpler simply providing our own relocation driver. */ /* The reloc processing routine for the ARM/Thumb COFF linker. NOTE: This code is a very slightly modified copy of @@ -1179,7 +1176,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, sym = NULL; } else - { + { h = obj_coff_sym_hashes (input_bfd)[symndx]; sym = syms + symndx; } @@ -1194,7 +1191,6 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, else addend = 0; - howto = coff_rtype_to_howto (input_bfd, input_section, rel, h, sym, &addend); if (howto == NULL) @@ -1212,7 +1208,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, || h->root.type == bfd_link_hash_defweak) && h->root.u.def.section->output_section == input_section->output_section) { - static reloc_howto_type fake_arm26_reloc = + static reloc_howto_type fake_arm26_reloc = HOWTO (ARM_26, 2, 2, @@ -1224,7 +1220,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, "ARM_26", false, 0x00ffffff, - 0x00ffffff, + 0x00ffffff, false); addend -= rel->r_vaddr - input_section->vma; @@ -1233,11 +1229,11 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, #ifdef ARM_WINCE /* MS ARM-CE makes the reloc relative to the opcode's pc, not - the next opcode's pc, so is off by one. */ + the next opcode's pc, so is off by one. */ if (howto->pc_relative && !info->relocateable) addend -= 8; #endif - + /* If we are doing a relocateable link, then we can just ignore a PC relative reloc that is pcrel_offset. It will already have the correct value. If this is not a relocateable link, @@ -1246,8 +1242,15 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, { if (info->relocateable) continue; +#if 0 /* 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 + the beginning of the symbol's section, so we must not cancel + out the symbol's value, otherwise we'll be adding it in + twice. */ if (sym != NULL && sym->n_scnum != 0) addend += sym->n_value; +#endif } val = 0; @@ -1277,14 +1280,14 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, relocatable output file, since we may as well leave the stub generation to the final linker pass. If we fail to verify that the name is defined, we'll try to build stubs - for an undefined name... */ + for an undefined name... */ if (! info->relocateable && ( h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak)) { asection * h_sec = h->root.u.def.section; const char * name = h->root.root.string; - + /* h locates the symbol referenced in the reloc. */ h_val = (h->root.u.def.value + h_sec->output_section->vma @@ -1300,9 +1303,9 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, long int my_offset; asection * s; long int ret_offset; - struct coff_link_hash_entry * myh; + struct coff_link_hash_entry * myh; struct coff_arm_link_hash_table * globals; - + myh = find_arm_glue (info, name, input_bfd); if (myh == NULL) return false; @@ -1311,10 +1314,10 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, BFD_ASSERT (globals != NULL); BFD_ASSERT (globals->bfd_of_glue_owner != NULL); - + my_offset = myh->root.u.def.value; - - s = bfd_get_section_by_name (globals->bfd_of_glue_owner, + + s = bfd_get_section_by_name (globals->bfd_of_glue_owner, ARM2THUMB_GLUE_SECTION_NAME); BFD_ASSERT (s != NULL); BFD_ASSERT (s->contents != NULL); @@ -1341,16 +1344,16 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, bfd_put_32 (output_bfd, a2t1_ldr_insn, s->contents + my_offset); - + bfd_put_32 (output_bfd, a2t2_bx_r12_insn, s->contents + my_offset + 4); - + /* It's a thumb address. Add the low order bit. */ bfd_put_32 (output_bfd, h_val | a2t3_func_addr_insn, s->contents + my_offset + 8); if (info->base_file) - arm_emit_base_file_entry (info, output_bfd, s, + arm_emit_base_file_entry (info, output_bfd, s, my_offset + 8); } @@ -1359,32 +1362,32 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, tmp = bfd_get_32 (input_bfd, contents + rel->r_vaddr - input_section->vma); - + tmp = tmp & 0xFF000000; - /* Somehow these are both 4 too far, so subtract 8. */ + /* Somehow these are both 4 too far, so subtract 8. */ ret_offset = s->output_offset - + my_offset + + my_offset + s->output_section->vma - (input_section->output_offset - + input_section->output_section->vma + + input_section->output_section->vma + rel->r_vaddr) - 8; tmp = tmp | ((ret_offset >> 2) & 0x00FFFFFF); - + bfd_put_32 (output_bfd, tmp, contents + rel->r_vaddr - input_section->vma); done = 1; } } - + #ifndef ARM_WINCE /* Note: We used to check for ARM_THUMB9 and ARM_THUMB12 */ else if (howto->type == ARM_THUMB23) { - if ( h->class == C_EXT + if ( h->class == C_EXT || h->class == C_STAT || h->class == C_LABEL) { @@ -1401,19 +1404,19 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, return false; globals = coff_arm_hash_table (info); - + BFD_ASSERT (globals != NULL); BFD_ASSERT (globals->bfd_of_glue_owner != NULL); - + my_offset = myh->root.u.def.value; - - s = bfd_get_section_by_name (globals->bfd_of_glue_owner, + + s = bfd_get_section_by_name (globals->bfd_of_glue_owner, THUMB2ARM_GLUE_SECTION_NAME); - + BFD_ASSERT (s != NULL); BFD_ASSERT (s->contents != NULL); BFD_ASSERT (s->output_section != NULL); - + if ((my_offset & 0x01) == 0x01) { if (h_sec->owner != NULL @@ -1432,7 +1435,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, _bfd_error_handler (_(" consider relinking with --support-old-code enabled")); } - + -- my_offset; myh->root.u.def.value = my_offset; @@ -1440,7 +1443,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, { bfd_put_16 (output_bfd, t2a1_push_insn, s->contents + my_offset); - + bfd_put_16 (output_bfd, t2a2_ldr_insn, s->contents + my_offset + 2); @@ -1449,13 +1452,13 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, bfd_put_16 (output_bfd, t2a4_bx_insn, s->contents + my_offset + 6); - + bfd_put_32 (output_bfd, t2a5_pop_insn, s->contents + my_offset + 8); - + bfd_put_32 (output_bfd, t2a6_bx_insn, s->contents + my_offset + 12); - + /* Store the address of the function in the last word of the stub. */ bfd_put_32 (output_bfd, h_val, s->contents + my_offset + 16); @@ -1467,10 +1470,10 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, { bfd_put_16 (output_bfd, t2a1_bx_pc_insn, s->contents + my_offset); - + bfd_put_16 (output_bfd, t2a2_noop_insn, s->contents + my_offset + 2); - + ret_offset = ((bfd_signed_vma) h_val) /* Address of destination of the stub */ - ((bfd_signed_vma) @@ -1479,7 +1482,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, + s->output_section->vma) /* Address of the start of the current section. */ + 4 /* The branch instruction is 4 bytes into the stub. */ + 8); /* ARM branches work from the pc of the instruction + 8. */ - + bfd_put_32 (output_bfd, t2a3_b_insn | ((ret_offset >> 2) & 0x00FFFFFF), s->contents + my_offset + 4); @@ -1497,7 +1500,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, - (input_section->output_offset + rel->r_vaddr) -4; - + tmp = bfd_get_32 (input_bfd, contents + rel->r_vaddr - input_section->vma); @@ -1505,20 +1508,20 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, insert_thumb_branch (tmp, ret_offset), contents + rel->r_vaddr - input_section->vma); - + done = 1; } } #endif } - + /* If the relocation type and destination symbol does not fall into one of the above categories, then we can just - perform a direct link. */ + perform a direct link. */ if (done) rstat = bfd_reloc_ok; - else + else #endif /* THUMBEXTENSION */ if ( h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) @@ -1542,11 +1545,11 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, if (info->base_file) { - /* Emit a reloc if the backend thinks it needs it. */ + /* 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); } - + #if 1 /* THUMBEXTENSION */ if (done) rstat = bfd_reloc_ok; @@ -1562,9 +1565,9 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, instruction. Again, it would probably be simpler adding a ThumbBRANCH23 specific macro expansion into the default code. */ - + bfd_vma address = rel->r_vaddr - input_section->vma; - + if (address > input_section->_raw_size) rstat = bfd_reloc_outofrange; else @@ -1583,21 +1586,21 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, bfd_signed_vma signed_add; BFD_ASSERT (size == 4); - + /* howto->pc_relative should be TRUE for type 14 BRANCH23 */ relocation -= (input_section->output_section->vma + input_section->output_offset); - + /* howto->pcrel_offset should be TRUE for type 14 BRANCH23 */ relocation -= address; - - /* No need to negate the relocation with BRANCH23. */ + + /* No need to negate the relocation with BRANCH23. */ /* howto->complain_on_overflow == complain_overflow_signed for BRANCH23. */ /* howto->rightshift == 1 */ /* Drop unwanted bits from the value we are relocating to. */ - + 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) @@ -1606,7 +1609,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, signed_check = (check | ((bfd_vma) - 1 & ~((bfd_vma) - 1 >> howto->rightshift))); - + /* Get the value from the object file. */ if (bfd_big_endian (input_bfd)) { @@ -1625,16 +1628,16 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, can not get the upper bit, but that does not matter since signed_add needs no adjustment to become negative in that case. */ - + signed_add = add; - + if ((add & (((~ src_mask) >> 1) & src_mask)) != 0) signed_add -= (((~ src_mask) >> 1) & src_mask) << 1; - + /* Add the value from the object file, shifted so that it is a straight number. */ /* howto->bitpos == 0 */ - + signed_check += signed_add; relocation += signed_add; @@ -1644,9 +1647,9 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, if ( signed_check > reloc_signed_max || signed_check < reloc_signed_min) overflow = true; - + /* Put RELOCATION into the correct bits: */ - + if (bfd_big_endian (input_bfd)) { relocation = (((relocation & 0xffe) >> 1) | ((relocation << 4) & 0x07ff0000)); @@ -1655,7 +1658,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, { relocation = (((relocation & 0xffe) << 15) | ((relocation >> 12) & 0x7ff)); } - + /* Add RELOCATION to the correct bits of X: */ x = ((x & ~howto->dst_mask) | relocation); @@ -1673,7 +1676,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, rel->r_vaddr - input_section->vma, val, addend); #if 1 /* THUMBEXTENSION */ - /* FIXME: + /* FIXME: Is this the best way to fix up thumb addresses? krk@cygnus.com Probably not, but it works, and if it works it don't need fixing! nickc@cygnus.com */ /* Only perform this fix during the final link, not a relocatable link. nickc@cygnus.com */ @@ -1682,9 +1685,9 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, { /* Determine if we need to set the bottom bit of a relocated address because the address is the address of a Thumb code symbol. */ - + int patchit = false; - + if (h != NULL && ( h->class == C_THUMBSTATFUNC || h->class == C_THUMBEXTFUNC)) @@ -1709,8 +1712,8 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, bfd_put_32 (input_bfd, x | 1, location); } } -#endif /* THUMBEXTENSION */ - +#endif /* THUMBEXTENSION */ + switch (rstat) { default: @@ -1754,7 +1757,7 @@ coff_arm_relocate_section (output_bfd, info, input_bfd, input_section, #ifndef COFF_IMAGE_WITH_PE boolean -bfd_arm_allocate_interworking_sections (info) +bfd_arm_allocate_interworking_sections (info) struct bfd_link_info * info; { asection * s; @@ -1765,24 +1768,24 @@ bfd_arm_allocate_interworking_sections (info) #endif globals = coff_arm_hash_table (info); - + BFD_ASSERT (globals != NULL); if (globals->arm_glue_size != 0) { BFD_ASSERT (globals->bfd_of_glue_owner != NULL); - + 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); #if 0 memset (foo, test_char, globals->arm_glue_size); #endif - + s->_raw_size = s->_cooked_size = globals->arm_glue_size; s->contents = foo; } @@ -1790,18 +1793,18 @@ bfd_arm_allocate_interworking_sections (info) if (globals->thumb_glue_size != 0) { BFD_ASSERT (globals->bfd_of_glue_owner != NULL); - + s = bfd_get_section_by_name (globals->bfd_of_glue_owner, THUMB2ARM_GLUE_SECTION_NAME); BFD_ASSERT (s != NULL); - + foo = (bfd_byte *) bfd_alloc (globals->bfd_of_glue_owner, globals->thumb_glue_size); #if 0 memset (foo, test_char, globals->thumb_glue_size); #endif - + s->_raw_size = s->_cooked_size = globals->thumb_glue_size; s->contents = foo; } @@ -1836,10 +1839,10 @@ record_arm_to_thumb_glue (info, h) BFD_ASSERT (tmp_name); sprintf (tmp_name, ARM2THUMB_GLUE_ENTRY_NAME, name); - + myh = coff_link_hash_lookup (coff_hash_table (info), tmp_name, false, false, true); - + if (myh != NULL) { free (tmp_name); @@ -1851,13 +1854,13 @@ record_arm_to_thumb_glue (info, h) it. */ bfd_coff_link_add_one_symbol (info, globals->bfd_of_glue_owner, tmp_name, - BSF_GLOBAL, + BSF_GLOBAL, s, globals->arm_glue_size + 1, - NULL, true, false, + NULL, true, false, (struct bfd_link_hash_entry **) & myh); - + free (tmp_name); - + globals->arm_glue_size += ARM2THUMB_GLUE_SIZE; return; @@ -1874,9 +1877,8 @@ record_thumb_to_arm_glue (info, h) struct coff_link_hash_entry * myh; struct coff_arm_link_hash_table * globals; - globals = coff_arm_hash_table (info); - + BFD_ASSERT (globals != NULL); BFD_ASSERT (globals->bfd_of_glue_owner != NULL); @@ -1893,7 +1895,7 @@ record_thumb_to_arm_glue (info, h) myh = coff_link_hash_lookup (coff_hash_table (info), tmp_name, false, false, true); - + if (myh != NULL) { free (tmp_name); @@ -1902,35 +1904,35 @@ record_thumb_to_arm_glue (info, h) 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, + 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; free (tmp_name); /* Allocate another symbol to mark where we switch to arm mode. */ - + #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); - + BFD_ASSERT (tmp_name); - + sprintf (tmp_name, globals->support_old_code ? BACK_FROM_ARM : CHANGE_TO_ARM, name); myh = NULL; - + 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, + NULL, true, false, (struct bfd_link_hash_entry **) & myh); - free (tmp_name); - + free (tmp_name); + globals->thumb_glue_size += THUMB2ARM_GLUE_SIZE; return; @@ -1948,27 +1950,27 @@ bfd_arm_get_bfd_for_interworking (abfd, info) struct coff_arm_link_hash_table * globals; flagword flags; asection * sec; - + /* If we are only performing a partial link do not bother getting a bfd to hold the glue. */ if (info->relocateable) return true; - + globals = coff_arm_hash_table (info); - + BFD_ASSERT (globals != NULL); if (globals->bfd_of_glue_owner != NULL) return true; - + sec = bfd_get_section_by_name (abfd, ARM2THUMB_GLUE_SECTION_NAME); - - if (sec == NULL) + + if (sec == NULL) { flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY; - + sec = bfd_make_section (abfd, ARM2THUMB_GLUE_SECTION_NAME); - + if (sec == NULL || ! bfd_set_section_flags (abfd, sec, flags) || ! bfd_set_section_alignment (abfd, sec, 2)) @@ -1977,21 +1979,21 @@ bfd_arm_get_bfd_for_interworking (abfd, info) sec = bfd_get_section_by_name (abfd, THUMB2ARM_GLUE_SECTION_NAME); - if (sec == NULL) + if (sec == NULL) { flags = SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY; - + sec = bfd_make_section (abfd, THUMB2ARM_GLUE_SECTION_NAME); - + if (sec == NULL || ! bfd_set_section_flags (abfd, sec, flags) || ! bfd_set_section_alignment (abfd, sec, 2)) return false; } - + /* Save the bfd for later use. */ globals->bfd_of_glue_owner = abfd; - + return true; } @@ -2008,19 +2010,19 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) to construct any glue. */ if (info->relocateable) return true; - + /* Here we have a bfd that is to be included on the link. We have a hook to do reloc rummaging, before section sizes are nailed down. */ _bfd_coff_get_external_symbols (abfd); globals = coff_arm_hash_table (info); - + BFD_ASSERT (globals != NULL); BFD_ASSERT (globals->bfd_of_glue_owner != NULL); globals->support_old_code = support_old_code; - + /* Rummage around all the relocs and map the glue vectors. */ sec = abfd->sections; @@ -2032,17 +2034,17 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) struct internal_reloc * i; struct internal_reloc * rel; - if (sec->reloc_count == 0) + if (sec->reloc_count == 0) continue; /* Load the relocs. */ - /* FIXME: there may be a storage leak here. */ - + /* FIXME: there may be a storage leak here. */ + i = _bfd_coff_read_internal_relocs (abfd, sec, 1, 0, 0, 0); - + BFD_ASSERT (i != 0); - for (rel = i; rel < i + sec->reloc_count; ++rel) + for (rel = i; rel < i + sec->reloc_count; ++rel) { unsigned short r_type = rel->r_type; long symndx; @@ -2050,7 +2052,7 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) symndx = rel->r_symndx; - /* If the relocation is not against a symbol it cannot concern us. */ + /* If the relocation is not against a symbol it cannot concern us. */ if (symndx == -1) continue; @@ -2061,7 +2063,7 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) bfd_get_filename (abfd), symndx); continue; } - + h = obj_coff_sym_hashes (abfd)[symndx]; /* If the relocation is against a static symbol it must be within @@ -2075,11 +2077,11 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) /* This one is a call from arm code. We need to look up the target of the call. If it is a thumb target, we insert glue. */ - + if (h->class == C_THUMBEXTFUNC) record_arm_to_thumb_glue (info, h); break; - + #ifndef ARM_WINCE case ARM_THUMB23: /* This one is a call from thumb code. We used to look @@ -2102,7 +2104,7 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) } break; #endif - + default: break; } @@ -2126,7 +2128,6 @@ bfd_arm_process_before_allocation (abfd, info, support_old_code) #define coff_bfd_copy_private_bfd_data coff_arm_copy_private_bfd_data #define coff_bfd_link_hash_table_create coff_arm_link_hash_table_create - /* When doing a relocateable link, we want to convert ARM26 relocs into ARM26D relocs. */ @@ -2194,7 +2195,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) bfd_set_error (bfd_error_wrong_format); return false; } - + if (APCS_FLOAT_FLAG (obfd) != APCS_FLOAT_FLAG (ibfd)) { const char *msg; @@ -2205,14 +2206,14 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) else /* 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_get_filename (obfd)); bfd_set_error (bfd_error_wrong_format); return false; } - + if (PIC_FLAG (obfd) != PIC_FLAG (ibfd)) { const char * msg; @@ -2233,7 +2234,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) else { SET_APCS_FLAGS (obfd, APCS_26_FLAG (ibfd) | APCS_FLOAT_FLAG (ibfd) | PIC_FLAG (ibfd)); - + /* Set up the arch and fields as well as these are probably wrong. */ bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), bfd_get_mach (ibfd)); } @@ -2255,7 +2256,7 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) else /* xgettext: c-format */ msg = _("Warning: input file %s does not support interworking, whereas %s does."); - + _bfd_error_handler (msg, bfd_get_filename (ibfd), bfd_get_filename (obfd)); } @@ -2269,7 +2270,6 @@ coff_arm_merge_private_bfd_data (ibfd, obfd) return true; } - /* Display the flags field. */ static boolean @@ -2278,12 +2278,12 @@ coff_arm_print_private_bfd_data (abfd, ptr) PTR ptr; { FILE * file = (FILE *) ptr; - + BFD_ASSERT (abfd != NULL && ptr != NULL); - + /* xgettext:c-format */ fprintf (file, _("private flags = %x:"), coff_data (abfd)->flags); - + if (APCS_SET (abfd)) { /* xgettext: APCS is ARM Prodecure Call Standard, it should not be translated. */ @@ -2299,20 +2299,19 @@ coff_arm_print_private_bfd_data (abfd, ptr) else fprintf (file, _(" [absolute position]")); } - + if (! INTERWORK_SET (abfd)) fprintf (file, _(" [interworking flag not initialised]")); else if (INTERWORK_FLAG (abfd)) fprintf (file, _(" [interworking supported]")); else fprintf (file, _(" [interworking not supported]")); - + fputc ('\n', file); - + return true; } - /* Copies the given flags into the coff_tdata.flags field. Typically these flags come from the f_flags[] field of the COFF filehdr structure, which contains important, @@ -2330,7 +2329,7 @@ _bfd_coff_arm_set_private_flags (abfd, flags) BFD_ASSERT (abfd != NULL); flag = (flags & F_APCS26) ? F_APCS_26 : 0; - + /* Make sure that the APCS field has not been initialised to the opposite value. */ if (APCS_SET (abfd) @@ -2341,11 +2340,11 @@ _bfd_coff_arm_set_private_flags (abfd, flags) return false; flag |= (flags & (F_APCS_FLOAT | F_PIC)); - + SET_APCS_FLAGS (abfd, flag); flag = (flags & F_INTERWORK); - + /* If the BFD has already had its interworking flag set, but it is different from the value that we have been asked to set, then assume that that merged code will not support interworking @@ -2368,7 +2367,6 @@ _bfd_coff_arm_set_private_flags (abfd, flags) return true; } - /* Copy the important parts of the target specific data from one instance of a BFD to another. */ @@ -2378,7 +2376,7 @@ coff_arm_copy_private_bfd_data (src, dest) bfd * dest; { BFD_ASSERT (src != NULL && dest != NULL); - + if (src == dest) return true; @@ -2395,10 +2393,10 @@ coff_arm_copy_private_bfd_data (src, dest) /* If the src and dest have different APCS flag bits set, fail. */ if (APCS_26_FLAG (dest) != APCS_26_FLAG (src)) return false; - + if (APCS_FLOAT_FLAG (dest) != APCS_FLOAT_FLAG (src)) return false; - + if (PIC_FLAG (dest) != PIC_FLAG (src)) return false; } @@ -2422,7 +2420,7 @@ coff_arm_copy_private_bfd_data (src, dest) bfd_get_filename (dest), bfd_get_filename (src)); } - + SET_INTERWORK_FLAG (dest, 0); } } @@ -2436,8 +2434,8 @@ coff_arm_copy_private_bfd_data (src, dest) } /* Note: the definitions here of LOCAL_LABEL_PREFIX and USER_LABEL_PREIFX - *must* match the definitions in gcc/config/arm/coff.h and semi.h */ -#define LOCAL_LABEL_PREFIX "." + *must* match the definitions in gcc/config/arm/{coff|semi|aout}.h. */ +#define LOCAL_LABEL_PREFIX "" #ifndef USER_LABEL_PREFIX #define USER_LABEL_PREFIX "_" #endif @@ -2462,28 +2460,28 @@ coff_arm_is_local_label_name (abfd, name) #ifdef LOCAL_LABEL_PREFIX /* If there is a prefix for local labels then look for this. - If the prefix exists, but it is empty, then ignore the test. */ - + If the prefix exists, but it is empty, then ignore the test. */ + if (LOCAL_LABEL_PREFIX[0] != 0) { int len = strlen (LOCAL_LABEL_PREFIX); - + if (strncmp (name, LOCAL_LABEL_PREFIX, len) != 0) return false; - + /* Perform the checks below for the rest of the name. */ name += len; } #endif - + return name[0] == 'L'; } /* This piece of machinery exists only to guarantee that the bfd that holds - the glue section is written last. + the glue section is written last. This does depend on bfd_make_section attaching a new section to the - end of the section list for the bfd. + end of the section list for the bfd. krk@cygnus.com */ @@ -2504,17 +2502,17 @@ coff_arm_final_link_postscript (abfd, pfinfo) struct coff_arm_link_hash_table * globals; globals = coff_arm_hash_table (pfinfo->info); - + BFD_ASSERT (globals != NULL); - + if (globals->bfd_of_glue_owner != NULL) { if (! _bfd_coff_link_input_bfd (pfinfo, globals->bfd_of_glue_owner)) return false; - + globals->bfd_of_glue_owner->output_has_begun = true; } - + return true; } @@ -2537,11 +2535,13 @@ coff_arm_final_link_postscript (abfd, pfinfo) #define TARGET_UNDERSCORE 0 #endif +#ifndef EXTRA_S_FLAGS #ifdef COFF_WITH_PE #define EXTRA_S_FLAGS (SEC_LINK_ONCE | SEC_LINK_DUPLICATES) #else #define EXTRA_S_FLAGS 0 #endif +#endif /* Forward declaration for use initialising alternative_target field. */ extern const bfd_target TARGET_BIG_SYM ; @@ -2549,4 +2549,3 @@ extern const bfd_target TARGET_BIG_SYM ; /* Target vectors. */ CREATE_LITTLE_COFF_TARGET_VEC (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, D_PAGED, EXTRA_S_FLAGS, TARGET_UNDERSCORE, & TARGET_BIG_SYM) CREATE_BIG_COFF_TARGET_VEC (TARGET_BIG_SYM, TARGET_BIG_NAME, D_PAGED, EXTRA_S_FLAGS, TARGET_UNDERSCORE, & TARGET_LITTLE_SYM) - diff --git a/gnu/dist/toolchain/bfd/coff-aux.c b/gnu/dist/toolchain/bfd/coff-aux.c index 6966392a33bc..5bc9b8be9a64 100644 --- a/gnu/dist/toolchain/bfd/coff-aux.c +++ b/gnu/dist/toolchain/bfd/coff-aux.c @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* 4k pages */ #define COFF_PAGE_SIZE 0x1000 -/* On AUX, a STYP_NOLOAD|STYP_BSS section is part of a shared library. */ +/* On AUX, a STYP_NOLOAD|STYP_BSS section is part of a shared library. */ #define BSS_NOLOAD_IS_SHARED_LIBRARY #define STATIC_RELOCS @@ -41,8 +41,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" static boolean coff_m68k_aux_link_add_one_symbol - PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, - asection *, bfd_vma, const char *, boolean, boolean, + PARAMS ((struct bfd_link_info *, bfd *, const char *, flagword, + asection *, bfd_vma, const char *, boolean, boolean, struct bfd_link_hash_entry **)); #define coff_link_add_one_symbol coff_m68k_aux_link_add_one_symbol @@ -54,7 +54,7 @@ static boolean coff_m68k_aux_link_add_one_symbol mirrors Apple's "solution" to let a static library symbol override a shared library symbol. On the whole not a good thing, given how shared libraries work here, but can work if you are careful with - what you include in the shared object. */ + what you include in the shared object. */ static boolean coff_m68k_aux_link_add_one_symbol (info, abfd, name, flags, section, value, diff --git a/gnu/dist/toolchain/bfd/coff-go32.c b/gnu/dist/toolchain/bfd/coff-go32.c index 720f4be14246..7c40ba9262fe 100644 --- a/gnu/dist/toolchain/bfd/coff-go32.c +++ b/gnu/dist/toolchain/bfd/coff-go32.c @@ -1,5 +1,6 @@ /* BFD back-end for Intel 386 COFF files (DJGPP variant). - Copyright 1990, 91, 92, 93, 94, 1999, 2000 Free Software Foundation, Inc. + Copyright 1990, 91, 92, 93, 94, 1999, 2000, + 2001 Free Software Foundation, Inc. Written by DJ Delorie. This file is part of BFD, the Binary File Descriptor library. @@ -23,14 +24,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define TARGET_UNDERSCORE '_' #define COFF_LONG_SECTION_NAMES #define COFF_SUPPORT_GNU_LINKONCE +#define COFF_LONG_FILENAMES #define COFF_SECTION_ALIGNMENT_ENTRIES \ { COFF_SECTION_NAME_EXACT_MATCH (".data"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".text"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ -{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \ - COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.d"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_PARTIAL_MATCH (".gnu.linkonce.t"), \ diff --git a/gnu/dist/toolchain/bfd/coff-h8300.c b/gnu/dist/toolchain/bfd/coff-h8300.c index c86c4b944226..d0287b779956 100644 --- a/gnu/dist/toolchain/bfd/coff-h8300.c +++ b/gnu/dist/toolchain/bfd/coff-h8300.c @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (1) /* We derive a hash table from the basic BFD hash table to - hold entries in the function vector. Aside from the + hold entries in the function vector. Aside from the info stored by the basic hash table, we need the offset of a particular entry within the hash table as well as the offset where we'll add the next entry. */ @@ -196,7 +196,7 @@ h8300_coff_link_hash_table_create (abfd) We only come here for pcrel stuff and return normally if not an -r link. When doing -r, we can't do any arithmetic for the pcrel stuff, because the code in reloc.c assumes that we can manipulate the targets of - the pcrel branches. This isn't so, since the H8/300 can do relaxing, + the pcrel branches. This isn't so, since the H8/300 can do relaxing, which means that the gap after the instruction may not be enough to contain the offset required for the branch, so we have to use only the addend until the final link. */ @@ -255,8 +255,7 @@ static reloc_howto_type howto_table[] = HOWTO (R_JMP_DEL, 0, 0, 8, true, 0, complain_overflow_signed, special, "Deleted jump", false, 0x000000ff, 0x000000ff, true), }; - -/* Turn a howto into a reloc number */ +/* Turn a howto into a reloc number. */ #define SELECT_RELOC(x,howto) \ { x.r_type = select_reloc(howto); } @@ -265,16 +264,13 @@ static reloc_howto_type howto_table[] = #define H8300 1 /* Customize coffcode.h */ #define __A_MAGIC_SET__ - - -/* Code to swap in the reloc */ +/* Code to swap in the reloc. */ #define SWAP_IN_RELOC_OFFSET bfd_h_get_32 #define SWAP_OUT_RELOC_OFFSET bfd_h_put_32 #define SWAP_OUT_RELOC_EXTRA(abfd, src, dst) \ dst->r_stuff[0] = 'S'; \ dst->r_stuff[1] = 'C'; - static int select_reloc (howto) reloc_howto_type *howto; @@ -282,8 +278,7 @@ select_reloc (howto) return howto->type; } -/* Code to turn a r_type into a howto ptr, uses the above howto table - */ +/* Code to turn a r_type into a howto ptr, uses the above howto table. */ static void rtype2howto (internal, dst) @@ -360,24 +355,21 @@ rtype2howto (internal, dst) #define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry) - -/* Perform any necessary magic to the addend in a reloc entry */ - +/* Perform any necessary magic to the addend in a reloc entry. */ #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \ cache_ptr->addend = ext_reloc.r_offset; - #define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \ reloc_processing(relent, reloc, symbols, abfd, section) static void reloc_processing (relent, reloc, symbols, abfd, section) - arelent * relent; + arelent *relent; struct internal_reloc *reloc; - asymbol ** symbols; - bfd * abfd; - asection * section; + asymbol **symbols; + bfd *abfd; + asection *section; { relent->address = reloc->r_vaddr; rtype2howto (relent, reloc); @@ -391,12 +383,12 @@ reloc_processing (relent, reloc, symbols, abfd, section) relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; } - - relent->addend = reloc->r_offset; relent->address -= section->vma; - /* relent->section = 0;*/ +#if 0 + relent->section = 0; +#endif } static boolean @@ -412,7 +404,7 @@ h8300_symbol_address_p (abfd, input_section, address) /* Search all the symbols for one in INPUT_SECTION with address ADDRESS. */ - while (*s) + while (*s) { asymbol *p = *s; if (p->section == input_section @@ -421,11 +413,10 @@ h8300_symbol_address_p (abfd, input_section, address) + p->value) == address) return true; s++; - } + } return false; } - /* If RELOC represents a relaxable instruction/reloc, change it into the relaxed reloc, notify the linker that symbol addresses have changed (bfd_perform_slip) and return how much the current @@ -435,20 +426,20 @@ h8300_symbol_address_p (abfd, input_section, address) in the howto table. This needs to be fixed. */ static int -h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) +h8300_reloc16_estimate (abfd, input_section, reloc, shrink, link_info) bfd *abfd; asection *input_section; arelent *reloc; unsigned int shrink; struct bfd_link_info *link_info; { - bfd_vma value; + bfd_vma value; bfd_vma dot; bfd_vma gap; static asection *last_input_section = NULL; static arelent *last_reloc = NULL; - /* The address of the thing to be relocated will have moved back by + /* The address of the thing to be relocated will have moved back by the size of the shrink - but we don't change reloc->address here, since we need it to know where the relocation lives in the source uncooked section. */ @@ -459,14 +450,13 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) /* Only examine the relocs which might be relaxable. */ switch (reloc->howto->type) - { - + { /* This is the 16/24 bit absolute branch which could become an 8 bit pc-relative branch. */ case R_JMP1: case R_JMPL1: /* Get the address of the target of this branch. */ - value = bfd_coff_reloc16_get_value(reloc, link_info, input_section); + value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); /* Get the address of the next instruction (not the reloc). */ dot = (input_section->output_section->vma @@ -477,13 +467,12 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) /* Compute the distance from this insn to the branch target. */ gap = value - dot; - + /* If the distance is within -128..+128 inclusive, then we can relax this jump. +128 is valid since the target will move two bytes closer if we do relax this branch. */ if ((int)gap >= -128 && (int)gap <= 128 ) - { - + { /* It's possible we may be able to eliminate this branch entirely; if the previous instruction is a branch around this instruction, and there's no label at this instruction, then we can reverse @@ -493,7 +482,7 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) bCC lab1 bCC' lab2 jmp lab2 lab1: lab1: - + This saves 4 bytes instead of two, and should be relatively common. */ @@ -507,7 +496,7 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) if (last_value == dot + 2 && last_reloc->address + 1 == reloc->address - && ! h8300_symbol_address_p (abfd, input_section, dot - 2)) + && !h8300_symbol_address_p (abfd, input_section, dot - 2)) { reloc->howto = howto_table + 19; last_reloc->howto = howto_table + 18; @@ -520,11 +509,11 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) } /* Change the reloc type. */ - reloc->howto = reloc->howto + 1; + reloc->howto = reloc->howto + 1; /* This shrinks this section by two bytes. */ shrink += 2; - bfd_perform_slip(abfd, 2, input_section, address); + bfd_perform_slip (abfd, 2, input_section, address); } break; @@ -533,12 +522,12 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) case R_PCRWORD: /* Get the address of the target of this branch, add one to the value because the addend field in PCrel jumps is off by -1. */ - value = bfd_coff_reloc16_get_value(reloc, link_info, input_section) + 1; - + value = bfd_coff_reloc16_get_value (reloc, link_info, input_section) + 1; + /* Get the address of the next instruction if we were to relax. */ dot = input_section->output_section->vma + input_section->output_offset + address; - + /* Compute the distance from this insn to the branch target. */ gap = value - dot; @@ -546,13 +535,13 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) this jump. +128 is valid since the target will move two bytes closer if we do relax this branch. */ if ((int)gap >= -128 && (int)gap <= 128 ) - { + { /* Change the reloc type. */ reloc->howto = howto_table + 15; /* This shrinks this section by two bytes. */ shrink += 2; - bfd_perform_slip(abfd, 2, input_section, address); + bfd_perform_slip (abfd, 2, input_section, address); } break; @@ -560,7 +549,7 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) become an 8 bit absolute address if it's in the right range. */ case R_MOV16B1: /* Get the address of the data referenced by this mov.b insn. */ - value = bfd_coff_reloc16_get_value(reloc, link_info, input_section); + value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); /* The address is in 0xff00..0xffff inclusive on the h8300 or 0xffff00..0xffffff inclusive on the h8300h, then we can @@ -578,7 +567,7 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) /* This shrinks this section by two bytes. */ shrink += 2; - bfd_perform_slip(abfd, 2, input_section, address); + bfd_perform_slip (abfd, 2, input_section, address); } break; @@ -587,7 +576,7 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) and try to relax it into a 16bit absolute. */ case R_MOV24B1: /* Get the address of the data referenced by this mov.b insn. */ - value = bfd_coff_reloc16_get_value(reloc, link_info, input_section); + value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); /* The address is in 0xffff00..0xffffff inclusive on the h8300h, then we can relax this mov.b */ @@ -601,7 +590,7 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) /* This shrinks this section by four bytes. */ shrink += 4; - bfd_perform_slip(abfd, 4, input_section, address); + bfd_perform_slip (abfd, 4, input_section, address); /* Done with this reloc. */ break; @@ -614,7 +603,7 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) become an 16 bit absolute address if it's in the right range. */ case R_MOVL1: /* Get the address of the data referenced by this mov insn. */ - value = bfd_coff_reloc16_get_value(reloc, link_info, input_section); + value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); /* If this address is in 0x0000..0x7fff inclusive or 0xff8000..0xffffff inclusive, then it can be relaxed. */ @@ -625,13 +614,13 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) /* This shrinks this section by two bytes. */ shrink += 2; - bfd_perform_slip(abfd, 2, input_section, address); + bfd_perform_slip (abfd, 2, input_section, address); } break; /* No other reloc types represent relaxing opportunities. */ - default: - break; + default: + break; } last_reloc = reloc; @@ -639,7 +628,6 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) return shrink; } - /* Handle relocations for the H8/300, including relocs for relaxed instructions. @@ -661,18 +649,17 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, asection *input_section = link_order->u.indirect.section; bfd_vma value; bfd_vma dot; - int gap,tmp; + int gap, tmp; switch (reloc->howto->type) { - /* Generic 8bit pc-relative relocation. */ case R_PCRBYTE: /* Get the address of the target of this branch. */ - value = bfd_coff_reloc16_get_value(reloc, link_info, input_section); + value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); - dot = (link_order->offset - + dst_address + dot = (link_order->offset + + dst_address + link_order->u.indirect.section->output_section->vma); gap = value - dot; @@ -700,11 +687,11 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, /* Generic 16bit pc-relative relocation. */ case R_PCRWORD: /* Get the address of the target of this branch. */ - value = bfd_coff_reloc16_get_value(reloc, link_info, input_section); + value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); /* Get the address of the instruction (not the reloc). */ - dot = (link_order->offset - + dst_address + dot = (link_order->offset + + dst_address + link_order->u.indirect.section->output_section->vma + 1); gap = value - dot; @@ -763,7 +750,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, case R_MOV16B1: case R_JMP1: case R_RELWORD: - value = bfd_coff_reloc16_get_value(reloc, link_info, input_section); + value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); bfd_put_16 (abfd, value, data + dst_address); dst_address += 2; src_address += 2; @@ -774,7 +761,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, case R_MOVL1: case R_RELLONG: /* Get the address of the target of this branch. */ - value = bfd_coff_reloc16_get_value (reloc, link_info, input_section), + value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); bfd_put_32 (abfd, value, data + dst_address); dst_address += 4; src_address += 4; @@ -921,7 +908,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, src_address += 2; break; - + /* Similarly for a 24bit absolute that is now 8 bits. */ case R_JMPL2: /* Get the address of the target of this branch. */ @@ -964,13 +951,13 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, abort (); /* Fix up the opcode. */ - switch (data[src_address-1] & 0xf0) + switch (data[src_address - 1] & 0xf0) { case 0x00: - data[dst_address - 2] = (data[src_address-1] & 0xf) | 0x20; + data[dst_address - 2] = (data[src_address - 1] & 0xf) | 0x20; break; case 0x80: - data[dst_address - 2] = (data[src_address-1] & 0xf) | 0x30; + data[dst_address - 2] = (data[src_address - 1] & 0xf) | 0x30; break; default: abort (); @@ -989,13 +976,13 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, abort (); /* Fix up the opcode. */ - switch (data[src_address-1] & 0xf0) + switch (data[src_address - 1] & 0xf0) { case 0x20: - data[dst_address - 2] = (data[src_address-1] & 0xf) | 0x20; + data[dst_address - 2] = (data[src_address - 1] & 0xf) | 0x20; break; case 0xa0: - data[dst_address - 2] = (data[src_address-1] & 0xf) | 0x30; + data[dst_address - 2] = (data[src_address - 1] & 0xf) | 0x30; break; default: abort (); @@ -1007,10 +994,10 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, case R_BCC_INV: /* Get the address of the target of this branch. */ - value = bfd_coff_reloc16_get_value(reloc, link_info, input_section); + value = bfd_coff_reloc16_get_value (reloc, link_info, input_section); - dot = (link_order->offset - + dst_address + dot = (link_order->offset + + dst_address + link_order->u.indirect.section->output_section->vma) + 1; gap = value - dot; @@ -1092,7 +1079,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, } /* This is a jump/call through a function vector, and we're - expected to create the function vector ourselves. + expected to create the function vector ourselves. First look up this symbol in the linker hash table -- we need the derived linker symbol which holds this symbol's index @@ -1106,7 +1093,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, strcpy (new_name, name); sprintf (new_name + strlen (name), "_%08x", - (int)symbol->section); + (int) symbol->section); name = new_name; } @@ -1165,7 +1152,6 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, *dst_ptr = dst_address; } - /* Routine for the h8300 linker. This routine is necessary to handle the special R_MEM_INDIRECT @@ -1178,7 +1164,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, selected static symbols to the bfd linker hash table. */ static boolean -h8300_bfd_link_add_symbols(abfd, info) +h8300_bfd_link_add_symbols (abfd, info) bfd *abfd; struct bfd_link_info *info; { @@ -1242,7 +1228,7 @@ h8300_bfd_link_add_symbols(abfd, info) if (reloc_size <= 0) continue; - relocs = (arelent **)bfd_malloc ((size_t)reloc_size); + relocs = (arelent **) bfd_malloc ((size_t) reloc_size); if (!relocs) return false; @@ -1285,7 +1271,7 @@ h8300_bfd_link_add_symbols(abfd, info) strcpy (new_name, name); sprintf (new_name + strlen (name), "_%08x", - (int)symbol->section); + (int) symbol->section); name = new_name; } @@ -1293,7 +1279,6 @@ h8300_bfd_link_add_symbols(abfd, info) h = funcvec_hash_lookup (h8300_coff_hash_table (info)->funcvec_hash_table, name, false, false); - /* If this symbol isn't already in the hash table, add it and bump up the size of the hash table. */ if (h == NULL) @@ -1345,12 +1330,10 @@ h8300_bfd_link_add_symbols(abfd, info) #define COFF_LONG_FILENAMES #include "coffcode.h" - #undef coff_bfd_get_relocated_section_contents #undef coff_bfd_relax_section #define coff_bfd_get_relocated_section_contents \ bfd_coff_reloc16_get_relocated_section_contents #define coff_bfd_relax_section bfd_coff_reloc16_relax_section - CREATE_BIG_COFF_TARGET_VEC (h8300coff_vec, "coff-h8300", BFD_IS_RELAXABLE, 0, '_', NULL) diff --git a/gnu/dist/toolchain/bfd/coff-h8500.c b/gnu/dist/toolchain/bfd/coff-h8500.c index 22eeaa55954c..1dfb2bdb8814 100644 --- a/gnu/dist/toolchain/bfd/coff-h8500.c +++ b/gnu/dist/toolchain/bfd/coff-h8500.c @@ -45,7 +45,6 @@ static reloc_howto_type r_imm32 = HOWTO (R_H8500_IMM32, 0, 1, 32, false, 0, complain_overflow_bitfield, 0, "r_imm32", true, 0xffffffff, 0xffffffff, false); - static reloc_howto_type r_high8 = HOWTO (R_H8500_HIGH8, 0, 1, 8, false, 0, complain_overflow_dont, 0, "r_high8", true, 0x000000ff, 0x000000ff, false); @@ -57,7 +56,6 @@ HOWTO (R_H8500_LOW16, 0, 1, 16, false, 0, static reloc_howto_type r_pcrel8 = HOWTO (R_H8500_PCREL8, 0, 1, 8, true, 0, complain_overflow_signed, 0, "r_pcrel8", true, 0, 0, true); - static reloc_howto_type r_pcrel16 = HOWTO (R_H8500_PCREL16, 0, 1, 16, true, 0, complain_overflow_signed, 0, "r_pcrel16", true, 0, 0, true); @@ -65,10 +63,9 @@ static reloc_howto_type r_high16 = HOWTO (R_H8500_HIGH16, 0, 1, 8, false, 0, complain_overflow_dont, 0, "r_high16", true, 0x000ffff, 0x0000ffff, false); - /* Turn a howto into a reloc number */ -static int +static int coff_h8500_select_reloc (howto) reloc_howto_type *howto; { @@ -77,7 +74,6 @@ coff_h8500_select_reloc (howto) #define SELECT_RELOC(x,howto) x.r_type = coff_h8500_select_reloc(howto) - #define BADMAG(x) H8500BADMAG(x) #define H8500 1 /* Customize coffcode.h */ @@ -135,14 +131,11 @@ rtype2howto(internal, dst) #define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry) - /* Perform any necessary magic to the addend in a reloc entry */ - #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \ cache_ptr->addend = ext_reloc.r_offset; - #define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \ reloc_processing(relent, reloc, symbols, abfd, section) @@ -165,7 +158,6 @@ static void reloc_processing (relent, reloc, symbols, abfd, section) relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; } - relent->addend = reloc->r_offset; relent->address -= section->vma; } @@ -217,7 +209,7 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) (*dst_ptr) += 2; (*src_ptr) += 2; break; - + case R_H8500_HIGH16: bfd_put_16 (in_abfd, (bfd_coff_reloc16_get_value (reloc, link_info, input_section) @@ -231,7 +223,7 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) case R_H8500_IMM24: { int v = bfd_coff_reloc16_get_value(reloc, link_info, input_section); - int o = bfd_get_32(in_abfd, data+ *dst_ptr -1); + int o = bfd_get_32 (in_abfd, data+ *dst_ptr -1); v = (v & 0x00ffffff) | (o & 0xff00000); bfd_put_32 (in_abfd, v, data + *dst_ptr -1); (*dst_ptr) +=3; @@ -247,7 +239,6 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) } break; - case R_H8500_PCREL8: { bfd_vma dst = bfd_coff_reloc16_get_value (reloc, link_info, @@ -304,7 +295,6 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) #include "coffcode.h" - #undef coff_bfd_get_relocated_section_contents #undef coff_bfd_relax_section #define coff_bfd_get_relocated_section_contents \ diff --git a/gnu/dist/toolchain/bfd/coff-i386.c b/gnu/dist/toolchain/bfd/coff-i386.c index 84d4d145c7b6..83d67c4a8758 100644 --- a/gnu/dist/toolchain/bfd/coff-i386.c +++ b/gnu/dist/toolchain/bfd/coff-i386.c @@ -73,8 +73,10 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, { symvalue diff; +#ifndef COFF_WITH_PE if (output_bfd == (bfd *) NULL) return bfd_reloc_continue; +#endif if (bfd_is_com_section (symbol->section)) { @@ -102,7 +104,26 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, ignores the addend for a COFF target when producing relocateable output. This seems to be always wrong for 386 COFF, so we handle the addend here instead. */ - diff = reloc_entry->addend; +#ifdef COFF_WITH_PE + if (output_bfd == (bfd *) NULL) + { + reloc_howto_type *howto = reloc_entry->howto; + + /* Although PC relative relocations are very similar between + PE and non-PE formats, but they are off by 1 << howto->size + bytes. For the external relocation, PE is very different + from others. See md_apply_fix3 () in gas/config/tc-i386.c. + When we link PE and non-PE object files together to + generate a non-PE executable, we have to compensate it + here. */ + if (howto->pc_relative == true && howto->pcrel_offset == true) + diff = -(1 << howto->size); + else + diff = -reloc_entry->addend; + } + else +#endif + diff = reloc_entry->addend; } #ifdef COFF_WITH_PE @@ -155,19 +176,17 @@ coff_i386_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, } #ifdef COFF_WITH_PE - /* 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; + bfd * abfd ATTRIBUTE_UNUSED; reloc_howto_type *howto; { return ! howto->pc_relative && howto->type != R_IMAGEBASE; } - #endif /* COFF_WITH_PE */ #ifndef PCRELOFFSET @@ -575,7 +594,7 @@ const bfd_target bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ -/* Note that we allow an object file to be treated as a core file as well. */ +/* Note that we allow an object file to be treated as a core file as well. */ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, coff_object_p}, {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ diff --git a/gnu/dist/toolchain/bfd/coff-i860.c b/gnu/dist/toolchain/bfd/coff-i860.c index ab3bb5f759fe..c02acce861ea 100644 --- a/gnu/dist/toolchain/bfd/coff-i860.c +++ b/gnu/dist/toolchain/bfd/coff-i860.c @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libcoff.h" -static bfd_reloc_status_type coff_i860_reloc +static bfd_reloc_status_type coff_i860_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static reloc_howto_type *coff_i860_rtype_to_howto PARAMS ((bfd *, asection *, struct internal_reloc *, @@ -66,7 +66,6 @@ coff_i860_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, if (output_bfd == (bfd *) NULL) return bfd_reloc_continue; - if (bfd_is_com_section (symbol->section)) { /* We are relocating a common symbol. The current value in the @@ -91,7 +90,6 @@ coff_i860_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)) @@ -139,7 +137,7 @@ coff_i860_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, #define PCRELOFFSET false #endif -static reloc_howto_type howto_table[] = +static reloc_howto_type howto_table[] = { EMPTY_HOWTO (0), EMPTY_HOWTO (1), @@ -147,32 +145,32 @@ static reloc_howto_type howto_table[] = EMPTY_HOWTO (3), EMPTY_HOWTO (4), EMPTY_HOWTO (5), - HOWTO (R_DIR32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_DIR32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - coff_i860_reloc, /* special_function */ - "dir32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + coff_i860_reloc, /* special_function */ + "dir32", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ true), /* pcrel_offset */ /* {7}, */ - HOWTO (R_IMAGEBASE, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_IMAGEBASE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - coff_i860_reloc, /* special_function */ - "rva32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + coff_i860_reloc, /* special_function */ + "rva32", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ EMPTY_HOWTO (010), EMPTY_HOWTO (011), @@ -181,83 +179,83 @@ static reloc_howto_type howto_table[] = EMPTY_HOWTO (014), EMPTY_HOWTO (015), EMPTY_HOWTO (016), - HOWTO (R_RELBYTE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RELBYTE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - coff_i860_reloc, /* special_function */ - "8", /* name */ - true, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ + coff_i860_reloc, /* special_function */ + "8", /* name */ + true, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ PCRELOFFSET), /* pcrel_offset */ - HOWTO (R_RELWORD, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RELWORD, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - coff_i860_reloc, /* special_function */ - "16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ + coff_i860_reloc, /* special_function */ + "16", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ PCRELOFFSET), /* pcrel_offset */ - HOWTO (R_RELLONG, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_RELLONG, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - coff_i860_reloc, /* special_function */ - "32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + coff_i860_reloc, /* special_function */ + "32", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ PCRELOFFSET), /* pcrel_offset */ - HOWTO (R_PCRBYTE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 8, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_PCRBYTE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - coff_i860_reloc, /* special_function */ - "DISP8", /* name */ - true, /* partial_inplace */ - 0x000000ff, /* src_mask */ - 0x000000ff, /* dst_mask */ + coff_i860_reloc, /* special_function */ + "DISP8", /* name */ + true, /* partial_inplace */ + 0x000000ff, /* src_mask */ + 0x000000ff, /* dst_mask */ PCRELOFFSET), /* pcrel_offset */ - HOWTO (R_PCRWORD, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_PCRWORD, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - coff_i860_reloc, /* special_function */ - "DISP16", /* name */ - true, /* partial_inplace */ - 0x0000ffff, /* src_mask */ - 0x0000ffff, /* dst_mask */ + coff_i860_reloc, /* special_function */ + "DISP16", /* name */ + true, /* partial_inplace */ + 0x0000ffff, /* src_mask */ + 0x0000ffff, /* dst_mask */ PCRELOFFSET), /* pcrel_offset */ - HOWTO (R_PCRLONG, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_PCRLONG, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - coff_i860_reloc, /* special_function */ - "DISP32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + coff_i860_reloc, /* special_function */ + "DISP32", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ PCRELOFFSET) /* pcrel_offset */ }; @@ -335,14 +333,13 @@ coff_i860_rtype_to_howto (abfd, sec, rel, h, sym, addendp) function will be adding in the final value of the symbol. We need to subtract out the current size in order to get the correct result. */ - - BFD_ASSERT (h != NULL); + BFD_ASSERT (h != NULL); /* I think we *do* want to bypass this. If we don't, I have seen some data parameters get the wrong relcation address. If I link two versions with and without this section bypassed and then do a binary comparison, - the addresses which are different can be looked up in the map. The + the addresses which are different can be looked up in the map. The case in which this section has been bypassed has addresses which correspond to values I can find in the map */ *addendp -= sym->n_value; @@ -351,7 +348,7 @@ coff_i860_rtype_to_howto (abfd, sec, rel, h, sym, addendp) /* If the output symbol is common (in which case this must be a relocateable link), we need to add in the final size of the common symbol. */ - if (h != NULL && h->root.type == bfd_link_hash_common) + if (h != NULL && h->root.type == bfd_link_hash_common) *addendp += h->root.u.c.size; return howto; @@ -400,7 +397,7 @@ const bfd_target bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ -/* Note that we allow an object file to be treated as a core file as well. */ +/* Note that we allow an object file to be treated as a core file as well. */ {_bfd_dummy_target, i3coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, i3coff_object_p}, {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ @@ -419,6 +416,6 @@ const bfd_target BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + COFF_SWAP_TABLE }; diff --git a/gnu/dist/toolchain/bfd/coff-i960.c b/gnu/dist/toolchain/bfd/coff-i960.c index 4c37fab6973a..562f0481e377 100644 --- a/gnu/dist/toolchain/bfd/coff-i960.c +++ b/gnu/dist/toolchain/bfd/coff-i960.c @@ -99,7 +99,7 @@ coff_i960_is_local_label_name (abfd, name) #define BAL 0x0b000000 /* Template for 'bal' instruction */ #define BAL_MASK 0x00ffffff -static bfd_reloc_status_type +static bfd_reloc_status_type optcall_callback (abfd, reloc_entry, symbol_in, data, input_section, ignore_bfd, error_message) bfd *abfd; @@ -117,13 +117,13 @@ optcall_callback (abfd, reloc_entry, symbol_in, data, coff_symbol_type *cs = coffsymbol(symbol_in); /* Don't do anything with symbols which aren't tied up yet, - except move the reloc. */ + except move the reloc. */ if (bfd_is_und_section (cs->symbol.section)) { reloc_entry->address += input_section->output_offset; return bfd_reloc_ok; } - - /* So the target symbol has to be of coff type, and the symbol + + /* So the target symbol has to be of coff type, and the symbol has to have the correct native information within it */ if ((bfd_asymbol_flavour(&cs->symbol) != bfd_target_coff_flavour) || (cs->native == (combined_entry_type *)NULL)) @@ -138,7 +138,7 @@ optcall_callback (abfd, reloc_entry, symbol_in, data, } else { - switch (cs->native->u.syment.n_sclass) + switch (cs->native->u.syment.n_sclass) { case C_LEAFSTAT: case C_LEAFEXT: @@ -146,7 +146,7 @@ optcall_callback (abfd, reloc_entry, symbol_in, data, to the correct location. */ { union internal_auxent *aux = &((cs->native+2)->u.auxent); - int word = bfd_get_32(abfd, (bfd_byte *)data + reloc_entry->address); + int word = bfd_get_32 (abfd, (bfd_byte *)data + reloc_entry->address); int olf = (aux->x_bal.x_balntry - cs->native->u.syment.n_value); BFD_ASSERT(cs->native->u.syment.n_numaux==2); @@ -156,7 +156,7 @@ optcall_callback (abfd, reloc_entry, symbol_in, data, sym and auxents untouched, so the delta between the two is the offset of the bal entry point. */ word = ((word + olf) & BAL_MASK) | BAL; - bfd_put_32(abfd, word, (bfd_byte *) data + reloc_entry->address); + bfd_put_32 (abfd, word, (bfd_byte *) data + reloc_entry->address); } result = bfd_reloc_ok; break; @@ -188,7 +188,7 @@ optcall_callback (abfd, reloc_entry, symbol_in, data, useful. It was used before this target was converted to use the COFF specific backend linker. */ -static bfd_reloc_status_type +static bfd_reloc_status_type coff_i960_relocate (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) bfd *abfd; @@ -402,7 +402,7 @@ coff_i960_relocate_section (output_bfd, info, input_bfd, input_section, sym = NULL; } else - { + { h = obj_coff_sym_hashes (input_bfd)[symndx]; sym = syms + symndx; } @@ -578,7 +578,6 @@ coff_i960_relocate_section (output_bfd, info, input_bfd, input_section, instead be a reloc against the internal symbol we created specially for the section. */ -/*ARGSUSED*/ static boolean coff_i960_adjust_symndx (obfd, info, ibfd, sec, irel, adjustedp) bfd *obfd ATTRIBUTE_UNUSED; @@ -661,6 +660,6 @@ bfd_getb64, bfd_getb_signed_64, bfd_putb64, BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), & icoff_little_vec, - + COFF_SWAP_TABLE }; diff --git a/gnu/dist/toolchain/bfd/coff-ia64.c b/gnu/dist/toolchain/bfd/coff-ia64.c new file mode 100644 index 000000000000..1f2b4458f3d6 --- /dev/null +++ b/gnu/dist/toolchain/bfd/coff-ia64.c @@ -0,0 +1,198 @@ +/* BFD back-end for HP/Intel IA-64 COFF files. + Copyright 1999 Free Software Foundation, Inc. + Contributed by David Mosberger + +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 "coff/ia64.h" + +#include "coff/internal.h" + +#include "coff/pe.h" + +#include "libcoff.h" + +#define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (2) +/* The page size is a guess based on ELF. */ + +#define COFF_PAGE_SIZE 0x1000 + +static reloc_howto_type howto_table[] = +{ + EMPTY_HOWTO (0), +}; + +#define BADMAG(x) IA64BADMAG(x) +#define IA64 1 /* Customize coffcode.h */ + +#ifdef COFF_WITH_PEP64 +# undef AOUTSZ +# define AOUTSZ PEP64AOUTSZ +# define PEAOUTHDR PEP64AOUTHDR +#endif + +#define RTYPE2HOWTO(cache_ptr, dst) \ + (cache_ptr)->howto = howto_table + (dst)->r_type; + +#ifdef COFF_WITH_PE +/* Return true if this relocation should + appear in the output .reloc section. */ + +static boolean +in_reloc_p(abfd, howto) + bfd * abfd ATTRIBUTE_UNUSED; + reloc_howto_type *howto ATTRIBUTE_UNUSED; +{ + return 0; /* We don't do relocs for now... */ +} +#endif + +#include "coffcode.h" + +static const bfd_target * +ia64coff_object_p (abfd) + bfd *abfd; +{ +#ifdef COFF_IMAGE_WITH_PE + /* We need to hack badly to handle a PE image correctly. In PE + images created by the GNU linker, the offset to the COFF header + is always the size. However, this is not the case in images + generated by other PE linkers. The PE format stores a four byte + offset to the PE signature just before the COFF header at + location 0x3c of the file. We pick up that offset, verify that + the PE signature is there, and then set ourselves up to read in + the COFF header. */ + { + bfd_byte ext_offset[4]; + file_ptr offset; + bfd_byte ext_signature[4]; + unsigned long signature; + + if (bfd_seek (abfd, 0x3c, SEEK_SET) != 0 + || bfd_read (ext_offset, 1, 4, abfd) != 4) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + offset = bfd_h_get_32 (abfd, ext_offset); + if (bfd_seek (abfd, offset, SEEK_SET) != 0 + || bfd_read (ext_signature, 1, 4, abfd) != 4) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + signature = bfd_h_get_32 (abfd, ext_signature); + + if (signature != 0x4550) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + + /* Here is the hack. coff_object_p wants to read filhsz bytes to + pick up the COFF header. We adjust so that that will work. 20 + is the size of the COFF filehdr. */ + + if (bfd_seek (abfd, + (bfd_tell (abfd) + - bfd_coff_filhsz (abfd) + + 20), + SEEK_SET) + != 0) + { + if (bfd_get_error () != bfd_error_system_call) + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + } +#endif + + return coff_object_p (abfd); +} + +const bfd_target +#ifdef TARGET_SYM + TARGET_SYM = +#else + ia64coff_vec = +#endif +{ +#ifdef TARGET_NAME + TARGET_NAME, +#else + "coff-ia64", /* name */ +#endif + bfd_target_coff_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_LITTLE, /* header byte order is little */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), + +#ifndef COFF_WITH_PE + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */ + | SEC_CODE | SEC_DATA), +#else + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC /* section flags */ + | SEC_CODE | SEC_DATA + | SEC_LINK_ONCE | SEC_LINK_DUPLICATES), +#endif + +#ifdef TARGET_UNDERSCORE + TARGET_UNDERSCORE, /* leading underscore */ +#else + 0, /* leading underscore */ +#endif + '/', /* 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 */ + +/* Note that we allow an object file to be treated as a core file as well. */ + {_bfd_dummy_target, ia64coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, ia64coff_object_p}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + NULL, + + COFF_SWAP_TABLE +}; diff --git a/gnu/dist/toolchain/bfd/coff-m68k.c b/gnu/dist/toolchain/bfd/coff-m68k.c index d7138c082e0b..e5e890f1c312 100644 --- a/gnu/dist/toolchain/bfd/coff-m68k.c +++ b/gnu/dist/toolchain/bfd/coff-m68k.c @@ -1,5 +1,5 @@ /* BFD back-end for Motorola 68000 COFF binaries. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 99, 2000 Free Software Foundation, Inc. Written by Cygnus Support. @@ -97,7 +97,7 @@ extern reloc_howto_type m68kcoff_howto_table[]; #ifdef STATIC_RELOCS static #endif -reloc_howto_type m68kcoff_howto_table[] = +reloc_howto_type m68kcoff_howto_table[] = { HOWTO(R_RELBYTE, 0, 0, 8, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "8", true, 0x000000ff,0x000000ff, false), HOWTO(R_RELWORD, 0, 1, 16, false, 0, complain_overflow_bitfield, RELOC_SPECIAL_FN, "16", true, 0x0000ffff,0x0000ffff, false), @@ -130,7 +130,7 @@ m68k_rtype2howto(internal, relocentry) arelent *internal; int relocentry; { - switch (relocentry) + switch (relocentry) { case R_RELBYTE: internal->howto = m68kcoff_howto_table + 0; break; case R_RELWORD: internal->howto = m68kcoff_howto_table + 1; break; @@ -145,29 +145,29 @@ m68k_rtype2howto(internal, relocentry) #ifdef STATIC_RELOCS static #endif -int +int m68k_howto2rtype (internal) reloc_howto_type *internal; { - if (internal->pc_relative) + if (internal->pc_relative) { - switch (internal->bitsize) + switch (internal->bitsize) { case 32: return R_PCRLONG; case 16: return R_PCRWORD; case 8: return R_PCRBYTE; } } - else + else { - switch (internal->bitsize) + switch (internal->bitsize) { case 32: return R_RELLONG; case 16: return R_RELWORD; case 8: return R_RELBYTE; } } - return R_RELLONG; + return R_RELLONG; } #ifdef STATIC_RELOCS @@ -213,7 +213,6 @@ static reloc_howto_type *m68kcoff_rtype_to_howto struct coff_link_hash_entry *, struct internal_syment *, bfd_vma *)); -/*ARGSUSED*/ static reloc_howto_type * m68kcoff_rtype_to_howto (abfd, sec, rel, h, sym, addendp) bfd *abfd ATTRIBUTE_UNUSED; @@ -374,7 +373,6 @@ m68kcoff_common_addend_special_fn (abfd, reloc_entry, symbol, data, /* coff-m68k.c uses the special COFF backend linker. We need to adjust common symbols. */ -/*ARGSUSED*/ static reloc_howto_type * m68kcoff_common_addend_rtype_to_howto (abfd, sec, rel, h, sym, addendp) bfd *abfd ATTRIBUTE_UNUSED; @@ -419,6 +417,98 @@ m68kcoff_common_addend_rtype_to_howto (abfd, sec, rel, h, sym, addendp) #endif /* ! defined (coff_rtype_to_howto) */ #endif /* COFF_COMMON_ADDEND */ + +#if !defined ONLY_DECLARE_RELOCS && ! defined STATIC_RELOCS +/* Given a .data section and a .emreloc in-memory section, store + relocation information into the .emreloc section which can be + used at runtime to relocate the section. This is called by the + linker when the --embedded-relocs switch is used. This is called + after the add_symbols entry point has been called for all the + objects, and before the final_link entry point is called. */ + +boolean +bfd_m68k_coff_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) + bfd *abfd; + struct bfd_link_info *info; + asection *datasec; + asection *relsec; + char **errmsg; +{ + char *extsyms; + bfd_size_type symesz; + struct internal_reloc *irel, *irelend; + bfd_byte *p; + + BFD_ASSERT (! info->relocateable); + + *errmsg = NULL; + + if (datasec->reloc_count == 0) + return true; + + extsyms = obj_coff_external_syms (abfd); + symesz = bfd_coff_symesz (abfd); + + irel = _bfd_coff_read_internal_relocs (abfd, datasec, true, NULL, false, + NULL); + irelend = irel + datasec->reloc_count; + + relsec->contents = (bfd_byte *) bfd_alloc (abfd, datasec->reloc_count * 12); + if (relsec->contents == NULL) + return false; + + p = relsec->contents; + + for (; irel < irelend; irel++, p += 12) + { + asection *targetsec; + + /* We are going to write a four byte longword into the runtime + reloc section. The longword will be the address in the data + section which must be relocated. It is followed by the name + of the target section NUL-padded or truncated to 8 + characters. */ + + /* We can only relocate absolute longword relocs at run time. */ + if (irel->r_type != R_RELLONG) + { + *errmsg = _("unsupported reloc type"); + bfd_set_error (bfd_error_bad_value); + return false; + } + + if (irel->r_symndx == -1) + targetsec = bfd_abs_section_ptr; + else + { + struct coff_link_hash_entry *h; + + h = obj_coff_sym_hashes (abfd)[irel->r_symndx]; + if (h == NULL) + { + struct internal_syment isym; + + bfd_coff_swap_sym_in (abfd, extsyms + symesz * irel->r_symndx, + &isym); + targetsec = coff_section_from_bfd_index (abfd, isym.n_scnum); + } + else if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + targetsec = h->root.u.def.section; + else + targetsec = NULL; + } + + bfd_put_32 (abfd, + (irel->r_vaddr - datasec->vma + datasec->output_offset), p); + memset (p + 4, 0, 8); + if (targetsec != NULL) + strncpy (p + 4, targetsec->output_section->name, 8); + } + + return true; +} +#endif /* neither ONLY_DECLARE_RELOCS not STATIC_RELOCS */ #define coff_bfd_is_local_label_name m68k_coff_is_local_label_name diff --git a/gnu/dist/toolchain/bfd/coff-m88k.c b/gnu/dist/toolchain/bfd/coff-m88k.c index f78377a3a427..a88b8365f1f4 100644 --- a/gnu/dist/toolchain/bfd/coff-m88k.c +++ b/gnu/dist/toolchain/bfd/coff-m88k.c @@ -51,7 +51,7 @@ m88k_is_local_label_name (abfd, name) return name[0] == '@'; } -static bfd_reloc_status_type +static bfd_reloc_status_type m88k_special_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) bfd *abfd; @@ -144,7 +144,7 @@ m88k_special_reloc (abfd, reloc_entry, symbol, data, return bfd_reloc_ok; } -static reloc_howto_type howto_table[] = +static reloc_howto_type howto_table[] = { HOWTO (R_PCR16L, /* type */ 02, /* rightshift */ @@ -250,12 +250,10 @@ rtype2howto (cache_ptr, dst) #define RTYPE2HOWTO(cache_ptr, dst) rtype2howto (cache_ptr, dst) - /* Code to swap in the reloc offset */ #define SWAP_IN_RELOC_OFFSET bfd_h_get_16 #define SWAP_OUT_RELOC_OFFSET bfd_h_put_16 - #define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \ reloc_processing(relent, reloc, symbols, abfd, section) diff --git a/gnu/dist/toolchain/bfd/coff-mcore.c b/gnu/dist/toolchain/bfd/coff-mcore.c index 19cbea1dc807..f5763b5affa3 100644 --- a/gnu/dist/toolchain/bfd/coff-mcore.c +++ b/gnu/dist/toolchain/bfd/coff-mcore.c @@ -42,7 +42,7 @@ extern boolean mcore_bfd_coff_final_link static struct bfd_link_hash_table * coff_mcore_link_hash_table_create PARAMS ((bfd *)); -static bfd_reloc_status_type mcore_coff_unsupported_reloc +static bfd_reloc_status_type mcore_coff_unsupported_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static boolean coff_mcore_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, @@ -65,41 +65,40 @@ static reloc_howto_type * coff_mcore_rtype_to_howto /* In case we're on a 32-bit machine, construct a 64-bit "-1" value from smaller values. Start with zero, widen, *then* decrement. */ #define MINUS_ONE (((bfd_vma)0) - 1) - static reloc_howto_type mcore_coff_howto_table[] = { /* Unused: */ - HOWTO (IMAGE_REL_MCORE_ABSOLUTE,/* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_MCORE_ABSOLUTE,/* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_dont, /* dont complain_on_overflow */ - NULL, /* special_function */ + NULL, /* special_function */ "ABSOLUTE", /* name */ - false, /* partial_inplace */ - 0x00, /* src_mask */ - 0x00, /* dst_mask */ + false, /* partial_inplace */ + 0x00, /* src_mask */ + 0x00, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (IMAGE_REL_MCORE_ADDR32,/* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - NULL, /* special_function */ + NULL, /* special_function */ "ADDR32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + /* 8 bits + 2 zero bits; jmpi/jsri/lrw instructions. - Should not appear in object files. */ + Should not appear in object files. */ HOWTO (IMAGE_REL_MCORE_PCREL_IMM8BY4, /* type */ 2, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -114,7 +113,7 @@ static reloc_howto_type mcore_coff_howto_table[] = 0, /* dst_mask */ true), /* pcrel_offset */ - /* bsr/bt/bf/br instructions; 11 bits + 1 zero bit + /* bsr/bt/bf/br instructions; 11 bits + 1 zero bit Span 2k instructions == 4k bytes. Only useful pieces at the relocated address are the opcode (5 bits) */ HOWTO (IMAGE_REL_MCORE_PCREL_IMM11BY2,/* type */ @@ -131,7 +130,7 @@ static reloc_howto_type mcore_coff_howto_table[] = 0x7ff, /* dst_mask */ true), /* pcrel_offset */ - /* 4 bits + 1 zero bit; 'loopt' instruction only; unsupported. */ + /* 4 bits + 1 zero bit; 'loopt' instruction only; unsupported. */ HOWTO (IMAGE_REL_MCORE_PCREL_IMM4BY2, /* type */ 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -146,7 +145,7 @@ static reloc_howto_type mcore_coff_howto_table[] = 0, /* dst_mask */ true), /* pcrel_offset */ - /* 32-bit pc-relative. Eventually this will help support PIC code. */ + /* 32-bit pc-relative. Eventually this will help support PIC code. */ HOWTO (IMAGE_REL_MCORE_PCREL_32,/* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -163,11 +162,11 @@ static reloc_howto_type mcore_coff_howto_table[] = /* Like PCREL_IMM11BY2, this relocation indicates that there is a 'jsri' at the specified address. There is a separate relocation - entry for the literal pool entry that it references, but we + entry for the literal pool entry that it references, but we might be able to change the jsri to a bsr if the target turns out to be close enough [even though we won't reclaim the literal pool entry, we'll get some runtime efficiency back]. Note that this - is a relocation that we are allowed to safely ignore. */ + is a relocation that we are allowed to safely ignore. */ HOWTO (IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2,/* type */ 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -181,7 +180,7 @@ static reloc_howto_type mcore_coff_howto_table[] = 0x0, /* src_mask */ 0x7ff, /* dst_mask */ true), /* pcrel_offset */ - + HOWTO (IMAGE_REL_MCORE_RVA, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -259,11 +258,10 @@ mcore_emit_base_file_entry (info, output_bfd, input_section, reloc_offset) if (coff_data (output_bfd)->pe) addr -= pe_data (output_bfd)->pe_opthdr.ImageBase; - + fwrite (&addr, 1, sizeof (addr), (FILE *) info->base_file); } -/*ARGSUSED*/ static bfd_reloc_status_type mcore_coff_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) @@ -276,17 +274,16 @@ mcore_coff_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section, char ** error_message ATTRIBUTE_UNUSED; { BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0); - + _bfd_error_handler (_("%s: Relocation %s (%d) is not currently supported.\n"), bfd_get_filename (abfd), reloc_entry->howto->name, reloc_entry->howto->type); - + return bfd_reloc_notsupported; } - -/* A cheesy little macro to make the code a little more readable. */ +/* A cheesy little macro to make the code a little more readable. */ #define HOW2MAP(bfd_rtype, mcore_rtype) \ case bfd_rtype: return & mcore_coff_howto_table [mcore_rtype] @@ -296,7 +293,7 @@ mcore_coff_reloc_type_lookup (abfd, code) bfd_reloc_code_real_type code; { switch (code) - { + { HOW2MAP (BFD_RELOC_32, IMAGE_REL_MCORE_ADDR32); HOW2MAP (BFD_RELOC_MCORE_PCREL_IMM8BY4, IMAGE_REL_MCORE_PCREL_IMM8BY4); HOW2MAP (BFD_RELOC_MCORE_PCREL_IMM11BY2, IMAGE_REL_MCORE_PCREL_IMM11BY2); @@ -304,7 +301,7 @@ mcore_coff_reloc_type_lookup (abfd, code) HOW2MAP (BFD_RELOC_32_PCREL, IMAGE_REL_MCORE_PCREL_32); HOW2MAP (BFD_RELOC_MCORE_PCREL_JSR_IMM11BY2, IMAGE_REL_MCORE_PCREL_JSR_IMM11BY2); HOW2MAP (BFD_RELOC_RVA, IMAGE_REL_MCORE_RVA); - default: + default: return NULL; } /*NOTREACHED*/ @@ -326,19 +323,18 @@ coff_mcore_rtype_to_howto (abfd, sec, rel, h, sym, addendp) { reloc_howto_type * howto; - if (rel->r_type >= NUM_ELEM (mcore_coff_howto_table)) return NULL; - + howto = mcore_coff_howto_table + rel->r_type; if (rel->r_type == IMAGE_REL_MCORE_RVA) * addendp -= pe_data (sec->output_section->owner)->pe_opthdr.ImageBase; - + else if (howto->pc_relative) { * addendp = sec->vma - 2; /* XXX guess - is this right ? */ - + /* If the symbol is defined, then the generic code is going to add back the symbol value in order to cancel out an adjustment it made to the addend. However, we set the addend @@ -350,7 +346,7 @@ coff_mcore_rtype_to_howto (abfd, sec, rel, h, sym, addendp) } else * addendp = 0; - + return howto; } @@ -362,8 +358,7 @@ in_reloc_p (abfd, howto) reloc_howto_type * howto; { return ! howto->pc_relative && howto->type != IMAGE_REL_MCORE_RVA; -} - +} /* The reloc processing routine for the optimized COFF linker. */ static boolean @@ -382,13 +377,13 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, struct internal_reloc * relend; boolean hihalf; bfd_vma hihalf_val; - + /* If we are performing a relocateable link, we don't need to do a thing. The caller will take care of adjusting the reloc addresses and symbol indices. */ if (info->relocateable) return true; - + /* Check if we have the same endianess */ if ( input_bfd->xvec->byteorder != output_bfd->xvec->byteorder && output_bfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) @@ -408,7 +403,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, rel = relocs; relend = rel + input_section->reloc_count; - + for (; rel < relend; rel++) { long symndx; @@ -421,7 +416,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, reloc_howto_type * howto = NULL; struct coff_link_hash_entry * h; const char * my_name; - + symndx = rel->r_symndx; loc = contents + rel->r_vaddr - input_section->vma; @@ -437,7 +432,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, } addend = 0; - + /* Get the howto and initialise the addend. */ howto = bfd_coff_rtype_to_howto (input_bfd, input_section, rel, h, sym, & addend); @@ -445,7 +440,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, return false; val = 0; - + if (h == NULL) { if (symndx == -1) @@ -453,8 +448,8 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, else { asection * sec = sections[symndx]; - - val = (sym->n_value + + val = (sym->n_value + sec->output_section->vma + sec->output_offset); @@ -463,10 +458,10 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, else if ( sym->_n._n_n._n_zeroes == 0 && sym->_n._n_n._n_offset != 0) my_name = obj_coff_strings (input_bfd) + sym->_n._n_n._n_offset; - else + else { static char buf [SYMNMLEN + 1]; - + strncpy (buf, sym->_n._n_name, SYMNMLEN); buf[SYMNMLEN] = '\0'; my_name = buf; @@ -479,7 +474,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, || h->root.type == bfd_link_hash_defweak) { asection * sec = h->root.u.def.section; - + val = (h->root.u.def.value + sec->output_section->vma + sec->output_offset); @@ -491,12 +486,12 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, rel->r_vaddr - input_section->vma, true))) return false; } - + my_name = h->root.root.string; - } + } rstat = bfd_reloc_ok; - + /* Each case must do its own relocation, setting rstat appropriately. */ switch (r_type) { @@ -505,19 +500,19 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, bfd_get_filename (input_bfd), r_type); bfd_set_error (bfd_error_bad_value); return false; - + case IMAGE_REL_MCORE_ABSOLUTE: - fprintf (stderr, - _("Warning: unsupported reloc %s \n"), + fprintf (stderr, + _("Warning: unsupported reloc %s \n"), howto->name, bfd_get_filename (input_bfd), input_section->name); - - fprintf (stderr,"sym %ld (%s), r_vaddr %ld (%lx)\n", + + fprintf (stderr,"sym %ld (%s), r_vaddr %ld (%lx)\n", rel->r_symndx, my_name, (long) rel->r_vaddr, - (unsigned long) rel->r_vaddr); + (unsigned long) rel->r_vaddr); break; - + case IMAGE_REL_MCORE_PCREL_IMM8BY4: case IMAGE_REL_MCORE_PCREL_IMM11BY2: case IMAGE_REL_MCORE_PCREL_IMM4BY2: @@ -527,7 +522,7 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, /* XXX fixme - shouldn't this be like the code for the RVA reloc ? */ rstat = _bfd_relocate_contents (howto, input_bfd, val, loc); break; - + case IMAGE_REL_MCORE_RVA: rstat = _bfd_final_link_relocate (howto, input_bfd, @@ -535,36 +530,35 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, val, addend); break; } - + if (info->base_file) { /* Emit a reloc if the backend thinks it needs it. */ if (sym && pe_data (output_bfd)->in_reloc_p (output_bfd, howto)) mcore_emit_base_file_entry (info, output_bfd, input_section, rel->r_vaddr); } - + switch (rstat) { default: abort (); - + case bfd_reloc_ok: break; - + case bfd_reloc_overflow: if (! ((*info->callbacks->reloc_overflow) - (info, my_name, howto->name, + (info, my_name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_vaddr - input_section->vma))) return false; } - } + } return true; } - -/* Tailor coffcode.h -- macro heaven. */ +/* Tailor coffcode.h -- macro heaven. */ /* We use the special COFF backend linker, with our own special touch. */ @@ -581,6 +575,10 @@ coff_mcore_relocate_section (output_bfd, info, input_bfd, input_section, /* Forward declaration to initialise alterbative_target field. */ extern const bfd_target TARGET_LITTLE_SYM; -/* The transfer vectors that lead the outside world to all of the above. */ -CREATE_BIG_COFF_TARGET_VEC (TARGET_BIG_SYM, TARGET_BIG_NAME, D_PAGED, (SEC_LINK_ONCE | SEC_LINK_DUPLICATES), 0, & TARGET_LITTLE_SYM) -CREATE_LITTLE_COFF_TARGET_VEC (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, D_PAGED, (SEC_LINK_ONCE | SEC_LINK_DUPLICATES), 0, & TARGET_BIG_SYM) +/* The transfer vectors that lead the outside world to all of the above. */ +CREATE_BIG_COFF_TARGET_VEC (TARGET_BIG_SYM, TARGET_BIG_NAME, D_PAGED, + (SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_READONLY | SEC_LINK_ONCE | SEC_LINK_DUPLICATES), + 0, & TARGET_LITTLE_SYM) +CREATE_LITTLE_COFF_TARGET_VEC (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, D_PAGED, + (SEC_CODE | SEC_DATA | SEC_DEBUGGING | SEC_READONLY | SEC_LINK_ONCE | SEC_LINK_DUPLICATES), + 0, & TARGET_BIG_SYM) diff --git a/gnu/dist/toolchain/bfd/coff-mips.c b/gnu/dist/toolchain/bfd/coff-mips.c index bb4b15e96c24..5634ca5b7447 100644 --- a/gnu/dist/toolchain/bfd/coff-mips.c +++ b/gnu/dist/toolchain/bfd/coff-mips.c @@ -1,5 +1,5 @@ /* BFD back-end for MIPS Extended-Coff files. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -115,7 +115,6 @@ static boolean mips_relax_pcrel16 PARAMS ((struct bfd_link_info *, bfd *, bfd_byte *, bfd_vma)); static reloc_howto_type *mips_bfd_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); - /* ECOFF has COFF sections, but the debugging information is stored in a completely different format. ECOFF targets use some of the @@ -910,7 +909,7 @@ mips_gprel_reloc (abfd, reloc_entry->address += input_section->output_offset; /* Make sure it fit in 16 bits. */ - if (val >= 0x8000 && val < 0xffff8000) + if ((long) val >= 0x8000 || (long) val < -0x8000) return bfd_reloc_overflow; return bfd_reloc_ok; @@ -1100,7 +1099,6 @@ mips_rello_reloc (abfd, requires special handling when relaxing. We don't want bfd_perform_relocation to tamper with it at all. */ -/*ARGSUSED*/ static bfd_reloc_status_type mips_switch_reloc (abfd, reloc_entry, @@ -1195,7 +1193,7 @@ mips_relocate_hi (refhi, reflo, input_bfd, input_section, contents, adjust, if (refhi == NULL) return; - + insn = bfd_get_32 (input_bfd, contents + adjust + refhi->r_vaddr - input_section->vma); if (reflo == NULL) @@ -1204,7 +1202,7 @@ mips_relocate_hi (refhi, reflo, input_bfd, input_section, contents, adjust, vallo = (bfd_get_32 (input_bfd, contents + adjust + reflo->r_vaddr - input_section->vma) & 0xffff); - + val = ((insn & 0xffff) << 16) + vallo; val += relocation; @@ -1505,7 +1503,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section, memmove (here + PCREL16_EXPANSION_ADJUSTMENT, here, (size_t) (input_section->_raw_size - (int_rel.r_vaddr - input_section->vma))); - + /* Generate the new instructions. */ if (! mips_relax_pcrel16 (info, input_bfd, input_section, h, here, @@ -1626,7 +1624,7 @@ mips_relocate_section (output_bfd, info, input_bfd, input_section, int_rel.r_symndx = RELOC_SECTION_TEXT; break; } - + if (int_rel.r_symndx == -1) abort (); @@ -2104,7 +2102,7 @@ mips_relax_section (abfd, sec, info, again) somebody felt it were important. Ignoring this reloc will presumably cause a reloc overflow error later on. */ if (bfd_get_32 (abfd, contents + int_rel.r_vaddr - sec->vma) - != 0x0411ffff) /* bgezal $0,. == bal . */ + != 0x0411ffff) /* bgezal $0,. == bal . */ continue; /* Bother. We need to expand this reloc, and we will need to @@ -2180,7 +2178,7 @@ mips_relax_section (abfd, sec, info, again) mips_ecoff_swap_reloc_in (abfd, (PTR) (adj_ext_rel + 1), &rello); BFD_ASSERT (rello.r_type == MIPS_R_RELLO); - + addhi = bfd_get_32 (abfd, contents + adj_int_rel.r_vaddr - sec->vma); addhi &= 0xffff; @@ -2505,7 +2503,7 @@ static const struct ecoff_backend_data mips_ecoff_backend_data = (unsigned (*) PARAMS ((bfd *,PTR,PTR))) bfd_void, /* reloc_out */ mips_ecoff_swap_filehdr_out, mips_ecoff_swap_aouthdr_out, mips_ecoff_swap_scnhdr_out, - FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4, + FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, true, false, 4, false, 2, mips_ecoff_swap_filehdr_in, mips_ecoff_swap_aouthdr_in, mips_ecoff_swap_scnhdr_in, NULL, mips_ecoff_bad_format_hook, _bfd_ecoff_set_arch_mach_hook, @@ -2643,7 +2641,7 @@ const bfd_target ecoff_little_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), & ecoff_big_vec, - + (PTR) &mips_ecoff_backend_data }; @@ -2686,7 +2684,7 @@ const bfd_target ecoff_big_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), & ecoff_little_vec, - + (PTR) &mips_ecoff_backend_data }; @@ -2730,6 +2728,6 @@ const bfd_target ecoff_biglittle_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) &mips_ecoff_backend_data }; diff --git a/gnu/dist/toolchain/bfd/coff-pmac.c b/gnu/dist/toolchain/bfd/coff-pmac.c index f3332d98959b..1d68158aeeea 100644 --- a/gnu/dist/toolchain/bfd/coff-pmac.c +++ b/gnu/dist/toolchain/bfd/coff-pmac.c @@ -17,11 +17,17 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#define TARGET_SYM pmac_xcoff_vec -#define TARGET_NAME "xcoff-powermac" - -/* Tweak coffcode.h based on this being a PowerMac instead of RS/6000. */ +/* Tweak coffcode.h based on this being a PowerMac instead of RS/6000. */ #define POWERMAC -#include "coff-rs6000.c" +#define TARGET_SYM pmac_xcoff_vec +#define TARGET_NAME "xcoff-powermac" + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "coff/internal.h" +#include "coff/rs6000.h" +#include "libcoff.h" +#include "xcoff-target.h" diff --git a/gnu/dist/toolchain/bfd/coff-ppc.c b/gnu/dist/toolchain/bfd/coff-ppc.c index c5e695d311a9..798399d90caf 100644 --- a/gnu/dist/toolchain/bfd/coff-ppc.c +++ b/gnu/dist/toolchain/bfd/coff-ppc.c @@ -5,7 +5,7 @@ Original version pieced together by Kim Knuttila (krk@cygnus.com) There is nothing new under the sun. This file draws a lot on other - coff files, in particular, those for the rs/6000, alpha, mips, and + coff files, in particular, those for the rs/6000, alpha, mips, and intel backends, and the PE work for the arm. This file is part of BFD, the Binary File Descriptor library. @@ -29,11 +29,10 @@ Boston, MA 02111-1307, USA. */ - objdump works - relocs generated by gas - ld will link files, but they do not run. - - dlltool will not produce correct output in some .reloc cases, and will + - dlltool will not produce correct output in some .reloc cases, and will not produce the right glue code for dll function calls. */ - #include "bfd.h" #include "sysdep.h" @@ -75,7 +74,6 @@ extern void dump_toc PARAMS ((PTR)); #define MARK_AS_WRITTEN(x) ((x) |= 1) #define MAKE_ADDR_AGAIN(x) ((x) &= ~1) - /* Turn on this check if you suspect something amiss in the hash tables */ #ifdef DEBUG_HASH @@ -87,13 +85,12 @@ extern void dump_toc PARAMS ((PTR)); #define HASH_CHECK(addr) \ if (strcmp(addr->eye_catcher, EYE) != 0) \ { \ - fprintf(stderr,\ + fprintf (stderr,\ _("File %s, line %d, Hash check failure, bad eye %8s\n"), \ __FILE__, __LINE__, addr->eye_catcher); \ - abort(); \ + abort (); \ } - #else #define HASH_CHECK_DCL @@ -105,7 +102,7 @@ extern void dump_toc PARAMS ((PTR)); /* In order not to add an int to every hash table item for every coff linker, we define our own hash table, derived from the coff one */ -/* PE linker hash table entries. */ +/* PE linker hash table entries. */ struct ppc_coff_link_hash_entry { @@ -120,7 +117,6 @@ struct ppc_coff_link_hash_entry HASH_CHECK_DCL }; - /* PE linker hash table. */ struct ppc_coff_link_hash_table @@ -154,14 +150,14 @@ ppc_coff_link_hash_newfunc (entry, table, string) struct bfd_hash_table *table; const char *string; { - struct ppc_coff_link_hash_entry *ret = + struct ppc_coff_link_hash_entry *ret = (struct ppc_coff_link_hash_entry *) entry; /* Allocate the structure if it has not already been allocated by a subclass. */ if (ret == (struct ppc_coff_link_hash_entry *) NULL) ret = (struct ppc_coff_link_hash_entry *) - bfd_hash_allocate (table, + bfd_hash_allocate (table, sizeof (struct ppc_coff_link_hash_entry)); if (ret == (struct ppc_coff_link_hash_entry *) NULL) @@ -169,7 +165,7 @@ ppc_coff_link_hash_newfunc (entry, table, string) /* Call the allocation method of the superclass. */ ret = ((struct ppc_coff_link_hash_entry *) - _bfd_coff_link_hash_newfunc ((struct bfd_hash_entry *) ret, + _bfd_coff_link_hash_newfunc ((struct bfd_hash_entry *) ret, table, string)); if (ret) @@ -222,7 +218,6 @@ ppc_coff_link_hash_table_create (abfd) /* Now, tailor coffcode.h to use our hash stuff */ #define coff_bfd_link_hash_table_create ppc_coff_link_hash_table_create - /* The nt loader points the toc register to &toc + 32768, in order to */ /* use the complete range of a 16-bit displacement. We have to adjust */ @@ -238,7 +233,7 @@ ppc_coff_link_hash_table_create (abfd) from smaller values. Start with zero, widen, *then* decrement. */ #define MINUS_ONE (((bfd_vma)0) - 1) -/* these should definitely go in a header file somewhere... */ +/* these should definitely go in a header file somewhere... */ /* NOP */ #define IMAGE_REL_PPC_ABSOLUTE 0x0000 @@ -320,7 +315,6 @@ ppc_coff_link_hash_table_create (abfd) #define EXTRACT_FLAGS(x) ((x) & IMAGE_REL_PPC_FLAGMASK) #define EXTRACT_JUNK(x) \ ((x) & ~(IMAGE_REL_PPC_TYPEMASK | IMAGE_REL_PPC_FLAGMASK)) - /* static helper functions to make relocation work */ /* (Work In Progress) */ @@ -348,7 +342,6 @@ static bfd_reloc_status_type ppc_pair_reloc PARAMS ((bfd *abfd, asection *section, bfd *output_bfd, char **error)); - static bfd_reloc_status_type ppc_toc16_reloc PARAMS ((bfd *abfd, arelent *reloc, @@ -391,10 +384,7 @@ static bfd_reloc_status_type ppc_imglue_reloc PARAMS ((bfd *abfd, bfd *output_bfd, char **error)); - - static boolean in_reloc_p PARAMS((bfd *abfd, reloc_howto_type *howto)); - /* FIXME: It'll take a while to get through all of these. I only need a few to get us started, so those I'll make sure work. Those marked FIXME are either @@ -418,7 +408,7 @@ static boolean in_reloc_p PARAMS((bfd *abfd, reloc_howto_type *howto)); /* the address of the SYM will be inserted at link time. */ /* TOCREL16 : 16 bit displacement field referring to a slot in */ /* toc. */ -/* TOCREL14 : 16 bit displacement field, similar to REL14 or ADDR14. */ +/* TOCREL14 : 16 bit displacement field, similar to REL14 or ADDR14. */ /* ADDR32NB : 32 bit address relative to the virtual origin. */ /* (On the alpha, this is always a linker generated thunk)*/ /* (i.e. 32bit addr relative to the image base) */ @@ -438,32 +428,32 @@ static reloc_howto_type ppc_coff_howto_table[] = { /* IMAGE_REL_PPC_ABSOLUTE 0x0000 NOP */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_ABSOLUTE, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_ABSOLUTE, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_dont, /* dont complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "ABSOLUTE", /* name */ - false, /* partial_inplace */ - 0x00, /* src_mask */ - 0x00, /* dst_mask */ + false, /* partial_inplace */ + 0x00, /* src_mask */ + 0x00, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_ADDR64 0x0001 64-bit address */ /* Unused: */ - HOWTO(IMAGE_REL_PPC_ADDR64, /* type */ - 0, /* rightshift */ - 3, /* size (0 = byte, 1 = short, 2 = long) */ - 64, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO(IMAGE_REL_PPC_ADDR64, /* type */ + 0, /* rightshift */ + 3, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "ADDR64", /* name */ - true, /* partial_inplace */ + true, /* partial_inplace */ MINUS_ONE, /* src_mask */ MINUS_ONE, /* dst_mask */ false), /* pcrel_offset */ @@ -471,314 +461,311 @@ static reloc_howto_type ppc_coff_howto_table[] = /* IMAGE_REL_PPC_ADDR32 0x0002 32-bit address */ /* Used: */ HOWTO (IMAGE_REL_PPC_ADDR32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + 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 */ + 0, /* special_function */ "ADDR32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_ADDR24 0x0003 26-bit address, shifted left 2 (branch absolute) */ /* the LI field is in bit 6 through bit 29 is 24 bits, + 2 for the shift */ /* Of course, That's the IBM approved bit numbering, which is not what */ - /* anyone else uses.... The li field is in bit 2 thru 25 */ + /* anyone else uses.... The li field is in bit 2 thru 25 */ /* Used: */ HOWTO (IMAGE_REL_PPC_ADDR24, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "ADDR24", /* name */ - true, /* partial_inplace */ - 0x07fffffc, /* src_mask */ - 0x07fffffc, /* dst_mask */ + true, /* partial_inplace */ + 0x07fffffc, /* src_mask */ + 0x07fffffc, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_ADDR16 0x0004 16-bit address */ /* Used: */ - HOWTO (IMAGE_REL_PPC_ADDR16, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_ADDR16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "ADDR16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_ADDR14 0x0005 */ /* 16-bit address, shifted left 2 (load doubleword) */ /* FIXME: the mask is likely wrong, and the bit position may be as well */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_ADDR14, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_ADDR14, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "ADDR16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_REL24 0x0006 */ /* 26-bit PC-relative offset, shifted left 2 (branch relative) */ /* Used: */ HOWTO (IMAGE_REL_PPC_REL24, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "REL24", /* name */ - true, /* partial_inplace */ - 0x3fffffc, /* src_mask */ - 0x3fffffc, /* dst_mask */ + true, /* partial_inplace */ + 0x3fffffc, /* src_mask */ + 0x3fffffc, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_REL14 0x0007 */ /* 16-bit PC-relative offset, shifted left 2 (br cond relative) */ /* FIXME: the mask is likely wrong, and the bit position may be as well */ /* FIXME: how does it know how far to shift? */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_ADDR14, /* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_ADDR14, /* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "ADDR16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ true), /* pcrel_offset */ - + /* IMAGE_REL_PPC_TOCREL16 0x0008 */ /* 16-bit offset from TOC base */ /* Used: */ - HOWTO (IMAGE_REL_PPC_TOCREL16,/* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_TOCREL16,/* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - ppc_toc16_reloc, /* special_function */ + ppc_toc16_reloc, /* special_function */ "TOCREL16", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_TOCREL14 0x0009 */ /* 16-bit offset from TOC base, shifted left 2 (load doubleword) */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_TOCREL14,/* type */ - 1, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_TOCREL14,/* type */ + 1, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "TOCREL14", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_ADDR32NB 0x000A */ /* 32-bit addr w/ image base */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_ADDR32NB,/* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_ADDR32NB,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "ADDR32NB", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + /* IMAGE_REL_PPC_SECREL 0x000B */ /* va of containing section (as in an image sectionhdr) */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_SECREL,/* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_SECREL,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - ppc_secrel_reloc, /* special_function */ + ppc_secrel_reloc, /* special_function */ "SECREL", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ true), /* pcrel_offset */ /* IMAGE_REL_PPC_SECTION 0x000C */ /* sectionheader number */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_SECTION,/* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_SECTION,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - ppc_section_reloc, /* special_function */ + ppc_section_reloc, /* special_function */ "SECTION", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ true), /* pcrel_offset */ /* IMAGE_REL_PPC_IFGLUE 0x000D */ /* substitute TOC restore instruction iff symbol is glue code */ /* Used: */ - HOWTO (IMAGE_REL_PPC_IFGLUE,/* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_IFGLUE,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "IFGLUE", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ /* IMAGE_REL_PPC_IMGLUE 0x000E */ /* symbol is glue code; virtual address is TOC restore instruction */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_IMGLUE,/* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_IMGLUE,/* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - ppc_imglue_reloc, /* special_function */ + ppc_imglue_reloc, /* special_function */ "IMGLUE", /* name */ - false, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ /* IMAGE_REL_PPC_SECREL16 0x000F */ /* va of containing section (limited to 16 bits) */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_SECREL16,/* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_SECREL16,/* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "SECREL16", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ true), /* pcrel_offset */ /* IMAGE_REL_PPC_REFHI 0x0010 */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_REFHI, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_REFHI, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - ppc_refhi_reloc, /* special_function */ + ppc_refhi_reloc, /* special_function */ "REFHI", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ /* IMAGE_REL_PPC_REFLO 0x0011 */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_REFLO, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_REFLO, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - ppc_refhi_reloc, /* special_function */ + ppc_refhi_reloc, /* special_function */ "REFLO", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ /* IMAGE_REL_PPC_PAIR 0x0012 */ /* Unused: */ - HOWTO (IMAGE_REL_PPC_PAIR, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (IMAGE_REL_PPC_PAIR, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - ppc_pair_reloc, /* special_function */ + ppc_pair_reloc, /* special_function */ "PAIR", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ /* IMAGE_REL_PPC_TOCREL16_DEFN 0x0013 */ /* 16-bit offset from TOC base, without causing a definition */ /* Used: */ - HOWTO ( (IMAGE_REL_PPC_TOCREL16 | IMAGE_REL_PPC_TOCDEFN), /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO ( (IMAGE_REL_PPC_TOCREL16 | IMAGE_REL_PPC_TOCDEFN), /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_dont, /* complain_on_overflow */ - 0, /* special_function */ + 0, /* special_function */ "TOCREL16, TOCDEFN", /* name */ - false, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ }; - - - /* Some really cheezy macros that can be turned on to test stderr :-) */ #ifdef DEBUG_RELOC @@ -788,19 +775,19 @@ static reloc_howto_type ppc_coff_howto_table[] = if (i == 0) \ { \ i = 1; \ - fprintf(stderr,_("Unimplemented Relocation -- %s\n"),x); \ + fprintf (stderr,_("Unimplemented Relocation -- %s\n"),x); \ } \ } #define DUMP_RELOC(n,r) \ { \ - fprintf(stderr,"%s sym %d, addr %d, addend %d\n", \ + fprintf (stderr,"%s sym %d, addr %d, addend %d\n", \ n, (*(r->sym_ptr_ptr))->name, \ r->address, r->addend); \ } -/* Given a reloc name, n, and a pointer to an internal_reloc, - dump out interesting information on the contents +/* Given a reloc name, n, and a pointer to an internal_reloc, + dump out interesting information on the contents #define n_name _n._n_name #define n_zeroes _n._n_n._n_zeroes @@ -810,7 +797,7 @@ static reloc_howto_type ppc_coff_howto_table[] = #define DUMP_RELOC2(n,r) \ { \ - fprintf(stderr,"%s sym %d, r_vaddr %d %s\n", \ + fprintf (stderr,"%s sym %d, r_vaddr %d %s\n", \ n, r->r_symndx, r->r_vaddr,\ (((r->r_type) & IMAGE_REL_PPC_TOCDEFN) == 0) \ ?" ":" TOCDEFN" ); \ @@ -821,8 +808,6 @@ static reloc_howto_type ppc_coff_howto_table[] = #define DUMP_RELOC(n,r) #define DUMP_RELOC2(n,r) #endif - - /* toc construction and management routines */ @@ -924,16 +909,16 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind) HASH_CHECK(h); } - if (h == 0) - { + if (h == 0) + { local_syms = obj_coff_local_toc_table(abfd); if (local_syms == 0) { unsigned int i; /* allocate a table */ - local_syms = - (int *) bfd_zalloc (abfd, - obj_raw_syment_count(abfd) * sizeof(int)); + local_syms = + (int *) bfd_zalloc (abfd, + obj_raw_syment_count(abfd) * sizeof (int)); if (local_syms == 0) return false; obj_coff_local_toc_table(abfd) = local_syms; @@ -943,7 +928,7 @@ ppc_record_toc_entry(abfd, info, sec, sym, toc_kind) } } - if (IS_UNALLOCATED(local_syms[sym])) + if (IS_UNALLOCATED(local_syms[sym])) { local_syms[sym] = global_toc_size; global_toc_size += 4; @@ -1002,20 +987,19 @@ ppc_mark_symbol_as_glue(abfd, sym, rel) #endif /* COFF_IMAGE_WITH_PE */ - /* Return true if this relocation should - appear in the output .reloc section. */ + appear in the output .reloc section. */ static boolean in_reloc_p(abfd, howto) bfd * abfd ATTRIBUTE_UNUSED; reloc_howto_type *howto; { - return - (! howto->pc_relative) + return + (! howto->pc_relative) && (howto->type != IMAGE_REL_PPC_ADDR32NB) && (howto->type != IMAGE_REL_PPC_TOCREL16) && (howto->type != IMAGE_REL_PPC_IMGLUE) - && (howto->type != IMAGE_REL_PPC_IFGLUE) + && (howto->type != IMAGE_REL_PPC_IFGLUE) && (howto->type != IMAGE_REL_PPC_SECREL) && (howto->type != IMAGE_REL_PPC_SECTION) && (howto->type != IMAGE_REL_PPC_SECREL16) @@ -1023,7 +1007,7 @@ static boolean in_reloc_p(abfd, howto) && (howto->type != IMAGE_REL_PPC_REFLO) && (howto->type != IMAGE_REL_PPC_PAIR) && (howto->type != IMAGE_REL_PPC_TOCREL16_DEFN) ; -} +} #if 0 @@ -1050,39 +1034,38 @@ pe_ppc_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, unsigned long sym_value; unsigned short r_type; unsigned long addr = reloc_entry->address ; /*+ input_section->vma*/ - + r_type = reloc_entry->howto->type; - if (output_bfd) + if (output_bfd) { /* Partial linking - do nothing */ reloc_entry->address += input_section->output_offset; - return bfd_reloc_ok; + return bfd_reloc_ok; } if (symbol_in != NULL && bfd_is_und_section (symbol_in->section)) { /* Keep the state machine happy in case we're called again */ - if (r_type == IMAGE_REL_PPC_REFHI) + if (r_type == IMAGE_REL_PPC_REFHI) { part1_consth_active = true; part1_consth_value = 0; } return(bfd_reloc_undefined); } - - if ((part1_consth_active) && (r_type != IMAGE_REL_PPC_PAIR)) + + if ((part1_consth_active) && (r_type != IMAGE_REL_PPC_PAIR)) { part1_consth_active = false; *error_message = (char *) _("Missing PAIR"); return(bfd_reloc_dangerous); } - sym_value = get_symbol_value(symbol_in); - - return(bfd_reloc_ok); + + return(bfd_reloc_ok); } #endif /* 0 */ @@ -1108,13 +1091,13 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, asection *toc_section = 0; bfd_vma relocation; reloc_howto_type *howto = 0; - + /* If we are performing a relocateable link, we don't need to do a thing. The caller will take care of adjusting the reloc addresses and symbol indices. */ if (info->relocateable) return true; - + hihalf = false; hihalf_val = 0; @@ -1133,7 +1116,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, unsigned short r_type = EXTRACT_TYPE (rel->r_type); unsigned short r_flags = EXTRACT_FLAGS(rel->r_type); - + symndx = rel->r_symndx; loc = contents + rel->r_vaddr - input_section->vma; @@ -1147,9 +1130,9 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } else { - h = (struct ppc_coff_link_hash_entry *) + h = (struct ppc_coff_link_hash_entry *) (obj_coff_sym_hashes (input_bfd)[symndx]); - if (h != 0) + if (h != 0) { HASH_CHECK(h); } @@ -1159,8 +1142,8 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, if (r_type == IMAGE_REL_PPC_IMGLUE && h == 0) { - /* An IMGLUE reloc must have a name. Something is very wrong. */ - abort(); + /* An IMGLUE reloc must have a name. Something is very wrong. */ + abort (); } sec = NULL; @@ -1203,7 +1186,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } rstat = bfd_reloc_ok; - + /* Each case must do its own relocation, setting rstat appropriately */ switch (r_type) { @@ -1220,19 +1203,19 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, DUMP_RELOC2(howto->name, rel); - if (toc_section == 0) + if (toc_section == 0) { - toc_section = bfd_get_section_by_name (bfd_of_toc_owner, + toc_section = bfd_get_section_by_name (bfd_of_toc_owner, TOC_SECTION_NAME); - if ( toc_section == NULL ) + if ( toc_section == NULL ) { - /* There is no toc section. Something is very wrong. */ - abort(); + /* There is no toc section. Something is very wrong. */ + abort (); } } - /* + /* * Amazing bit tricks present. As we may have seen earlier, we * use the 1 bit to tell us whether or not a toc offset has been * allocated. Now that they've all been allocated, we will use @@ -1253,7 +1236,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, if (IS_WRITTEN(our_toc_offset)) { - /* if it has been written out, it is marked with the + /* if it has been written out, it is marked with the 1 bit. Fix up our offset, but do not write it out again. */ @@ -1262,12 +1245,12 @@ 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, + record_toc(toc_section, + our_toc_offset, + priv, strdup(name)); - bfd_put_32(output_bfd, + bfd_put_32 (output_bfd, val, toc_section->contents + our_toc_offset); @@ -1280,33 +1263,33 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, const char *name = h->root.root.root.string; our_toc_offset = h->toc_offset; - if ((r_flags & IMAGE_REL_PPC_TOCDEFN) + if ((r_flags & IMAGE_REL_PPC_TOCDEFN) == IMAGE_REL_PPC_TOCDEFN ) { - /* This is unbelievable cheese. Some knowledgable asm - hacker has decided to use r2 as a base for loading - a value. He/She does this by setting the tocdefn bit, - and not supplying a toc definition. The behaviour is - then to use the difference between the value of the - symbol and the actual location of the toc as the toc - index. + /* This is unbelievable cheese. Some knowledgable asm + hacker has decided to use r2 as a base for loading + a value. He/She does this by setting the tocdefn bit, + and not supplying a toc definition. The behaviour is + then to use the difference between the value of the + symbol and the actual location of the toc as the toc + index. In fact, what is usually happening is, because the Import Address Table is mapped immediately following the toc, some trippy library code trying for speed on - dll linkage, takes advantage of that and considers + dll linkage, takes advantage of that and considers the IAT to be part of the toc, thus saving a load. */ - our_toc_offset = val - - (toc_section->output_section->vma + + 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) { (*_bfd_error_handler) - (_("%s: Relocation for %s of %x exceeds Toc size limit"), + (_("%s: Relocation for %s of %x exceeds Toc size limit"), bfd_get_filename (input_bfd), name, our_toc_offset); bfd_set_error (bfd_error_bad_value); return false; @@ -1316,7 +1299,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } else if (IS_WRITTEN(our_toc_offset)) { - /* if it has been written out, it is marked with the + /* if it has been written out, it is marked with the 1 bit. Fix up our offset, but do not write it out again. */ @@ -1327,7 +1310,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, record_toc(toc_section, our_toc_offset, pub, strdup(name)); /* write out the toc entry */ - bfd_put_32(output_bfd, + bfd_put_32 (output_bfd, val, toc_section->contents + our_toc_offset); @@ -1338,31 +1321,30 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } } - if (fixit && info->base_file) + if (fixit && info->base_file) { /* So if this is non pcrelative, and is referenced to a section or a common symbol, then it needs a reloc */ /* relocation to a symbol in a section which - isn't absolute - we output the address here + 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; - + if (coff_data(output_bfd)->pe) addr -= pe_data(output_bfd)->pe_opthdr.ImageBase; fwrite (&addr, 1,4, (FILE *) info->base_file); } - /* FIXME: this test is conservative */ if ( (r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN && our_toc_offset > toc_section->_raw_size) { (*_bfd_error_handler) - (_("%s: Relocation exceeds allocated TOC (%x)"), + (_("%s: Relocation exceeds allocated TOC (%x)"), bfd_get_filename (input_bfd), toc_section->_raw_size); bfd_set_error (bfd_error_bad_value); @@ -1372,18 +1354,18 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, /* Now we know the relocation for this toc reference */ relocation = our_toc_offset + TOC_LOAD_ADJUSTMENT; rstat = _bfd_relocate_contents (howto, - input_bfd, - relocation, + input_bfd, + relocation, loc); } break; case IMAGE_REL_PPC_IFGLUE: { /* To solve this, we need to know whether or not the symbol */ - /* appearing on the call instruction is a glue function or not. */ + /* appearing on the call instruction is a glue function or not. */ /* A glue function must announce itself via a IMGLUE reloc, and */ /* the reloc contains the required toc restore instruction */ - + bfd_vma x; const char *my_name; DUMP_RELOC2(howto->name, rel); @@ -1391,18 +1373,18 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, if (h != 0) { my_name = h->root.root.root.string; - if (h->symbol_is_glue == 1) + if (h->symbol_is_glue == 1) { - x = bfd_get_32(input_bfd, loc); - bfd_put_32(input_bfd, h->glue_insn, loc); + x = bfd_get_32 (input_bfd, loc); + bfd_put_32 (input_bfd, h->glue_insn, loc); } } } break; case IMAGE_REL_PPC_SECREL: /* Unimplemented: codeview debugging information */ - /* For fast access to the header of the section - containing the item. */ + /* For fast access to the header of the section + containing the item. */ break; case IMAGE_REL_PPC_SECTION: /* Unimplemented: codeview debugging information */ @@ -1420,15 +1402,15 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, my_name = h->root.root.root.string; } - fprintf(stderr, - _("Warning: unsupported reloc %s \n"), + fprintf (stderr, + _("Warning: unsupported reloc %s \n"), howto->name, bfd_get_filename(input_bfd), input_section->name); - fprintf(stderr,"sym %ld (%s), r_vaddr %ld (%lx)\n", + fprintf (stderr,"sym %ld (%s), r_vaddr %ld (%lx)\n", rel->r_symndx, my_name, (long) rel->r_vaddr, - (unsigned long) rel->r_vaddr); + (unsigned long) rel->r_vaddr); } break; case IMAGE_REL_PPC_IMGLUE: @@ -1436,12 +1418,12 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, /* There is nothing to do now. This reloc was noted in the first pass over the relocs, and the glue instruction extracted */ const char *my_name; - if (h->symbol_is_glue == 1) + if (h->symbol_is_glue == 1) break; my_name = h->root.root.root.string; (*_bfd_error_handler) - (_("%s: Out of order IMGLUE reloc for %s"), + (_("%s: Out of order IMGLUE reloc for %s"), bfd_get_filename (input_bfd), my_name); bfd_set_error (bfd_error_bad_value); return false; @@ -1461,16 +1443,16 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, myh = coff_link_hash_lookup (coff_hash_table (info), "__idata5_magic__", false, false, true); - first_thunk_address = myh->root.u.def.value + - sec->output_section->vma + - sec->output_offset - + first_thunk_address = myh->root.u.def.value + + sec->output_section->vma + + sec->output_offset - pe_data(output_bfd)->pe_opthdr.ImageBase; - + idata5offset = myh->root.u.def.value; myh = coff_link_hash_lookup (coff_hash_table (info), "__idata6_magic__", false, false, true); - + thunk_size = myh->root.u.def.value - idata5offset; myh = coff_link_hash_lookup (coff_hash_table (info), "__idata4_magic__", @@ -1502,13 +1484,13 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, myh = coff_link_hash_lookup (coff_hash_table (info), target, false, false, true); - if (myh == 0) + if (myh == 0) { - /* Missing magic cookies. Something is very wrong. */ - abort(); + /* Missing magic cookies. Something is very wrong. */ + abort (); } - - val = myh->root.u.def.value + + + val = myh->root.u.def.value + sec->output_section->vma + sec->output_offset; if (first_thunk_address == 0) { @@ -1516,16 +1498,16 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, myh = coff_link_hash_lookup (coff_hash_table (info), "__idata5_magic__", false, false, true); - first_thunk_address = myh->root.u.def.value + - sec->output_section->vma + - sec->output_offset - + first_thunk_address = myh->root.u.def.value + + sec->output_section->vma + + sec->output_offset - pe_data(output_bfd)->pe_opthdr.ImageBase; - + idata5offset = myh->root.u.def.value; myh = coff_link_hash_lookup (coff_hash_table (info), "__idata6_magic__", false, false, true); - + thunk_size = myh->root.u.def.value - idata5offset; myh = coff_link_hash_lookup (coff_hash_table (info), "__idata4_magic__", @@ -1536,8 +1518,8 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } rstat = _bfd_relocate_contents (howto, - input_bfd, - val - + input_bfd, + val - pe_data(output_bfd)->pe_opthdr.ImageBase, loc); } @@ -1549,8 +1531,8 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, + input_section->output_offset); rstat = _bfd_relocate_contents (howto, - input_bfd, - val, + input_bfd, + val, loc); break; case IMAGE_REL_PPC_ADDR16: @@ -1558,8 +1540,8 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, case IMAGE_REL_PPC_ADDR32: DUMP_RELOC2(howto->name, rel); rstat = _bfd_relocate_contents (howto, - input_bfd, - val, + input_bfd, + val, loc); break; } @@ -1571,11 +1553,11 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, if (sym && pe_data(output_bfd)->in_reloc_p(output_bfd, howto)) { /* relocation to a symbol in a section which - isn't absolute - we output the address here + isn't absolute - we output the address here to a file */ - bfd_vma addr = rel->r_vaddr - - input_section->vma - + input_section->output_offset + bfd_vma addr = rel->r_vaddr + - input_section->vma + + input_section->output_offset + input_section->output_section->vma; if (coff_data(output_bfd)->pe) @@ -1614,7 +1596,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } if (! ((*info->callbacks->reloc_overflow) - (info, name, howto->name, + (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_vaddr - input_section->vma))) { @@ -1623,7 +1605,7 @@ coff_ppc_relocate_section (output_bfd, info, input_bfd, input_section, } } - } + } return true; } @@ -1659,11 +1641,11 @@ dump_toc (vfile) FILE *file = (FILE *) vfile; struct list_ele *t; - fprintf(file, _(h1)); - fprintf(file, _(h2)); - fprintf(file, _(h3)); + fprintf (file, _(h1)); + fprintf (file, _(h2)); + fprintf (file, _(h3)); - for(t = head; t != 0; t=t->next) + for (t = head; t != 0; t=t->next) { const char *cat = ""; @@ -1680,26 +1662,26 @@ dump_toc (vfile) cat = _("IAT reference "); else { - fprintf(file, + fprintf (file, _("**** global_toc_size %ld(%lx), thunk_size %ld(%lx)\n"), global_toc_size, global_toc_size, thunk_size, thunk_size); cat = _("Out of bounds!"); } } - fprintf(file, + fprintf (file, " %04lx (%d)", (unsigned long) t->offset, t->offset - 32768); - fprintf(file, + fprintf (file, " %s %s\n", cat, t->name); } - fprintf(file, "\n"); + fprintf (file, "\n"); } boolean -ppc_allocate_toc_section (info) +ppc_allocate_toc_section (info) struct bfd_link_info *info ATTRIBUTE_UNUSED; { asection *s; @@ -1711,15 +1693,15 @@ ppc_allocate_toc_section (info) if (bfd_of_toc_owner == 0) { - /* No toc owner? Something is very wrong. */ - abort(); + /* No toc owner? Something is very wrong. */ + abort (); } s = bfd_get_section_by_name ( bfd_of_toc_owner , TOC_SECTION_NAME); - if (s == NULL) + if (s == NULL) { - /* No toc section? Something is very wrong. */ - abort(); + /* No toc section? Something is very wrong. */ + abort (); } foo = (bfd_byte *) bfd_alloc(bfd_of_toc_owner, global_toc_size); @@ -1740,7 +1722,7 @@ ppc_process_before_allocation (abfd, info) struct internal_reloc *i, *rel; /* here we have a bfd that is to be included on the link. We have a hook - to do reloc rummaging, before section sizes are nailed down. */ + to do reloc rummaging, before section sizes are nailed down. */ _bfd_coff_get_external_symbols(abfd); @@ -1754,17 +1736,17 @@ ppc_process_before_allocation (abfd, info) for (; sec != 0; sec = sec->next) { - if (sec->reloc_count == 0) + if (sec->reloc_count == 0) continue; /* load the relocs */ /* FIXME: there may be a storage leak here */ i=_bfd_coff_read_internal_relocs(abfd,sec,1,0,0,0); - - if (i == 0) - abort(); - for (rel=i;relreloc_count;++rel) + if (i == 0) + abort (); + + for (rel=i;relreloc_count;++rel) { unsigned short r_type = EXTRACT_TYPE (rel->r_type); unsigned short r_flags = EXTRACT_FLAGS(rel->r_type); @@ -1772,13 +1754,13 @@ ppc_process_before_allocation (abfd, info) DUMP_RELOC2(ppc_coff_howto_table[r_type].name, rel); - switch(r_type) + switch(r_type) { case IMAGE_REL_PPC_TOCREL16: /* if TOCDEFN is on, ignore as someone else has allocated the toc entry */ if ( (r_flags & IMAGE_REL_PPC_TOCDEFN) != IMAGE_REL_PPC_TOCDEFN ) - ok = ppc_record_toc_entry(abfd, info, sec, + ok = ppc_record_toc_entry(abfd, info, sec, rel->r_symndx, default_toc); if (!ok) return false; @@ -1797,7 +1779,6 @@ ppc_process_before_allocation (abfd, info) #endif - static bfd_reloc_status_type ppc_refhi_reloc (abfd, reloc_entry, @@ -1876,7 +1857,6 @@ ppc_pair_reloc (abfd, return bfd_reloc_undefined; } - static bfd_reloc_status_type ppc_toc16_reloc (abfd, @@ -2011,15 +1991,12 @@ ppc_imglue_reloc (abfd, return bfd_reloc_ok; } - - #define MAX_RELOC_INDEX \ - (sizeof(ppc_coff_howto_table) / sizeof(ppc_coff_howto_table[0]) - 1) - + (sizeof (ppc_coff_howto_table) / sizeof (ppc_coff_howto_table[0]) - 1) /* FIXME: There is a possiblity that when we read in a reloc from a file, - that there are some bits encoded in the upper portion of the + that there are some bits encoded in the upper portion of the type field. Not yet implemented. */ static void ppc_coff_rtype2howto PARAMS ((arelent *relent, @@ -2029,7 +2006,7 @@ static void ppc_coff_rtype2howto (relent, internal) arelent *relent; struct internal_reloc *internal; -{ +{ /* We can encode one of three things in the type field, aside from the type: @@ -2046,15 +2023,15 @@ ppc_coff_rtype2howto (relent, internal) unsigned short r_flags = EXTRACT_FLAGS(internal->r_type); unsigned short junk = EXTRACT_JUNK (internal->r_type); - /* the masking process only slices off the bottom byte for r_type. */ - if ( r_type > MAX_RELOC_INDEX ) - abort(); + /* the masking process only slices off the bottom byte for r_type. */ + if ( r_type > MAX_RELOC_INDEX ) + abort (); /* check for absolute crap */ if ( junk != 0 ) - abort(); + abort (); - switch(r_type) + switch(r_type) { case IMAGE_REL_PPC_ADDR16: case IMAGE_REL_PPC_REL24: @@ -2079,16 +2056,16 @@ ppc_coff_rtype2howto (relent, internal) howto = ppc_coff_howto_table + IMAGE_REL_PPC_TOCREL16; break; default: - fprintf(stderr, + fprintf (stderr, _("Warning: Unsupported reloc %s [%d] used -- it may not work.\n"), ppc_coff_howto_table[r_type].name, r_type); - howto = ppc_coff_howto_table + r_type; + howto = ppc_coff_howto_table + r_type; break; } - + relent->howto = howto; - + } static reloc_howto_type * @@ -2117,15 +2094,15 @@ coff_ppc_rtype_to_howto (abfd, sec, rel, h, sym, addendp) unsigned short r_flags = EXTRACT_FLAGS(rel->r_type); unsigned short junk = EXTRACT_JUNK (rel->r_type); - /* the masking process only slices off the bottom byte for r_type. */ - if ( r_type > MAX_RELOC_INDEX ) - abort(); - + /* the masking process only slices off the bottom byte for r_type. */ + if ( r_type > MAX_RELOC_INDEX ) + abort (); + /* check for absolute crap */ if ( junk != 0 ) - abort(); - - switch(r_type) + abort (); + + switch(r_type) { case IMAGE_REL_PPC_ADDR32NB: DUMP_RELOC2(ppc_coff_howto_table[r_type].name, rel); @@ -2154,18 +2131,17 @@ coff_ppc_rtype_to_howto (abfd, sec, rel, h, sym, addendp) howto = ppc_coff_howto_table + r_type; break; default: - fprintf(stderr, + fprintf (stderr, _("Warning: Unsupported reloc %s [%d] used -- it may not work.\n"), ppc_coff_howto_table[r_type].name, r_type); howto = ppc_coff_howto_table + r_type; break; } - + return howto; } - /* a cheesy little macro to make the code a little more readable */ #define HOW2MAP(bfd_rtype,ppc_rtype) \ case bfd_rtype: return &ppc_coff_howto_table[ppc_rtype] @@ -2189,16 +2165,15 @@ ppc_coff_reloc_type_lookup (abfd, code) HOW2MAP(BFD_RELOC_16_GOTOFF, IMAGE_REL_PPC_TOCREL16_DEFN); HOW2MAP(BFD_RELOC_32, IMAGE_REL_PPC_ADDR32); HOW2MAP(BFD_RELOC_RVA, IMAGE_REL_PPC_ADDR32NB); - default: + default: return NULL; } /*NOTREACHED*/ } #undef HOW2MAP - -/* Tailor coffcode.h -- macro heaven. */ +/* Tailor coffcode.h -- macro heaven. */ #define RTYPE2HOWTO(cache_ptr, dst) ppc_coff_rtype2howto (cache_ptr, dst) @@ -2211,7 +2186,7 @@ static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR)); #define coff_bfd_reloc_type_lookup ppc_coff_reloc_type_lookup #define coff_rtype_to_howto coff_ppc_rtype_to_howto #define coff_relocate_section coff_ppc_relocate_section -#define coff_bfd_final_link ppc_bfd_coff_final_link +#define coff_bfd_final_link ppc_bfd_coff_final_link #ifndef COFF_IMAGE_WITH_PE /* FIXME: This no longer works. */ @@ -2242,12 +2217,10 @@ static void ppc_coff_swap_sym_in_hook PARAMS ((bfd *, PTR, PTR)); COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 1 } #include "coffcode.h" - - #ifndef COFF_IMAGE_WITH_PE /* FIXME: - What we're trying to do here is allocate a toc section (early), and attach + 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 written out before all files have been processed. This code allocates a toc section for every file, and records the last one seen. There are @@ -2277,7 +2250,7 @@ ppc_coff_swap_sym_in_hook (abfd, ext1, in1) register asection *s; s = bfd_get_section_by_name ( abfd , TOC_SECTION_NAME); - if (s != NULL) + if (s != NULL) { return; } @@ -2291,7 +2264,7 @@ ppc_coff_swap_sym_in_hook (abfd, ext1, in1) || !bfd_set_section_alignment (abfd, s, 2)) { /* FIXME: set appropriate bfd error */ - abort(); + abort (); } /* save the bfd for later allocation */ @@ -2324,18 +2297,17 @@ ppc_get_last() } /* this piece of machinery exists only to guarantee that the bfd that holds - the toc section is written last. + the toc section is written last. This does depend on bfd_make_section attaching a new section to the - end of the section list for the bfd. + end of the section list for the bfd. - This is otherwise intended to be functionally the same as - cofflink.c:_bfd_coff_final_link(). It is specifically different only - where the POWERPC_LE_PE macro modifies the code. It is left in as a + This is otherwise intended to be functionally the same as + cofflink.c:_bfd_coff_final_link(). It is specifically different only + where the POWERPC_LE_PE macro modifies the code. It is left in as a precise form of comment. krk@cygnus.com */ - /* Do the final link step. */ boolean @@ -2840,13 +2812,12 @@ ppc_bfd_coff_final_link (abfd, info) } #endif - /* Forward declaration for use by alternative_target field. */ #ifdef TARGET_BIG_SYM extern const bfd_target TARGET_BIG_SYM; #endif -/* The transfer vectors that lead the outside world to all of the above. */ +/* The transfer vectors that lead the outside world to all of the above. */ #ifdef TARGET_LITTLE_SYM const bfd_target TARGET_LITTLE_SYM = @@ -2859,7 +2830,7 @@ const bfd_target TARGET_LITTLE_SYM = (HAS_RELOC | EXEC_P | /* FIXME: object flags */ HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | WP_TEXT | D_PAGED), - + #ifndef COFF_WITH_PE (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ #else @@ -2878,14 +2849,14 @@ const bfd_target TARGET_LITTLE_SYM = bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ - + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, /* _bfd_dummy_target */ coff_object_p }, {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ bfd_false}, {bfd_false, coff_write_object_contents, /* bfd_write_contents */ _bfd_write_archive_contents, bfd_false}, - + BFD_JUMP_TABLE_GENERIC (coff), BFD_JUMP_TABLE_COPY (coff), BFD_JUMP_TABLE_CORE (_bfd_nocore), @@ -2902,7 +2873,7 @@ const bfd_target TARGET_LITTLE_SYM = #else NULL, #endif - + COFF_SWAP_TABLE }; #endif @@ -2911,7 +2882,7 @@ const bfd_target TARGET_LITTLE_SYM = const bfd_target TARGET_BIG_SYM = { TARGET_BIG_NAME, - bfd_target_coff_flavour, + bfd_target_coff_flavour, BFD_ENDIAN_BIG, /* data byte order is big */ BFD_ENDIAN_BIG, /* header byte order is big */ @@ -2955,14 +2926,13 @@ const bfd_target TARGET_BIG_SYM = BFD_JUMP_TABLE_LINK (coff), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), - /* Alternative_target. */ #ifdef TARGET_LITTLE_SYM & TARGET_LITTLE_SYM, #else NULL, #endif - + COFF_SWAP_TABLE }; diff --git a/gnu/dist/toolchain/bfd/coff-rs6000.c b/gnu/dist/toolchain/bfd/coff-rs6000.c index 6f8563f911b3..76e58eafcdf1 100644 --- a/gnu/dist/toolchain/bfd/coff-rs6000.c +++ b/gnu/dist/toolchain/bfd/coff-rs6000.c @@ -5,7 +5,7 @@ Using the following chars caused a compiler warning on HIUX (so I replaced them with octal escapes), and isn't useful without an understanding of what character set it is. - Written by Metin G. Ozisik, Mimi Ph\373\364ng-Th\345o V\365, + Written by Metin G. Ozisik, Mimi Ph\373\364ng-Th\345o V\365, and John Gilmore. Archive support from Damon A. Permezel. Contributed by IBM Corporation and Cygnus Support. @@ -26,41 +26,25 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Internalcoff.h and coffcode.h modify themselves based on this flag. */ -#define RS6000COFF_C 1 - #include "bfd.h" #include "sysdep.h" #include "libbfd.h" #include "coff/internal.h" #include "coff/rs6000.h" #include "libcoff.h" +#define TARGET_NAME "aixcoff-rs6000" +#define TARGET_SYM rs6000coff_vec +#include "xcoff-target.h" /* The main body of code is in coffcode.h. */ -static boolean xcoff_mkobject PARAMS ((bfd *)); -static boolean xcoff_copy_private_bfd_data PARAMS ((bfd *, bfd *)); -static boolean xcoff_is_local_label_name PARAMS ((bfd *, const char *)); -static void xcoff_rtype2howto - PARAMS ((arelent *, struct internal_reloc *)); -static reloc_howto_type *xcoff_reloc_type_lookup - PARAMS ((bfd *, bfd_reloc_code_real_type)); -static boolean xcoff_slurp_armap PARAMS ((bfd *)); -static const bfd_target *xcoff_archive_p PARAMS ((bfd *)); -static PTR xcoff_read_ar_hdr PARAMS ((bfd *)); -static bfd *xcoff_openr_next_archived_file PARAMS ((bfd *, bfd *)); -static int xcoff_generic_stat_arch_elt PARAMS ((bfd *, struct stat *)); static const char *normalize_filename PARAMS ((bfd *)); -static boolean xcoff_write_armap - PARAMS ((bfd *, unsigned int, struct orl *, unsigned int, int)); -static boolean xcoff_write_archive_contents PARAMS ((bfd *)); -static int _bfd_xcoff_sizeof_headers PARAMS ((bfd *, boolean)); - + /* We use our own tdata type. Its first field is the COFF tdata type, so the COFF routines are compatible. */ -static boolean -xcoff_mkobject (abfd) +boolean +_bfd_xcoff_mkobject (abfd) bfd *abfd; { coff_data_type *coff; @@ -90,8 +74,8 @@ xcoff_mkobject (abfd) /* Copy XCOFF data from one BFD to another. */ -static boolean -xcoff_copy_private_bfd_data (ibfd, obfd) +boolean +_bfd_xcoff_copy_private_bfd_data (ibfd, obfd) bfd *ibfd; bfd *obfd; { @@ -138,430 +122,723 @@ xcoff_copy_private_bfd_data (ibfd, obfd) The AIX native linker does not have a -X option, and it ignores the -x option. */ -static boolean -xcoff_is_local_label_name (abfd, name) +boolean +_bfd_xcoff_is_local_label_name (abfd, name) bfd *abfd ATTRIBUTE_UNUSED; const char *name ATTRIBUTE_UNUSED; { return false; } +void +_bfd_xcoff_swap_sym_in (abfd, ext1, in1) + 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) + { + memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN); + } + 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_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); +} + +unsigned int +_bfd_xcoff_swap_sym_out (abfd, inp, 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) + { + memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN); + } + 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); + } + + 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); + 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; + PTR ext1; + int type; + int class; + int indx; + int numaux; + PTR in1; +{ + AUXENT *ext = (AUXENT *)ext1; + union internal_auxent *in = (union internal_auxent *)in1; + + switch (class) { + case C_FILE: + 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); + } + } + goto end; + + /* RS/6000 "csect" auxents */ + case C_EXT: + 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); + /* 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); + goto end; + } + break; + + 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); + /* PE defines some extra fields; we zero them out for + safety. */ + in->x_scn.x_checksum = 0; + in->x_scn.x_associated = 0; + in->x_scn.x_comdat = 0; + + goto end; + } + 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); + + 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); + } + 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]); + 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]); + 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]); + 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]); + } + 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. */ + +} + +unsigned int +_bfd_xcoff_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; +{ + union internal_auxent *in = (union internal_auxent *)inp; + AUXENT *ext = (AUXENT *)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); + goto end; + } + 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); + + 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); + } + 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]); + } + + if (ISFCN (type)) + PUTWORD (abfd, in->x_sym.x_misc.x_fsize, + (bfd_byte *) 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); + } + +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 conventional type. This table is for the types, which are used for different algorithms for putting in the reloc. Many of these relocs need special_function entries, which I have not written. */ -static reloc_howto_type xcoff_howto_table[] = +/* 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[] = { /* Standard 32 bit relocation. */ - HOWTO (0, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + 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 */ + 0, /* special_function */ + "R_POS", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ /* 32 bit relocation, but store negative value. */ - HOWTO (1, /* type */ - 0, /* rightshift */ - -2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (1, /* 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_NEG", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + 0, /* special_function */ + "R_NEG", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ /* 32 bit PC relative relocation. */ - HOWTO (2, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ + 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", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + 0, /* special_function */ + "R_REL", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + /* 16 bit TOC relative relocation. */ - HOWTO (3, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (3, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_TOC", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_TOC", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* I don't really know what this is. */ - HOWTO (4, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (4, /* type */ + 1, /* 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_RTB", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + 0, /* special_function */ + "R_RTB", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + /* External TOC relative symbol. */ - HOWTO (5, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (5, /* 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_GL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_GL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Local TOC relative symbol. */ - HOWTO (6, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (6, /* 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_TCL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_TCL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + EMPTY_HOWTO (7), - + /* Non modifiable absolute branch. */ - HOWTO (8, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (8, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_BA", /* name */ - true, /* partial_inplace */ - 0x3fffffc, /* src_mask */ - 0x3fffffc, /* dst_mask */ + 0, /* special_function */ + "R_BA", /* name */ + true, /* partial_inplace */ + 0x3fffffc, /* src_mask */ + 0x3fffffc, /* dst_mask */ false), /* pcrel_offset */ - + EMPTY_HOWTO (9), /* Non modifiable relative branch. */ - HOWTO (0xa, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0xa, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ - "R_BR", /* name */ - true, /* partial_inplace */ - 0x3fffffc, /* src_mask */ - 0x3fffffc, /* dst_mask */ + 0, /* special_function */ + "R_BR", /* name */ + true, /* partial_inplace */ + 0x3fffffc, /* src_mask */ + 0x3fffffc, /* dst_mask */ false), /* pcrel_offset */ - + EMPTY_HOWTO (0xb), /* Indirect load. */ - HOWTO (0xc, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0xc, /* 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_RL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_RL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Load address. */ - HOWTO (0xd, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0xd, /* 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_RLA", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_RLA", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + EMPTY_HOWTO (0xe), - + /* Non-relocating reference. */ - HOWTO (0xf, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0xf, /* 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_REF", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ + 0, /* special_function */ + "R_REF", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ false), /* pcrel_offset */ - + EMPTY_HOWTO (0x10), EMPTY_HOWTO (0x11), - + /* TOC relative indirect load. */ - HOWTO (0x12, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x12, /* 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_TRL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_TRL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* TOC relative load address. */ - HOWTO (0x13, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x13, /* 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_TRLA", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_TRLA", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Modifiable relative branch. */ - HOWTO (0x14, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x14, /* type */ + 1, /* 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_RRTBI", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + 0, /* special_function */ + "R_RRTBI", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Modifiable absolute branch. */ - HOWTO (0x15, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x15, /* type */ + 1, /* 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_RRTBA", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + 0, /* special_function */ + "R_RRTBA", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Modifiable call absolute indirect. */ - HOWTO (0x16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x16, /* 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_CAI", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_CAI", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Modifiable call relative. */ - HOWTO (0x17, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x17, /* 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_CREL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_CREL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Modifiable branch absolute. */ - HOWTO (0x18, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x18, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_RBA", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_RBA", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Modifiable branch absolute. */ - HOWTO (0x19, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x19, /* 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_RBAC", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_RBAC", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Modifiable branch relative. */ - HOWTO (0x1a, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x1a, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ - "R_RBR", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_RBR", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Modifiable branch absolute. */ - HOWTO (0x1b, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x1b, /* 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_RBRC", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_RBRC", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + HOWTO (0, /* type */ + 0, /* rightshift */ + 4, /* size (0 = byte, 1 = short, 2 = long) */ + 64, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + 0, /* special_function */ + "R_POS", /* name */ + true, /* partial_inplace */ + MINUS_ONE, /* src_mask */ + MINUS_ONE, /* dst_mask */ false) /* pcrel_offset */ + }; /* 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 */ + 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 */ + 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 */ + 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 */ + 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 */ + 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 */ -}; - -static void -xcoff_rtype2howto (relent, internal) + 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; struct internal_reloc *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]))) + && (internal->r_type + < sizeof (xcoff_howto_table_16)/sizeof (xcoff_howto_table_16[0]))) relent->howto = xcoff_howto_table_16 + internal->r_type; /* The r_size field of an XCOFF reloc encodes the bitsize of the relocation, as well as indicating whether it is signed or not. Doublecheck that the relocation information gathered from the - type matches this information. */ - if (relent->howto->bitsize != ((unsigned int) internal->r_size & 0x1f) + 1) + type matches this information. The bitsize is not significant + for R_REF relocs. */ + if (relent->howto->dst_mask != 0 + && (relent->howto->bitsize + != ((unsigned int) internal->r_size & 0x3f) + 1)) abort (); #if 0 if ((internal->r_size & 0x80) != 0 @@ -571,8 +848,8 @@ xcoff_rtype2howto (relent, internal) #endif } -static reloc_howto_type * -xcoff_reloc_type_lookup (abfd, code) +reloc_howto_type * +_bfd_xcoff_reloc_type_lookup (abfd, code) bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { @@ -587,34 +864,12 @@ xcoff_reloc_type_lookup (abfd, code) case BFD_RELOC_32: case BFD_RELOC_CTOR: return &xcoff_howto_table[0]; + case BFD_RELOC_64: + return &xcoff_howto_table[0x1c]; default: return NULL; } } - -#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 RTYPE2HOWTO(cache_ptr, dst) xcoff_rtype2howto (cache_ptr, dst) - -#define coff_mkobject xcoff_mkobject -#define coff_bfd_copy_private_bfd_data xcoff_copy_private_bfd_data -#define coff_bfd_is_local_label_name xcoff_is_local_label_name -#define coff_bfd_reloc_type_lookup xcoff_reloc_type_lookup -#define coff_relocate_section _bfd_ppc_xcoff_relocate_section - -#include "coffcode.h" /* XCOFF archive support. The original version of this code was by Damon A. Permezel. It was enhanced to permit cross support, and @@ -727,7 +982,6 @@ struct xcoff_ar_file_hdr_big #define SIZEOF_AR_FILE_HDR_BIG (6 * 20 + SXCOFFARMAG) - /* Each XCOFF archive member starts with this (printable) structure. */ struct xcoff_ar_hdr @@ -804,7 +1058,6 @@ struct xcoff_ar_hdr_big #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. */ @@ -826,34 +1079,17 @@ struct xcoff_ar_hdr_big #define arch_xhdr_big(bfd) \ ((struct xcoff_ar_hdr_big *) arch_eltdata (bfd)->arch_header) -/* XCOFF archives do not have anything which corresponds to an - extended name table. */ - -#define xcoff_slurp_extended_name_table bfd_false -#define xcoff_construct_extended_name_table \ - ((boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \ - bfd_false) -#define xcoff_truncate_arname bfd_dont_truncate_arname - -/* We can use the standard get_elt_at_index routine. */ - -#define xcoff_get_elt_at_index _bfd_generic_get_elt_at_index - -/* XCOFF archives do not have a timestamp. */ - -#define xcoff_update_armap_timestamp bfd_true - /* Read in the armap of an XCOFF archive. */ -static boolean -xcoff_slurp_armap (abfd) +boolean +_bfd_xcoff_slurp_armap (abfd) bfd *abfd; { file_ptr off; size_t namlen; bfd_size_type sz; bfd_byte *contents, *cend; - unsigned int c, i; + bfd_vma c, i; carsym *arsym; bfd_byte *p; @@ -888,6 +1124,33 @@ xcoff_slurp_armap (abfd) return false; sz = strtol (hdr.size, (char **) NULL, 10); + + /* Read in the entire symbol table. */ + contents = (bfd_byte *) bfd_alloc (abfd, sz); + if (contents == NULL) + return false; + if (bfd_read ((PTR) contents, 1, sz, abfd) != sz) + return false; + + /* The symbol table starts with a four byte count. */ + c = bfd_h_get_32 (abfd, contents); + + if (c * 4 >= sz) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + + bfd_ardata (abfd)->symdefs = ((carsym *) + bfd_alloc (abfd, c * sizeof (carsym))); + if (bfd_ardata (abfd)->symdefs == NULL) + return false; + + /* After the count comes a list of four byte file offsets. */ + 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); } else { @@ -918,35 +1181,35 @@ xcoff_slurp_armap (abfd) machines) since the field width is 20 and there numbers with more than 32 bits can be represented. */ sz = strtol (hdr.size, (char **) NULL, 10); + + /* Read in the entire symbol table. */ + contents = (bfd_byte *) bfd_alloc (abfd, sz); + if (contents == NULL) + return false; + if (bfd_read ((PTR) contents, 1, sz, abfd) != sz) + return false; + + /* The symbol table starts with an eight byte count. */ + c = bfd_h_get_64 (abfd, contents); + + if (c * 8 >= sz) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + + bfd_ardata (abfd)->symdefs = ((carsym *) + bfd_alloc (abfd, c * sizeof (carsym))); + if (bfd_ardata (abfd)->symdefs == NULL) + return false; + + /* After the count comes a list of eight byte file offsets. */ + 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); } - /* Read in the entire symbol table. */ - contents = (bfd_byte *) bfd_alloc (abfd, sz); - if (contents == NULL) - return false; - if (bfd_read ((PTR) contents, 1, sz, abfd) != sz) - return false; - - /* The symbol table starts with a four byte count. */ - c = bfd_h_get_32 (abfd, contents); - - if (c * 4 >= sz) - { - bfd_set_error (bfd_error_bad_value); - return false; - } - - bfd_ardata (abfd)->symdefs = ((carsym *) - bfd_alloc (abfd, c * sizeof (carsym))); - if (bfd_ardata (abfd)->symdefs == NULL) - return false; - - /* After the count comes a list of four byte file offsets. */ - 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); - /* After the file offsets come null terminated symbol names. */ cend = contents + sz; for (i = 0, arsym = bfd_ardata (abfd)->symdefs; @@ -969,8 +1232,8 @@ xcoff_slurp_armap (abfd) /* See if this is an XCOFF archive. */ -static const bfd_target * -xcoff_archive_p (abfd) +const bfd_target * +_bfd_xcoff_archive_p (abfd) bfd *abfd; { char magic[SXCOFFARMAG]; @@ -1060,7 +1323,7 @@ xcoff_archive_p (abfd) memcpy (bfd_ardata (abfd)->tdata, &hdr, SIZEOF_AR_FILE_HDR_BIG); } - if (! xcoff_slurp_armap (abfd)) + if (! _bfd_xcoff_slurp_armap (abfd)) { bfd_release (abfd, bfd_ardata (abfd)); abfd->tdata.aout_ar_data = (struct artdata *) NULL; @@ -1072,8 +1335,8 @@ xcoff_archive_p (abfd) /* Read the archive header in an XCOFF archive. */ -static PTR -xcoff_read_ar_hdr (abfd) +PTR +_bfd_xcoff_read_ar_hdr (abfd) bfd *abfd; { size_t namlen; @@ -1160,8 +1423,8 @@ xcoff_read_ar_hdr (abfd) /* Open the next element in an XCOFF archive. */ -static bfd * -xcoff_openr_next_archived_file (archive, last_file) +bfd * +_bfd_xcoff_openr_next_archived_file (archive, last_file) bfd *archive; bfd *last_file; { @@ -1221,8 +1484,8 @@ xcoff_openr_next_archived_file (archive, last_file) /* Stat an element in an XCOFF archive. */ -static int -xcoff_generic_stat_arch_elt (abfd, s) +int +_bfd_xcoff_generic_stat_arch_elt (abfd, s) bfd *abfd; struct stat *s; { @@ -1276,7 +1539,6 @@ normalize_filename (abfd) /* Write out an XCOFF armap. */ -/*ARGSUSED*/ static boolean xcoff_write_armap_old (abfd, elength, map, orl_count, stridx) bfd *abfd; @@ -1362,29 +1624,39 @@ xcoff_write_armap_old (abfd, elength, map, orl_count, stridx) return true; } -/*ARGSUSED*/ +/* Write a single armap in the big format. */ static boolean -xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) +xcoff_write_one_armap_big (abfd, map, orl_count, orl_ccount, stridx, bits64, + prevoff, nextoff) bfd *abfd; - unsigned int elength ATTRIBUTE_UNUSED; struct orl *map; unsigned int orl_count; - int stridx; + unsigned int orl_ccount; + unsigned int stridx; + int bits64; + const char *prevoff; + char *nextoff; { struct xcoff_ar_hdr_big hdr; char *p; unsigned char buf[4]; + const bfd_arch_info_type *arch_info = NULL; bfd *sub; file_ptr fileoff; + bfd *object_bfd; unsigned int i; 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_count * 4 + stridx)); - sprintf (hdr.nextoff, "%d", 0); - memcpy (hdr.prevoff, xcoff_ardata (abfd)->memoff, 12); + 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); @@ -1396,11 +1668,13 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) if (*p == '\0') *p = ' '; + memcpy (nextoff, hdr.nextoff, sizeof (hdr.nextoff)); + if (bfd_write ((PTR) &hdr, SIZEOF_AR_HDR_BIG, 1, abfd) != SIZEOF_AR_HDR_BIG || bfd_write (XCOFFARFMAG, 1, SXCOFFARFMAG, abfd) != SXCOFFARFMAG) return false; - bfd_h_put_32 (abfd, orl_count, buf); + bfd_h_put_32 (abfd, orl_ccount, buf); if (bfd_write (buf, 1, 4, abfd) != 4) return false; @@ -1411,13 +1685,18 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) { size_t namlen; - while (((bfd *) (map[i]).pos) == sub) - { - bfd_h_put_32 (abfd, fileoff, buf); - if (bfd_write (buf, 1, 4, abfd) != 4) - return false; - ++i; - } + 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++; + } + else + while (((bfd *) (map[i]).pos) == sub) + i++; + namlen = strlen (normalize_filename (sub)); namlen = (namlen + 1) &~ 1; fileoff += (SIZEOF_AR_HDR_BIG @@ -1428,10 +1707,18 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) sub = sub->next; } + object_bfd = NULL; for (i = 0; i < orl_count; i++) { const char *name; size_t namlen; + bfd *ob = (bfd *)map[i].pos; + + if (ob != object_bfd) + arch_info = bfd_get_arch_info (ob); + + if (arch_info && (arch_info->bits_per_address == 64) != bits64) + continue; name = *map[i].name; namlen = strlen (name); @@ -1451,9 +1738,67 @@ xcoff_write_armap_big (abfd, elength, map, orl_count, stridx) return true; } -/*ARGSUSED*/ static boolean -xcoff_write_armap (abfd, elength, map, orl_count, stridx) +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; + + return true; +} + +boolean +_bfd_xcoff_write_armap (abfd, elength, map, orl_count, stridx) bfd *abfd; unsigned int elength ATTRIBUTE_UNUSED; struct orl *map; @@ -1962,7 +2307,6 @@ xcoff_write_archive_contents_big (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.symoff, "%ld", (long) nextoff); bfd_ardata (abfd)->tdata = (PTR) &fhdr; if (! _bfd_compute_and_write_armap (abfd, 0)) return false; @@ -1983,8 +2327,8 @@ xcoff_write_archive_contents_big (abfd) return true; } -static boolean -xcoff_write_archive_contents (abfd) +boolean +_bfd_xcoff_write_archive_contents (abfd) bfd *abfd; { if (! xcoff_big_format_p (abfd)) @@ -1996,8 +2340,7 @@ xcoff_write_archive_contents (abfd) /* We can't use the usual coff_sizeof_headers routine, because AIX always uses an a.out header. */ -/*ARGSUSED*/ -static int +int _bfd_xcoff_sizeof_headers (abfd, reloc) bfd *abfd; boolean reloc ATTRIBUTE_UNUSED; @@ -2012,116 +2355,3 @@ _bfd_xcoff_sizeof_headers (abfd, reloc) size += abfd->section_count * SCNHSZ; return size; } - -#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 - -#ifdef AIX_CORE -#undef CORE_FILE_P -#define CORE_FILE_P rs6000coff_core_p -extern const bfd_target * rs6000coff_core_p (); -extern boolean rs6000coff_get_section_contents (); -extern boolean rs6000coff_core_file_matches_executable_p (); - -#undef coff_core_file_matches_executable_p -#define coff_core_file_matches_executable_p \ - rs6000coff_core_file_matches_executable_p - -extern char *rs6000coff_core_file_failing_command PARAMS ((bfd *abfd)); -#undef coff_core_file_failing_command -#define coff_core_file_failing_command rs6000coff_core_file_failing_command - -extern int rs6000coff_core_file_failing_signal PARAMS ((bfd *abfd)); -#undef coff_core_file_failing_signal -#define coff_core_file_failing_signal rs6000coff_core_file_failing_signal - -#undef coff_get_section_contents -#define coff_get_section_contents rs6000coff_get_section_contents -#endif /* AIX_CORE */ - -#ifdef LYNX_CORE - -#undef CORE_FILE_P -#define CORE_FILE_P lynx_core_file_p -extern const bfd_target *lynx_core_file_p PARAMS ((bfd *abfd)); - -extern boolean lynx_core_file_matches_executable_p PARAMS ((bfd *core_bfd, - bfd *exec_bfd)); -#undef coff_core_file_matches_executable_p -#define coff_core_file_matches_executable_p lynx_core_file_matches_executable_p - -extern char *lynx_core_file_failing_command PARAMS ((bfd *abfd)); -#undef coff_core_file_failing_command -#define coff_core_file_failing_command lynx_core_file_failing_command - -extern int lynx_core_file_failing_signal PARAMS ((bfd *abfd)); -#undef coff_core_file_failing_signal -#define coff_core_file_failing_signal lynx_core_file_failing_signal - -#endif /* LYNX_CORE */ - -#define _bfd_xcoff_bfd_get_relocated_section_contents \ - coff_bfd_get_relocated_section_contents -#define _bfd_xcoff_bfd_relax_section coff_bfd_relax_section -#define _bfd_xcoff_bfd_gc_sections coff_bfd_gc_sections -#define _bfd_xcoff_bfd_link_split_section coff_bfd_link_split_section - -/* The transfer vector that leads the outside world to all of the above. */ - -const bfd_target -#ifdef TARGET_SYM - TARGET_SYM = -#else - rs6000coff_vec = -#endif -{ -#ifdef TARGET_NAME - TARGET_NAME, -#else - "aixcoff-rs6000", /* name */ -#endif - bfd_target_coff_flavour, - BFD_ENDIAN_BIG, /* data byte order is big */ - BFD_ENDIAN_BIG, /* header byte order is big */ - - (HAS_RELOC | EXEC_P | /* object flags */ - HAS_LINENO | HAS_DEBUG | 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 */ - - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ - bfd_getb64, bfd_getb_signed_64, bfd_putb64, - bfd_getb32, bfd_getb_signed_32, bfd_putb32, - bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ - - {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ - xcoff_archive_p, CORE_FILE_P}, - {bfd_false, coff_mkobject, /* bfd_set_format */ - _bfd_generic_mkarchive, bfd_false}, - {bfd_false, coff_write_object_contents, /* bfd_write_contents */ - xcoff_write_archive_contents, bfd_false}, - - BFD_JUMP_TABLE_GENERIC (coff), - BFD_JUMP_TABLE_COPY (coff), - BFD_JUMP_TABLE_CORE (coff), - BFD_JUMP_TABLE_ARCHIVE (xcoff), - BFD_JUMP_TABLE_SYMBOLS (coff), - BFD_JUMP_TABLE_RELOCS (coff), - BFD_JUMP_TABLE_WRITE (coff), - BFD_JUMP_TABLE_LINK (_bfd_xcoff), - BFD_JUMP_TABLE_DYNAMIC (_bfd_xcoff), - - NULL, - - COFF_SWAP_TABLE -}; diff --git a/gnu/dist/toolchain/bfd/coff-sh.c b/gnu/dist/toolchain/bfd/coff-sh.c index 821fecd4db2c..77665d677ae0 100644 --- a/gnu/dist/toolchain/bfd/coff-sh.c +++ b/gnu/dist/toolchain/bfd/coff-sh.c @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "coff/pe.h" #ifndef COFF_IMAGE_WITH_PE -static boolean sh_align_load_span +static boolean sh_align_load_span PARAMS ((bfd *, asection *, bfd_byte *, boolean (*) (bfd *, asection *, PTR, bfd_byte *, bfd_vma), PTR, bfd_vma **, bfd_vma *, bfd_vma, bfd_vma, boolean *)); @@ -88,7 +88,7 @@ static boolean in_reloc_p (abfd, howto) reloc_howto_type * howto; { return ! howto->pc_relative && howto->type != R_SH_IMAGEBASE; -} +} #endif /* The supported relocations. There are a lot of relocations defined @@ -171,18 +171,18 @@ static reloc_howto_type sh_coff_howtos[] = EMPTY_HOWTO (15), #ifdef COFF_WITH_PE - HOWTO (R_SH_IMAGEBASE, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (R_SH_IMAGEBASE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - sh_reloc, /* special_function */ - "rva32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + sh_reloc, /* special_function */ + "rva32", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ #else EMPTY_HOWTO (16), /* R_SH_IMM8 */ @@ -391,14 +391,14 @@ static reloc_howto_type sh_coff_howtos[] = /* Get the value of a symbol, when performing a relocation. */ static long -get_symbol_value (symbol) +get_symbol_value (symbol) asymbol *symbol; -{ +{ bfd_vma relocation; if (bfd_is_com_section (symbol->section)) - relocation = 0; - else + relocation = 0; + else relocation = (symbol->value + symbol->section->output_section->vma + symbol->section->output_offset); @@ -676,7 +676,7 @@ sh_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, align load and store instructions on four byte boundaries if we can, by swapping them with one of the adjacent instructions. */ -static boolean +static boolean sh_relax_section (abfd, sec, link_info, again) bfd *abfd; asection *sec; @@ -2144,7 +2144,7 @@ sh_insn_info (insn) return op; } - return NULL; + return NULL; } /* See whether an instruction uses or sets a general purpose register */ @@ -2251,7 +2251,7 @@ sh_insn_uses_freg (insn, op, freg) of a double precision value. So what this all boils down to is that we have to ignore the lowest bit of the register number. */ - + if ((f & USESF1) != 0 && (USESF1_REG (insn) & 0xe) == (freg & 0xe)) return true; @@ -2285,7 +2285,7 @@ sh_insn_sets_freg (insn, op, freg) of a double precision value. So what this all boils down to is that we have to ignore the lowest bit of the register number. */ - + if ((f & SETSF1) != 0 && (SETSF1_REG (insn) & 0xe) == (freg & 0xe)) return true; @@ -2485,7 +2485,7 @@ _bfd_sh_align_load_span (abfd, sec, contents, swap, relocs, if (dsp && i - 2 > start) { unsigned pprev_insn = bfd_get_16 (abfd, contents + i - 4); - + if ((pprev_insn & 0xfc00) == 0xf800) prev_op = NULL; else @@ -2875,7 +2875,7 @@ sh_relocate_section (output_bfd, info, input_bfd, input_section, contents, sym = NULL; } else - { + { if (symndx < 0 || (unsigned long) symndx >= obj_raw_syment_count (input_bfd)) { @@ -2912,7 +2912,7 @@ sh_relocate_section (output_bfd, info, input_bfd, input_section, contents, if (rel->r_type == R_SH_IMAGEBASE) addend -= pe_data (input_section->output_section->owner)->pe_opthdr.ImageBase; #endif - + val = 0; if (h == NULL) @@ -3118,7 +3118,7 @@ CREATE_BIG_COFF_TARGET_VEC (shcoff_vec, "coff-sh", BFD_IS_RELAXABLE, 0, '_', NUL #else #define TARGET_SYM shlcoff_vec #endif - + #ifndef TARGET_SHL_NAME #define TARGET_SHL_NAME "coff-shl" #endif @@ -3198,6 +3198,16 @@ static const bfd_coff_backend_data bfd_coff_small_swap_table = false, #endif 2, +#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS + true, +#else + false, +#endif +#ifdef COFF_DEBUG_STRING_WIDE_PREFIX + 4, +#else + 2, +#endif coff_swap_filehdr_in, coff_swap_aouthdr_in, coff_swap_scnhdr_in, coff_swap_reloc_in, coff_bad_format_hook, coff_set_arch_mach_hook, coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, @@ -3260,7 +3270,7 @@ const bfd_target shcoff_small_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), & shlcoff_small_vec, - + (PTR) &bfd_coff_small_swap_table }; @@ -3287,7 +3297,7 @@ const bfd_target shlcoff_small_vec = bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ {_bfd_dummy_target, coff_small_object_p, /* bfd_check_format */ - bfd_generic_archive_p, _bfd_dummy_target}, + bfd_generic_archive_p, _bfd_dummy_target}, {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ bfd_false}, {bfd_false, coff_write_object_contents, /* bfd_write_contents */ @@ -3304,7 +3314,7 @@ const bfd_target shlcoff_small_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), & shcoff_small_vec, - + (PTR) &bfd_coff_small_swap_table }; #endif diff --git a/gnu/dist/toolchain/bfd/coff-sparc.c b/gnu/dist/toolchain/bfd/coff-sparc.c index 5e919da1f990..93677707830f 100644 --- a/gnu/dist/toolchain/bfd/coff-sparc.c +++ b/gnu/dist/toolchain/bfd/coff-sparc.c @@ -36,8 +36,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ enum reloc_type { R_SPARC_NONE = 0, - R_SPARC_8, R_SPARC_16, R_SPARC_32, - R_SPARC_DISP8, R_SPARC_DISP16, R_SPARC_DISP32, + R_SPARC_8, R_SPARC_16, R_SPARC_32, + R_SPARC_DISP8, R_SPARC_DISP16, R_SPARC_DISP32, R_SPARC_WDISP30, R_SPARC_WDISP22, R_SPARC_HI22, R_SPARC_22, R_SPARC_13, R_SPARC_LO10, @@ -96,7 +96,7 @@ bfd_coff_generic_reloc (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_continue; } -static reloc_howto_type coff_sparc_howto_table[] = +static reloc_howto_type coff_sparc_howto_table[] = { HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, bfd_coff_generic_reloc,"R_SPARC_NONE", false,0,0x00000000,true), HOWTO(R_SPARC_8, 0,0, 8,false,0,complain_overflow_bitfield,bfd_coff_generic_reloc,"R_SPARC_8", false,0,0x000000ff,true), @@ -197,7 +197,7 @@ rtype2howto (cache_ptr, dst) #define __A_MAGIC_SET__ -/* Enable Sparc-specific hacks in coffcode.h. */ +/* Enable Sparc-specific hacks in coffcode.h. */ #define COFF_SPARC diff --git a/gnu/dist/toolchain/bfd/coff-stgo32.c b/gnu/dist/toolchain/bfd/coff-stgo32.c index 5a7a716a9e09..9fb9d37cae43 100644 --- a/gnu/dist/toolchain/bfd/coff-stgo32.c +++ b/gnu/dist/toolchain/bfd/coff-stgo32.c @@ -1,5 +1,5 @@ -/* BFD back-end for Intel 386 COFF files (go32 variant with a stub). - Copyright 1997, 1998, 1999, 2000 Free Software Foundation, Inc. +/* BFD back-end for Intel 386 COFF files (DJGPP variant with a stub). + Copyright 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Robert Hoehne. This file is part of BFD, the Binary File Descriptor library. @@ -41,13 +41,12 @@ #define COFF_GO32_EXE #define COFF_LONG_SECTION_NAMES #define COFF_SUPPORT_GNU_LINKONCE +#define COFF_LONG_FILENAMES #define COFF_SECTION_ALIGNMENT_ENTRIES \ { COFF_SECTION_NAME_EXACT_MATCH (".data"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ { COFF_SECTION_NAME_EXACT_MATCH (".text"), \ - COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 }, \ -{ COFF_SECTION_NAME_EXACT_MATCH (".bss"), \ COFF_ALIGNMENT_FIELD_EMPTY, COFF_ALIGNMENT_FIELD_EMPTY, 4 } #include "bfd.h" @@ -111,7 +110,7 @@ static boolean /* This macro is used, because I cannot assume the endianess of the host system */ -#define _H(index) (bfd_h_get_16(abfd, (bfd_byte *)(header+index*2))) +#define _H(index) (bfd_h_get_16(abfd, (bfd_byte *) (header+index*2))) /* These bytes are a 2048-byte DOS executable, which loads the COFF image into memory and then runs it. It is called 'stub' */ diff --git a/gnu/dist/toolchain/bfd/coff-tic30.c b/gnu/dist/toolchain/bfd/coff-tic30.c index a971f76d7be9..267ca974308c 100644 --- a/gnu/dist/toolchain/bfd/coff-tic30.c +++ b/gnu/dist/toolchain/bfd/coff-tic30.c @@ -49,7 +49,7 @@ reloc_howto_type tic30_coff_howto_table[] = /* For the case statement use the code values used in tc_gen_reloc to map to the howto table entries that match those in both the aout - and coff implementations. */ + and coff implementations. */ reloc_howto_type * tic30_coff_reloc_type_lookup (abfd, code) bfd *abfd ATTRIBUTE_UNUSED; @@ -86,7 +86,6 @@ coff_tic30_select_reloc (howto) #define SELECT_RELOC(x,howto) x.r_type = coff_tic30_select_reloc(howto) - #define BADMAG(x) TIC30BADMAG(x) #define TIC30 1 /* Customize coffcode.h */ #define __A_MAGIC_SET__ @@ -97,7 +96,7 @@ coff_tic30_select_reloc (howto) #define SWAP_OUT_RELOC_EXTRA(abfd, src, dst) dst->r_stuff[0] = 'S'; \ dst->r_stuff[1] = 'C'; -/* Code to turn a r_type into a howto ptr, uses the above howto table. */ +/* Code to turn a r_type into a howto ptr, uses the above howto table. */ static void rtype2howto (internal, dst) @@ -134,7 +133,6 @@ rtype2howto (internal, dst) #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \ cache_ptr->addend = ext_reloc.r_offset; - #define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \ reloc_processing(relent, reloc, symbols, abfd, section) @@ -203,6 +201,6 @@ const bfd_target tic30_coff_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + COFF_SWAP_TABLE }; diff --git a/gnu/dist/toolchain/bfd/coff-tic54x.c b/gnu/dist/toolchain/bfd/coff-tic54x.c new file mode 100644 index 000000000000..6a3aef1d0b45 --- /dev/null +++ b/gnu/dist/toolchain/bfd/coff-tic54x.c @@ -0,0 +1,760 @@ +/* BFD back-end for TMS320C54X coff binaries. + Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Contributed by Timothy Wall (twall@cygnus.com) + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "bfdlink.h" +#include "coff/tic54x.h" +#include "coff/internal.h" +#include "libcoff.h" + +#undef F_LSYMS +#define F_LSYMS F_LSYMS_TICOFF + +/* + 32-bit operations + The octet order is screwy. words are LSB first (LS octet, actually), but + longwords are MSW first. For example, 0x12345678 is encoded 0x5678 in the + first word and 0x1234 in the second. When looking at the data as stored in + the COFF file, you would see the octets ordered as 0x78, 0x56, 0x34, 0x12. + Don't bother with 64-bits, as there aren't any. + */ +static bfd_vma +tic54x_getl32(addr) + register const bfd_byte *addr; +{ + unsigned long v; + v = (unsigned long) addr[2]; + v |= (unsigned long) addr[3] << 8; + v |= (unsigned long) addr[0] << 16; + v |= (unsigned long) addr[1] << 24; + return (bfd_vma) v; +} + +static void +tic54x_putl32 (data, addr) + bfd_vma data; + register bfd_byte *addr; +{ + addr[2] = (bfd_byte)data; + addr[3] = (bfd_byte) (data >> 8); + addr[0] = (bfd_byte) (data >> 16); + addr[1] = (bfd_byte) (data >> 24); +} + +bfd_signed_vma +tic54x_getl_signed_32 (addr) + register const bfd_byte *addr; +{ + unsigned long v; + + v = (unsigned long) addr[2]; + v |= (unsigned long) addr[3] << 8; + v |= (unsigned long) addr[0] << 16; + v |= (unsigned long) addr[1] << 24; +#define COERCE32(x) \ + ((bfd_signed_vma) (long) (((unsigned long) (x) ^ 0x80000000) - 0x80000000)) + return COERCE32 (v); +} + +#define coff_get_section_load_page bfd_ticoff_get_section_load_page +#define coff_set_section_load_page bfd_ticoff_set_section_load_page + +void +bfd_ticoff_set_section_load_page (sect, page) + asection *sect; + int page; +{ + sect->lma = (sect->lma & ADDR_MASK) | PG_TO_FLAG(page); +} + +int +bfd_ticoff_get_section_load_page (sect) + asection *sect; +{ + int page; + + /* Provide meaningful defaults for predefined sections. */ + if (sect == &bfd_com_section) + page = PG_DATA; + + else if (sect == &bfd_und_section + || sect == &bfd_abs_section + || sect == &bfd_ind_section) + page = PG_PROG; + + else + page = FLAG_TO_PG (sect->lma); + + return page; +} + +/* Set the architecture appropriately. Allow unkown architectures + (e.g. binary). */ +static boolean +tic54x_set_arch_mach (abfd, arch, machine) + bfd *abfd; + enum bfd_architecture arch; + unsigned long machine; +{ + if (arch == bfd_arch_unknown) + arch = bfd_arch_tic54x; + + else if (arch != bfd_arch_tic54x) + return false; + + return bfd_default_set_arch_mach (abfd, arch, machine); +} + +static bfd_reloc_status_type +tic54x_relocation (abfd, reloc_entry, symbol, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry; + asymbol *symbol ATTRIBUTE_UNUSED; + PTR data ATTRIBUTE_UNUSED; + asection *input_section; + bfd *output_bfd; + char **error_message ATTRIBUTE_UNUSED; +{ + + if (output_bfd != (bfd *) NULL) + { + /* This is a partial relocation, and we want to apply the + relocation to the reloc entry rather than the raw data. + Modify the reloc inplace to reflect what we now know. */ + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + return bfd_reloc_continue; +} + +reloc_howto_type tic54x_howto_table[] = +{ +/* type,rightshift,size (0=byte, 1=short, 2=long), + bit size, pc_relative, bitpos, dont complain_on_overflow, + special_function, name, partial_inplace, src_mask, dst_mask, pcrel_offset */ + + /* NORMAL BANK */ + /* 16-bit direct reference to symbol's address */ + HOWTO (R_RELWORD,0,1,16,false,0,complain_overflow_dont, + tic54x_relocation,"REL16",false,0xFFFF,0xFFFF,false), + + /* 7 LSBs of an address */ + HOWTO (R_PARTLS7,0,1,7,false,0,complain_overflow_dont, + tic54x_relocation,"LS7",false,0x007F,0x007F,false), + + /* 9 MSBs of an address */ + /* TI assembler doesn't shift its encoding, and is thus incompatible */ + HOWTO (R_PARTMS9,7,1,9,false,0,complain_overflow_dont, + tic54x_relocation,"MS9",false,0x01FF,0x01FF,false), + + /* 23-bit relocation */ + HOWTO (R_EXTWORD,0,2,23,false,0,complain_overflow_dont, + tic54x_relocation,"RELEXT",false,0x7FFFFF,0x7FFFFF,false), + + /* 16 bits of 23-bit extended address */ + HOWTO (R_EXTWORD16,0,1,16,false,0,complain_overflow_dont, + tic54x_relocation,"RELEXT16",false,0x7FFFFF,0x7FFFFF,false), + + /* upper 7 bits of 23-bit extended address */ + HOWTO (R_EXTWORDMS7,16,1,7,false,0,complain_overflow_dont, + tic54x_relocation,"RELEXTMS7",false,0x7F,0x7F,false), + + /* ABSOLUTE BANK */ + /* 16-bit direct reference to symbol's address, absolute */ + HOWTO (R_RELWORD,0,1,16,false,0,complain_overflow_dont, + tic54x_relocation,"AREL16",false,0xFFFF,0xFFFF,false), + + /* 7 LSBs of an address, absolute */ + HOWTO (R_PARTLS7,0,1,7,false,0,complain_overflow_dont, + tic54x_relocation,"ALS7",false,0x007F,0x007F,false), + + /* 9 MSBs of an address, absolute */ + /* TI assembler doesn't shift its encoding, and is thus incompatible */ + HOWTO (R_PARTMS9,7,1,9,false,0,complain_overflow_dont, + tic54x_relocation,"AMS9",false,0x01FF,0x01FF,false), + + /* 23-bit direct reference, absolute */ + HOWTO (R_EXTWORD,0,2,23,false,0,complain_overflow_dont, + tic54x_relocation,"ARELEXT",false,0x7FFFFF,0x7FFFFF,false), + + /* 16 bits of 23-bit extended address, absolute */ + HOWTO (R_EXTWORD16,0,1,16,false,0,complain_overflow_dont, + tic54x_relocation,"ARELEXT16",false,0x7FFFFF,0x7FFFFF,false), + + /* upper 7 bits of 23-bit extended address, absolute */ + HOWTO (R_EXTWORDMS7,16,1,7,false,0,complain_overflow_dont, + tic54x_relocation,"ARELEXTMS7",false,0x7F,0x7F,false), + + /* 32-bit relocation exclusively for stabs */ + HOWTO (R_RELLONG,0,2,32,false,0,complain_overflow_dont, + tic54x_relocation,"STAB",false,0xFFFFFFFF,0xFFFFFFFF,false), + +}; + +#define coff_bfd_reloc_type_lookup tic54x_coff_reloc_type_lookup + +/* For the case statement use the code values used tc_gen_reloc (defined in + bfd/reloc.c) to map to the howto table entries */ +reloc_howto_type * +tic54x_coff_reloc_type_lookup (abfd, code) + bfd *abfd ATTRIBUTE_UNUSED; + bfd_reloc_code_real_type code; +{ + switch (code) + { + case BFD_RELOC_16: + return &tic54x_howto_table[0]; + case BFD_RELOC_TIC54X_PARTLS7: + return &tic54x_howto_table[1]; + case BFD_RELOC_TIC54X_PARTMS9: + return &tic54x_howto_table[2]; + case BFD_RELOC_TIC54X_23: + return &tic54x_howto_table[3]; + case BFD_RELOC_TIC54X_16_OF_23: + return &tic54x_howto_table[4]; + case BFD_RELOC_TIC54X_MS7_OF_23: + return &tic54x_howto_table[5]; + case BFD_RELOC_32: + return &tic54x_howto_table[12]; + default: + return (reloc_howto_type *) NULL; + } +} + +/* Code to turn a r_type into a howto ptr, uses the above howto table. + Called after some initial checking by the tic54x_rtype_to_howto fn below */ +static void +tic54x_lookup_howto (internal, dst) + arelent *internal; + struct internal_reloc *dst; +{ + unsigned i; + int bank = (dst->r_symndx == -1) ? HOWTO_BANK : 0; + for (i = 0; i < sizeof tic54x_howto_table/sizeof tic54x_howto_table[0]; i++) + { + if (tic54x_howto_table[i].type == dst->r_type) + { + internal->howto = tic54x_howto_table + i + bank; + return; + } + } + + (*_bfd_error_handler) (_("Unrecognized reloc type 0x%x"), + (unsigned int) dst->r_type); + abort (); +} + +#define RELOC_PROCESSING(RELENT,RELOC,SYMS,ABFD,SECT)\ + tic54x_reloc_processing(RELENT,RELOC,SYMS,ABFD,SECT) + +static void tic54x_reloc_processing(); + +#define coff_rtype_to_howto coff_tic54x_rtype_to_howto + +static reloc_howto_type * +coff_tic54x_rtype_to_howto (abfd, sec, rel, h, sym, addendp) + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec; + struct internal_reloc *rel; + struct coff_link_hash_entry *h ATTRIBUTE_UNUSED; + struct internal_syment *sym ATTRIBUTE_UNUSED; + bfd_vma *addendp; +{ + arelent genrel; + + if (rel->r_symndx == -1 && addendp != NULL) + { + /* This is a TI "internal relocation", which means that the relocation + amount is the amount by which the current section is being relocated + in the output section. */ + *addendp = (sec->output_section->vma + sec->output_offset) - sec->vma; + } + + tic54x_lookup_howto (&genrel, rel); + + return genrel.howto; +} + +static boolean +ticoff0_bad_format_hook (abfd, filehdr) + bfd * abfd ATTRIBUTE_UNUSED; + PTR filehdr; +{ + struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; + + if (COFF0_BADMAG (*internal_f)) + return false; + + return true; +} + +static boolean +ticoff1_bad_format_hook (abfd, filehdr) + bfd * abfd ATTRIBUTE_UNUSED; + PTR filehdr; +{ + struct internal_filehdr *internal_f = (struct internal_filehdr *) filehdr; + + if (COFF1_BADMAG (*internal_f)) + return false; + + return true; +} + +/* replace the stock _bfd_coff_is_local_label_name to recognize TI COFF local + labels */ +static boolean +ticoff_bfd_is_local_label_name (abfd, name) + bfd *abfd ATTRIBUTE_UNUSED; + const char *name; +{ + if (TICOFF_LOCAL_LABEL_P(name)) + return true; + return false; +} + +#define coff_bfd_is_local_label_name ticoff_bfd_is_local_label_name + +/* Customize coffcode.h; the default coff_ functions are set up to use COFF2; + coff_bad_format_hook uses BADMAG, so set that for COFF2. The COFF1 + and COFF0 vectors use custom _bad_format_hook procs instead of setting + BADMAG. + */ +#define BADMAG(x) COFF2_BADMAG(x) +#include "coffcode.h" + +static boolean +tic54x_set_section_contents (abfd, section, location, offset, bytes_to_do) + bfd *abfd; + sec_ptr section; + PTR location; + file_ptr offset; + bfd_size_type bytes_to_do; +{ + return coff_set_section_contents (abfd, section, location, + offset, bytes_to_do); +} + +static void +tic54x_reloc_processing (relent, reloc, symbols, abfd, section) + arelent *relent; + struct internal_reloc *reloc; + asymbol **symbols; + bfd *abfd; + asection *section; +{ + asymbol *ptr; + + relent->address = reloc->r_vaddr; + + if (reloc->r_symndx != -1) + { + if (reloc->r_symndx < 0 || reloc->r_symndx >= obj_conv_table_size (abfd)) + { + (*_bfd_error_handler) + (_("%s: warning: illegal symbol index %ld in relocs"), + bfd_get_filename (abfd), reloc->r_symndx); + relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; + ptr = NULL; + } + else + { + relent->sym_ptr_ptr = (symbols + + obj_convert (abfd)[reloc->r_symndx]); + ptr = *(relent->sym_ptr_ptr); + } + } + else + { + relent->sym_ptr_ptr = section->symbol_ptr_ptr; + ptr = *(relent->sym_ptr_ptr); + } + + /* The symbols definitions that we have read in have been + relocated as if their sections started at 0. But the offsets + refering to the symbols in the raw data have not been + modified, so we have to have a negative addend to compensate. + + Note that symbols which used to be common must be left alone */ + + /* Calculate any reloc addend by looking at the symbol */ + CALC_ADDEND (abfd, ptr, *reloc, relent); + + relent->address -= section->vma; + /* !! relent->section = (asection *) NULL;*/ + + /* Fill in the relent->howto field from reloc->r_type */ + tic54x_lookup_howto (relent, reloc); +} + +/* COFF0 differs in file/section header size and relocation entry size */ +static CONST bfd_coff_backend_data ticoff0_swap_table = +{ + coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in, + coff_SWAP_aux_out, coff_SWAP_sym_out, + coff_SWAP_lineno_out, coff_SWAP_reloc_out, + coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out, + coff_SWAP_scnhdr_out, + FILHSZ_V0, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ_V0, LINESZ, FILNMLEN, +#ifdef COFF_LONG_FILENAMES + true, +#else + false, +#endif +#ifdef COFF_LONG_SECTION_NAMES + true, +#else + false, +#endif +#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS + true, +#else + false, +#endif +#ifdef COFF_DEBUG_STRING_WIDE_PREFIX + 4, +#else + 2, +#endif + COFF_DEFAULT_SECTION_ALIGNMENT_POWER, + coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in, + coff_SWAP_reloc_in, ticoff0_bad_format_hook, coff_set_arch_mach_hook, + coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, + coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook, + coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate, + coff_classify_symbol, coff_compute_section_file_positions, + coff_start_final_link, coff_relocate_section, coff_rtype_to_howto, + coff_adjust_symndx, coff_link_add_one_symbol, + coff_link_output_has_begun, coff_final_link_postscript +}; + +/* COFF1 differs in section header size */ +static CONST bfd_coff_backend_data ticoff1_swap_table = +{ + coff_SWAP_aux_in, coff_SWAP_sym_in, coff_SWAP_lineno_in, + coff_SWAP_aux_out, coff_SWAP_sym_out, + coff_SWAP_lineno_out, coff_SWAP_reloc_out, + coff_SWAP_filehdr_out, coff_SWAP_aouthdr_out, + coff_SWAP_scnhdr_out, + FILHSZ, AOUTSZ, SCNHSZ_V01, SYMESZ, AUXESZ, RELSZ, LINESZ, FILNMLEN, +#ifdef COFF_LONG_FILENAMES + true, +#else + false, +#endif +#ifdef COFF_LONG_SECTION_NAMES + true, +#else + false, +#endif + COFF_DEFAULT_SECTION_ALIGNMENT_POWER, +#ifdef COFF_FORCE_SYMBOLS_IN_STRINGS + true, +#else + false, +#endif +#ifdef COFF_DEBUG_STRING_WIDE_PREFIX + 4, +#else + 2, +#endif + coff_SWAP_filehdr_in, coff_SWAP_aouthdr_in, coff_SWAP_scnhdr_in, + coff_SWAP_reloc_in, ticoff1_bad_format_hook, coff_set_arch_mach_hook, + coff_mkobject_hook, styp_to_sec_flags, coff_set_alignment_hook, + coff_slurp_symbol_table, symname_in_debug_hook, coff_pointerize_aux_hook, + coff_print_aux, coff_reloc16_extra_cases, coff_reloc16_estimate, + coff_classify_symbol, coff_compute_section_file_positions, + coff_start_final_link, coff_relocate_section, coff_rtype_to_howto, + coff_adjust_symndx, coff_link_add_one_symbol, + coff_link_output_has_begun, coff_final_link_postscript +}; + +/* TI COFF v0, DOS tools (little-endian headers) */ +const bfd_target tic54x_coff0_vec = +{ + "coff0-c54x", /* name */ + bfd_target_coff_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT ), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (tic54x), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + NULL, + + (PTR)&ticoff0_swap_table +}; + +/* TI COFF v0, SPARC tools (big-endian headers) */ +const bfd_target tic54x_coff0_beh_vec = +{ + "coff0-beh-c54x", /* name */ + bfd_target_coff_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_BIG, /* header byte order is big */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT ), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (tic54x), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + &tic54x_coff0_vec, + + (PTR)&ticoff0_swap_table +}; + +/* TI COFF v1, DOS tools (little-endian headers) */ +const bfd_target tic54x_coff1_vec = +{ + "coff1-c54x", /* name */ + bfd_target_coff_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT ), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (tic54x), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + &tic54x_coff0_beh_vec, + + (PTR)&ticoff1_swap_table +}; + +/* TI COFF v1, SPARC tools (big-endian headers) */ +const bfd_target tic54x_coff1_beh_vec = +{ + "coff1-beh-c54x", /* name */ + bfd_target_coff_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_BIG, /* header byte order is big */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT ), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (tic54x), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + &tic54x_coff1_vec, + + (PTR)&ticoff1_swap_table +}; + +/* TI COFF v2, TI DOS tools output (little-endian headers) */ +const bfd_target tic54x_coff2_vec = +{ + "coff2-c54x", /* name */ + bfd_target_coff_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_LITTLE, /* header byte order is little (DOS tools) */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT ), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + bfd_getl32, bfd_getl_signed_32, bfd_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (tic54x), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + &tic54x_coff1_beh_vec, + + COFF_SWAP_TABLE +}; + +/* TI COFF v2, TI SPARC tools output (big-endian headers) */ +const bfd_target tic54x_coff2_beh_vec = +{ + "coff2-beh-c54x", /* name */ + bfd_target_coff_flavour, + BFD_ENDIAN_LITTLE, /* data byte order is little */ + BFD_ENDIAN_BIG, /* header byte order is big */ + + (HAS_RELOC | EXEC_P | /* object flags */ + HAS_LINENO | HAS_DEBUG | + HAS_SYMS | HAS_LOCALS | WP_TEXT ), + + (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* section flags */ + '_', /* leading symbol underscore */ + '/', /* ar_pad_char */ + 15, /* ar_max_namelen */ + bfd_getl64, bfd_getl_signed_64, bfd_putl64, + tic54x_getl32, tic54x_getl_signed_32, tic54x_putl32, + bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + bfd_generic_archive_p, _bfd_dummy_target}, + {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ + bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (_bfd_nocore), + BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (tic54x), + BFD_JUMP_TABLE_LINK (coff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), + + &tic54x_coff2_vec, + + COFF_SWAP_TABLE +}; diff --git a/gnu/dist/toolchain/bfd/coff-tic80.c b/gnu/dist/toolchain/bfd/coff-tic80.c index a8ade33ba9c7..934603cf9d18 100644 --- a/gnu/dist/toolchain/bfd/coff-tic80.c +++ b/gnu/dist/toolchain/bfd/coff-tic80.c @@ -424,7 +424,7 @@ local16_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, /* Code to turn an external r_type into a pointer to an entry in the howto_table. If passed an r_type we don't recognize the abort rather than silently failing - to generate an output file. */ + to generate an output file. */ static void rtype2howto (cache_ptr, dst) @@ -465,7 +465,7 @@ coff_tic80_rtype_to_howto (abfd, sec, rel, h, sym, addendp) { /* This is a TI "internal relocation", which means that the relocation amount is the amount by which the current section is being relocated - in the output section. */ + in the output section. */ *addendp = (sec -> output_section -> vma + sec -> output_offset) - sec -> vma; } RTYPE2HOWTO (&genrel, rel); @@ -518,7 +518,7 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd, sym = NULL; } else - { + { h = obj_coff_sym_hashes (input_bfd)[symndx]; sym = syms + symndx; } @@ -649,7 +649,7 @@ coff_tic80_relocate_section (output_bfd, info, input_bfd, contents[addr + 1] |= hold & 0x80; break; } - + case R_PPBASE: /* Parameter RAM is from 0x1000000 to 0x1000800. */ contents[addr] &=~ 0x3; diff --git a/gnu/dist/toolchain/bfd/coff-w65.c b/gnu/dist/toolchain/bfd/coff-w65.c index c82d4d7844bd..787f4dba9963 100644 --- a/gnu/dist/toolchain/bfd/coff-w65.c +++ b/gnu/dist/toolchain/bfd/coff-w65.c @@ -42,7 +42,6 @@ static reloc_howto_type howto_table[] = }; - /* Turn a howto into a reloc number */ #define SELECT_RELOC(x,howto) \ @@ -52,7 +51,6 @@ static reloc_howto_type howto_table[] = #define W65 1 /* Customize coffcode.h */ #define __A_MAGIC_SET__ - /* Code to swap in the reloc */ #define SWAP_IN_RELOC_OFFSET bfd_h_get_32 #define SWAP_OUT_RELOC_OFFSET bfd_h_put_32 @@ -60,7 +58,6 @@ static reloc_howto_type howto_table[] = dst->r_stuff[0] = 'S'; \ dst->r_stuff[1] = 'C'; - static int select_reloc (howto) reloc_howto_type *howto; @@ -81,14 +78,11 @@ rtype2howto (internal, dst) #define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry) - /* Perform any necessary magic to the addend in a reloc entry */ - #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \ cache_ptr->addend = ext_reloc.r_offset; - #define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \ reloc_processing(relent, reloc, symbols, abfd, section) @@ -112,15 +106,12 @@ reloc_processing (relent, reloc, symbols, abfd, section) relent->sym_ptr_ptr = (asymbol **)&(bfd_abs_symbol); } - - relent->addend = reloc->r_offset; relent->address -= section->vma; /* relent->section = 0;*/ } - static int h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) bfd *abfd; @@ -129,11 +120,11 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) unsigned int shrink; struct bfd_link_info *link_info; { - bfd_vma value; + bfd_vma value; bfd_vma dot; bfd_vma gap; - /* The address of the thing to be relocated will have moved back by + /* The address of the thing to be relocated will have moved back by the size of the shrink - but we don't change reloc->address here, since we need it to know where the relocation lives in the source uncooked section */ @@ -141,10 +132,9 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) /* reloc->address -= shrink; conceptual */ bfd_vma address = reloc->address - shrink; - switch (reloc->howto->type) - { + { case R_MOV16B2: case R_JMP2: shrink+=2; @@ -155,40 +145,40 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) value = bfd_coff_reloc16_get_value(reloc, link_info, input_section); if (value >= 0xff00) - { + { /* Change the reloc type from 16bit, possible 8 to 8bit possible 16 */ - reloc->howto = reloc->howto + 1; + reloc->howto = reloc->howto + 1; /* The place to relc moves back by one */ /* This will be two bytes smaller in the long run */ shrink +=2 ; bfd_perform_slip(abfd, 2, input_section, address); - } + } break; - /* This is the 24 bit branch which could become an 8 bitter, + /* This is the 24 bit branch which could become an 8 bitter, the relocation points to the first byte of the insn, not the actual data */ case R_JMPL1: value = bfd_coff_reloc16_get_value(reloc, link_info, input_section); - + dot = input_section->output_section->vma + input_section->output_offset + address; - + /* See if the address we're looking at within 127 bytes of where we are, if so then we can use a small branch rather than the jump we were going to */ gap = value - dot ; - + if (-120 < (long)gap && (long)gap < 120 ) - { + { /* Change the reloc type from 24bit, possible 8 to 8bit possible 32 */ - reloc->howto = reloc->howto + 1; + reloc->howto = reloc->howto + 1; /* This will be two bytes smaller in the long run */ shrink +=2 ; bfd_perform_slip(abfd, 2, input_section, address); @@ -198,23 +188,22 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) case R_JMP1: value = bfd_coff_reloc16_get_value(reloc, link_info, input_section); - + dot = input_section->output_section->vma + input_section->output_offset + address; - + /* See if the address we're looking at within 127 bytes of where we are, if so then we can use a small branch rather than the jump we were going to */ gap = value - (dot - shrink); - if (-120 < (long)gap && (long)gap < 120 ) - { + { /* Change the reloc type from 16bit, possible 8 to 8bit possible 16 */ - reloc->howto = reloc->howto + 1; + reloc->howto = reloc->howto + 1; /* The place to relc moves back by one */ /* This will be two bytes smaller in the long run */ @@ -224,11 +213,9 @@ h8300_reloc16_estimate(abfd, input_section, reloc, shrink, link_info) break; } - return shrink; } - /* First phase of a relaxing link */ /* Reloc types @@ -336,8 +323,8 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, { int gap = bfd_coff_reloc16_get_value (reloc, link_info, input_section); - bfd_vma dot = link_order->offset - + dst_address + bfd_vma dot = link_order->offset + + dst_address + link_order->u.indirect.section->output_section->vma; gap -= dot + 1; @@ -346,7 +333,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr), reloc->howto->name, reloc->addend, input_section->owner, input_section, reloc->address))) - abort(); + abort (); } bfd_put_8 (abfd, gap, data + dst_address); dst_address += 1; @@ -358,11 +345,10 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, { bfd_vma gap = bfd_coff_reloc16_get_value (reloc, link_info, input_section); - bfd_vma dot = link_order->offset - + dst_address + bfd_vma dot = link_order->offset + + dst_address + link_order->u.indirect.section->output_section->vma; - /* This wraps within the page, so ignore the relativeness, look at the high part */ if ((gap & 0xf0000) != (dot & 0xf0000)) { @@ -370,7 +356,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr), reloc->howto->name, reloc->addend, input_section->owner, input_section, reloc->address))) - abort(); + abort (); } gap -= dot + 2; @@ -380,7 +366,7 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, } break; default: - printf(_("ignoring reloc %s\n"), reloc->howto->name); + printf (_("ignoring reloc %s\n"), reloc->howto->name); break; } @@ -394,7 +380,6 @@ h8300_reloc16_extra_cases (abfd, link_info, link_order, reloc, data, src_ptr, #include "coffcode.h" - #undef coff_bfd_get_relocated_section_contents #undef coff_bfd_relax_section #define coff_bfd_get_relocated_section_contents \ diff --git a/gnu/dist/toolchain/bfd/coff-we32k.c b/gnu/dist/toolchain/bfd/coff-we32k.c index c559ad7c76f7..8d3fa5d164bd 100644 --- a/gnu/dist/toolchain/bfd/coff-we32k.c +++ b/gnu/dist/toolchain/bfd/coff-we32k.c @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define COFF_DEFAULT_SECTION_ALIGNMENT_POWER (3) -static reloc_howto_type howto_table[] = +static reloc_howto_type howto_table[] = { EMPTY_HOWTO (0), EMPTY_HOWTO (1), diff --git a/gnu/dist/toolchain/bfd/coff-z8k.c b/gnu/dist/toolchain/bfd/coff-z8k.c index 21f29a829690..7ad063019a9a 100644 --- a/gnu/dist/toolchain/bfd/coff-z8k.c +++ b/gnu/dist/toolchain/bfd/coff-z8k.c @@ -54,7 +54,7 @@ HOWTO (R_JR, 0, 1, 8, true, 0, complain_overflow_signed, 0, /* Turn a howto into a reloc number */ -static int +static int coff_z8k_select_reloc (howto) reloc_howto_type *howto; { @@ -63,13 +63,10 @@ coff_z8k_select_reloc (howto) #define SELECT_RELOC(x,howto) x.r_type = coff_z8k_select_reloc(howto) - #define BADMAG(x) Z8KBADMAG(x) #define Z8K 1 /* Customize coffcode.h */ #define __A_MAGIC_SET__ - - /* Code to swap in the reloc */ #define SWAP_IN_RELOC_OFFSET bfd_h_get_32 #define SWAP_OUT_RELOC_OFFSET bfd_h_put_32 @@ -110,18 +107,15 @@ rtype2howto (internal, dst) #define RTYPE2HOWTO(internal, relocentry) rtype2howto(internal,relocentry) - /* Perform any necessary magic to the addend in a reloc entry */ - #define CALC_ADDEND(abfd, symbol, ext_reloc, cache_ptr) \ cache_ptr->addend = ext_reloc.r_offset; - #define RELOC_PROCESSING(relent,reloc,symbols,abfd,section) \ reloc_processing(relent, reloc, symbols, abfd, section) -static void +static void reloc_processing (relent, reloc, symbols, abfd, section) arelent * relent; struct internal_reloc *reloc; @@ -141,7 +135,6 @@ reloc_processing (relent, reloc, symbols, abfd, section) relent->sym_ptr_ptr = bfd_abs_section_ptr->symbol_ptr_ptr; } - relent->addend = reloc->r_offset; relent->address -= section->vma; } @@ -178,7 +171,7 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) case R_IMM4L: bfd_put_8 (in_abfd, - ((bfd_get_8 (in_abfd, data + *dst_ptr) & 0xf0) + ((bfd_get_8 (in_abfd, data + *dst_ptr) & 0xf0) | (0x0f & bfd_coff_reloc16_get_value (reloc, link_info, input_section))), @@ -230,7 +223,6 @@ extra_case (in_abfd, link_info, link_order, reloc, data, src_ptr, dst_ptr) #include "coffcode.h" - #undef coff_bfd_get_relocated_section_contents #undef coff_bfd_relax_section #define coff_bfd_get_relocated_section_contents \ diff --git a/gnu/dist/toolchain/bfd/coff64-rs6000.c b/gnu/dist/toolchain/bfd/coff64-rs6000.c new file mode 100644 index 000000000000..64fd39bb82e9 --- /dev/null +++ b/gnu/dist/toolchain/bfd/coff64-rs6000.c @@ -0,0 +1,351 @@ +/* BFD back-end for IBM RS/6000 "XCOFF64" files. + Copyright 2000 + Free Software Foundation, Inc. + Written Clinton Popetz. + Contributed by Cygnus Support. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +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. */ + +/* Internalcoff.h and coffcode.h modify themselves based on these flags. */ +#define XCOFF64 +#define RS6000COFF_C 1 + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "coff/internal.h" +#include "coff/rs6k64.h" +#include "libcoff.h" + +#define GET_FILEHDR_SYMPTR bfd_h_get_64 +#define PUT_FILEHDR_SYMPTR bfd_h_put_64 +#define GET_AOUTHDR_DATA_START bfd_h_get_64 +#define PUT_AOUTHDR_DATA_START 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_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_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_SCNHDR_NRELOC bfd_h_get_32 +#define MAX_SCNHDR_NRELOC 0xffffffff +#define PUT_SCNHDR_NRELOC bfd_h_put_32 +#define GET_SCNHDR_NLNNO bfd_h_get_32 +#define MAX_SCNHDR_NLNNO 0xffffffff +#define PUT_SCNHDR_NLNNO bfd_h_put_32 +#define GET_RELOC_VADDR bfd_h_get_64 +#define PUT_RELOC_VADDR bfd_h_put_64 + +#define COFF_FORCE_SYMBOLS_IN_STRINGS +#define COFF_DEBUG_STRING_WIDE_PREFIX + +#define COFF_ADJUST_SCNHDR_OUT_POST(ABFD,INT,EXT) \ +do { \ + memset (((SCNHDR *)EXT)->s_pad, 0, sizeof (((SCNHDR *)EXT)->s_pad));\ +} while (0) + +#define NO_COFF_LINENOS + +#define coff_SWAP_lineno_in xcoff64_swap_lineno_in +#define coff_SWAP_lineno_out xcoff64_swap_lineno_out + +#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 + +/* For XCOFF64, the effective width of symndx changes depending on + whether we are the first entry. Sigh. */ +static void +xcoff64_swap_lineno_in (abfd, ext1, in1) + bfd *abfd; + PTR ext1; + PTR in1; +{ + LINENO *ext = (LINENO *)ext1; + struct internal_lineno *in = (struct internal_lineno *)in1; + + in->l_lnno = bfd_h_get_32(abfd, (bfd_byte *) (ext->l_lnno)); + if (in->l_lnno == 0) + in->l_addr.l_symndx = + bfd_h_get_32(abfd, (bfd_byte *) ext->l_addr.l_symndx); + else + in->l_addr.l_symndx = + bfd_h_get_64(abfd, (bfd_byte *) ext->l_addr.l_symndx); +} + +static unsigned int +xcoff64_swap_lineno_out (abfd, inp, 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); + + bfd_h_put_32 (abfd, in->l_lnno, (bfd_byte *) (ext->l_lnno)); + if (in->l_lnno == 0) + bfd_h_put_32 (abfd, in->l_addr.l_symndx, (bfd_byte *)ext->l_addr.l_symndx); + else + bfd_h_put_64 (abfd, in->l_addr.l_symndx, (bfd_byte *)ext->l_addr.l_symndx); + + return bfd_coff_linesz (abfd); +} + +static void xcoff64_swap_sym_in PARAMS ((bfd *, PTR, PTR)); +static unsigned int xcoff64_swap_sym_out PARAMS ((bfd *, PTR, PTR)); +static void xcoff64_swap_aux_in PARAMS ((bfd *, PTR, int, int, int, int, PTR)); +static unsigned int xcoff64_swap_aux_out PARAMS ((bfd *, PTR, int, int, int, int, PTR)); + +static void +xcoff64_swap_sym_in (abfd, ext1, in1) + bfd *abfd; + PTR ext1; + PTR in1; +{ + SYMENT *ext = (SYMENT *)ext1; + struct internal_syment *in = (struct internal_syment *)in1; + + in->_n._n_n._n_zeroes = 0; + in->_n._n_n._n_offset = bfd_h_get_32(abfd, (bfd_byte *) ext->e_offset); + in->n_value = bfd_h_get_64(abfd, (bfd_byte *) ext->e.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); +} + +static unsigned int +xcoff64_swap_sym_out (abfd, inp, extp) + bfd *abfd; + PTR inp; + PTR extp; +{ + struct internal_syment *in = (struct internal_syment *)inp; + SYMENT *ext =(SYMENT *)extp; + + bfd_h_put_32(abfd, in->_n._n_n._n_offset, (bfd_byte *) ext->e_offset); + bfd_h_put_64(abfd, in->n_value , (bfd_byte *) ext->e.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); + return bfd_coff_symesz (abfd); +} + +static void +xcoff64_swap_aux_in (abfd, ext1, type, class, indx, numaux, 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; + + switch (class) { + case C_FILE: + 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); + } + } + goto end; + + /* RS/6000 "csect" auxents */ + case C_EXT: + case C_HIDEXT: + if (indx + 1 == numaux) + { + in->x_csect.x_scnlen.l = + bfd_h_get_32(abfd, ext->x_csect.x_scnlen_lo); + /* FIXME: If we want section lengths larger than 32 bits, we need + to modify the internal coff structures to support it. */ + 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); + /* 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); + goto end; + } + break; + + case C_STAT: + case C_LEAFSTAT: + case C_HIDDEN: + if (type == T_NULL) { + /* PE defines some extra fields; we zero them out for + safety. */ + in->x_scn.x_checksum = 0; + in->x_scn.x_associated = 0; + in->x_scn.x_comdat = 0; + + goto end; + } + break; + } + + if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) + { + in->x_sym.x_fcnary.x_fcn.x_lnnoptr = bfd_h_get_64(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); + } + if (ISFCN(type)) { + in->x_sym.x_misc.x_fsize = bfd_h_get_32(abfd, (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_fsize); + } + else { + in->x_sym.x_misc.x_lnsz.x_lnno = bfd_h_get_32(abfd, (bfd_byte *) + ext->x_sym.x_fcnary.x_lnsz.x_lnno); + in->x_sym.x_misc.x_lnsz.x_size = bfd_h_get_16(abfd, (bfd_byte *) + ext->x_sym.x_fcnary.x_lnsz.x_size); + } + +end: ; + /* the semicolon is because MSVC doesn't like labels at + end of block. */ + +} + +static unsigned int +xcoff64_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; +{ + union internal_auxent *in = (union internal_auxent *)inp; + AUXENT *ext = (AUXENT *)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); + } + PUTBYTE (abfd, _AUX_FILE, (bfd_byte *) ext->x_auxtype.x_auxtype); + 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_lo); + 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); + PUTBYTE (abfd, _AUX_CSECT, (bfd_byte *) ext->x_auxtype.x_auxtype); + goto end; + } + break; + + case C_STAT: + case C_LEAFSTAT: + case C_HIDDEN: + if (type == T_NULL) { + goto end; + } + break; + } + + if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) + { + bfd_h_put_64(abfd, in->x_sym.x_fcnary.x_fcn.x_lnnoptr, + (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_lnnoptr); + PUTBYTE (abfd, _AUX_FCN, (bfd_byte *) ext->x_auxtype.x_auxtype); + PUTWORD(abfd, in->x_sym.x_fcnary.x_fcn.x_endndx.l, + (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_endndx); + } + if (ISFCN (type)) + PUTWORD (abfd, in->x_sym.x_misc.x_fsize, + (bfd_byte *) ext->x_sym.x_fcnary.x_fcn.x_fsize); + else + { + bfd_h_put_32(abfd, in->x_sym.x_misc.x_lnsz.x_lnno, + (bfd_byte *)ext->x_sym.x_fcnary.x_lnsz.x_lnno); + bfd_h_put_16(abfd, in->x_sym.x_misc.x_lnsz.x_size, + (bfd_byte *)ext->x_sym.x_fcnary.x_lnsz.x_size); + } + +end: + return bfd_coff_auxesz (abfd); +} + +#define coff_SWAP_sym_in xcoff64_swap_sym_in +#define coff_SWAP_sym_out xcoff64_swap_sym_out +#define coff_SWAP_aux_in xcoff64_swap_aux_in +#define coff_SWAP_aux_out xcoff64_swap_aux_out + +#define TARGET_NAME "aixcoff64-rs6000" +#define TARGET_SYM rs6000coff64_vec + +#include "xcoff-target.h" diff --git a/gnu/dist/toolchain/bfd/coffgen.c b/gnu/dist/toolchain/bfd/coffgen.c index f2410d919d9a..35e8f718e6a3 100644 --- a/gnu/dist/toolchain/bfd/coffgen.c +++ b/gnu/dist/toolchain/bfd/coffgen.c @@ -60,7 +60,7 @@ static void coff_pointerize_aux static boolean make_a_section_from_file PARAMS ((bfd *, struct internal_scnhdr *, unsigned int)); static const bfd_target *coff_real_object_p - PARAMS ((bfd *, unsigned, struct internal_filehdr *, + PARAMS ((bfd *, unsigned, struct internal_filehdr *, struct internal_aouthdr *)); static void fixup_symbol_value PARAMS ((bfd *, coff_symbol_type *, struct internal_syment *)); @@ -212,7 +212,7 @@ coff_real_object_p (abfd, nscns, internal_f, internal_a) goto fail; /* Set the arch/mach *before* swapping in sections; section header swapping - may depend on arch/mach info. */ + may depend on arch/mach info. */ if (bfd_coff_set_arch_mach_hook (abfd, (PTR) internal_f) == false) goto fail; @@ -340,7 +340,6 @@ coff_get_symtab_upper_bound (abfd) return (bfd_get_symcount (abfd) + 1) * (sizeof (coff_symbol_type *)); } - /* Canonicalize a COFF symbol table. */ long @@ -525,7 +524,7 @@ coff_count_linenumbers (abfd) { asymbol *q_maybe = *p; - if (bfd_asymbol_flavour (q_maybe) == bfd_target_coff_flavour) + if (bfd_family_coff (bfd_asymbol_bfd (q_maybe))) { coff_symbol_type *q = coffsymbol (q_maybe); @@ -558,13 +557,12 @@ coff_count_linenumbers (abfd) /* Takes a bfd and a symbol, returns a pointer to the coff specific area of the symbol if there is one. */ -/*ARGSUSED*/ coff_symbol_type * coff_symbol_from (ignore_abfd, symbol) bfd *ignore_abfd ATTRIBUTE_UNUSED; asymbol *symbol; { - if (bfd_asymbol_flavour (symbol) != bfd_target_coff_flavour) + if (!bfd_family_coff (bfd_asymbol_bfd (symbol))) return (coff_symbol_type *) NULL; if (bfd_asymbol_bfd (symbol)->tdata.coff_obj_data == (coff_data_type *) NULL) @@ -608,8 +606,11 @@ fixup_symbol_value (abfd, coff_symbol_ptr, syment) syment->n_value = (coff_symbol_ptr->symbol.value + coff_symbol_ptr->symbol.section->output_offset); if (! obj_pe (abfd)) - syment->n_value += - coff_symbol_ptr->symbol.section->output_section->vma; + { + syment->n_value += (syment->n_sclass == C_STATLAB) + ? coff_symbol_ptr->symbol.section->output_section->lma + : coff_symbol_ptr->symbol.section->output_section->vma; + } } else { @@ -689,7 +690,7 @@ coff_renumber_symbols (bfd_ptr, first_undef) for (symbol_index = 0; symbol_index < symbol_count; symbol_index++) { coff_symbol_type *coff_symbol_ptr = coff_symbol_from (bfd_ptr, symbol_ptr_ptr[symbol_index]); - symbol_ptr_ptr[symbol_index]->udata.i = symbol_index; + symbol_ptr_ptr[symbol_index]->udata.i = symbol_index; if (coff_symbol_ptr && coff_symbol_ptr->native) { combined_entry_type *s = coff_symbol_ptr->native; @@ -816,7 +817,16 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, { unsigned int filnmlen; - strncpy (native->u.syment._n._n_name, ".file", SYMNMLEN); + if (bfd_coff_force_symnames_in_strings (abfd)) + { + native->u.syment._n._n_n._n_offset = + (*string_size_p + STRING_SIZE_SIZE); + native->u.syment._n._n_n._n_zeroes = 0; + *string_size_p += 6; /* strlen(".file") + 1 */ + } + else + strncpy (native->u.syment._n._n_name, ".file", SYMNMLEN); + auxent = &(native + 1)->u.auxent; filnmlen = bfd_coff_filnmlen (abfd); @@ -843,7 +853,7 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, } else { - if (name_length <= SYMNMLEN) + if (name_length <= SYMNMLEN && !bfd_coff_force_symnames_in_strings (abfd)) { /* This name will fit into the symbol neatly */ strncpy (native->u.syment._n._n_name, symbol->name, SYMNMLEN); @@ -858,7 +868,8 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, else { long filepos; - bfd_byte buf[2]; + bfd_byte buf[4]; + int prefix_len = bfd_coff_debug_string_prefix_length (abfd); /* This name should be written into the .debug section. For some reason each name is preceded by a two byte length @@ -868,24 +879,29 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, if (*debug_string_section_p == (asection *) NULL) *debug_string_section_p = bfd_get_section_by_name (abfd, ".debug"); filepos = bfd_tell (abfd); - bfd_put_16 (abfd, name_length + 1, buf); + if (prefix_len == 4) + bfd_put_32 (abfd, name_length + 1, buf); + else + bfd_put_16 (abfd, name_length + 1, buf); + if (!bfd_set_section_contents (abfd, *debug_string_section_p, (PTR) buf, (file_ptr) *debug_string_size_p, - (bfd_size_type) 2) + (bfd_size_type) prefix_len) || !bfd_set_section_contents (abfd, *debug_string_section_p, (PTR) symbol->name, ((file_ptr) *debug_string_size_p - + 2), + + prefix_len), (bfd_size_type) name_length + 1)) abort (); if (bfd_seek (abfd, filepos, SEEK_SET) != 0) abort (); - native->u.syment._n._n_n._n_offset = *debug_string_size_p + 2; + native->u.syment._n._n_n._n_offset = + *debug_string_size_p + prefix_len; native->u.syment._n._n_n._n_zeroes = 0; - *debug_string_size_p += name_length + 3; + *debug_string_size_p += name_length + 1 + prefix_len; } } } @@ -1085,7 +1101,7 @@ coff_write_native_symbol (abfd, symbol, written, string_size_p, while (lineno[count].line_number != 0) { #if 0 - /* 13 april 92. sac + /* 13 april 92. sac I've been told this, but still need proof: > The second bug is also in `bfd/coffcode.h'. This bug > causes the linker to screw up the pc-relocations for @@ -1241,7 +1257,7 @@ coff_write_symbols (abfd) { /* This is not a COFF symbol, so it certainly is not a file name, nor does it go in the .debug section. */ - maxlen = SYMNMLEN; + maxlen = bfd_coff_force_symnames_in_strings (abfd) ? 0 : SYMNMLEN; } else if (bfd_coff_symname_in_debug (abfd, &c_symbol->native->u.syment)) @@ -1252,9 +1268,13 @@ coff_write_symbols (abfd) } else if (c_symbol->native->u.syment.n_sclass == C_FILE && c_symbol->native->u.syment.n_numaux > 0) - maxlen = bfd_coff_filnmlen (abfd); + { + if (bfd_coff_force_symnames_in_strings (abfd)) + bfd_write (".file", 1, 6, abfd); + maxlen = bfd_coff_filnmlen (abfd); + } else - maxlen = SYMNMLEN; + maxlen = bfd_coff_force_symnames_in_strings (abfd) ? 0 : SYMNMLEN; if (name_length > maxlen) { @@ -1354,7 +1374,6 @@ coff_write_linenumbers (abfd) return true; } -/*ARGSUSED */ alent * coff_get_lineno (ignore_abfd, symbol) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -1465,7 +1484,7 @@ coff_pointerize_aux (abfd, table_base, symbol, indaux, auxent) /* Allocate space for the ".debug" section, and read it. We did not read the debug section until now, because - we didn't want to go to the trouble until someone needed it. */ + we didn't want to go to the trouble until someone needed it. */ static char * build_debug_section (abfd) @@ -1487,7 +1506,7 @@ build_debug_section (abfd) if (debug_section == NULL) return NULL; - /* Seek to the beginning of the `.debug' section and read it. + /* Seek to the beginning of the `.debug' section and read it. Save the current position first; it is needed by our caller. Then read debug section and reset the file pointer. */ @@ -1501,7 +1520,6 @@ build_debug_section (abfd) return debug_section; } - /* Return a pointer to a malloc'd copy of 'name'. 'name' may not be \0-terminated, but will not exceed 'maxlen' characters. The copy *will* be \0-terminated. */ @@ -1589,7 +1607,7 @@ _bfd_coff_read_string_table (abfd) + obj_raw_syment_count (abfd) * bfd_coff_symesz (abfd)), SEEK_SET) != 0) return NULL; - + if (bfd_read (extstrsize, sizeof extstrsize, 1, abfd) != sizeof extstrsize) { if (bfd_get_error () != bfd_error_file_truncated) @@ -1790,7 +1808,7 @@ coff_get_normalized_symtab (abfd) { break; } /* if end of string */ - } /* possible lengths of this string. */ + } /* possible lengths of this string. */ if ((newstring = (PTR) bfd_alloc (abfd, ++i)) == NULL) return (NULL); @@ -1888,7 +1906,6 @@ coff_bfd_make_debug_symbol (abfd, ptr, sz) return &new->symbol; } -/*ARGSUSED */ void coff_get_symbol_info (abfd, symbol, ret) bfd *abfd; @@ -2141,7 +2158,7 @@ _bfd_coff_is_local_label_name (abfd, name) /* Provided a BFD, a section and an offset (in bytes, not octets) into the section, calculate and return the name of the source file and the line nearest to the wanted location. */ -/*ARGSUSED*/ + boolean coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr, functionname_ptr, line_ptr) @@ -2168,17 +2185,25 @@ coff_find_nearest_line (abfd, section, symbols, offset, filename_ptr, if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, &found, filename_ptr, functionname_ptr, line_ptr, - &coff_data (abfd)->line_info)) + &coff_data(abfd)->line_info)) return false; + if (found) return true; + /* Also try examining DWARF2 debugging information. */ + if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, + filename_ptr, functionname_ptr, + line_ptr, 0, + &coff_data(abfd)->dwarf2_find_line_info)) + return true; + *filename_ptr = 0; *functionname_ptr = 0; *line_ptr = 0; /* Don't try and find line numbers in a non coff file */ - if (abfd->xvec->flavour != bfd_target_coff_flavour) + if (!bfd_family_coff (abfd)) return false; if (cof == NULL) @@ -2385,7 +2410,7 @@ bfd_coff_set_symbol_class (abfd, symbol, class) We cheat here by creating a fake native entry for it and then filling in the class. This code is based on that in coff_write_alien_symbol(). */ - + combined_entry_type * native; native = (combined_entry_type *) bfd_alloc (abfd, sizeof (* native)); @@ -2393,10 +2418,10 @@ bfd_coff_set_symbol_class (abfd, symbol, class) return false; memset (native, 0, sizeof (* native)); - + native->u.syment.n_type = T_NULL; native->u.syment.n_sclass = class; - + if (bfd_is_und_section (symbol->section)) { native->u.syment.n_scnum = N_UNDEF; @@ -2415,19 +2440,18 @@ bfd_coff_set_symbol_class (abfd, symbol, class) + symbol->section->output_offset); if (! obj_pe (abfd)) native->u.syment.n_value += symbol->section->output_section->vma; - + /* Copy the any flags from the the file header into the symbol. FIXME: Why? */ native->u.syment.n_flags = bfd_asymbol_bfd (& csym->symbol)->flags; } - + csym->native = native; } else { csym->native->u.syment.n_sclass = class; } - + return true; } - diff --git a/gnu/dist/toolchain/bfd/cofflink.c b/gnu/dist/toolchain/bfd/cofflink.c index 609f6653e098..223ccbf1c7bd 100644 --- a/gnu/dist/toolchain/bfd/cofflink.c +++ b/gnu/dist/toolchain/bfd/cofflink.c @@ -40,6 +40,15 @@ static int process_embedded_commands PARAMS ((bfd *, struct bfd_link_info *, bfd *)); static void mark_relocs PARAMS ((struct coff_final_link_info *, bfd *)); +/* Return true if SYM is a weak, external symbol. */ +#define IS_WEAK_EXTERNAL(abfd, sym) \ + ((sym).n_sclass == C_WEAKEXT \ + || (obj_pe (abfd) && (sym).n_sclass == C_NT_WEAK)) + +/* Return true if SYM is an external symbol. */ +#define IS_EXTERNAL(abfd, sym) \ + ((sym).n_sclass == C_EXT || IS_WEAK_EXTERNAL (abfd, sym)) + /* Define macros so that the ISFCN, et. al., macros work correctly. These macros are defined in include/coff/internal.h in terms of N_TMASK, etc. These definitions require a user to define local @@ -395,8 +404,7 @@ coff_link_add_symbols (abfd, info) break; } - if (sym.n_sclass == C_WEAKEXT - || (obj_pe (abfd) && sym.n_sclass == C_NT_WEAK)) + if (IS_WEAK_EXTERNAL (abfd, sym)) flags = BSF_WEAK; addit = true; @@ -894,8 +902,7 @@ _bfd_coff_final_link (abfd, info) for (p = o->link_order_head; p != NULL; p = p->next) { if (p->type == bfd_indirect_link_order - && (bfd_get_flavour (p->u.indirect.section->owner) - == bfd_target_coff_flavour)) + && bfd_family_coff (p->u.indirect.section->owner)) { sub = p->u.indirect.section->owner; if (! bfd_coff_link_output_has_begun (sub, & finfo)) @@ -921,7 +928,7 @@ _bfd_coff_final_link (abfd, info) if (! bfd_coff_final_link_postscript (abfd, & finfo)) goto error_return; - + /* Free up the buffers used by _bfd_coff_link_input_bfd. */ coff_debug_merge_hash_table_free (&finfo.debug_merge); @@ -982,7 +989,7 @@ _bfd_coff_final_link (abfd, info) /* If doing task linking (ld --task-link) then make a pass through the global symbols, writing out any that are defined, and making them - static. */ + static. */ if (info->task_link) { finfo.failed = false; @@ -1095,6 +1102,8 @@ _bfd_coff_final_link (abfd, info) if (! _bfd_stringtab_emit (abfd, finfo.strtab)) return false; + + obj_coff_strings_written (abfd) = true; } _bfd_stringtab_free (finfo.strtab); @@ -1152,7 +1161,7 @@ dores_com (ptr, output_bfd, heap) bfd *output_bfd; int heap; { - if (coff_data(output_bfd)->pe) + if (coff_data(output_bfd)->pe) { int val = strtoul (ptr, &ptr, 0); if (heap) @@ -1160,7 +1169,7 @@ dores_com (ptr, output_bfd, heap) else pe_data(output_bfd)->pe_opthdr.SizeOfStackReserve =val; - if (ptr[0] == ',') + if (ptr[0] == ',') { int val = strtoul (ptr+1, &ptr, 0); if (heap) @@ -1186,7 +1195,7 @@ char **dst; } /* Process any magic embedded commands in a section called .drectve */ - + static int process_embedded_commands (output_bfd, info, abfd) bfd *output_bfd; @@ -1197,19 +1206,19 @@ process_embedded_commands (output_bfd, info, abfd) char *s; char *e; char *copy; - if (!sec) + if (!sec) return 1; - + copy = bfd_malloc ((size_t) sec->_raw_size); - if (!copy) + if (!copy) return 0; - if (! bfd_get_section_contents(abfd, sec, copy, 0, sec->_raw_size)) + if (! bfd_get_section_contents(abfd, sec, copy, 0, sec->_raw_size)) { free (copy); return 0; } e = copy + sec->_raw_size; - for (s = copy; s < e ; ) + for (s = copy; s < e ; ) { if (s[0]!= '-') { s++; @@ -1230,7 +1239,7 @@ process_embedded_commands (output_bfd, info, abfd) s = get_name(s, &name); s = get_name(s, &attribs); while (loop) { - switch (*attribs++) + switch (*attribs++) { case 'W': had_write = 1; @@ -1264,7 +1273,7 @@ process_embedded_commands (output_bfd, info, abfd) { s = dores_com (s+6, output_bfd, 0); } - else + else s++; } free (copy); @@ -1274,7 +1283,7 @@ process_embedded_commands (output_bfd, info, abfd) /* Place a marker against all symbols which are used by relocations. This marker can be picked up by the 'do we skip this symbol ?' loop in _bfd_coff_link_input_bfd() and used to prevent skipping - that symbol. + that symbol. */ static void @@ -1286,14 +1295,13 @@ mark_relocs (finfo, input_bfd) if ((bfd_get_file_flags (input_bfd) & HAS_SYMS) == 0) return; - + for (a = input_bfd->sections; a != (asection *) NULL; a = a->next) { struct internal_reloc * internal_relocs; struct internal_reloc * irel; struct internal_reloc * irelend; - if ((a->flags & SEC_RELOC) == 0 || a->reloc_count < 1) continue; @@ -1306,7 +1314,7 @@ mark_relocs (finfo, input_bfd) ? (finfo->section_info[ a->output_section->target_index ].relocs + a->output_section->reloc_count) : finfo->internal_relocs) ); - + if (internal_relocs == NULL) continue; @@ -1317,7 +1325,7 @@ mark_relocs (finfo, input_bfd) been initialised to 0) for all of the symbols that are used in the relocation table. This will then be picked up in the skip/don't pass */ - + for (; irel < irelend; irel++) { finfo->sym_indices[ irel->r_symndx ] = -1; @@ -1400,8 +1408,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) && finfo->info->relocateable) { /* mark the symbol array as 'not-used' */ - memset (indexp, 0, obj_raw_syment_count (input_bfd) * sizeof * indexp); - + memset (indexp, 0, obj_raw_syment_count (input_bfd) * sizeof * indexp); + mark_relocs (finfo, input_bfd); } @@ -1448,7 +1456,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) dont_skip_symbol = *indexp; else dont_skip_symbol = false; - + *indexp = -1; skip = false; @@ -1834,12 +1842,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) } /* If doing task linking, convert normal global function symbols to - static functions. */ - - if (finfo->info->task_link - && (isym.n_sclass == C_EXT - || isym.n_sclass == C_WEAKEXT - || (obj_pe (input_bfd) && isym.n_sclass == C_NT_WEAK))) + static functions. */ + if (finfo->info->task_link && IS_EXTERNAL (input_bfd, isym)) isym.n_sclass = C_STAT; /* Output the symbol. */ @@ -2202,7 +2206,7 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) is.n_numaux, auxptr); } - skipping = false; + skipping = false; } iline.l_addr.l_symndx = indx; @@ -2400,8 +2404,8 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) /* This reloc is against a symbol we are stripping. This should have been handled by the 'dont_skip_symbol' code in the while - loop at the top of this function. */ - + loop at the top of this function. */ + is = finfo->internal_syms + irel->r_symndx; name = (_bfd_coff_internal_syment_name @@ -2425,9 +2429,9 @@ _bfd_coff_link_input_bfd (finfo, input_bfd) if (secdata == NULL || secdata->stab_info == NULL) { if (! bfd_set_section_contents (output_bfd, o->output_section, - contents, - (file_ptr) - (o->output_offset * + contents, + (file_ptr) + (o->output_offset * bfd_octets_per_byte (output_bfd)), (o->_cooked_size != 0 ? o->_cooked_size @@ -2549,20 +2553,25 @@ _bfd_coff_write_global_sym (h, data) /* If doing task linking and this is the pass where we convert defined globals to statics, then do that conversion now. If the symbol is not being converted, just ignore it and it will be - output during a later pass. */ + output during a later pass. */ if (finfo->global_to_static) { - if (isym.n_sclass != C_EXT - && isym.n_sclass != C_WEAKEXT - && (! obj_pe (output_bfd) || isym.n_sclass != C_NT_WEAK)) - { - return true; - } + if (! IS_EXTERNAL (output_bfd, isym)) + return true; + isym.n_sclass = C_STAT; } + /* When a weak symbol is not overriden by a strong one, + turn it into an external symbol when not building a + shared or relocateable object. */ + if (! finfo->info->shared + && ! finfo->info->relocateable + && IS_WEAK_EXTERNAL (finfo->output_bfd, isym)) + isym.n_sclass = C_EXT; + isym.n_numaux = h->numaux; - + bfd_coff_swap_sym_out (output_bfd, (PTR) &isym, (PTR) finfo->outsyms); symesz = bfd_coff_symesz (output_bfd); @@ -2654,7 +2663,7 @@ _bfd_coff_write_global_sym (h, data) /* Write out task global symbols, converting them to statics. Called via coff_link_hash_traverse. Calls bfd_coff_write_global_sym to do - the dirty work, if the symbol we are processing needs conversion. */ + the dirty work, if the symbol we are processing needs conversion. */ boolean _bfd_coff_write_task_globals (h, data) @@ -2740,7 +2749,7 @@ _bfd_coff_reloc_link_order (output_bfd, finfo, output_section, link_order) break; } ok = bfd_set_section_contents (output_bfd, output_section, (PTR) buf, - (file_ptr) + (file_ptr) (link_order->offset * bfd_octets_per_byte (output_bfd)), size); free (buf); @@ -2862,7 +2871,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, return false; } else - { + { h = obj_coff_sym_hashes (input_bfd)[symndx]; sym = syms + symndx; } @@ -2877,7 +2886,6 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, else addend = 0; - howto = bfd_coff_rtype_to_howto (input_bfd, input_section, rel, h, sym, &addend); if (howto == NULL) @@ -2929,6 +2937,9 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, + sec->output_offset); } + else if (h->root.type == bfd_link_hash_undefweak) + val = 0; + else if (! info->relocateable) { if (! ((*info->callbacks->undefined_symbol) @@ -2940,7 +2951,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, if (info->base_file) { - /* Emit a reloc if the backend thinks it needs it. */ + /* Emit a reloc if the backend thinks it needs it. */ if (sym && pe_data (output_bfd)->in_reloc_p (output_bfd, howto)) { /* Relocation to a symbol in a section which isn't @@ -2949,9 +2960,9 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, reloc section. Note that the base file is not portable between systems. We write out a long here, and dlltool reads in a long. */ - long addr = (rel->r_vaddr - - input_section->vma - + input_section->output_offset + long addr = (rel->r_vaddr + - input_section->vma + + input_section->output_offset + input_section->output_section->vma); if (coff_data (output_bfd)->pe) addr -= pe_data(output_bfd)->pe_opthdr.ImageBase; @@ -2963,7 +2974,7 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, } } } - + rstat = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_vaddr - input_section->vma, @@ -3007,4 +3018,3 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd, } return true; } - diff --git a/gnu/dist/toolchain/bfd/coffswap.h b/gnu/dist/toolchain/bfd/coffswap.h index d7d090fd41e1..2f89afbff2d0 100644 --- a/gnu/dist/toolchain/bfd/coffswap.h +++ b/gnu/dist/toolchain/bfd/coffswap.h @@ -168,12 +168,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef GET_SCNHDR_NRELOC #define GET_SCNHDR_NRELOC bfd_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 #endif #ifndef GET_SCNHDR_NLNNO #define GET_SCNHDR_NLNNO bfd_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 #endif @@ -184,6 +190,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define PUT_SCNHDR_FLAGS bfd_h_put_32 #endif +#ifndef GET_RELOC_VADDR +#define GET_RELOC_VADDR bfd_h_get_32 +#endif +#ifndef PUT_RELOC_VADDR +#define PUT_RELOC_VADDR bfd_h_put_32 +#endif static void coff_swap_aouthdr_in PARAMS ((bfd *, PTR, PTR)); static unsigned int coff_swap_aouthdr_out PARAMS ((bfd *, PTR, PTR)); @@ -217,7 +229,7 @@ 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 = bfd_h_get_32(abfd, (bfd_byte *)reloc_src->r_vaddr); + 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); #ifdef RS6000COFF_C @@ -241,7 +253,7 @@ coff_swap_reloc_out (abfd, src, dst) { struct internal_reloc *reloc_src = (struct internal_reloc *)src; struct external_reloc *reloc_dst = (struct external_reloc *)dst; - bfd_h_put_32(abfd, reloc_src->r_vaddr, (bfd_byte *) reloc_dst->r_vaddr); + 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); #ifdef RS6000COFF_C @@ -324,7 +336,6 @@ coff_swap_filehdr_out (abfd, in, out) return bfd_coff_filhsz (abfd); } - #ifndef NO_COFF_SYMBOLS static void @@ -347,9 +358,9 @@ coff_swap_sym_in (abfd, ext1, in1) 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_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){ + if (sizeof (ext->e_type) == 2){ in->n_type = bfd_h_get_16(abfd, (bfd_byte *) ext->e_type); } else { @@ -383,7 +394,7 @@ coff_swap_sym_out (abfd, inp, extp) } 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) + if (sizeof (ext->e_type) == 2) { bfd_h_put_16(abfd, in->n_type , (bfd_byte *) ext->e_type); } @@ -419,7 +430,7 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) case C_FILE: if (ext->x_file.x_fname[0] == 0) { in->x_file.x_n.x_zeroes = 0; - in->x_file.x_n.x_offset = + in->x_file.x_n.x_offset = bfd_h_get_32(abfd, (bfd_byte *) ext->x_file.x_n.x_offset); } else { #if FILNMLEN != E_FILNMLEN @@ -439,28 +450,6 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) } goto end; - /* RS/6000 "csect" auxents */ -#ifdef RS6000COFF_C - case C_EXT: - 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); - /* 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); - goto end; - } - break; -#endif - case C_STAT: #ifdef C_LEAFSTAT case C_LEAFSTAT: @@ -517,7 +506,7 @@ coff_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) end: ; /* the semicolon is because MSVC doesn't like labels at - end of block. */ + end of block. */ #ifdef COFF_ADJUST_AUX_IN_POST COFF_ADJUST_AUX_IN_POST (abfd, ext1, type, class, indx, numaux, in1); @@ -558,27 +547,6 @@ coff_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) } goto end; -#ifdef RS6000COFF_C - /* 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; -#endif - case C_STAT: #ifdef C_LEAFSTAT case C_LEAFSTAT: @@ -703,9 +671,12 @@ coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) bfd_h_put_32(abfd, aouthdr_int->vid[1], (bfd_byte *) aouthdr_ext->vid + 4); #endif - #ifdef RS6000COFF_C +#ifdef XCOFF64 + aouthdr_int->o_toc = bfd_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); @@ -716,9 +687,14 @@ coff_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) 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); +#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); +#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); #endif +#endif #ifdef MIPSECOFF aouthdr_int->bss_start = bfd_h_get_32(abfd, aouthdr_ext->bss_start); @@ -763,7 +739,11 @@ coff_swap_aouthdr_out (abfd, in, out) #endif #ifdef RS6000COFF_C +#ifdef XCOFF64 + bfd_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); @@ -774,9 +754,18 @@ coff_swap_aouthdr_out (abfd, in, out) 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); +#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); +#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); +#endif memset (aouthdr_out->o_resv2, 0, sizeof aouthdr_out->o_resv2); +#ifdef XCOFF64 + memset (aouthdr_out->o_debugger, 0, sizeof aouthdr_out->o_debugger); + memset (aouthdr_out->o_resv3, 0, sizeof aouthdr_out->o_resv3); +#endif #endif #ifdef MIPSECOFF @@ -814,7 +803,7 @@ coff_swap_scnhdr_in (abfd, ext, in) #ifdef COFF_ADJUST_SCNHDR_IN_PRE COFF_ADJUST_SCNHDR_IN_PRE (abfd, ext, in); #endif - memcpy(scnhdr_int->s_name, scnhdr_ext->s_name, sizeof(scnhdr_int->s_name)); + 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 = @@ -856,12 +845,11 @@ coff_swap_scnhdr_out (abfd, in, out) #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)); + 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, @@ -879,8 +867,9 @@ coff_swap_scnhdr_out (abfd, in, out) PUTWORD(abfd, scnhdr_int->s_nlnno, (bfd_byte *) scnhdr_ext->s_nlnno); PUTWORD(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc); #else - if (scnhdr_int->s_nlnno <= 0xffff) - PUTHALF(abfd, scnhdr_int->s_nlnno, (bfd_byte *) scnhdr_ext->s_nlnno); + if (scnhdr_int->s_nlnno <= MAX_SCNHDR_NLNNO) + PUT_SCNHDR_NLNNO(abfd, scnhdr_int->s_nlnno, + (bfd_byte *) scnhdr_ext->s_nlnno); else { char buf[sizeof (scnhdr_int->s_name) + 1]; @@ -891,10 +880,11 @@ 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); - PUTHALF (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno); + PUT_SCNHDR_NLNNO(abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nlnno); } - if (scnhdr_int->s_nreloc <= 0xffff) - PUTHALF(abfd, scnhdr_int->s_nreloc, (bfd_byte *) scnhdr_ext->s_nreloc); + if (scnhdr_int->s_nreloc <= MAX_SCNHDR_NRELOC) + PUT_SCNHDR_NRELOC(abfd, scnhdr_int->s_nreloc, + (bfd_byte *) scnhdr_ext->s_nreloc); else { char buf[sizeof (scnhdr_int->s_name) + 1]; @@ -905,7 +895,7 @@ coff_swap_scnhdr_out (abfd, in, out) bfd_get_filename (abfd), buf, scnhdr_int->s_nreloc); bfd_set_error (bfd_error_file_truncated); - PUTHALF (abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc); + PUT_SCNHDR_NRELOC(abfd, 0xffff, (bfd_byte *) scnhdr_ext->s_nreloc); ret = 0; } #endif diff --git a/gnu/dist/toolchain/bfd/config.in b/gnu/dist/toolchain/bfd/config.in index 7383656618bc..74af3d376ba8 100644 --- a/gnu/dist/toolchain/bfd/config.in +++ b/gnu/dist/toolchain/bfd/config.in @@ -25,9 +25,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 @@ -211,21 +208,42 @@ /* Define if has prstatus_t. */ #undef HAVE_PRSTATUS_T +/* Define if has prstatus32_t. */ +#undef HAVE_PRSTATUS32_T + /* Define if has prstatus_t.pr_who. */ #undef HAVE_PRSTATUS_T_PR_WHO +/* Define if has prstatus32_t.pr_who. */ +#undef HAVE_PRSTATUS32_T_PR_WHO + /* Define if has pstatus_t. */ #undef HAVE_PSTATUS_T +/* Define if has pxstatus_t. */ +#undef HAVE_PXSTATUS_T + +/* Define if has pstatus32_t. */ +#undef HAVE_PSTATUS32_T + /* Define if has prpsinfo_t. */ #undef HAVE_PRPSINFO_T +/* Define if has prpsinfo32_t. */ +#undef HAVE_PRPSINFO32_T + /* Define if has psinfo_t. */ #undef HAVE_PSINFO_T +/* Define if has psinfo32_t. */ +#undef HAVE_PSINFO32_T + /* Define if has lwpstatus_t. */ #undef HAVE_LWPSTATUS_T +/* Define if has lwpxstatus_t. */ +#undef HAVE_LWPXSTATUS_T + /* Define if has lwpstatus_t.pr_context. */ #undef HAVE_LWPSTATUS_T_PR_CONTEXT diff --git a/gnu/dist/toolchain/bfd/corefile.c b/gnu/dist/toolchain/bfd/corefile.c index 212f519ce8a5..061383fcf43a 100644 --- a/gnu/dist/toolchain/bfd/corefile.c +++ b/gnu/dist/toolchain/bfd/corefile.c @@ -30,7 +30,6 @@ DESCRIPTION #include "sysdep.h" #include "libbfd.h" - /* FUNCTION bfd_core_file_failing_command @@ -78,7 +77,6 @@ bfd_core_file_failing_signal (abfd) return BFD_SEND (abfd, _core_file_failing_signal, (abfd)); } - /* FUNCTION core_file_matches_executable_p diff --git a/gnu/dist/toolchain/bfd/cpu-a29k.c b/gnu/dist/toolchain/bfd/cpu-a29k.c index 5bd25a47720b..5b79937ff9c3 100644 --- a/gnu/dist/toolchain/bfd/cpu-a29k.c +++ b/gnu/dist/toolchain/bfd/cpu-a29k.c @@ -33,7 +33,7 @@ const bfd_arch_info_type bfd_a29k_arch = "a29k", 4, true, /* the one and only */ - bfd_default_compatible, + bfd_default_compatible, bfd_default_scan , 0, }; diff --git a/gnu/dist/toolchain/bfd/cpu-alpha.c b/gnu/dist/toolchain/bfd/cpu-alpha.c index b89900be3b72..48a16e313198 100644 --- a/gnu/dist/toolchain/bfd/cpu-alpha.c +++ b/gnu/dist/toolchain/bfd/cpu-alpha.c @@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define NN(index) (&arch_info_struct[index]) /* These exist only so that we can resonably disassemble PALcode. */ -static const bfd_arch_info_type arch_info_struct[] = +static const bfd_arch_info_type arch_info_struct[] = { N (64, 64, bfd_mach_alpha_ev4, "alpha:ev4", false, NN(1)), N (64, 64, bfd_mach_alpha_ev5, "alpha:ev5", false, NN(2)), diff --git a/gnu/dist/toolchain/bfd/cpu-arc.c b/gnu/dist/toolchain/bfd/cpu-arc.c index bce59d4c99f3..dbd7fb1bae5d 100644 --- a/gnu/dist/toolchain/bfd/cpu-arc.c +++ b/gnu/dist/toolchain/bfd/cpu-arc.c @@ -24,31 +24,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define ARC(mach, print_name, default_p, next) \ { \ - 32, /* 32 bits in a word */ \ - 32, /* 32 bits in an address */ \ - 8, /* 8 bits in a byte */ \ + 32, /* 32 bits in a word */ \ + 32, /* 32 bits in an address */ \ + 8, /* 8 bits in a byte */ \ bfd_arch_arc, \ mach, \ "arc", \ print_name, \ - 4, /* section alignment power */ \ + 4, /* section alignment power */ \ default_p, \ bfd_default_compatible, \ bfd_default_scan, \ next, \ } -#if 0 /* ??? Not currently needed, but keep in for future reference. */ static const bfd_arch_info_type arch_info_struct[] = { - ARC (bfd_mach_arc_foo, "arc-foo", false, &arch_info_struct[1]), - ARC (bfd_mach_arc_bar, "arc-bar", false, 0), + ARC ( bfd_mach_arc_5, "arc5", false, &arch_info_struct[1] ), + ARC ( bfd_mach_arc_6, "arc6", false, &arch_info_struct[2] ), + ARC ( bfd_mach_arc_7, "arc7", false, &arch_info_struct[3] ), + ARC ( bfd_mach_arc_8, "arc8", false, NULL ), }; -#endif const bfd_arch_info_type bfd_arc_arch = - ARC (bfd_mach_arc_base, "arc-base", true, 0 /*&arch_info_struct[0]*/); - + ARC ( bfd_mach_arc_5, "arc", true, &arch_info_struct[0] ); + /* Utility routines. */ /* Given cpu type NAME, return its bfd_mach_arc_xxx value. @@ -61,10 +61,7 @@ arc_get_mach (name) const bfd_arch_info_type *p; for (p = &bfd_arc_arch; p != NULL; p = p->next) - { - /* +4: skip over "arc-" */ - if (strcmp (name, p->printable_name + 4) == 0) - return p->mach; - } + if (strcmp (name, p->printable_name) == 0) + return p->mach; return -1; } diff --git a/gnu/dist/toolchain/bfd/cpu-arm.c b/gnu/dist/toolchain/bfd/cpu-arm.c index bda9c4489a66..91507f82b1d0 100644 --- a/gnu/dist/toolchain/bfd/cpu-arm.c +++ b/gnu/dist/toolchain/bfd/cpu-arm.c @@ -47,7 +47,7 @@ compatible (a,b) it can be polymorphed into the other */ if (a->the_default) return b; - + if (b->the_default) return a; @@ -93,9 +93,10 @@ processors[] = { bfd_mach_arm_4, "strongarm"}, { bfd_mach_arm_4, "strongarm110" }, { bfd_mach_arm_4, "strongarm1100" }, + { bfd_mach_arm_XScale, "xscale" } }; -static boolean +static boolean scan (info, string) const struct bfd_arch_info * info; const char * string; @@ -119,16 +120,15 @@ scan (info, string) /* Finally check for the default architecture */ if (strcasecmp (string, "arm") == 0) return info->the_default; - + return false; } - #define N(number, print, default, next) \ { 32, 32, 8, bfd_arch_arm, number, "arm", print, 4, default, compatible, scan, next } static const bfd_arch_info_type arch_info_struct[] = -{ +{ N( bfd_mach_arm_2, "armv2", false, & arch_info_struct[1] ), N( bfd_mach_arm_2a, "armv2a", false, & arch_info_struct[2] ), N( bfd_mach_arm_3, "armv3", false, & arch_info_struct[3] ), @@ -136,7 +136,9 @@ static const bfd_arch_info_type arch_info_struct[] = N( bfd_mach_arm_4, "armv4", false, & arch_info_struct[5] ), N( bfd_mach_arm_4T, "armv4t", false, & arch_info_struct[6] ), N( bfd_mach_arm_5, "armv5", false, & arch_info_struct[7] ), - N( bfd_mach_arm_5T, "armv5t", false, NULL ) + N( bfd_mach_arm_5T, "armv5t", false, & arch_info_struct[8] ), + N( bfd_mach_arm_5TE, "armv5te", false, & arch_info_struct[9] ), + N( bfd_mach_arm_XScale, "xscale", false, NULL ) }; const bfd_arch_info_type bfd_arm_arch = diff --git a/gnu/dist/toolchain/bfd/cpu-avr.c b/gnu/dist/toolchain/bfd/cpu-avr.c index 637b13fb3fd1..c86339d33a6c 100644 --- a/gnu/dist/toolchain/bfd/cpu-avr.c +++ b/gnu/dist/toolchain/bfd/cpu-avr.c @@ -22,11 +22,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" - static const bfd_arch_info_type *compatible PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *)); - #define N(addr_bits, machine, print, default, next) \ { \ 8, /* 8 bits in a word */ \ @@ -45,17 +43,20 @@ static const bfd_arch_info_type *compatible static const bfd_arch_info_type arch_info_struct[] = { - /* AT90S1200 */ + /* AT90S1200, ATtiny1x, ATtiny28 */ N (16, bfd_mach_avr1, "avr:1", false, & arch_info_struct[1]), - /* AT90S2xxx, AT90S4xxx, AT90S81xx, ATtiny22 */ + /* AT90S2xxx, AT90S4xxx, AT90S8xxx, ATtiny22 */ N (16, bfd_mach_avr2, "avr:2", false, & arch_info_struct[2]), /* ATmega103, ATmega603 */ N (22, bfd_mach_avr3, "avr:3", false, & arch_info_struct[3]), - /* ATmega161 */ - N (16, bfd_mach_avr4, "avr:4", false, NULL) + /* ATmega83, ATmega85 */ + N (16, bfd_mach_avr4, "avr:4", false, & arch_info_struct[4]), + + /* ATmega161, ATmega163, ATmega32, AT94K */ + N (22, bfd_mach_avr5, "avr:5", false, NULL) }; const bfd_arch_info_type bfd_avr_arch = @@ -74,7 +75,7 @@ compatible (a,b) if (a->arch != b->arch) return NULL; - /* Special case for ATmega[16]03 (avr:3) and ATmega161 (avr:4). */ + /* Special case for ATmega[16]03 (avr:3) and ATmega83 (avr:4). */ if ((a->mach == 3 && b->mach == 4) || (a->mach == 4 && b->mach == 3)) return NULL; @@ -84,6 +85,9 @@ compatible (a,b) if (a->mach <= b->mach) return b; + if (a->mach >= b->mach) + return a; + /* Never reached! */ return NULL; } diff --git a/gnu/dist/toolchain/bfd/cpu-cris.c b/gnu/dist/toolchain/bfd/cpu-cris.c new file mode 100644 index 000000000000..423da6ec57ce --- /dev/null +++ b/gnu/dist/toolchain/bfd/cpu-cris.c @@ -0,0 +1,57 @@ +/* BFD support for the Axis CRIS architecture. + Copyright (C) 2000 Free Software Foundation, Inc. + Contributed by Axis Communications AB. + Written by Hans-Peter Nilsson. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" + +const bfd_arch_info_type +bfd_cris_arch = +{ + 32, /* There's 32 bits_per_word. */ + 32, /* There's 32 bits_per_address. */ + 8, /* There's 8 bits_per_byte. */ + bfd_arch_cris, /* One of enum bfd_architecture, defined + in archures.c and provided in + generated header files. */ + 0xff, /* Only 1 machine, but #255 for + historical reasons. */ + "cris", /* The arch_name. */ + "cris", /* The printable name is the same. */ + 1, /* Section alignment power; each section + is aligned to (only) 2^1 bytes. */ + true, /* This is the default "machine", since + there's only one. */ + bfd_default_compatible, /* A default function for testing + "machine" compatibility of two + bfd_arch_info_type. */ + bfd_default_scan, /* Check if an bfd_arch_info_type is a + match. */ + NULL /* Pointer to next bfd_arch_info_type in + the same family. */ +}; + +/* + * Local variables: + * eval: (c-set-style "gnu") + * indent-tabs-mode: t + * End: + */ diff --git a/gnu/dist/toolchain/bfd/cpu-d10v.c b/gnu/dist/toolchain/bfd/cpu-d10v.c index e16c3b79fa92..868cbcff5aef 100644 --- a/gnu/dist/toolchain/bfd/cpu-d10v.c +++ b/gnu/dist/toolchain/bfd/cpu-d10v.c @@ -22,50 +22,50 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" -static const bfd_arch_info_type d10v_ts3_info = -{ - 16, /* 16 bits in a word */ - 16, /* 16 bits in an address */ - 8, /* 8 bits in a byte */ - bfd_arch_d10v, - bfd_mach_d10v_ts3, - "d10v", - "d10v:ts3", - 4, /* section alignment power */ - false, - bfd_default_compatible, - bfd_default_scan, - 0, -}; - -static const bfd_arch_info_type d10v_ts2_info = +static const bfd_arch_info_type d10v_ts3_info = { - 16, /* 16 bits in a word */ - 16, /* 16 bits in an address */ - 8, /* 8 bits in a byte */ + 16, /* 16 bits in a word */ + 16, /* 16 bits in an address */ + 8, /* 8 bits in a byte */ bfd_arch_d10v, - bfd_mach_d10v_ts2, - "d10v", - "d10v:ts2", - 4, /* section alignment power */ - false, - bfd_default_compatible, - bfd_default_scan, - &d10v_ts3_info, + bfd_mach_d10v_ts3, + "d10v", + "d10v:ts3", + 4, /* section alignment power */ + false, + bfd_default_compatible, + bfd_default_scan, + 0, }; -const bfd_arch_info_type bfd_d10v_arch = -{ - 16, /* 16 bits in a word */ - 16, /* 16 bits in an address */ - 8, /* 8 bits in a byte */ +static const bfd_arch_info_type d10v_ts2_info = +{ + 16, /* 16 bits in a word */ + 16, /* 16 bits in an address */ + 8, /* 8 bits in a byte */ bfd_arch_d10v, - bfd_mach_d10v, - "d10v", - "d10v", - 4, /* section alignment power */ - true, - bfd_default_compatible, - bfd_default_scan, - &d10v_ts2_info, + bfd_mach_d10v_ts2, + "d10v", + "d10v:ts2", + 4, /* section alignment power */ + false, + bfd_default_compatible, + bfd_default_scan, + &d10v_ts3_info, +}; + +const bfd_arch_info_type bfd_d10v_arch = +{ + 16, /* 16 bits in a word */ + 16, /* 16 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_d10v, + bfd_mach_d10v, + "d10v", + "d10v", + 4, /* section alignment power */ + true, + bfd_default_compatible, + bfd_default_scan, + &d10v_ts2_info, }; diff --git a/gnu/dist/toolchain/bfd/cpu-h8300.c b/gnu/dist/toolchain/bfd/cpu-h8300.c index 567b7df9de2a..9a4047ddb2ee 100644 --- a/gnu/dist/toolchain/bfd/cpu-h8300.c +++ b/gnu/dist/toolchain/bfd/cpu-h8300.c @@ -65,15 +65,14 @@ h8300_scan (info, string) } } - -/* This routine is provided two arch_infos and works out the - machine which would be compatible with both and returns a pointer - to its info structure */ +/* This routine is provided two arch_infos and works out the machine + which would be compatible with both and returns a pointer to its + info structure. */ static const bfd_arch_info_type * compatible (in, out) - const bfd_arch_info_type * in; - const bfd_arch_info_type * out; + const bfd_arch_info_type *in; + const bfd_arch_info_type *out; { /* It's really not a good idea to mix and match modes. */ if (in->mach != out->mach) @@ -95,7 +94,9 @@ static const bfd_arch_info_type h8300_info_struct = true, /* the default machine */ compatible, h8300_scan, -/* local_bfd_reloc_type_lookup, */ +#if 0 + local_bfd_reloc_type_lookup, +#endif 0, }; @@ -112,7 +113,9 @@ static const bfd_arch_info_type h8300h_info_struct = false, /* the default machine */ compatible, h8300_scan, -/* local_bfd_reloc_type_lookup, */ +#if 0 + local_bfd_reloc_type_lookup, +#endif &h8300_info_struct, }; @@ -129,6 +132,8 @@ const bfd_arch_info_type bfd_h8300_arch = false, /* the default machine */ compatible, h8300_scan, -/* local_bfd_reloc_type_lookup, */ +#if 0 + local_bfd_reloc_type_lookup, +#endif &h8300h_info_struct, }; diff --git a/gnu/dist/toolchain/bfd/cpu-h8500.c b/gnu/dist/toolchain/bfd/cpu-h8500.c index eae42e3abf22..143217c29108 100644 --- a/gnu/dist/toolchain/bfd/cpu-h8500.c +++ b/gnu/dist/toolchain/bfd/cpu-h8500.c @@ -24,11 +24,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if 0 -/* +/* Relocations for the Z8K */ -static bfd_reloc_status_type +static bfd_reloc_status_type howto16_callback (abfd, reloc_entry, symbol_in, data, ignore_input_section, ignore_bfd) bfd *abfd; @@ -40,18 +40,17 @@ howto16_callback (abfd, reloc_entry, symbol_in, data, { long relocation = 0; bfd_vma addr = reloc_entry->address; - long x = bfd_get_16(abfd, (bfd_byte *)data + addr); + long x = bfd_get_16 (abfd, (bfd_byte *)data + addr); HOWTO_PREPARE(relocation, symbol_in); x = (x + relocation + reloc_entry->addend); - bfd_put_16(abfd, x, (bfd_byte *)data + addr); + bfd_put_16 (abfd, x, (bfd_byte *)data + addr); return bfd_reloc_ok; } - -static bfd_reloc_status_type +static bfd_reloc_status_type howto8_callback (abfd, reloc_entry, symbol_in, data, ignore_input_section, ignore_bfd) bfd *abfd; @@ -63,18 +62,17 @@ howto8_callback (abfd, reloc_entry, symbol_in, data, { long relocation = 0; bfd_vma addr = reloc_entry->address; - long x = bfd_get_8(abfd, (bfd_byte *)data + addr); + long x = bfd_get_8 (abfd, (bfd_byte *)data + addr); HOWTO_PREPARE(relocation, symbol_in); x = (x + relocation + reloc_entry->addend); - bfd_put_8(abfd, x, (bfd_byte *)data + addr); + bfd_put_8 (abfd, x, (bfd_byte *)data + addr); return bfd_reloc_ok; } - -static bfd_reloc_status_type +static bfd_reloc_status_type howto8_FFnn_callback (abfd, reloc_entry, symbol_in, data, ignore_input_section, ignore_bfd) bfd *abfd; @@ -87,17 +85,17 @@ howto8_FFnn_callback (abfd, reloc_entry, symbol_in, data, long relocation = 0; bfd_vma addr = reloc_entry->address; - long x = bfd_get_8(abfd, (bfd_byte *)data + addr); - abort(); + long x = bfd_get_8 (abfd, (bfd_byte *)data + addr); + abort (); HOWTO_PREPARE(relocation, symbol_in); x = (x + relocation + reloc_entry->addend); - bfd_put_8(abfd, x, (bfd_byte *)data + addr); + bfd_put_8 (abfd, x, (bfd_byte *)data + addr); return bfd_reloc_ok; } -static bfd_reloc_status_type +static bfd_reloc_status_type howto8_pcrel_callback (abfd, reloc_entry, symbol_in, data, ignore_input_section, ignore_bfd) bfd *abfd; @@ -109,18 +107,16 @@ howto8_pcrel_callback (abfd, reloc_entry, symbol_in, data, { long relocation = 0; bfd_vma addr = reloc_entry->address; - long x = bfd_get_8(abfd, (bfd_byte *)data + addr); - abort(); + long x = bfd_get_8 (abfd, (bfd_byte *)data + addr); + abort (); HOWTO_PREPARE(relocation, symbol_in); x = (x + relocation + reloc_entry->addend); - bfd_put_8(abfd, x, (bfd_byte *)data + addr); + bfd_put_8 (abfd, x, (bfd_byte *)data + addr); return bfd_reloc_ok; } - - static reloc_howto_type howto_16 = NEWHOWTO(howto16_callback,"abs16",1,false,false); static reloc_howto_type howto_8 @@ -132,7 +128,6 @@ static reloc_howto_type howto_8_FFnn static reloc_howto_type howto_8_pcrel = NEWHOWTO(howto8_pcrel_callback,"pcrel8",0,false,true); - static reloc_howto_type * local_bfd_reloc_type_lookup (arch, code) const struct bfd_arch_info *arch; @@ -154,7 +149,7 @@ local_bfd_reloc_type_lookup (arch, code) int bfd_default_scan_num_mach(); -static boolean +static boolean scan_mach (info, string) const struct bfd_arch_info *info ATTRIBUTE_UNUSED; const char *string; @@ -166,7 +161,6 @@ scan_mach (info, string) return false; } - #if 0 /* not used currently */ /* This routine is provided two arch_infos and returns whether they'd be compatible */ diff --git a/gnu/dist/toolchain/bfd/cpu-hppa.c b/gnu/dist/toolchain/bfd/cpu-hppa.c index 5c1774367d59..3f807563cbfe 100644 --- a/gnu/dist/toolchain/bfd/cpu-hppa.c +++ b/gnu/dist/toolchain/bfd/cpu-hppa.c @@ -32,7 +32,7 @@ static const bfd_arch_info_type bfd_hppa10_arch = "hppa1.0", 3, true, /* Unless we use 1.1 specific features */ - bfd_default_compatible, + bfd_default_compatible, bfd_default_scan , 0, }; @@ -49,7 +49,7 @@ static const bfd_arch_info_type bfd_hppa20_arch = "hppa2.0", 3, false, /* Unless we use 1.1 specific features */ - bfd_default_compatible, + bfd_default_compatible, bfd_default_scan , &bfd_hppa10_arch, }; @@ -66,7 +66,7 @@ static const bfd_arch_info_type bfd_hppa20w_arch = "hppa2.0w", 3, false, /* Unless we use 1.1 specific features */ - bfd_default_compatible, + bfd_default_compatible, bfd_default_scan , &bfd_hppa20_arch, }; @@ -82,7 +82,7 @@ const bfd_arch_info_type bfd_hppa_arch = "hppa1.1", 3, false, /* 1.1 specific features used */ - bfd_default_compatible, + bfd_default_compatible, bfd_default_scan , &bfd_hppa20w_arch, }; diff --git a/gnu/dist/toolchain/bfd/cpu-i370.c b/gnu/dist/toolchain/bfd/cpu-i370.c index 2331eef913fd..b07a4c7709bd 100644 --- a/gnu/dist/toolchain/bfd/cpu-i370.c +++ b/gnu/dist/toolchain/bfd/cpu-i370.c @@ -46,7 +46,7 @@ i370_compatible (a, b) static const bfd_arch_info_type arch_info_struct[] = { - /* hack alert: old old machines are really 16 and 24 bit arch ... */ + /* hack alert: old old machines are really 16 and 24 bit arch ... */ { 32, /* 32 bits in a word */ 32, /* 32 bits in an address */ diff --git a/gnu/dist/toolchain/bfd/cpu-i386.c b/gnu/dist/toolchain/bfd/cpu-i386.c index f5b9b181d18d..c3e9bafc0931 100644 --- a/gnu/dist/toolchain/bfd/cpu-i386.c +++ b/gnu/dist/toolchain/bfd/cpu-i386.c @@ -32,10 +32,25 @@ const bfd_arch_info_type bfd_i386_arch_intel_syntax = "i386:intel", 3, true, - bfd_default_compatible, + bfd_default_compatible, bfd_default_scan , 0, }; +const bfd_arch_info_type bfd_x86_64_arch_intel_syntax = +{ + 64, /* 64 bits in a word */ + 64, /* 64 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_i386, + bfd_mach_x86_64_intel_syntax, + "x86_64:intel", + "x86_64:intel", + 3, + true, + bfd_default_compatible, + bfd_default_scan , + &bfd_i386_arch_intel_syntax, +}; static const bfd_arch_info_type i8086_arch = { 32, /* 32 bits in a word */ @@ -47,9 +62,25 @@ static const bfd_arch_info_type i8086_arch = "i8086", 3, false, - bfd_default_compatible, + bfd_default_compatible, bfd_default_scan , - &bfd_i386_arch_intel_syntax, + &bfd_x86_64_arch_intel_syntax, +}; + +const bfd_arch_info_type bfd_x86_64_arch = +{ + 64, /* 32 bits in a word */ + 64, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_i386, + bfd_mach_x86_64, + "x86_64", + "x86_64", + 3, + true, + bfd_default_compatible, + bfd_default_scan , + &i8086_arch, }; const bfd_arch_info_type bfd_i386_arch = @@ -63,8 +94,7 @@ const bfd_arch_info_type bfd_i386_arch = "i386", 3, true, - bfd_default_compatible, + bfd_default_compatible, bfd_default_scan , - &i8086_arch, + &bfd_x86_64_arch }; - diff --git a/gnu/dist/toolchain/bfd/cpu-i860.c b/gnu/dist/toolchain/bfd/cpu-i860.c index 57c867cdb2cb..7445e5ffbae4 100644 --- a/gnu/dist/toolchain/bfd/cpu-i860.c +++ b/gnu/dist/toolchain/bfd/cpu-i860.c @@ -1,5 +1,5 @@ /* BFD support for the Intel 860 architecture. - Copyright 1992, 1995 Free Software Foundation, Inc. + Copyright 1992, 1995, 2000 Free Software Foundation, Inc. Created mostly by substituting "860" for "386" in cpu-i386.c Harry Dolan , October 1995 @@ -25,16 +25,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ const bfd_arch_info_type bfd_i860_arch = { - 32, /* 32 bits in a word */ - 32, /* 32 bits in an address */ - 8, /* 8 bits in a byte */ - bfd_arch_i860, - 0, /* only 1 machine */ - "i860", - "i860", - 3, - true, /* the one and only */ - bfd_default_compatible, - bfd_default_scan , - 0, + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_i860, /* Architecture */ + 0, /* Only one machine */ + "i860", /* Architecture name */ + "i860", /* Printable name */ + 3, /* Section alignment exponent */ + true, /* Is this the default architecture? */ + bfd_default_compatible, + bfd_default_scan, + 0, /* Next in list */ }; diff --git a/gnu/dist/toolchain/bfd/cpu-i960.c b/gnu/dist/toolchain/bfd/cpu-i960.c index 7fb2c7ebc5c1..071d2a0ce2d0 100644 --- a/gnu/dist/toolchain/bfd/cpu-i960.c +++ b/gnu/dist/toolchain/bfd/cpu-i960.c @@ -18,12 +18,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #include "bfd.h" #include "sysdep.h" #include "libbfd.h" - /* This routine is provided a string, and tries to work out if it could possibly refer to the i960 machine pointed at in the info_struct pointer */ @@ -34,28 +32,44 @@ scan_960_mach (ap, string) const char *string; { unsigned long machine; + int i; + int fail_because_not_80960 = false; - /* Look for the string i960, or somesuch at the front of the string */ + for (i = 0; i < strlen (string); i ++) + string[i] = tolower (string[i]); - if (strncmp("i960",string,4) == 0) { - string+=4; - } - else { - /* no match, can be us */ - return false; - } - if (string[0] == 0) { - /* i960 on it's own means core to us*/ - if (ap->mach == bfd_mach_i960_core) return true; - return false; - } + /* Look for the string i960 at the front of the string. */ + if (strncmp ("i960", string, 4) == 0) + { + string += 4; - if (string[0] != ':') { + /* i960 on it's own means core to us. */ + if (* string == 0) + return ap->mach == bfd_mach_i960_core; + + /* "i960:*" is valid, anything else is not. */ + if (* string != ':') + return false; + + string ++; + } + /* In some bfds the cpu-id is written as "80960KA", "80960KB", + "80960CA" or "80960MC". */ + else if (strncmp ("80960", string, 5) == 0) + { + string += 5; + + /* Sett his to true here. If a correct matching postfix + is detected below it will be reset to false. */ + fail_because_not_80960 = true; + } + /* No match, can't be us. */ + else return false; - } - string++; - if (string[0] == '\0') + + if (* string == '\0') return false; + if (string[0] == 'c' && string[1] == 'o' && string[2] == 'r' && string[3] == 'e' && string[4] == '\0') machine = bfd_mach_i960_core; @@ -63,20 +77,20 @@ scan_960_mach (ap, string) machine = bfd_mach_i960_ka_sa; else if (strcmp (string, "kb_sb") == 0) machine = bfd_mach_i960_kb_sb; - else if (string[1] == '\0' || string[2] != '\0') /* rest are 2-char */ + else if (string[1] == '\0' || string[2] != '\0') /* rest are 2-char. */ return false; else if (string[0] == 'k' && string[1] == 'b') - machine = bfd_mach_i960_kb_sb; + { machine = bfd_mach_i960_kb_sb; fail_because_not_80960 = false; } else if (string[0] == 's' && string[1] == 'b') machine = bfd_mach_i960_kb_sb; else if (string[0] == 'm' && string[1] == 'c') - machine = bfd_mach_i960_mc; + { machine = bfd_mach_i960_mc; fail_because_not_80960 = false; } else if (string[0] == 'x' && string[1] == 'a') machine = bfd_mach_i960_xa; else if (string[0] == 'c' && string[1] == 'a') - machine = bfd_mach_i960_ca; + { machine = bfd_mach_i960_ca; fail_because_not_80960 = false; } else if (string[0] == 'k' && string[1] == 'a') - machine = bfd_mach_i960_ka_sa; + { machine = bfd_mach_i960_ka_sa; fail_because_not_80960 = false; } else if (string[0] == 's' && string[1] == 'a') machine = bfd_mach_i960_ka_sa; else if (string[0] == 'j' && string[1] == 'x') @@ -85,12 +99,16 @@ scan_960_mach (ap, string) machine = bfd_mach_i960_hx; else return false; - if (machine == ap->mach) return true; + + if (fail_because_not_80960) + return false; + + if (machine == ap->mach) + return true; + return false; } - - /* This routine is provided two arch_infos and works out the i960 machine which would be compatible with both and returns a pointer to its info structure */ @@ -102,17 +120,17 @@ compatible (a,b) { /* The i960 has distinct subspecies which may not interbreed: - CORE CA + CORE CA CORE KA KB MC XA CORE HX JX Any architecture on the same line is compatible, the one on - the right is the least restrictive. - + the right is the least restrictive. + We represent this information in an array, each machine to a side */ #define ERROR 0 -#define CORE bfd_mach_i960_core /*1*/ -#define KA bfd_mach_i960_ka_sa /*2*/ +#define CORE bfd_mach_i960_core /*1*/ +#define KA bfd_mach_i960_ka_sa /*2*/ #define KB bfd_mach_i960_kb_sb /*3*/ #define MC bfd_mach_i960_mc /*4*/ #define XA bfd_mach_i960_xa /*5*/ @@ -121,7 +139,7 @@ compatible (a,b) #define HX bfd_mach_i960_hx /*8*/ #define MAX_ARCH ((int)HX) - static CONST unsigned long matrix[MAX_ARCH+1][MAX_ARCH+1] = + static CONST unsigned long matrix[MAX_ARCH+1][MAX_ARCH+1] = { { ERROR, CORE, KA, KB, MC, XA, CA, JX, HX }, { CORE, CORE, KA, KB, MC, XA, CA, JX, HX }, @@ -134,25 +152,22 @@ compatible (a,b) { HX, HX, ERROR, ERROR, ERROR, ERROR, ERROR, HX, HX }, }; - - if (a->arch != b->arch || matrix[a->mach][b->mach] == ERROR) + if (a->arch != b->arch || matrix[a->mach][b->mach] == ERROR) { return NULL; } - else + else { return (a->mach == matrix[a->mach][b->mach]) ? a : b; } } - - int bfd_default_scan_num_mach(); #define N(a,b,d,n) \ { 32, 32, 8,bfd_arch_i960,a,"i960",b,3,d,compatible,scan_960_mach,n,} -static const bfd_arch_info_type arch_info_struct[] = -{ +static const bfd_arch_info_type arch_info_struct[] = +{ N(bfd_mach_i960_ka_sa,"i960:ka_sa",false, &arch_info_struct[1]), N(bfd_mach_i960_kb_sb,"i960:kb_sb",false, &arch_info_struct[2]), N(bfd_mach_i960_mc, "i960:mc", false, &arch_info_struct[3]), diff --git a/gnu/dist/toolchain/bfd/cpu-ia64-opc.c b/gnu/dist/toolchain/bfd/cpu-ia64-opc.c new file mode 100644 index 000000000000..2cd96c30fc96 --- /dev/null +++ b/gnu/dist/toolchain/bfd/cpu-ia64-opc.c @@ -0,0 +1,589 @@ +/* Copyright (C) 1998, 1999 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang + +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. */ + +/* 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 + 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. + + --davidm Mon Apr 13 22:14:02 1998 */ + +#include "../opcodes/ia64-opc.h" + +#define NELEMS(a) ((int) (sizeof (a) / sizeof ((a)[0]))) + +static const char* +ins_rsvd (const struct ia64_operand *self ATTRIBUTE_UNUSED, + ia64_insn value ATTRIBUTE_UNUSED, ia64_insn *code ATTRIBUTE_UNUSED) +{ + return "internal error---this shouldn't happen"; +} + +static const char* +ext_rsvd (const struct ia64_operand *self ATTRIBUTE_UNUSED, + ia64_insn code ATTRIBUTE_UNUSED, ia64_insn *valuep ATTRIBUTE_UNUSED) +{ + return "internal error---this shouldn't happen"; +} + +static const char* +ins_const (const struct ia64_operand *self ATTRIBUTE_UNUSED, + ia64_insn value ATTRIBUTE_UNUSED, ia64_insn *code ATTRIBUTE_UNUSED) +{ + return 0; +} + +static const char* +ext_const (const struct ia64_operand *self ATTRIBUTE_UNUSED, + ia64_insn code ATTRIBUTE_UNUSED, ia64_insn *valuep ATTRIBUTE_UNUSED) +{ + return 0; +} + +static const char* +ins_reg (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + if (value >= 1u << self->field[0].bits) + return "register number out of range"; + + *code |= value << self->field[0].shift; + return 0; +} + +static const char* +ext_reg (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + *valuep = ((code >> self->field[0].shift) + & ((1u << self->field[0].bits) - 1)); + return 0; +} + +static const char* +ins_immu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + ia64_insn new = 0; + int i; + + for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) + { + new |= ((value & ((((ia64_insn) 1) << self->field[i].bits) - 1)) + << self->field[i].shift); + value >>= self->field[i].bits; + } + if (value) + return "integer operand out of range"; + + *code |= new; + return 0; +} + +static const char* +ext_immu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + BFD_HOST_U_64_BIT value = 0; + int i, bits = 0, total = 0; + + for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) + { + bits = self->field[i].bits; + value |= ((code >> self->field[i].shift) + & ((((BFD_HOST_U_64_BIT) 1) << bits) - 1)) << total; + total += bits; + } + *valuep = value; + return 0; +} + +static const char* +ins_immus8 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + if (value & 0x7) + return "value not an integer multiple of 8"; + return ins_immu (self, value >> 3, code); +} + +static const char* +ext_immus8 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + const char *result; + + result = ext_immu (self, code, valuep); + if (result) + return result; + + *valuep = *valuep << 3; + return 0; +} + +static const char* +ins_imms_scaled (const struct ia64_operand *self, ia64_insn value, + ia64_insn *code, int scale) +{ + BFD_HOST_64_BIT svalue = value, sign_bit = 0; + ia64_insn new = 0; + int i; + + svalue >>= scale; + + for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) + { + new |= ((svalue & ((((ia64_insn) 1) << self->field[i].bits) - 1)) + << self->field[i].shift); + sign_bit = (svalue >> (self->field[i].bits - 1)) & 1; + svalue >>= self->field[i].bits; + } + if ((!sign_bit && svalue != 0) || (sign_bit && svalue != -1)) + return "integer operand out of range"; + + *code |= new; + return 0; +} + +static const char* +ext_imms_scaled (const struct ia64_operand *self, ia64_insn code, + ia64_insn *valuep, int scale) +{ + int i, bits = 0, total = 0, shift; + BFD_HOST_64_BIT val = 0; + + for (i = 0; i < NELEMS (self->field) && self->field[i].bits; ++i) + { + bits = self->field[i].bits; + val |= ((code >> self->field[i].shift) + & ((((BFD_HOST_U_64_BIT) 1) << bits) - 1)) << total; + total += bits; + } + /* sign extend: */ + shift = 8*sizeof (val) - total; + val = (val << shift) >> shift; + + *valuep = (val << scale); + return 0; +} + +static const char* +ins_imms (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + return ins_imms_scaled (self, value, code, 0); +} + +static const char* +ins_immsu4 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + if (value == (BFD_HOST_U_64_BIT) 0x100000000) + value = 0; + else + value = (((BFD_HOST_64_BIT)value << 32) >> 32); + + return ins_imms_scaled (self, value, code, 0); +} + +static const char* +ext_imms (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + return ext_imms_scaled (self, code, valuep, 0); +} + +static const char* +ins_immsm1 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + --value; + return ins_imms_scaled (self, value, code, 0); +} + +static const char* +ins_immsm1u4 (const struct ia64_operand *self, ia64_insn value, + ia64_insn *code) +{ + if (value == (BFD_HOST_U_64_BIT) 0x100000000) + value = 0; + else + value = (((BFD_HOST_64_BIT)value << 32) >> 32); + + --value; + return ins_imms_scaled (self, value, code, 0); +} + +static const char* +ext_immsm1 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + const char *res = ext_imms_scaled (self, code, valuep, 0); + + ++*valuep; + return res; +} + +static const char* +ins_imms1 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + return ins_imms_scaled (self, value, code, 1); +} + +static const char* +ext_imms1 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + return ext_imms_scaled (self, code, valuep, 1); +} + +static const char* +ins_imms4 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + return ins_imms_scaled (self, value, code, 4); +} + +static const char* +ext_imms4 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + return ext_imms_scaled (self, code, valuep, 4); +} + +static const char* +ins_imms16 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + return ins_imms_scaled (self, value, code, 16); +} + +static const char* +ext_imms16 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + return ext_imms_scaled (self, code, valuep, 16); +} + +static const char* +ins_cimmu (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + ia64_insn mask = (((ia64_insn) 1) << self->field[0].bits) - 1; + return ins_immu (self, value ^ mask, code); +} + +static const char* +ext_cimmu (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + const char *result; + ia64_insn mask; + + mask = (((ia64_insn) 1) << self->field[0].bits) - 1; + result = ext_immu (self, code, valuep); + if (!result) + { + mask = (((ia64_insn) 1) << self->field[0].bits) - 1; + *valuep ^= mask; + } + return result; +} + +static const char* +ins_cnt (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + --value; + if (value >= ((BFD_HOST_U_64_BIT) 1) << self->field[0].bits) + return "count out of range"; + + *code |= value << self->field[0].shift; + return 0; +} + +static const char* +ext_cnt (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + *valuep = ((code >> self->field[0].shift) + & ((((BFD_HOST_U_64_BIT) 1) << self->field[0].bits) - 1)) + 1; + return 0; +} + +static const char* +ins_cnt2b (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + --value; + + if (value > 2) + return "count must be in range 1..3"; + + *code |= value << self->field[0].shift; + return 0; +} + +static const char* +ext_cnt2b (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + *valuep = ((code >> self->field[0].shift) & 0x3) + 1; + return 0; +} + +static const char* +ins_cnt2c (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + switch (value) + { + case 0: value = 0; break; + case 7: value = 1; break; + case 15: value = 2; break; + case 16: value = 3; break; + default: return "count must be 0, 7, 15, or 16"; + } + *code |= value << self->field[0].shift; + return 0; +} + +static const char* +ext_cnt2c (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + ia64_insn value; + + value = (code >> self->field[0].shift) & 0x3; + switch (value) + { + case 0: value = 0; break; + case 1: value = 7; break; + case 2: value = 15; break; + case 3: value = 16; break; + } + *valuep = value; + return 0; +} + +static const char* +ins_inc3 (const struct ia64_operand *self, ia64_insn value, ia64_insn *code) +{ + BFD_HOST_64_BIT val = value; + BFD_HOST_U_64_BIT sign = 0; + + if (val < 0) + { + sign = 0x4; + value = -value; + } + switch (value) + { + case 1: value = 3; break; + case 4: value = 2; break; + case 8: value = 1; break; + case 16: value = 0; break; + default: return "count must be +/- 1, 4, 8, or 16"; + } + *code |= (sign | value) << self->field[0].shift; + return 0; +} + +static const char* +ext_inc3 (const struct ia64_operand *self, ia64_insn code, ia64_insn *valuep) +{ + BFD_HOST_64_BIT val; + int negate; + + val = (code >> self->field[0].shift) & 0x7; + negate = val & 0x4; + switch (val & 0x3) + { + case 0: val = 16; break; + case 1: val = 8; break; + case 2: val = 4; break; + case 3: val = 1; break; + } + if (negate) + val = -val; + + *valuep = val; + return 0; +} + +#define CST IA64_OPND_CLASS_CST +#define REG IA64_OPND_CLASS_REG +#define IND IA64_OPND_CLASS_IND +#define ABS IA64_OPND_CLASS_ABS +#define REL IA64_OPND_CLASS_REL + +#define SDEC IA64_OPND_FLAG_DECIMAL_SIGNED +#define UDEC IA64_OPND_FLAG_DECIMAL_UNSIGNED + +const struct ia64_operand elf64_ia64_operands[IA64_OPND_COUNT] = + { + /* constants: */ + { CST, ins_const, ext_const, "NIL", {{ 0, 0}}, 0, "" }, + { CST, ins_const, ext_const, "ar.ccv", {{ 0, 0}}, 0, "ar.ccv" }, + { CST, ins_const, ext_const, "ar.pfs", {{ 0, 0}}, 0, "ar.pfs" }, + { CST, ins_const, ext_const, "1", {{ 0, 0}}, 0, "1" }, + { CST, ins_const, ext_const, "8", {{ 0, 0}}, 0, "8" }, + { CST, ins_const, ext_const, "16", {{ 0, 0}}, 0, "16" }, + { CST, ins_const, ext_const, "r0", {{ 0, 0}}, 0, "r0" }, + { CST, ins_const, ext_const, "ip", {{ 0, 0}}, 0, "ip" }, + { CST, ins_const, ext_const, "pr", {{ 0, 0}}, 0, "pr" }, + { CST, ins_const, ext_const, "pr.rot", {{ 0, 0}}, 0, "pr.rot" }, + { CST, ins_const, ext_const, "psr", {{ 0, 0}}, 0, "psr" }, + { CST, ins_const, ext_const, "psr.l", {{ 0, 0}}, 0, "psr.l" }, + { CST, ins_const, ext_const, "psr.um", {{ 0, 0}}, 0, "psr.um" }, + + /* register operands: */ + { REG, ins_reg, ext_reg, "ar", {{ 7, 20}}, 0, /* AR3 */ + "an application register" }, + { REG, ins_reg, ext_reg, "b", {{ 3, 6}}, 0, /* B1 */ + "a branch register" }, + { REG, ins_reg, ext_reg, "b", {{ 3, 13}}, 0, /* B2 */ + "a branch register"}, + { REG, ins_reg, ext_reg, "cr", {{ 7, 20}}, 0, /* CR */ + "a control register"}, + { REG, ins_reg, ext_reg, "f", {{ 7, 6}}, 0, /* F1 */ + "a floating-point register" }, + { REG, ins_reg, ext_reg, "f", {{ 7, 13}}, 0, /* F2 */ + "a floating-point register" }, + { REG, ins_reg, ext_reg, "f", {{ 7, 20}}, 0, /* F3 */ + "a floating-point register" }, + { REG, ins_reg, ext_reg, "f", {{ 7, 27}}, 0, /* F4 */ + "a floating-point register" }, + { REG, ins_reg, ext_reg, "p", {{ 6, 6}}, 0, /* P1 */ + "a predicate register" }, + { REG, ins_reg, ext_reg, "p", {{ 6, 27}}, 0, /* P2 */ + "a predicate register" }, + { REG, ins_reg, ext_reg, "r", {{ 7, 6}}, 0, /* R1 */ + "a general register" }, + { REG, ins_reg, ext_reg, "r", {{ 7, 13}}, 0, /* R2 */ + "a general register" }, + { REG, ins_reg, ext_reg, "r", {{ 7, 20}}, 0, /* R3 */ + "a general register" }, + { REG, ins_reg, ext_reg, "r", {{ 2, 20}}, 0, /* R3_2 */ + "a general register r0-r3" }, + + /* indirect operands: */ + { IND, ins_reg, ext_reg, "cpuid", {{7, 20}}, 0, /* CPUID_R3 */ + "a cpuid register" }, + { IND, ins_reg, ext_reg, "dbr", {{7, 20}}, 0, /* DBR_R3 */ + "a dbr register" }, + { IND, ins_reg, ext_reg, "dtr", {{7, 20}}, 0, /* DTR_R3 */ + "a dtr register" }, + { IND, ins_reg, ext_reg, "itr", {{7, 20}}, 0, /* ITR_R3 */ + "an itr register" }, + { IND, ins_reg, ext_reg, "ibr", {{7, 20}}, 0, /* IBR_R3 */ + "an ibr register" }, + { IND, ins_reg, ext_reg, "", {{7, 20}}, 0, /* MR3 */ + "an indirect memory address" }, + { IND, ins_reg, ext_reg, "msr", {{7, 20}}, 0, /* MSR_R3 */ + "an msr register" }, + { IND, ins_reg, ext_reg, "pkr", {{7, 20}}, 0, /* PKR_R3 */ + "a pkr register" }, + { IND, ins_reg, ext_reg, "pmc", {{7, 20}}, 0, /* PMC_R3 */ + "a pmc register" }, + { IND, ins_reg, ext_reg, "pmd", {{7, 20}}, 0, /* PMD_R3 */ + "a pmd register" }, + { IND, ins_reg, ext_reg, "rr", {{7, 20}}, 0, /* RR_R3 */ + "an rr register" }, + + /* immediate operands: */ + { ABS, ins_cimmu, ext_cimmu, 0, {{ 5, 20 }}, UDEC, /* CCNT5 */ + "a 5-bit count (0-31)" }, + { ABS, ins_cnt, ext_cnt, 0, {{ 2, 27 }}, UDEC, /* CNT2a */ + "a 2-bit count (1-4)" }, + { ABS, ins_cnt2b, ext_cnt2b, 0, {{ 2, 27 }}, UDEC, /* CNT2b */ + "a 2-bit count (1-3)" }, + { ABS, ins_cnt2c, ext_cnt2c, 0, {{ 2, 30 }}, UDEC, /* CNT2c */ + "a count (0, 7, 15, or 16)" }, + { ABS, ins_immu, ext_immu, 0, {{ 5, 14}}, UDEC, /* CNT5 */ + "a 5-bit count (0-31)" }, + { ABS, ins_immu, ext_immu, 0, {{ 6, 27}}, UDEC, /* CNT6 */ + "a 6-bit count (0-63)" }, + { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 20}}, UDEC, /* CPOS6a */ + "a 6-bit bit pos (0-63)" }, + { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 14}}, UDEC, /* CPOS6b */ + "a 6-bit bit pos (0-63)" }, + { ABS, ins_cimmu, ext_cimmu, 0, {{ 6, 31}}, UDEC, /* CPOS6c */ + "a 6-bit bit pos (0-63)" }, + { ABS, ins_imms, ext_imms, 0, {{ 1, 36}}, SDEC, /* IMM1 */ + "a 1-bit integer (-1, 0)" }, + { ABS, ins_immu, ext_immu, 0, {{ 2, 13}}, UDEC, /* IMMU2 */ + "a 2-bit unsigned (0-3)" }, + { ABS, ins_immu, ext_immu, 0, {{ 7, 13}}, 0, /* IMMU7a */ + "a 7-bit unsigned (0-127)" }, + { ABS, ins_immu, ext_immu, 0, {{ 7, 20}}, 0, /* IMMU7b */ + "a 7-bit unsigned (0-127)" }, + { ABS, ins_immu, ext_immu, 0, {{ 7, 13}}, UDEC, /* SOF */ + "a frame size (register count)" }, + { ABS, ins_immu, ext_immu, 0, {{ 7, 20}}, UDEC, /* SOL */ + "a local register count" }, + { ABS, ins_immus8,ext_immus8,0, {{ 4, 27}}, UDEC, /* SOR */ + "a rotating register count (integer multiple of 8)" }, + { ABS, ins_imms, ext_imms, 0, /* IMM8 */ + {{ 7, 13}, { 1, 36}}, SDEC, + "an 8-bit integer (-128-127)" }, + { ABS, ins_immsu4, ext_imms, 0, /* IMM8U4 */ + {{ 7, 13}, { 1, 36}}, SDEC, + "an 8-bit signed integer for 32-bit unsigned compare (-128-127)" }, + { ABS, ins_immsm1, ext_immsm1, 0, /* IMM8M1 */ + {{ 7, 13}, { 1, 36}}, SDEC, + "an 8-bit integer (-127-128)" }, + { ABS, ins_immsm1u4, ext_immsm1, 0, /* IMM8M1U4 */ + {{ 7, 13}, { 1, 36}}, SDEC, + "an 8-bit integer for 32-bit unsigned compare (-127-(-1),1-128,0x100000000)" }, + { ABS, ins_immsm1, ext_immsm1, 0, /* IMM8M1U8 */ + {{ 7, 13}, { 1, 36}}, SDEC, + "an 8-bit integer for 64-bit unsigned compare (-127-(-1),1-128,0x10000000000000000)" }, + { ABS, ins_immu, ext_immu, 0, {{ 2, 33}, { 7, 20}}, 0, /* IMMU9 */ + "a 9-bit unsigned (0-511)" }, + { ABS, ins_imms, ext_imms, 0, /* IMM9a */ + {{ 7, 6}, { 1, 27}, { 1, 36}}, SDEC, + "a 9-bit integer (-256-255)" }, + { ABS, ins_imms, ext_imms, 0, /* IMM9b */ + {{ 7, 13}, { 1, 27}, { 1, 36}}, SDEC, + "a 9-bit integer (-256-255)" }, + { ABS, ins_imms, ext_imms, 0, /* IMM14 */ + {{ 7, 13}, { 6, 27}, { 1, 36}}, SDEC, + "a 14-bit integer (-8192-8191)" }, + { ABS, ins_imms1, ext_imms1, 0, /* IMM17 */ + {{ 7, 6}, { 8, 24}, { 1, 36}}, 0, + "a 17-bit integer (-65536-65535)" }, + { ABS, ins_immu, ext_immu, 0, {{20, 6}, { 1, 36}}, 0, /* IMMU21 */ + "a 21-bit unsigned" }, + { ABS, ins_imms, ext_imms, 0, /* IMM22 */ + {{ 7, 13}, { 9, 27}, { 5, 22}, { 1, 36}}, SDEC, + "a 22-bit signed integer" }, + { ABS, ins_immu, ext_immu, 0, /* IMMU24 */ + {{21, 6}, { 2, 31}, { 1, 36}}, 0, + "a 24-bit unsigned" }, + { ABS, ins_imms16,ext_imms16,0, {{27, 6}, { 1, 36}}, 0, /* IMM44 */ + "a 44-bit unsigned (least 16 bits ignored/zeroes)" }, + { ABS, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* IMMU62 */ + "a 62-bit unsigned" }, + { ABS, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* IMMU64 */ + "a 64-bit unsigned" }, + { ABS, ins_inc3, ext_inc3, 0, {{ 3, 13}}, SDEC, /* INC3 */ + "an increment (+/- 1, 4, 8, or 16)" }, + { ABS, ins_cnt, ext_cnt, 0, {{ 4, 27}}, UDEC, /* LEN4 */ + "a 4-bit length (1-16)" }, + { ABS, ins_cnt, ext_cnt, 0, {{ 6, 27}}, UDEC, /* LEN6 */ + "a 6-bit length (1-64)" }, + { ABS, ins_immu, ext_immu, 0, {{ 4, 20}}, 0, /* MBTYPE4 */ + "a mix type (@rev, @mix, @shuf, @alt, or @brcst)" }, + { ABS, ins_immu, ext_immu, 0, {{ 8, 20}}, 0, /* MBTYPE8 */ + "an 8-bit mix type" }, + { ABS, ins_immu, ext_immu, 0, {{ 6, 14}}, UDEC, /* POS6 */ + "a 6-bit bit pos (0-63)" }, + { REL, ins_imms4, ext_imms4, 0, {{ 7, 6}, { 2, 33}}, 0, /* TAG13 */ + "a branch tag" }, + { REL, ins_imms4, ext_imms4, 0, {{ 9, 24}}, 0, /* TAG13b */ + "a branch tag" }, + { REL, ins_imms4, ext_imms4, 0, {{20, 6}, { 1, 36}}, 0, /* TGT25 */ + "a branch target" }, + { REL, ins_imms4, ext_imms4, 0, /* TGT25b */ + {{ 7, 6}, {13, 20}, { 1, 36}}, 0, + "a branch target" }, + { REL, ins_imms4, ext_imms4, 0, {{20, 13}, { 1, 36}}, 0, /* TGT25c */ + "a branch target" }, + { REL, ins_rsvd, ext_rsvd, 0, {{0, 0}}, 0, /* TGT64 */ + "a branch target" }, + }; diff --git a/gnu/dist/toolchain/bfd/cpu-ia64.c b/gnu/dist/toolchain/bfd/cpu-ia64.c new file mode 100644 index 000000000000..924e862fd8d7 --- /dev/null +++ b/gnu/dist/toolchain/bfd/cpu-ia64.c @@ -0,0 +1,57 @@ +/* BFD support for the ia64 architecture. + Copyright (C) 1998, 1999 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" + +const bfd_arch_info_type bfd_ia64_elf32_arch = + { + 64, /* 64 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_ia64, + bfd_mach_ia64_elf32, + "ia64", + "ia64-elf32", + 3, /* log2 of section alignment */ + true, /* the one and only */ + bfd_default_compatible, + bfd_default_scan , + 0, + }; + +const bfd_arch_info_type bfd_ia64_arch = + { + 64, /* 64 bits in a word */ + 64, /* 64 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_ia64, + bfd_mach_ia64_elf64, + "ia64", + "ia64-elf64", + 3, /* log2 of section alignment */ + true, /* the one and only */ + bfd_default_compatible, + bfd_default_scan , + &bfd_ia64_elf32_arch, + }; + +#include "cpu-ia64-opc.c" diff --git a/gnu/dist/toolchain/bfd/cpu-m32r.c b/gnu/dist/toolchain/bfd/cpu-m32r.c index 895ad413b266..490224637fcc 100644 --- a/gnu/dist/toolchain/bfd/cpu-m32r.c +++ b/gnu/dist/toolchain/bfd/cpu-m32r.c @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define NEXT NULL -static const bfd_arch_info_type arch_info_struct[] = +static const bfd_arch_info_type arch_info_struct[] = { N (bfd_mach_m32rx, "m32rx", false, NULL) }; diff --git a/gnu/dist/toolchain/bfd/cpu-m68hc11.c b/gnu/dist/toolchain/bfd/cpu-m68hc11.c new file mode 100644 index 000000000000..3238c578d542 --- /dev/null +++ b/gnu/dist/toolchain/bfd/cpu-m68hc11.c @@ -0,0 +1,38 @@ +/* BFD support for the Motorola 68HC11 processor + Copyright 1999, 2000 Free Software Foundation, Inc. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" + +const bfd_arch_info_type bfd_m68hc11_arch = +{ + 16, /* 16 bits in a word */ + 16, /* 16 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_m68hc11, + 0, + "m68hc11", + "m68hc11", + 4, /* section alignment power */ + true, + bfd_default_compatible, + bfd_default_scan, + 0, +}; diff --git a/gnu/dist/toolchain/bfd/cpu-m68hc12.c b/gnu/dist/toolchain/bfd/cpu-m68hc12.c new file mode 100644 index 000000000000..1810438b291a --- /dev/null +++ b/gnu/dist/toolchain/bfd/cpu-m68hc12.c @@ -0,0 +1,38 @@ +/* BFD support for the Motorola 68HC12 processor + Copyright 1999, 2000 Free Software Foundation, Inc. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" + +const bfd_arch_info_type bfd_m68hc12_arch = +{ + 16, /* 16 bits in a word */ + 16, /* 16 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_m68hc12, + 0, + "m68hc12", + "m68hc12", + 4, /* section alignment power */ + true, + bfd_default_compatible, + bfd_default_scan, + 0, +}; diff --git a/gnu/dist/toolchain/bfd/cpu-m68k.c b/gnu/dist/toolchain/bfd/cpu-m68k.c index 184182d695e0..6b67f1829f13 100644 --- a/gnu/dist/toolchain/bfd/cpu-m68k.c +++ b/gnu/dist/toolchain/bfd/cpu-m68k.c @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ { 32, 32, 8, bfd_arch_m68k, name, "m68k",print,2,d,bfd_default_compatible,bfd_default_scan, next, } static const bfd_arch_info_type arch_info_struct[] = -{ +{ N(bfd_mach_m68000, "m68k:68000", false, &arch_info_struct[1]), N(bfd_mach_m68008, "m68k:68008", false, &arch_info_struct[2]), N(bfd_mach_m68010, "m68k:68010", false, &arch_info_struct[3]), diff --git a/gnu/dist/toolchain/bfd/cpu-m88k.c b/gnu/dist/toolchain/bfd/cpu-m88k.c index c3716c5a394c..e5cc1a1f390b 100644 --- a/gnu/dist/toolchain/bfd/cpu-m88k.c +++ b/gnu/dist/toolchain/bfd/cpu-m88k.c @@ -22,9 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" - - - const bfd_arch_info_type bfd_m88k_arch = { 32, /* 32 bits in a word */ @@ -36,7 +33,7 @@ const bfd_arch_info_type bfd_m88k_arch = "m88k:88100", 3, true, /* the one and only */ - bfd_default_compatible, + bfd_default_compatible, bfd_default_scan , 0, }; diff --git a/gnu/dist/toolchain/bfd/cpu-mips.c b/gnu/dist/toolchain/bfd/cpu-mips.c index a933b8cd10bc..397e5a9a8408 100644 --- a/gnu/dist/toolchain/bfd/cpu-mips.c +++ b/gnu/dist/toolchain/bfd/cpu-mips.c @@ -1,5 +1,5 @@ /* bfd back-end for mips support - Copyright (C) 1990, 91-97, 1998 Free Software Foundation, Inc. + Copyright (C) 1990, 91-97, 1998, 2000 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -38,46 +38,54 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ NEXT, \ } -enum { -I_mips3000, -I_mips3900, -I_mips4000, -I_mips4010, -I_mips4100, -I_mips4111, -I_mips4300, -I_mips4400, -I_mips4600, -I_mips4650, -I_mips5000, -I_mips6000, -I_mips8000, -I_mips10000, -I_mips16 +enum +{ + I_mips3000, + I_mips3900, + I_mips4000, + I_mips4010, + I_mips4100, + I_mips4111, + I_mips4300, + I_mips4400, + I_mips4600, + I_mips4650, + I_mips5000, + I_mips6000, + I_mips8000, + I_mips10000, + I_mips16, + I_mips32, + I_mips32_4k, + I_mips5, + I_mips64, + I_sb1, }; +#define NN(index) (&arch_info_struct[(index) + 1]) -#define NN(index) (&arch_info_struct[(index)+1]) - -static const bfd_arch_info_type arch_info_struct[] = +static const bfd_arch_info_type arch_info_struct[] = { - N (32, 32, bfd_mach_mips3000, "mips:3000", false, NN(I_mips3000)), - N (32, 32, bfd_mach_mips3900, "mips:3900", false, NN(I_mips3900)), - N (64, 64, bfd_mach_mips4000, "mips:4000", false, NN(I_mips4000)), - N (64, 64, bfd_mach_mips4010, "mips:4010", false, NN(I_mips4010)), - N (64, 64, bfd_mach_mips4100, "mips:4100", false, NN(I_mips4100)), - N (64, 64, bfd_mach_mips4111, "mips:4111", false, NN(I_mips4111)), - N (64, 64, bfd_mach_mips4300, "mips:4300", false, NN(I_mips4300)), - N (64, 64, bfd_mach_mips4400, "mips:4400", false, NN(I_mips4400)), - N (64, 64, bfd_mach_mips4600, "mips:4600", false, NN(I_mips4600)), - N (64, 64, bfd_mach_mips4650, "mips:4650", false, NN(I_mips4650)), - N (64, 64, bfd_mach_mips5000, "mips:5000", false, NN(I_mips5000)), - N (32, 32, bfd_mach_mips6000, "mips:6000", false, NN(I_mips6000)), - N (64, 64, bfd_mach_mips8000, "mips:8000", false, NN(I_mips8000)), - N (64, 64, bfd_mach_mips10000, "mips:10000", false, NN(I_mips10000)), - - - N (64, 64, bfd_mach_mips16, "mips:16", false, 0), + N (32, 32, bfd_mach_mips3000, "mips:3000", false, NN(I_mips3000)), + N (32, 32, bfd_mach_mips3900, "mips:3900", false, NN(I_mips3900)), + N (64, 64, bfd_mach_mips4000, "mips:4000", false, NN(I_mips4000)), + N (64, 64, bfd_mach_mips4010, "mips:4010", false, NN(I_mips4010)), + N (64, 64, bfd_mach_mips4100, "mips:4100", false, NN(I_mips4100)), + N (64, 64, bfd_mach_mips4111, "mips:4111", false, NN(I_mips4111)), + N (64, 64, bfd_mach_mips4300, "mips:4300", false, NN(I_mips4300)), + N (64, 64, bfd_mach_mips4400, "mips:4400", false, NN(I_mips4400)), + N (64, 64, bfd_mach_mips4600, "mips:4600", false, NN(I_mips4600)), + N (64, 64, bfd_mach_mips4650, "mips:4650", false, NN(I_mips4650)), + N (64, 64, bfd_mach_mips5000, "mips:5000", false, NN(I_mips5000)), + N (32, 32, bfd_mach_mips6000, "mips:6000", false, NN(I_mips6000)), + N (64, 64, bfd_mach_mips8000, "mips:8000", false, NN(I_mips8000)), + N (64, 64, bfd_mach_mips10000,"mips:10000", false, NN(I_mips10000)), + N (64, 64, bfd_mach_mips16, "mips:16", false, NN(I_mips16)), + N (32, 32, bfd_mach_mips32, "mips:mips32", false, NN(I_mips32)), + N (32, 32, bfd_mach_mips32_4k,"mips:mips32-4k", false, NN(I_mips32_4k)), + N (64, 64, bfd_mach_mips5, "mips:mips5", false, NN(I_mips5)), + N (64, 64, bfd_mach_mips64, "mips:mips64", false, NN(I_mips64)), + N (64, 64, bfd_mach_mips_sb1, "mips:sb1", false, 0), }; /* The default architecture is mips:3000, but with a machine number of diff --git a/gnu/dist/toolchain/bfd/cpu-ns32k.c b/gnu/dist/toolchain/bfd/cpu-ns32k.c index f74e25bbcb77..6083a7ddc319 100644 --- a/gnu/dist/toolchain/bfd/cpu-ns32k.c +++ b/gnu/dist/toolchain/bfd/cpu-ns32k.c @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ { 32, 32, 8, bfd_arch_ns32k, machine, "ns32k",printable,3,d,bfd_default_compatible,bfd_default_scan, next, } static const bfd_arch_info_type arch_info_struct[] = -{ +{ N(32532,"ns32k:32532",true, 0), /* the word ns32k will match this too */ }; @@ -174,8 +174,8 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, asection *input_section; bfd *output_bfd; char **error_message ATTRIBUTE_UNUSED; - long (*get_data)(); - int (*put_data)(); + long (*get_data) (); + int (*put_data) (); { int overflow = 0; bfd_vma relocation; @@ -200,7 +200,6 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, && output_bfd == (bfd *) NULL) flag = bfd_reloc_undefined; - /* Is the address of the relocation really within the section? */ if (reloc_entry->address > input_section->_cooked_size) return bfd_reloc_outofrange; @@ -214,7 +213,6 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, else relocation = symbol->value; - reloc_target_output_section = symbol->section->output_section; /* Convert input-section-relative symbol value to absolute. */ @@ -290,8 +288,7 @@ do_ns32k_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, reloc_entry->address += input_section->output_offset; /* WTF?? */ - if (abfd->xvec->flavour == bfd_target_coff_flavour - && strcmp (abfd->xvec->name, "aixcoff-rs6000") != 0) + if (abfd->xvec->flavour == bfd_target_coff_flavour) { #if 1 /* For m68k-coff, the addend was being subtracted twice during @@ -599,8 +596,8 @@ _bfd_do_ns32k_reloc_contents ( howto, input_bfd, relocation, location, bfd *input_bfd ATTRIBUTE_UNUSED; bfd_vma relocation; bfd_byte *location; - long (*get_data)(); - int (*put_data)(); + long (*get_data) (); + int (*put_data) (); { int size; bfd_vma x; diff --git a/gnu/dist/toolchain/bfd/cpu-pj.c b/gnu/dist/toolchain/bfd/cpu-pj.c index 44ddd3326029..913cbc58ee2d 100644 --- a/gnu/dist/toolchain/bfd/cpu-pj.c +++ b/gnu/dist/toolchain/bfd/cpu-pj.c @@ -22,8 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" - -static boolean +static boolean scan_mach (info, string) const struct bfd_arch_info *info; const char *string; @@ -33,7 +32,6 @@ scan_mach (info, string) return false; } - #if 0 /* This routine is provided two arch_infos and returns whether they'd be compatible */ @@ -49,8 +47,7 @@ compatible (a,b) } #endif - -static const bfd_arch_info_type arch_info_struct[] = +static const bfd_arch_info_type arch_info_struct[] = { { 32, /* 32 bits in a word */ diff --git a/gnu/dist/toolchain/bfd/cpu-powerpc.c b/gnu/dist/toolchain/bfd/cpu-powerpc.c index 11f0f80af5ab..2e41899a4417 100644 --- a/gnu/dist/toolchain/bfd/cpu-powerpc.c +++ b/gnu/dist/toolchain/bfd/cpu-powerpc.c @@ -54,12 +54,12 @@ static const bfd_arch_info_type arch_info_struct[] = 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_powerpc, - 603, /* for the mpc603 */ + bfd_mach_ppc_603, "powerpc", "powerpc:603", 3, false, /* not the default */ - powerpc_compatible, + powerpc_compatible, bfd_default_scan, &arch_info_struct[1] }, @@ -68,12 +68,12 @@ static const bfd_arch_info_type arch_info_struct[] = 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_powerpc, - 604, /* for the mpc604 */ + bfd_mach_ppc_ec603e, "powerpc", - "powerpc:604", + "powerpc:EC603e", 3, false, /* not the default */ - powerpc_compatible, + powerpc_compatible, bfd_default_scan, &arch_info_struct[2] }, @@ -82,12 +82,12 @@ static const bfd_arch_info_type arch_info_struct[] = 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_powerpc, - 403, /* for the 403 */ + bfd_mach_ppc_604, "powerpc", - "powerpc:403", + "powerpc:604", 3, false, /* not the default */ - powerpc_compatible, + powerpc_compatible, bfd_default_scan, &arch_info_struct[3] }, @@ -96,12 +96,124 @@ static const bfd_arch_info_type arch_info_struct[] = 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_powerpc, - 601, /* for the mpc601 */ + bfd_mach_ppc_403, + "powerpc", + "powerpc:403", + 3, + false, /* not the default */ + powerpc_compatible, + bfd_default_scan, + &arch_info_struct[4] + }, + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_601, "powerpc", "powerpc:601", 3, false, /* not the default */ - powerpc_compatible, + powerpc_compatible, + bfd_default_scan, + &arch_info_struct[5] + }, + { + 64, /* 64 bits in a word */ + 64, /* 64 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_620, + "powerpc", + "powerpc:620", + 3, + false, /* not the default */ + powerpc_compatible, + bfd_default_scan, + &arch_info_struct[6] + }, + { + 64, /* 64 bits in a word */ + 64, /* 64 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_630, + "powerpc", + "powerpc:630", + 3, + false, /* not the default */ + powerpc_compatible, + bfd_default_scan, + &arch_info_struct[7] + }, + { + 64, /* 64 bits in a word */ + 64, /* 64 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_a35, + "powerpc", + "powerpc:a35", + 3, + false, /* not the default */ + powerpc_compatible, + bfd_default_scan, + &arch_info_struct[8] + }, + { + 64, /* 64 bits in a word */ + 64, /* 64 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_rs64ii, + "powerpc", + "powerpc:rs64ii", + 3, + false, /* not the default */ + powerpc_compatible, + bfd_default_scan, + &arch_info_struct[9] + }, + { + 64, /* 64 bits in a word */ + 64, /* 64 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_rs64iii, + "powerpc", + "powerpc:rs64iii", + 3, + false, /* not the default */ + powerpc_compatible, + bfd_default_scan, + &arch_info_struct[10] + }, + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_7400, + "powerpc", + "powerpc:7400", + 3, + false, /* not the default */ + powerpc_compatible, + bfd_default_scan, + &arch_info_struct[11] + }, + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_powerpc, + bfd_mach_ppc_860, + "powerpc", + "powerpc:MPC8XX", + 3, + false, /* not the default */ + powerpc_compatible, bfd_default_scan, 0 } @@ -113,12 +225,12 @@ const bfd_arch_info_type bfd_powerpc_arch = 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_powerpc, - 0, /* for the POWER/PowerPC common architecture */ + bfd_mach_ppc, /* for the POWER/PowerPC common architecture */ "powerpc", "powerpc:common", 3, true, /* the default */ - powerpc_compatible, + powerpc_compatible, bfd_default_scan, &arch_info_struct[0] }; diff --git a/gnu/dist/toolchain/bfd/cpu-rs6000.c b/gnu/dist/toolchain/bfd/cpu-rs6000.c index 9852ae9a0536..49345423a95e 100644 --- a/gnu/dist/toolchain/bfd/cpu-rs6000.c +++ b/gnu/dist/toolchain/bfd/cpu-rs6000.c @@ -53,18 +53,64 @@ rs6000_compatible (a,b) /*NOTREACHED*/ } +static const bfd_arch_info_type arch_info_struct[] = +{ + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_rs6000, + bfd_mach_rs6k_rs1, + "rs6000", + "rs6000:rs1", + 3, + false, /* not the default */ + rs6000_compatible, + bfd_default_scan, + &arch_info_struct[1] + }, + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_rs6000, + bfd_mach_rs6k_rsc, + "rs6000", + "rs6000:rsc", + 3, + false, /* not the default */ + rs6000_compatible, + bfd_default_scan, + &arch_info_struct[2] + }, + { + 32, /* 32 bits in a word */ + 32, /* 32 bits in an address */ + 8, /* 8 bits in a byte */ + bfd_arch_rs6000, + bfd_mach_rs6k_rs2, + "rs6000", + "rs6000:rs2", + 3, + false, /* not the default */ + rs6000_compatible, + bfd_default_scan, + 0 + } +}; + const bfd_arch_info_type bfd_rs6000_arch = { 32, /* 32 bits in a word */ 32, /* 32 bits in an address */ 8, /* 8 bits in a byte */ bfd_arch_rs6000, - 6000, /* only 1 machine */ + bfd_mach_rs6k, /* POWER common architecture */ "rs6000", "rs6000:6000", 3, - true, /* the one and only */ + true, /* the default */ rs6000_compatible, bfd_default_scan, - 0, + &arch_info_struct[0] }; diff --git a/gnu/dist/toolchain/bfd/cpu-sh.c b/gnu/dist/toolchain/bfd/cpu-sh.c index cb54e7d0c44c..3b903eb53c6a 100644 --- a/gnu/dist/toolchain/bfd/cpu-sh.c +++ b/gnu/dist/toolchain/bfd/cpu-sh.c @@ -22,8 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" - -static boolean +static boolean scan_mach (info, string) const struct bfd_arch_info *info; const char *string; @@ -33,7 +32,6 @@ scan_mach (info, string) return false; } - #if 0 /* This routine is provided two arch_infos and returns whether they'd be compatible */ @@ -49,15 +47,15 @@ compatible (a,b) } #endif -#define SH_NEXT &arch_info_struct[0] -#define SH2_NEXT &arch_info_struct[1] -#define SH_DSP_NEXT &arch_info_struct[2] -#define SH3_NEXT &arch_info_struct[3] +#define SH_NEXT &arch_info_struct[0] +#define SH2_NEXT &arch_info_struct[1] +#define SH_DSP_NEXT &arch_info_struct[2] +#define SH3_NEXT &arch_info_struct[3] #define SH3_DSP_NEXT &arch_info_struct[4] -#define SH3E_NEXT &arch_info_struct[5] -#define SH4_NEXT NULL +#define SH3E_NEXT &arch_info_struct[5] +#define SH4_NEXT NULL -static const bfd_arch_info_type arch_info_struct[] = +static const bfd_arch_info_type arch_info_struct[] = { { 32, /* 32 bits in a word */ diff --git a/gnu/dist/toolchain/bfd/cpu-sparc.c b/gnu/dist/toolchain/bfd/cpu-sparc.c index 234bd92bd29c..5c777d20d5bb 100644 --- a/gnu/dist/toolchain/bfd/cpu-sparc.c +++ b/gnu/dist/toolchain/bfd/cpu-sparc.c @@ -1,5 +1,5 @@ /* BFD support for the SPARC architecture. - Copyright (C) 1992, 94, 95, 96, 1997 Free Software Foundation, Inc. + Copyright (C) 1992, 94, 95, 96, 97, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -49,7 +49,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc:sparclet", 3, false, - sparc_compatible, + sparc_compatible, bfd_default_scan, &arch_info_struct[1], }, @@ -63,7 +63,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc:sparclite", 3, false, - sparc_compatible, + sparc_compatible, bfd_default_scan, &arch_info_struct[2], }, @@ -77,7 +77,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc:v8plus", 3, false, - sparc_compatible, + sparc_compatible, bfd_default_scan, &arch_info_struct[3], }, @@ -91,7 +91,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc:v8plusa", 3, false, - sparc_compatible, + sparc_compatible, bfd_default_scan, &arch_info_struct[4], }, @@ -105,7 +105,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc:sparclite_le", 3, false, - sparc_compatible, + sparc_compatible, bfd_default_scan, &arch_info_struct[5], }, @@ -119,7 +119,7 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc:v9", 3, false, - sparc_compatible, + sparc_compatible, bfd_default_scan, &arch_info_struct[6], }, @@ -133,7 +133,35 @@ static const bfd_arch_info_type arch_info_struct[] = "sparc:v9a", 3, false, - sparc_compatible, + sparc_compatible, + bfd_default_scan, + &arch_info_struct[7], + }, + { + 32, /* bits in a word */ + 32, /* bits in an address */ + 8, /* bits in a byte */ + bfd_arch_sparc, + bfd_mach_sparc_v8plusb, + "sparc", + "sparc:v8plusb", + 3, + false, + sparc_compatible, + bfd_default_scan, + &arch_info_struct[8], + }, + { + 64, /* bits in a word */ + 64, /* bits in an address */ + 8, /* bits in a byte */ + bfd_arch_sparc, + bfd_mach_sparc_v9b, + "sparc", + "sparc:v9b", + 3, + false, + sparc_compatible, bfd_default_scan, 0, } @@ -150,7 +178,7 @@ const bfd_arch_info_type bfd_sparc_arch = "sparc", 3, true, /* the default */ - sparc_compatible, + sparc_compatible, bfd_default_scan, &arch_info_struct[0], }; diff --git a/gnu/dist/toolchain/bfd/cpu-tic54x.c b/gnu/dist/toolchain/bfd/cpu-tic54x.c new file mode 100644 index 000000000000..f82432d21bcb --- /dev/null +++ b/gnu/dist/toolchain/bfd/cpu-tic54x.c @@ -0,0 +1,39 @@ +/* BFD support for the Texas Instruments TMS320C54X architecture. + Copyright 1999,2000 Free Software Foundation, Inc. + + This file is part of BFD, the Binary File Descriptor library. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" + +const bfd_arch_info_type bfd_tic54x_arch = +{ + 16, /* 16 bits in a word */ + 16, /* 16 bits in an address (except '548) */ + 16, /* 16 bits in a byte */ + bfd_arch_tic54x, + 0, /* only 1 machine */ + "tic54x", + "tms320c54x", + 1, + true, /* the one and only */ + bfd_default_compatible, + bfd_default_scan, + 0, +}; diff --git a/gnu/dist/toolchain/bfd/cpu-v850.c b/gnu/dist/toolchain/bfd/cpu-v850.c index 539413de0223..55606f8c1657 100644 --- a/gnu/dist/toolchain/bfd/cpu-v850.c +++ b/gnu/dist/toolchain/bfd/cpu-v850.c @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include -static boolean +static boolean scan (info, string) const struct bfd_arch_info * info; const char * string; @@ -41,9 +41,9 @@ scan (info, string) architecture, eg the string m68k:68020 would match the m68k entry up to the :, then we get left with the machine number */ - for (ptr_src = string, ptr_tst = info->arch_name; + for (ptr_src = string, ptr_tst = info->arch_name; *ptr_src && *ptr_tst; - ptr_src++, ptr_tst++) + ptr_src++, ptr_tst++) { if (*ptr_src != *ptr_tst) break; } @@ -52,7 +52,7 @@ scan (info, string) colons */ if (*ptr_src == ':') ptr_src++; - + if (*ptr_src == 0) { /* nothing more, then only keep this one if it is the default @@ -67,15 +67,15 @@ scan (info, string) ptr_src++; } - switch (number) + switch (number) { case bfd_mach_v850e: arch = bfd_arch_v850; break; case bfd_mach_v850ea: arch = bfd_arch_v850; break; - default: + default: return false; } - if (arch != info->arch) + if (arch != info->arch) return false; if (number != info->mach) @@ -90,7 +90,7 @@ scan (info, string) #define NEXT NULL -static const bfd_arch_info_type arch_info_struct[] = +static const bfd_arch_info_type arch_info_struct[] = { N (bfd_mach_v850e, "v850e", false, &arch_info_struct[1]), N (bfd_mach_v850ea, "v850ea", false, NULL) diff --git a/gnu/dist/toolchain/bfd/cpu-vax.c b/gnu/dist/toolchain/bfd/cpu-vax.c index bdc6d39e451f..e42ec1014990 100644 --- a/gnu/dist/toolchain/bfd/cpu-vax.c +++ b/gnu/dist/toolchain/bfd/cpu-vax.c @@ -33,7 +33,7 @@ const bfd_arch_info_type bfd_vax_arch = "vax", 3, true, /* the one and only */ - bfd_default_compatible, + bfd_default_compatible, bfd_default_scan , 0, }; diff --git a/gnu/dist/toolchain/bfd/cpu-w65.c b/gnu/dist/toolchain/bfd/cpu-w65.c index 13f68b3138d8..9a31772de48b 100644 --- a/gnu/dist/toolchain/bfd/cpu-w65.c +++ b/gnu/dist/toolchain/bfd/cpu-w65.c @@ -22,10 +22,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" - int bfd_default_scan_num_mach(); -static boolean +static boolean scan_mach (info, string) const struct bfd_arch_info *info ATTRIBUTE_UNUSED; const char *string; @@ -35,8 +34,6 @@ scan_mach (info, string) return false; } - - const bfd_arch_info_type bfd_w65_arch = { 16, /* 16 bits in a word */ diff --git a/gnu/dist/toolchain/bfd/cpu-we32k.c b/gnu/dist/toolchain/bfd/cpu-we32k.c index a38cbc1268b4..2133015d0a49 100644 --- a/gnu/dist/toolchain/bfd/cpu-we32k.c +++ b/gnu/dist/toolchain/bfd/cpu-we32k.c @@ -33,7 +33,7 @@ const bfd_arch_info_type bfd_we32k_arch = "we32k:32000", 3, true, /* the one and only */ - bfd_default_compatible, + bfd_default_compatible, bfd_default_scan , 0, }; diff --git a/gnu/dist/toolchain/bfd/cpu-z8k.c b/gnu/dist/toolchain/bfd/cpu-z8k.c index 5cce8eb0689b..29682c1ec4c1 100644 --- a/gnu/dist/toolchain/bfd/cpu-z8k.c +++ b/gnu/dist/toolchain/bfd/cpu-z8k.c @@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" - #if 0 /* not used currently */ /* Relocations for the Z8K @@ -50,7 +49,6 @@ howto16_callback (abfd, reloc_entry, symbol_in, data, return bfd_reloc_ok; } - static bfd_reloc_status_type howto8_callback (abfd, reloc_entry, symbol_in, data, ignore_input_section, ignore_bfd) @@ -73,7 +71,6 @@ howto8_callback (abfd, reloc_entry, symbol_in, data, return bfd_reloc_ok; } - static bfd_reloc_status_type howto8_FFnn_callback (abfd, reloc_entry, symbol_in, data, ignore_input_section, ignore_bfd) @@ -119,8 +116,6 @@ howto8_pcrel_callback (abfd, reloc_entry, symbol_in, data, return bfd_reloc_ok; } - - static reloc_howto_type howto_16 = NEWHOWTO (howto16_callback, "abs16", 1, false, false); static reloc_howto_type howto_8 @@ -132,7 +127,6 @@ static reloc_howto_type howto_8_FFnn static reloc_howto_type howto_8_pcrel = NEWHOWTO (howto8_pcrel_callback, "pcrel8", 0, false, true); - static reloc_howto_type * local_bfd_reloc_type_lookup (arch, code) const struct bfd_arch_info *arch; @@ -172,7 +166,6 @@ scan_mach (info, string) return false; } - /* This routine is provided two arch_infos and returns whether they'd be compatible */ @@ -186,7 +179,6 @@ compatible (a, b) return a; } - static const bfd_arch_info_type arch_info_struct[] = { {32, 32, 8, bfd_arch_z8k, bfd_mach_z8001, "z8k", "z8001", 1, false, compatible, scan_mach, 0,}, diff --git a/gnu/dist/toolchain/bfd/dep-in.sed b/gnu/dist/toolchain/bfd/dep-in.sed index 9da181ab8fc1..c3781f23bcbd 100644 --- a/gnu/dist/toolchain/bfd/dep-in.sed +++ b/gnu/dist/toolchain/bfd/dep-in.sed @@ -6,6 +6,7 @@ t loop s!\.o:!.lo:! s! @BFD_H@!!g s!@INCDIR@!$(INCDIR)!g +s!@SRCDIR@/../opcodes!$(srcdir)/../opcodes!g s!@SRCDIR@/!!g s! hosts/[^ ]*\.h! !g s/ sysdep.h//g diff --git a/gnu/dist/toolchain/bfd/doc/ChangeLog b/gnu/dist/toolchain/bfd/doc/ChangeLog index def932ccb2e6..57326a98fb27 100644 --- a/gnu/dist/toolchain/bfd/doc/ChangeLog +++ b/gnu/dist/toolchain/bfd/doc/ChangeLog @@ -1,3 +1,30 @@ +2001-01-25 Kazu Hirata + + * chew.c: Do not output trailing whitespaces in type and + functionname. Update copyright. + +2001-01-24 Kazu Hirata + + * chew.c: Do not output a trailing whitespace. + +2000-11-06 Nick Clifton + + * bfd.texinfo: Add GNU Free Documentation License. + +2000-07-09 Alan Modra + + * Makefile.in: Regenerate. + +2000-07-08 Alan Modra + + * chew.c (outputdots): Don't add a space before `/*'. + (courierize): Likewise. + +Wed May 24 12:03:25 2000 Hans-Peter Nilsson + + * bfdint.texi (BFD ELF processor required): Add paragraph about + target necessities for readelf. + 2000-04-30 Ben Elliston * bfdint.texi (BFD generated files): Fix another typo. @@ -6,6 +33,10 @@ * bfdint.texi (BFD_JUMP_TABLE macros): Fix typo. +Fri Apr 7 17:54:38 2000 Andrew Cagney + + * Makefile.in: Rebuild with current autoconf/automake. + Thu Feb 4 23:21:36 1999 Ian Lance Taylor * Makefile.in: Rebuild with current autoconf/automake. diff --git a/gnu/dist/toolchain/bfd/doc/Makefile.in b/gnu/dist/toolchain/bfd/doc/Makefile.in index acdc9bf3de52..dfc33e1fb149 100644 --- a/gnu/dist/toolchain/bfd/doc/Makefile.in +++ b/gnu/dist/toolchain/bfd/doc/Makefile.in @@ -75,10 +75,14 @@ CC = @CC@ CC_FOR_BUILD = @CC_FOR_BUILD@ COREFILE = @COREFILE@ COREFLAG = @COREFLAG@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ DATADIRNAME = @DATADIRNAME@ DLLTOOL = @DLLTOOL@ EXEEXT = @EXEEXT@ EXEEXT_FOR_BUILD = @EXEEXT_FOR_BUILD@ +GCJ = @GCJ@ +GCJFLAGS = @GCJFLAGS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GT_NO = @GT_NO@ @@ -96,14 +100,17 @@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ +STRIP = @STRIP@ TDEFINES = @TDEFINES@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ +WARN_CFLAGS = @WARN_CFLAGS@ WIN32LDFLAGS = @WIN32LDFLAGS@ WIN32LIBADD = @WIN32LIBADD@ all_backends = @all_backends@ @@ -187,7 +194,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: diff --git a/gnu/dist/toolchain/bfd/doc/aoutx.texi b/gnu/dist/toolchain/bfd/doc/aoutx.texi index d97e96aeb793..d99fd0542338 100644 --- a/gnu/dist/toolchain/bfd/doc/aoutx.texi +++ b/gnu/dist/toolchain/bfd/doc/aoutx.texi @@ -148,7 +148,7 @@ Swap the information in an internal exec header structure @example const bfd_target *aout_@var{size}_some_aout_object_p (bfd *abfd, - const bfd_target *(*callback_to_real_object_p)()); + const bfd_target *(*callback_to_real_object_p) ()); @end example @strong{Description}@* Some a.out variant thinks that the file open in @var{abfd} diff --git a/gnu/dist/toolchain/bfd/doc/archures.texi b/gnu/dist/toolchain/bfd/doc/archures.texi index 6ee20e971cfc..b3637801cea5 100644 --- a/gnu/dist/toolchain/bfd/doc/archures.texi +++ b/gnu/dist/toolchain/bfd/doc/archures.texi @@ -1,7 +1,7 @@ @section Architectures BFD keeps one atom in a BFD describing the architecture of the data attached to the BFD: a pointer to a -@code{bfd_arch_info_type}. +@code{bfd_arch_info_type}. Pointers to structures can be requested independently of a BFD so that an architecture's information can be interrogated @@ -11,13 +11,13 @@ The architecture information is provided by each architecture package. The set of default architectures is selected by the macro @code{SELECT_ARCHITECTURES}. This is normally set up in the @file{config/@var{target}.mt} file of your choice. If the name is not -defined, then all the architectures supported are included. +defined, then all the architectures supported are included. When BFD starts up, all the architectures are called with an initialize method. It is up to the architecture back end to insert as many items into the list of architectures as it wants to; generally this would be one for each machine and one for the -default case (an item with a machine field of 0). +default case (an item with a machine field of 0). BFD's idea of an architecture is implemented in @file{archures.c}. @@ -31,13 +31,13 @@ Another field indicates which processor within the family is in use. The machine gives a number which distinguishes different versions of the architecture, containing, for example, 2 and 3 for Intel i960 KA and i960 KB, -and 68020 and 68030 for Motorola 68020 and 68030. +and 68020 and 68030 for Motorola 68020 and 68030. @example -enum bfd_architecture +enum bfd_architecture @{ - bfd_arch_unknown, /* File arch not known */ - bfd_arch_obscure, /* Arch known, not one of these */ - bfd_arch_m68k, /* Motorola 68xxx */ + bfd_arch_unknown, /* File arch not known */ + bfd_arch_obscure, /* Arch known, not one of these */ + bfd_arch_m68k, /* Motorola 68xxx */ #define bfd_mach_m68000 1 #define bfd_mach_m68008 2 #define bfd_mach_m68010 3 @@ -46,14 +46,14 @@ enum bfd_architecture #define bfd_mach_m68040 6 #define bfd_mach_m68060 7 #define bfd_mach_cpu32 8 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. - lower number indicates a machine type that + bfd_arch_vax, /* DEC Vax */ + bfd_arch_i960, /* Intel 960 */ + /* The order of the following is important. + lower number indicates a machine type that only accepts a subset of the instructions available to machines with higher numbers. The exception is the "ca", which is - incompatible with all other machines except + incompatible with all other machines except "core". */ #define bfd_mach_i960_core 1 @@ -65,21 +65,24 @@ enum bfd_architecture #define bfd_mach_i960_jx 7 #define bfd_mach_i960_hx 8 - bfd_arch_a29k, /* AMD 29000 */ - bfd_arch_sparc, /* SPARC */ + bfd_arch_a29k, /* AMD 29000 */ + bfd_arch_sparc, /* SPARC */ #define bfd_mach_sparc 1 - /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ +/* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 #define bfd_mach_sparc_sparclite 3 #define bfd_mach_sparc_v8plus 4 -#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */ +#define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */ #define bfd_mach_sparc_sparclite_le 6 #define bfd_mach_sparc_v9 7 -#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */ - /* Nonzero if MACH has the v9 instruction set. */ +#define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */ +#define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns */ +#define bfd_mach_sparc_v9b 10 /* with cheetah add'ns */ +/* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a) - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + && (mach) != bfd_mach_sparc_sparclite_le) + bfd_arch_mips, /* MIPS Rxxxx */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -95,36 +98,66 @@ enum bfd_architecture #define bfd_mach_mips8000 8000 #define bfd_mach_mips10000 10000 #define bfd_mach_mips16 16 - bfd_arch_i386, /* Intel 386 */ +#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 */ + bfd_arch_i386, /* Intel 386 */ #define bfd_mach_i386_i386 0 #define bfd_mach_i386_i8086 1 #define bfd_mach_i386_i386_intel_syntax 2 - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_alliant, /* Alliant */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Hitachi H8/300 */ +#define bfd_mach_x86_64 3 +#define bfd_mach_x86_64_intel_syntax 4 + bfd_arch_we32k, /* AT&T WE32xxx */ + bfd_arch_tahoe, /* CCI/Harris Tahoe */ + bfd_arch_i860, /* Intel 860 */ + bfd_arch_i370, /* IBM 360/370 Mainframes */ + bfd_arch_romp, /* IBM ROMP PC/RT */ + bfd_arch_alliant, /* Alliant */ + bfd_arch_convex, /* Convex */ + bfd_arch_m88k, /* Motorola 88xxx */ + bfd_arch_pyramid, /* Pyramid Technology */ + bfd_arch_h8300, /* Hitachi H8/300 */ #define bfd_mach_h8300 1 #define bfd_mach_h8300h 2 #define bfd_mach_h8300s 3 - bfd_arch_powerpc, /* PowerPC */ - bfd_arch_rs6000, /* IBM RS/6000 */ - bfd_arch_hppa, /* HP PA RISC */ - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_powerpc, /* PowerPC */ +#define bfd_mach_ppc 0 +#define bfd_mach_ppc_403 403 +#define bfd_mach_ppc_403gc 4030 +#define bfd_mach_ppc_505 505 +#define bfd_mach_ppc_601 601 +#define bfd_mach_ppc_602 602 +#define bfd_mach_ppc_603 603 +#define bfd_mach_ppc_ec603e 6031 +#define bfd_mach_ppc_604 604 +#define bfd_mach_ppc_620 620 +#define bfd_mach_ppc_630 630 +#define bfd_mach_ppc_750 750 +#define bfd_mach_ppc_860 860 +#define bfd_mach_ppc_a35 35 +#define bfd_mach_ppc_rs64ii 642 +#define bfd_mach_ppc_rs64iii 643 +#define bfd_mach_ppc_7400 7400 + bfd_arch_rs6000, /* IBM RS/6000 */ +#define bfd_mach_rs6k 0 +#define bfd_mach_rs6k_rs1 6001 +#define bfd_mach_rs6k_rsc 6003 +#define bfd_mach_rs6k_rs2 6002 + bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_d10v, /* Mitsubishi D10V */ #define bfd_mach_d10v 0 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_d30v, /* Mitsubishi D30V */ + bfd_arch_m68hc11, /* Motorola 68HC11 */ + bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_z8k, /* Zilog Z8000 */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Hitachi H8/500 */ - bfd_arch_sh, /* Hitachi SH */ + bfd_arch_h8500, /* Hitachi H8/500 */ + bfd_arch_sh, /* Hitachi SH */ #define bfd_mach_sh 0 #define bfd_mach_sh2 0x20 #define bfd_mach_sh_dsp 0x2d @@ -132,11 +165,11 @@ enum bfd_architecture #define bfd_mach_sh3_dsp 0x3d #define bfd_mach_sh3e 0x3e #define bfd_mach_sh4 0x40 - bfd_arch_alpha, /* Dec Alpha */ + bfd_arch_alpha, /* Dec Alpha */ #define bfd_mach_alpha_ev4 0x10 #define bfd_mach_alpha_ev5 0x20 #define bfd_mach_alpha_ev6 0x30 - bfd_arch_arm, /* Advanced Risc Machines ARM */ + bfd_arch_arm, /* Advanced Risc Machines ARM */ #define bfd_mach_arm_2 1 #define bfd_mach_arm_2a 2 #define bfd_mach_arm_3 3 @@ -145,32 +178,43 @@ enum bfd_architecture #define bfd_mach_arm_4T 6 #define bfd_mach_arm_5 7 #define bfd_mach_arm_5T 8 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ +#define bfd_mach_arm_5TE 9 +#define bfd_mach_arm_XScale 10 + bfd_arch_ns32k, /* National Semiconductors ns32000 */ + bfd_arch_w65, /* WDC 65816 */ + bfd_arch_tic30, /* Texas Instruments TMS320C30 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ + bfd_arch_tic80, /* TI TMS320c80 (MVP) */ + bfd_arch_v850, /* NEC V850 */ #define bfd_mach_v850 0 #define bfd_mach_v850e 'E' #define bfd_mach_v850ea 'A' - bfd_arch_arc, /* Argonaut RISC Core */ -#define bfd_mach_arc_base 0 - bfd_arch_m32r, /* Mitsubishi M32R/D */ -#define bfd_mach_m32r 0 /* backwards compatibility */ + bfd_arch_arc, /* ARC Cores */ +#define bfd_mach_arc_5 0 +#define bfd_mach_arc_6 1 +#define bfd_mach_arc_7 2 +#define bfd_mach_arc_8 3 + bfd_arch_m32r, /* Mitsubishi M32R/D */ +#define bfd_mach_m32r 0 /* backwards compatibility */ #define bfd_mach_m32rx 'x' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ + bfd_arch_mn10200, /* Matsushita MN10200 */ + bfd_arch_mn10300, /* Matsushita MN10300 */ #define bfd_mach_mn10300 300 #define bfd_mach_am33 330 bfd_arch_fr30, #define bfd_mach_fr30 0x46523330 bfd_arch_mcore, + bfd_arch_ia64, /* HP/Intel ia64 */ +#define bfd_mach_ia64_elf64 0 +#define bfd_mach_ia64_elf32 1 bfd_arch_pj, - bfd_arch_avr, /* Atmel AVR microcontrollers */ + bfd_arch_avr, /* Atmel AVR microcontrollers */ #define bfd_mach_avr1 1 #define bfd_mach_avr2 2 #define bfd_mach_avr3 3 #define bfd_mach_avr4 4 +#define bfd_mach_avr5 5 + bfd_arch_cris, /* Axis CRIS */ bfd_arch_last @}; @end example @@ -183,7 +227,7 @@ This structure contains information on architectures for use within BFD. @example -typedef struct bfd_arch_info +typedef struct bfd_arch_info @{ int bits_per_word; int bits_per_address; @@ -193,8 +237,8 @@ typedef struct bfd_arch_info const char *arch_name; const char *printable_name; unsigned int section_align_power; - /* true if this is the default machine for the architecture */ - boolean the_default; + /* True if this is the default machine for the architecture. */ + boolean the_default; const struct bfd_arch_info * (*compatible) PARAMS ((const struct bfd_arch_info *a, const struct bfd_arch_info *b)); @@ -380,7 +424,7 @@ const char *bfd_printable_arch_mach @end example @strong{Description}@* Return a printable string representing the architecture and -machine type. +machine type. This routine is depreciated. @@ -404,6 +448,7 @@ unsigned int bfd_arch_mach_octets_per_byte(enum bfd_architecture arch, @end example @strong{Description}@* See bfd_octets_per_byte. + This routine is provided for those cases where a bfd * is not available diff --git a/gnu/dist/toolchain/bfd/doc/bfd.info b/gnu/dist/toolchain/bfd/doc/bfd.info index 58f549be00e1..0ba9cac43152 100644 --- a/gnu/dist/toolchain/bfd/doc/bfd.info +++ b/gnu/dist/toolchain/bfd/doc/bfd.info @@ -6,90 +6,84 @@ END-INFO-DIR-ENTRY This file documents the BFD library. - Copyright (C) 1991 Free Software Foundation, Inc. + Copyright (C) 1991, 2000 Free Software Foundation, Inc. - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, subject to the -terms of the GNU General Public License, which includes the provision -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. + 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".  Indirect: -bfd.info-1: 916 -bfd.info-2: 37727 -bfd.info-3: 81566 -bfd.info-4: 126215 -bfd.info-5: 175891 -bfd.info-6: 205826 -bfd.info-7: 233431 +bfd.info-1: 680 +bfd.info-2: 38513 +bfd.info-3: 83014 +bfd.info-4: 132756 +bfd.info-5: 181734 +bfd.info-6: 214313 +bfd.info-7: 260724  Tag Table: (Indirect) -Node: Top916 -Node: Overview1181 -Node: History2231 -Node: How It Works3172 -Node: What BFD Version 2 Can Do4710 -Node: BFD information loss6024 -Node: Canonical format8547 -Node: BFD front end12908 -Node: Memory Usage31825 -Node: Initialization33048 -Node: Sections33425 -Node: Section Input33903 -Node: Section Output35259 -Node: typedef asection37727 -Node: section prototypes53227 -Node: Symbols59441 -Node: Reading Symbols61031 -Node: Writing Symbols62205 -Node: Mini Symbols63895 -Node: typedef asymbol64860 -Node: symbol handling functions70089 -Node: Archives74418 -Node: Formats78036 -Node: Relocations80846 -Node: typedef arelent81566 -Node: howto manager97725 -Node: Core Files123231 -Node: Targets124252 -Node: bfd_target126215 -Node: Architectures145125 -Node: Opening and Closing158434 -Node: Internal162831 -Node: File Caching168829 -Node: Linker Functions171607 -Node: Creating a Linker Hash Table173273 -Node: Adding Symbols to the Hash Table175001 -Node: Differing file formats175891 -Node: Adding symbols from an object file177624 -Node: Adding symbols from an archive179760 -Node: Performing the Final Link182159 -Node: Information provided by the linker183390 -Node: Relocating the section contents184526 -Node: Writing the symbol table186263 -Node: Hash Tables188857 -Node: Creating and Freeing a Hash Table190048 -Node: Looking Up or Entering a String191205 -Node: Traversing a Hash Table192447 -Node: Deriving a New Hash Table Type193225 -Node: Define the Derived Structures194280 -Node: Write the Derived Creation Routine195346 -Node: Write Other Derived Routines198045 -Node: BFD back ends199345 -Node: What to Put Where199564 -Node: aout199702 -Node: coff205826 -Node: elf232598 -Node: Index233431 +Node: Top680 +Node: Overview1012 +Node: History2062 +Node: How It Works3003 +Node: What BFD Version 2 Can Do4541 +Node: BFD information loss5855 +Node: Canonical format8378 +Node: BFD front end12739 +Node: Memory Usage32611 +Node: Initialization33834 +Node: Sections34211 +Node: Section Input34689 +Node: Section Output36045 +Node: typedef asection38513 +Node: section prototypes54206 +Node: Symbols60891 +Node: Reading Symbols62481 +Node: Writing Symbols63655 +Node: Mini Symbols65345 +Node: typedef asymbol66310 +Node: symbol handling functions71539 +Node: Archives75866 +Node: Formats79484 +Node: Relocations82294 +Node: typedef arelent83014 +Node: howto manager99173 +Node: Core Files129772 +Node: Targets130793 +Node: bfd_target132756 +Node: Architectures151670 +Node: Opening and Closing166892 +Node: Internal171289 +Node: File Caching177289 +Node: Linker Functions180068 +Node: Creating a Linker Hash Table181734 +Node: Adding Symbols to the Hash Table183462 +Node: Differing file formats184352 +Node: Adding symbols from an object file186085 +Node: Adding symbols from an archive188221 +Node: Performing the Final Link190620 +Node: Information provided by the linker191851 +Node: Relocating the section contents192987 +Node: Writing the symbol table194724 +Node: Hash Tables197318 +Node: Creating and Freeing a Hash Table198509 +Node: Looking Up or Entering a String199666 +Node: Traversing a Hash Table200908 +Node: Deriving a New Hash Table Type201686 +Node: Define the Derived Structures202741 +Node: Write the Derived Creation Routine203807 +Node: Write Other Derived Routines206506 +Node: BFD back ends207806 +Node: What to Put Where208050 +Node: aout208188 +Node: coff214313 +Node: elf241469 +Node: GNU Free Documentation License242302 +Node: Index260724  End Tag Table diff --git a/gnu/dist/toolchain/bfd/doc/bfd.info-1 b/gnu/dist/toolchain/bfd/doc/bfd.info-1 index deef94c6815b..d9c195c2ae09 100644 --- a/gnu/dist/toolchain/bfd/doc/bfd.info-1 +++ b/gnu/dist/toolchain/bfd/doc/bfd.info-1 @@ -6,21 +6,14 @@ END-INFO-DIR-ENTRY This file documents the BFD library. - Copyright (C) 1991 Free Software Foundation, Inc. + Copyright (C) 1991, 2000 Free Software Foundation, Inc. - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, subject to the -terms of the GNU General Public License, which includes the provision -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. + 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".  File: bfd.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) @@ -32,6 +25,7 @@ File: bfd.info, Node: Top, Next: Overview, Prev: (dir), Up: (dir) * Overview:: Overview of BFD * BFD front end:: BFD front end * BFD back ends:: BFD back ends +* GNU Free Documentation License:: GNU Free Documentation License * Index:: Index  @@ -641,6 +635,36 @@ Set the flag word in the BFD ABFD to the value FLAGS. was made to set the `D_PAGED' bit on a BFD format which does not support demand paging. +`bfd_get_arch_size' +................... + + *Synopsis* + int bfd_get_arch_size (bfd *abfd); + *Description* +Returns the architecture address size, in bits, as determined by the +object file's format. For ELF, this information is included in the +header. + + *Returns* +Returns the arch size in bits if known, `-1' otherwise. + +`bfd_get_sign_extend_vma' +......................... + + *Synopsis* + int bfd_get_sign_extend_vma (bfd *abfd); + *Description* +Indicates if the target architecture "naturally" sign extends an +address. Some architectures implicitly sign extend address values when +they are converted to types larger than the size of an address. For +instance, bfd_get_start_address() will return an address sign extended +to fill a bfd_vma when this is the case. + + *Returns* +Returns `1' if the target architecture is known to sign extend +addresses, `0' if the target architecture is known to not sign extend +addresses, and `-1' otherwise. + `bfd_set_start_address' ....................... @@ -679,7 +703,7 @@ results were guaranteed. Instead, we want to ask questions like "is this NNN byte sized object I'm about to try read from file offset YYY reasonable?" As as example of where we might do this, some object formats use string -tables for which the first `sizeof(long)' bytes of the table contain +tables for which the first `sizeof (long)' bytes of the table contain the size of the table itself, including the size bytes. If an application tries to read what it thinks is one of these string tables, without some way to validate the size, and for some reason the size is @@ -786,7 +810,7 @@ Stuff which should be documented: #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line)) - /* Do these three do anything useful at all, for any back end? */ + /* Do these three do anything useful at all, for any back end? */ #define bfd_debug_info_start(abfd) \ BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) diff --git a/gnu/dist/toolchain/bfd/doc/bfd.info-2 b/gnu/dist/toolchain/bfd/doc/bfd.info-2 index 05c4f8ca3dee..4e92f0ab0046 100644 --- a/gnu/dist/toolchain/bfd/doc/bfd.info-2 +++ b/gnu/dist/toolchain/bfd/doc/bfd.info-2 @@ -6,21 +6,14 @@ END-INFO-DIR-ENTRY This file documents the BFD library. - Copyright (C) 1991 Free Software Foundation, Inc. + Copyright (C) 1991, 2000 Free Software Foundation, Inc. - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, subject to the -terms of the GNU General Public License, which includes the provision -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. + 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".  File: bfd.info, Node: typedef asection, Next: section prototypes, Prev: Section Output, Up: Sections @@ -31,10 +24,10 @@ typedef asection Here is the section structure: - /* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ + /* This structure is used for a comdat section, as in PE. A comdat + section is associated with a particular symbol. When the linker + sees a comdat section, it keeps only one of the sections with a + given name and associated with a given symbol. */ struct bfd_comdat_info { @@ -46,340 +39,362 @@ typedef asection specific code; it is not an index into the list returned by bfd_canonicalize_symtab. */ long symbol; - - /* If this section is being discarded, the linker uses this field - to point to the input section which is being kept. */ - struct sec *sec; }; typedef struct sec { - /* The name of the section; the name isn't a copy, the pointer is - the same as that passed to bfd_make_section. */ + /* The name of the section; the name isn't a copy, the pointer is + the same as that passed to bfd_make_section. */ - CONST char *name; + const char *name; - /* Which section is it; 0..nth. */ + /* A unique sequence number. */ - int index; + int id; - /* The next section in the list belonging to the BFD, or NULL. */ + /* Which section is it; 0..nth. */ - struct sec *next; + int index; - /* The field flags contains attributes of the section. Some - flags are read in from the object file, and some are - synthesized from other information. */ + /* The next section in the list belonging to the BFD, or NULL. */ - flagword flags; + struct sec *next; + + /* The field flags contains attributes of the section. Some + flags are read in from the object file, and some are + synthesized from other information. */ + + flagword flags; #define SEC_NO_FLAGS 0x000 - /* Tells the OS to allocate space for this section when loading. - This is clear for a section containing debug information - only. */ + /* Tells the OS to allocate space for this section when loading. + This is clear for a section containing debug information only. */ #define SEC_ALLOC 0x001 - /* Tells the OS to load the section from the file when loading. - This is clear for a .bss section. */ + /* Tells the OS to load the section from the file when loading. + This is clear for a .bss section. */ #define SEC_LOAD 0x002 - /* The section contains data still to be relocated, so there is - some relocation information too. */ + /* The section contains data still to be relocated, so there is + some relocation information too. */ #define SEC_RELOC 0x004 #if 0 /* Obsolete ? */ #define SEC_BALIGN 0x008 #endif - /* A signal to the OS that the section contains read only - data. */ + /* A signal to the OS that the section contains read only data. */ #define SEC_READONLY 0x010 - /* The section contains code only. */ + /* The section contains code only. */ #define SEC_CODE 0x020 - /* The section contains data only. */ + /* The section contains data only. */ #define SEC_DATA 0x040 - /* The section will reside in ROM. */ + /* The section will reside in ROM. */ #define SEC_ROM 0x080 - /* The section contains constructor information. This section - type is used by the linker to create lists of constructors and - destructors used by `g++'. When a back end sees a symbol - which should be used in a constructor list, it creates a new - section for the type of name (e.g., `__CTOR_LIST__'), attaches - the symbol to it, and builds a relocation. To build the lists - of constructors, all the linker has to do is catenate all the - sections called `__CTOR_LIST__' and relocate the data - contained within - exactly the operations it would peform on - standard data. */ + /* The section contains constructor information. This section + type is used by the linker to create lists of constructors and + destructors used by `g++'. When a back end sees a symbol + which should be used in a constructor list, it creates a new + section for the type of name (e.g., `__CTOR_LIST__'), attaches + the symbol to it, and builds a relocation. To build the lists + of constructors, all the linker has to do is catenate all the + sections called `__CTOR_LIST__' and relocate the data + contained within - exactly the operations it would peform on + standard data. */ #define SEC_CONSTRUCTOR 0x100 - /* The section is a constructor, and should be placed at the - end of the text, data, or bss section(?). */ + /* The section is a constructor, and should be placed at the + end of the text, data, or bss section(?). */ #define SEC_CONSTRUCTOR_TEXT 0x1100 #define SEC_CONSTRUCTOR_DATA 0x2100 #define SEC_CONSTRUCTOR_BSS 0x3100 - /* The section has contents - a data section could be - `SEC_ALLOC' | `SEC_HAS_CONTENTS'; a debug section could be - `SEC_HAS_CONTENTS' */ + /* The section has contents - a data section could be + `SEC_ALLOC' | `SEC_HAS_CONTENTS'; a debug section could be + `SEC_HAS_CONTENTS' */ #define SEC_HAS_CONTENTS 0x200 - /* An instruction to the linker to not output the section - even if it has information which would normally be written. */ + /* An instruction to the linker to not output the section + even if it has information which would normally be written. */ #define SEC_NEVER_LOAD 0x400 - /* The section is a COFF shared library section. This flag is - only for the linker. If this type of section appears in - the input file, the linker must copy it to the output file - without changing the vma or size. FIXME: Although this - was originally intended to be general, it really is COFF - specific (and the flag was renamed to indicate this). It - might be cleaner to have some more general mechanism to - allow the back end to control what the linker does with - sections. */ + /* The section is a COFF shared library section. This flag is + only for the linker. If this type of section appears in + the input file, the linker must copy it to the output file + without changing the vma or size. FIXME: Although this + was originally intended to be general, it really is COFF + specific (and the flag was renamed to indicate this). It + might be cleaner to have some more general mechanism to + allow the back end to control what the linker does with + sections. */ #define SEC_COFF_SHARED_LIBRARY 0x800 - /* The section contains common symbols (symbols may be defined - multiple times, the value of a symbol is the amount of - space it requires, and the largest symbol value is the one - used). Most targets have exactly one of these (which we - translate to bfd_com_section_ptr), but ECOFF has two. */ + /* The section has GOT references. This flag is only for the + linker, and is currently only used by the elf32-hppa back end. + It will be set if global offset table references were detected + in this section, which indicate to the linker that the section + contains PIC code, and must be handled specially when doing a + static link. */ + #define SEC_HAS_GOT_REF 0x4000 + + /* The section contains common symbols (symbols may be defined + multiple times, the value of a symbol is the amount of + space it requires, and the largest symbol value is the one + used). Most targets have exactly one of these (which we + translate to bfd_com_section_ptr), but ECOFF has two. */ #define SEC_IS_COMMON 0x8000 - /* The section contains only debugging information. For - example, this is set for ELF .debug and .stab sections. - strip tests this flag to see if a section can be - discarded. */ + /* The section contains only debugging information. For + example, this is set for ELF .debug and .stab sections. + strip tests this flag to see if a section can be + discarded. */ #define SEC_DEBUGGING 0x10000 - /* The contents of this section are held in memory pointed to - by the contents field. This is checked by - bfd_get_section_contents, and the data is retrieved from - memory if appropriate. */ + /* The contents of this section are held in memory pointed to + by the contents field. This is checked by bfd_get_section_contents, + and the data is retrieved from memory if appropriate. */ #define SEC_IN_MEMORY 0x20000 - /* The contents of this section are to be excluded by the - linker for executable and shared objects unless those - objects are to be further relocated. */ + /* The contents of this section are to be excluded by the + linker for executable and shared objects unless those + objects are to be further relocated. */ #define SEC_EXCLUDE 0x40000 - /* The contents of this section are to be sorted by the - based on the address specified in the associated symbol - table. */ + /* The contents of this section are to be sorted by the + based on the address specified in the associated symbol + table. */ #define SEC_SORT_ENTRIES 0x80000 - /* When linking, duplicate sections of the same name should be - discarded, rather than being combined into a single section as - is usually done. This is similar to how common symbols are - handled. See SEC_LINK_DUPLICATES below. */ + /* When linking, duplicate sections of the same name should be + discarded, rather than being combined into a single section as + is usually done. This is similar to how common symbols are + handled. See SEC_LINK_DUPLICATES below. */ #define SEC_LINK_ONCE 0x100000 - /* If SEC_LINK_ONCE is set, this bitfield describes how the linker - should handle duplicate sections. */ + /* If SEC_LINK_ONCE is set, this bitfield describes how the linker + should handle duplicate sections. */ #define SEC_LINK_DUPLICATES 0x600000 - /* This value for SEC_LINK_DUPLICATES means that duplicate - sections with the same name should simply be discarded. */ + /* This value for SEC_LINK_DUPLICATES means that duplicate + sections with the same name should simply be discarded. */ #define SEC_LINK_DUPLICATES_DISCARD 0x0 - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if there are any duplicate sections, although - it should still only link one copy. */ + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if there are any duplicate sections, although + it should still only link one copy. */ #define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000 - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections are a different size. */ + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if any duplicate sections are a different size. */ #define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000 - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections contain different - contents. */ + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if any duplicate sections contain different + contents. */ #define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000 - /* This section was created by the linker as part of dynamic - relocation or other arcane processing. It is skipped when - going through the first-pass output, trusting that someone - else up the line will take care of it later. */ + /* This section was created by the linker as part of dynamic + relocation or other arcane processing. It is skipped when + going through the first-pass output, trusting that someone + else up the line will take care of it later. */ #define SEC_LINKER_CREATED 0x800000 - /* This section should not be subject to garbage collection. */ + /* This section should not be subject to garbage collection. */ #define SEC_KEEP 0x1000000 - /* This section contains "short" data, and should be placed - "near" the GP. */ + /* This section contains "short" data, and should be placed + "near" the GP. */ #define SEC_SMALL_DATA 0x2000000 - /* This section contains data which may be shared with other - executables or shared objects. */ + /* This section contains data which may be shared with other + executables or shared objects. */ #define SEC_SHARED 0x4000000 - /* End of section flags. */ + /* When a section with this flag is being linked, then if the size of + the input section is less than a page, it should not cross a page + boundary. If the size of the input section is one page or more, it + should be aligned on a page boundary. */ + #define SEC_BLOCK 0x8000000 - /* Some internal packed boolean fields. */ + /* Conditionally link this section; do not link if there are no + references found to any symbol in the section. */ + #define SEC_CLINK 0x10000000 - /* See the vma field. */ - unsigned int user_set_vma : 1; + /* End of section flags. */ - /* Whether relocations have been processed. */ - unsigned int reloc_done : 1; + /* Some internal packed boolean fields. */ - /* A mark flag used by some of the linker backends. */ - unsigned int linker_mark : 1; + /* See the vma field. */ + unsigned int user_set_vma : 1; - /* A mark flag used by some linker backends for garbage collection. */ - unsigned int gc_mark : 1; + /* Whether relocations have been processed. */ + unsigned int reloc_done : 1; - /* End of internal packed boolean fields. */ + /* A mark flag used by some of the linker backends. */ + unsigned int linker_mark : 1; - /* The virtual memory address of the section - where it will be - at run time. The symbols are relocated against this. The - user_set_vma flag is maintained by bfd; if it's not set, the - backend can assign addresses (for example, in `a.out', where - the default address for `.data' is dependent on the specific - target and various flags). */ + /* A mark flag used by some linker backends for garbage collection. */ + unsigned int gc_mark : 1; - bfd_vma vma; + /* Used by the ELF code to mark sections which have been allocated to segments. */ + unsigned int segment_mark : 1; - /* The load address of the section - where it would be in a - rom image; really only used for writing section header - information. */ + /* End of internal packed boolean fields. */ - bfd_vma lma; + /* The virtual memory address of the section - where it will be + at run time. The symbols are relocated against this. The + user_set_vma flag is maintained by bfd; if it's not set, the + backend can assign addresses (for example, in `a.out', where + the default address for `.data' is dependent on the specific + target and various flags). */ - /* The size of the section in octets, as it will be output. - Contains a value even if the section has no contents (e.g., the - size of `.bss'). This will be filled in after relocation. */ + bfd_vma vma; - bfd_size_type _cooked_size; + /* The load address of the section - where it would be in a + rom image; really only used for writing section header + information. */ - /* The original size on disk of the section, in octets. Normally this - value is the same as the size, but if some relaxing has - been done, then this value will be bigger. */ + bfd_vma lma; - bfd_size_type _raw_size; + /* The size of the section in octets, as it will be output. + Contains a value even if the section has no contents (e.g., the + size of `.bss'). This will be filled in after relocation. */ - /* If this section is going to be output, then this value is the - offset in *bytes* into the output section of the first byte in the - input section (byte ==> smallest addressable unit on the - target). In most cases, if this was going to start at the - 100th octet (8-bit quantity) in the output section, this value - would be 100. However, if the target byte size is 16 bits - (bfd_octets_per_byte is "2"), this value would be 50. */ + bfd_size_type _cooked_size; - bfd_vma output_offset; + /* The original size on disk of the section, in octets. Normally this + value is the same as the size, but if some relaxing has + been done, then this value will be bigger. */ - /* The output section through which to map on output. */ + bfd_size_type _raw_size; - struct sec *output_section; + /* If this section is going to be output, then this value is the + offset in *bytes* into the output section of the first byte in the + input section (byte ==> smallest addressable unit on the + target). In most cases, if this was going to start at the + 100th octet (8-bit quantity) in the output section, this value + would be 100. However, if the target byte size is 16 bits + (bfd_octets_per_byte is "2"), this value would be 50. */ - /* The alignment requirement of the section, as an exponent of 2 - - e.g., 3 aligns to 2^3 (or 8). */ + bfd_vma output_offset; - unsigned int alignment_power; + /* The output section through which to map on output. */ - /* If an input section, a pointer to a vector of relocation - records for the data in this section. */ + struct sec *output_section; - struct reloc_cache_entry *relocation; + /* The alignment requirement of the section, as an exponent of 2 - + e.g., 3 aligns to 2^3 (or 8). */ - /* If an output section, a pointer to a vector of pointers to - relocation records for the data in this section. */ + unsigned int alignment_power; - struct reloc_cache_entry **orelocation; + /* If an input section, a pointer to a vector of relocation + records for the data in this section. */ - /* The number of relocation records in one of the above */ + struct reloc_cache_entry *relocation; - unsigned reloc_count; + /* If an output section, a pointer to a vector of pointers to + relocation records for the data in this section. */ - /* Information below is back end specific - and not always used - or updated. */ + struct reloc_cache_entry **orelocation; - /* File position of section data */ + /* The number of relocation records in one of the above */ - file_ptr filepos; + unsigned reloc_count; - /* File position of relocation info */ + /* Information below is back end specific - and not always used + or updated. */ - file_ptr rel_filepos; + /* File position of section data. */ - /* File position of line data */ + file_ptr filepos; - file_ptr line_filepos; + /* File position of relocation info. */ - /* Pointer to data for applications */ + file_ptr rel_filepos; - PTR userdata; + /* File position of line data. */ - /* If the SEC_IN_MEMORY flag is set, this points to the actual - contents. */ - unsigned char *contents; + file_ptr line_filepos; - /* Attached line number information */ + /* Pointer to data for applications. */ - alent *lineno; + PTR userdata; - /* Number of line number records */ + /* If the SEC_IN_MEMORY flag is set, this points to the actual + contents. */ + unsigned char *contents; - unsigned int lineno_count; + /* Attached line number information. */ - /* Optional information about a COMDAT entry; NULL if not COMDAT */ + alent *lineno; - struct bfd_comdat_info *comdat; + /* Number of line number records. */ - /* When a section is being output, this value changes as more - linenumbers are written out */ + unsigned int lineno_count; - file_ptr moving_line_filepos; + /* Optional information about a COMDAT entry; NULL if not COMDAT. */ - /* What the section number is in the target world */ + struct bfd_comdat_info *comdat; - int target_index; + /* Points to the kept section if this section is a link-once section, + and is discarded. */ + struct sec *kept_section; - PTR used_by_bfd; + /* When a section is being output, this value changes as more + linenumbers are written out. */ - /* If this is a constructor section then here is a list of the - relocations created to relocate items within it. */ + file_ptr moving_line_filepos; - struct relent_chain *constructor_chain; + /* What the section number is in the target world. */ - /* The BFD which owns the section. */ + int target_index; - bfd *owner; + PTR used_by_bfd; - /* A symbol which points at this section only */ - struct symbol_cache_entry *symbol; - struct symbol_cache_entry **symbol_ptr_ptr; + /* If this is a constructor section then here is a list of the + relocations created to relocate items within it. */ - struct bfd_link_order *link_order_head; - struct bfd_link_order *link_order_tail; + struct relent_chain *constructor_chain; + + /* The BFD which owns the section. */ + + bfd *owner; + + /* A symbol which points at this section only */ + struct symbol_cache_entry *symbol; + struct symbol_cache_entry **symbol_ptr_ptr; + + struct bfd_link_order *link_order_head; + struct bfd_link_order *link_order_tail; } asection ; - /* These sections are global, and are managed by BFD. The application - and target back end are not permitted to change the values in - these sections. New code should use the section_ptr macros rather - than referring directly to the const sections. The const sections - may eventually vanish. */ + /* These sections are global, and are managed by BFD. The application + and target back end are not permitted to change the values in + these sections. New code should use the section_ptr macros rather + than referring directly to the const sections. The const sections + may eventually vanish. */ #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" #define BFD_COM_SECTION_NAME "*COM*" #define BFD_IND_SECTION_NAME "*IND*" - /* the absolute section */ + /* the absolute section */ extern const asection bfd_abs_section; #define bfd_abs_section_ptr ((asection *) &bfd_abs_section) #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) - /* Pointer to the undefined section */ + /* Pointer to the undefined section */ extern const asection bfd_und_section; #define bfd_und_section_ptr ((asection *) &bfd_und_section) #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) - /* Pointer to the common section */ + /* Pointer to the common section */ extern const asection bfd_com_section; #define bfd_com_section_ptr ((asection *) &bfd_com_section) - /* Pointer to the indirect section */ + /* Pointer to the indirect section */ 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) @@ -407,7 +422,7 @@ Section prototypes ......................... *Synopsis* - asection *bfd_get_section_by_name(bfd *abfd, CONST char *name); + asection *bfd_get_section_by_name(bfd *abfd, const char *name); *Description* Run through ABFD and return the one of the `asection's whose name matches NAME, otherwise `NULL'. *Note Sections::, for more information. @@ -417,11 +432,24 @@ all sections of a given name is to use `bfd_map_over_sections' and `strcmp' on the name (or better yet, base it on the section flags or something else) for each section. +`bfd_get_unique_section_name' +............................. + + *Synopsis* + char *bfd_get_unique_section_name(bfd *abfd, + const char *templat, + int *count); + *Description* +Invent a section name that is unique in ABFD by tacking a dot and a +digit suffix onto the original TEMPLAT. If COUNT is non-NULL, then it +specifies the first number tried as a suffix to generate a unique name. +The value pointed to by COUNT will be incremented in this case. + `bfd_make_section_old_way' .......................... *Synopsis* - asection *bfd_make_section_old_way(bfd *abfd, CONST char *name); + asection *bfd_make_section_old_way(bfd *abfd, const char *name); *Description* Create a new empty section called NAME and attach it to the end of the chain of sections for the BFD ABFD. An attempt to create a section with @@ -441,7 +469,7 @@ was rewritten.... ......................... *Synopsis* - asection *bfd_make_section_anyway(bfd *abfd, CONST char *name); + asection *bfd_make_section_anyway(bfd *abfd, const char *name); *Description* Create a new empty section called NAME and attach it to the end of the chain of sections for ABFD. Create a new section even if there is @@ -457,7 +485,7 @@ already a section with that name. .................. *Synopsis* - asection *bfd_make_section(bfd *, CONST char *name); + asection *bfd_make_section(bfd *, const char *name); *Description* Like `bfd_make_section_anyway', but return `NULL' (without calling bfd_set_error ()) without changing the section chain if there is @@ -483,7 +511,7 @@ returns are: *Synopsis* void bfd_map_over_sections(bfd *abfd, - void (*func)(bfd *abfd, + void (*func) (bfd *abfd, asection *sect, PTR obj), PTR obj); @@ -955,8 +983,8 @@ for an unknown class. *Synopsis* int bfd_decode_symclass(asymbol *symbol); -`bfd_is_undefined_symclass ' -............................ +`bfd_is_undefined_symclass' +........................... *Description* Returns non-zero if the class symbol returned by bfd_decode_symclass diff --git a/gnu/dist/toolchain/bfd/doc/bfd.info-3 b/gnu/dist/toolchain/bfd/doc/bfd.info-3 index ec7f35135b9d..c0496bf67af2 100644 --- a/gnu/dist/toolchain/bfd/doc/bfd.info-3 +++ b/gnu/dist/toolchain/bfd/doc/bfd.info-3 @@ -6,21 +6,14 @@ END-INFO-DIR-ENTRY This file documents the BFD library. - Copyright (C) 1991 Free Software Foundation, Inc. + Copyright (C) 1991, 2000 Free Software Foundation, Inc. - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, subject to the -terms of the GNU General Public License, which includes the provision -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. + 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".  File: bfd.info, Node: typedef arelent, Next: howto manager, Prev: Relocations, Up: Relocations @@ -721,6 +714,16 @@ attributes. - : BFD_RELOC_386_GOTPC i386/elf relocations + - : BFD_RELOC_X86_64_GOT32 + - : BFD_RELOC_X86_64_PLT32 + - : BFD_RELOC_X86_64_COPY + - : BFD_RELOC_X86_64_GLOB_DAT + - : BFD_RELOC_X86_64_JUMP_SLOT + - : BFD_RELOC_X86_64_RELATIVE + - : BFD_RELOC_X86_64_GOTPCREL + - : BFD_RELOC_X86_64_32S + x86-64/elf relocations + - : BFD_RELOC_NS32K_IMM_8 - : BFD_RELOC_NS32K_IMM_16 - : BFD_RELOC_NS32K_IMM_32 @@ -788,6 +791,16 @@ attributes. ARM 26 bit pc-relative branch. The lowest two bits must be zero and are not stored in the instruction. + - : BFD_RELOC_ARM_PCREL_BLX + ARM 26 bit pc-relative branch. The lowest bit must be zero and is + not stored in the instruction. The 2nd lowest bit comes from a 1 + bit field in the instruction. + + - : BFD_RELOC_THUMB_PCREL_BLX + Thumb 22 bit pc-relative branch. The lowest bit must be zero and + is not stored in the instruction. The 2nd lowest bit comes from a + 1 bit field in the instruction. + - : BFD_RELOC_ARM_IMMEDIATE - : BFD_RELOC_ARM_ADRL_IMMEDIATE - : BFD_RELOC_ARM_OFFSET_IMM @@ -835,6 +848,13 @@ attributes. - : BFD_RELOC_SH_CODE - : BFD_RELOC_SH_DATA - : BFD_RELOC_SH_LABEL + - : BFD_RELOC_SH_LOOP_START + - : BFD_RELOC_SH_LOOP_END + - : BFD_RELOC_SH_COPY + - : BFD_RELOC_SH_GLOB_DAT + - : BFD_RELOC_SH_JMP_SLOT + - : BFD_RELOC_SH_RELATIVE + - : BFD_RELOC_SH_GOTPC Hitachi SH relocs. Not all of these appear in object files. - : BFD_RELOC_THUMB_PCREL_BRANCH9 @@ -844,10 +864,9 @@ attributes. be zero and is not stored in the instruction. - : BFD_RELOC_ARC_B22_PCREL - Argonaut RISC Core (ARC) relocs. ARC 22 bit pc-relative branch. - The lowest two bits must be zero and are not stored in the - instruction. The high 20 bits are installed in bits 26 through 7 - of the instruction. + ARC Cores relocs. ARC 22 bit pc-relative branch. The lowest two + bits must be zero and are not stored in the instruction. The high + 20 bits are installed in bits 26 through 7 of the instruction. - : BFD_RELOC_ARC_B26 ARC 26 bit absolute branch. The lowest two bits must be zero and @@ -1009,6 +1028,28 @@ attributes. significant 8 bits of a 24 bit word are placed into the least significant 8 bits of the opcode. + - : BFD_RELOC_TIC54X_PARTLS7 + This is a 7bit reloc for the tms320c54x, where the least + significant 7 bits of a 16 bit word are placed into the least + significant 7 bits of the opcode. + + - : BFD_RELOC_TIC54X_PARTMS9 + This is a 9bit DP reloc for the tms320c54x, where the most + significant 9 bits of a 16 bit word are placed into the least + significant 9 bits of the opcode. + + - : BFD_RELOC_TIC54X_23 + This is an extended address 23-bit reloc for the tms320c54x. + + - : BFD_RELOC_TIC54X_16_OF_23 + This is a 16-bit reloc for the tms320c54x, where the least + significant 16 bits of a 23-bit extended address are placed into + the opcode. + + - : BFD_RELOC_TIC54X_MS7_OF_23 + This is a reloc for the tms320c54x, where the most significant 7 + bits of a 23-bit extended address are placed into the opcode. + - : BFD_RELOC_FR30_48 This is a 48 bit reloc for the FR30 that stores 32 bits. @@ -1139,6 +1180,125 @@ attributes. this offset is stored in the reloc's addend. For Rel hosts, we are forced to put this offset in the reloc's section offset. + - : BFD_RELOC_IA64_IMM14 + - : BFD_RELOC_IA64_IMM22 + - : BFD_RELOC_IA64_IMM64 + - : BFD_RELOC_IA64_DIR32MSB + - : BFD_RELOC_IA64_DIR32LSB + - : BFD_RELOC_IA64_DIR64MSB + - : BFD_RELOC_IA64_DIR64LSB + - : BFD_RELOC_IA64_GPREL22 + - : BFD_RELOC_IA64_GPREL64I + - : BFD_RELOC_IA64_GPREL32MSB + - : BFD_RELOC_IA64_GPREL32LSB + - : BFD_RELOC_IA64_GPREL64MSB + - : BFD_RELOC_IA64_GPREL64LSB + - : BFD_RELOC_IA64_LTOFF22 + - : BFD_RELOC_IA64_LTOFF64I + - : BFD_RELOC_IA64_PLTOFF22 + - : BFD_RELOC_IA64_PLTOFF64I + - : BFD_RELOC_IA64_PLTOFF64MSB + - : BFD_RELOC_IA64_PLTOFF64LSB + - : BFD_RELOC_IA64_FPTR64I + - : BFD_RELOC_IA64_FPTR32MSB + - : BFD_RELOC_IA64_FPTR32LSB + - : BFD_RELOC_IA64_FPTR64MSB + - : BFD_RELOC_IA64_FPTR64LSB + - : BFD_RELOC_IA64_PCREL21B + - : BFD_RELOC_IA64_PCREL21BI + - : BFD_RELOC_IA64_PCREL21M + - : BFD_RELOC_IA64_PCREL21F + - : BFD_RELOC_IA64_PCREL22 + - : BFD_RELOC_IA64_PCREL60B + - : BFD_RELOC_IA64_PCREL64I + - : BFD_RELOC_IA64_PCREL32MSB + - : BFD_RELOC_IA64_PCREL32LSB + - : BFD_RELOC_IA64_PCREL64MSB + - : BFD_RELOC_IA64_PCREL64LSB + - : BFD_RELOC_IA64_LTOFF_FPTR22 + - : BFD_RELOC_IA64_LTOFF_FPTR64I + - : BFD_RELOC_IA64_LTOFF_FPTR64MSB + - : BFD_RELOC_IA64_LTOFF_FPTR64LSB + - : BFD_RELOC_IA64_SEGREL32MSB + - : BFD_RELOC_IA64_SEGREL32LSB + - : BFD_RELOC_IA64_SEGREL64MSB + - : BFD_RELOC_IA64_SEGREL64LSB + - : BFD_RELOC_IA64_SECREL32MSB + - : BFD_RELOC_IA64_SECREL32LSB + - : BFD_RELOC_IA64_SECREL64MSB + - : BFD_RELOC_IA64_SECREL64LSB + - : BFD_RELOC_IA64_REL32MSB + - : BFD_RELOC_IA64_REL32LSB + - : BFD_RELOC_IA64_REL64MSB + - : BFD_RELOC_IA64_REL64LSB + - : BFD_RELOC_IA64_LTV32MSB + - : BFD_RELOC_IA64_LTV32LSB + - : BFD_RELOC_IA64_LTV64MSB + - : BFD_RELOC_IA64_LTV64LSB + - : BFD_RELOC_IA64_IPLTMSB + - : BFD_RELOC_IA64_IPLTLSB + - : BFD_RELOC_IA64_COPY + - : BFD_RELOC_IA64_TPREL22 + - : BFD_RELOC_IA64_TPREL64MSB + - : BFD_RELOC_IA64_TPREL64LSB + - : BFD_RELOC_IA64_LTOFF_TP22 + - : BFD_RELOC_IA64_LTOFF22X + - : BFD_RELOC_IA64_LDXMOV + Intel IA64 Relocations. + + - : BFD_RELOC_M68HC11_HI8 + Motorola 68HC11 reloc. This is the 8 bits high part of an + absolute address. + + - : BFD_RELOC_M68HC11_LO8 + Motorola 68HC11 reloc. This is the 8 bits low part of an absolute + address. + + - : BFD_RELOC_M68HC11_3B + Motorola 68HC11 reloc. This is the 3 bits of a value. + + - : BFD_RELOC_CRIS_BDISP8 + - : BFD_RELOC_CRIS_UNSIGNED_5 + - : BFD_RELOC_CRIS_SIGNED_6 + - : BFD_RELOC_CRIS_UNSIGNED_6 + - : BFD_RELOC_CRIS_UNSIGNED_4 + These relocs are only used within the CRIS assembler. They are not + (at present) written to any object files. + + - : BFD_RELOC_860_COPY + - : BFD_RELOC_860_GLOB_DAT + - : BFD_RELOC_860_JUMP_SLOT + - : BFD_RELOC_860_RELATIVE + - : BFD_RELOC_860_PC26 + - : BFD_RELOC_860_PLT26 + - : BFD_RELOC_860_PC16 + - : BFD_RELOC_860_LOW0 + - : BFD_RELOC_860_SPLIT0 + - : BFD_RELOC_860_LOW1 + - : BFD_RELOC_860_SPLIT1 + - : BFD_RELOC_860_LOW2 + - : BFD_RELOC_860_SPLIT2 + - : BFD_RELOC_860_LOW3 + - : BFD_RELOC_860_LOGOT0 + - : BFD_RELOC_860_SPGOT0 + - : BFD_RELOC_860_LOGOT1 + - : BFD_RELOC_860_SPGOT1 + - : BFD_RELOC_860_LOGOTOFF0 + - : BFD_RELOC_860_SPGOTOFF0 + - : BFD_RELOC_860_LOGOTOFF1 + - : BFD_RELOC_860_SPGOTOFF1 + - : BFD_RELOC_860_LOGOTOFF2 + - : BFD_RELOC_860_LOGOTOFF3 + - : BFD_RELOC_860_LOPC + - : BFD_RELOC_860_HIGHADJ + - : BFD_RELOC_860_HAGOT + - : BFD_RELOC_860_HAGOTOFF + - : BFD_RELOC_860_HAPC + - : BFD_RELOC_860_HIGH + - : BFD_RELOC_860_HIGOT + - : BFD_RELOC_860_HIGOTOFF + Intel i860 Relocations. + typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; diff --git a/gnu/dist/toolchain/bfd/doc/bfd.info-4 b/gnu/dist/toolchain/bfd/doc/bfd.info-4 index d527fb1a1397..8278812c9f81 100644 --- a/gnu/dist/toolchain/bfd/doc/bfd.info-4 +++ b/gnu/dist/toolchain/bfd/doc/bfd.info-4 @@ -6,21 +6,14 @@ END-INFO-DIR-ENTRY This file documents the BFD library. - Copyright (C) 1991 Free Software Foundation, Inc. + Copyright (C) 1991, 2000 Free Software Foundation, Inc. - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, subject to the -terms of the GNU General Public License, which includes the provision -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. + 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".  File: bfd.info, Node: bfd_target, Prev: Targets, Up: Targets @@ -55,13 +48,13 @@ wants to fix this and not break the above, please do. #endif For operations which index on the BFD format: #define BFD_SEND_FMT(bfd, message, arglist) \ - (((bfd)->xvec->message[(int)((bfd)->format)]) arglist) + (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) #ifdef DEBUG_BFD_SEND #undef BFD_SEND_FMT #define BFD_SEND_FMT(bfd, message, arglist) \ (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ - (((bfd)->xvec->message[(int)((bfd)->format)]) arglist) : \ + (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \ (bfd_assert (__FILE__,__LINE__), NULL)) #endif This is the structure which defines the type of BFD this is. The @@ -76,6 +69,7 @@ them both! bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, + bfd_target_xcoff_flavour, bfd_target_elf_flavour, bfd_target_ieee_flavour, bfd_target_nlm_flavour, @@ -93,7 +87,7 @@ them both! enum bfd_endian { BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN }; - /* Forward declaration. */ + /* Forward declaration. */ typedef struct bfd_link_info _bfd_link_info; typedef struct bfd_target @@ -155,7 +149,7 @@ zero. The general target vector. These vectors are initialized using the BFD_JUMP_TABLE macros. - /* Generic entry points. */ + /* Generic entry points. */ #define BFD_JUMP_TABLE_GENERIC(NAME)\ CAT(NAME,_close_and_cleanup),\ CAT(NAME,_bfd_free_cached_info),\ @@ -163,20 +157,20 @@ BFD_JUMP_TABLE macros. CAT(NAME,_get_section_contents),\ CAT(NAME,_get_section_contents_in_window) - /* Called when the BFD is being closed to do any necessary cleanup. */ + /* Called when the BFD is being closed to do any necessary cleanup. */ boolean (*_close_and_cleanup) PARAMS ((bfd *)); - /* Ask the BFD to free all cached information. */ + /* Ask the BFD to free all cached information. */ boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); - /* Called when a new section is created. */ + /* Called when a new section is created. */ boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); - /* Read the contents of a section. */ + /* 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)); - /* Entry points to copy private data. */ + /* 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),\ @@ -184,27 +178,27 @@ BFD_JUMP_TABLE macros. CAT(NAME,_bfd_copy_private_symbol_data),\ CAT(NAME,_bfd_set_private_flags),\ CAT(NAME,_bfd_print_private_bfd_data)\ - /* Called to copy BFD general private data from one object file + /* Called to copy BFD general private data from one object file to another. */ boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); - /* Called to merge BFD general private data from one object file + /* 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 *)); - /* Called to copy BFD private section data from one object file + /* 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)); - /* Called to copy BFD private symbol data from one symbol + /* Called to copy BFD private symbol data from one symbol to another. */ boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *, bfd *, asymbol *)); - /* Called to set private backend flags */ + /* Called to set private backend flags */ boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword)); - /* Called to print private BFD data */ + /* Called to print private BFD data */ boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)); - /* Core file entry points. */ + /* Core file entry points. */ #define BFD_JUMP_TABLE_CORE(NAME)\ CAT(NAME,_core_file_failing_command),\ CAT(NAME,_core_file_failing_signal),\ @@ -213,7 +207,7 @@ BFD_JUMP_TABLE macros. int (*_core_file_failing_signal) PARAMS ((bfd *)); boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); - /* Archive entry points. */ + /* Archive entry points. */ #define BFD_JUMP_TABLE_ARCHIVE(NAME)\ CAT(NAME,_slurp_armap),\ CAT(NAME,_slurp_extended_name_table),\ @@ -242,7 +236,7 @@ BFD_JUMP_TABLE macros. int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); - /* Entry points used for symbols. */ + /* Entry points used for symbols. */ #define BFD_JUMP_TABLE_SYMBOLS(NAME)\ CAT(NAME,_get_symtab_upper_bound),\ CAT(NAME,_get_symtab),\ @@ -275,7 +269,7 @@ BFD_JUMP_TABLE macros. struct sec *section, struct symbol_cache_entry **symbols, bfd_vma offset, CONST char **file, CONST char **func, unsigned int *line)); - /* Back-door to allow format-aware applications to create debug symbols + /* 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 (( @@ -291,7 +285,7 @@ BFD_JUMP_TABLE macros. asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR, asymbol *)); - /* Routines for relocs. */ + /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME)\ CAT(NAME,_get_reloc_upper_bound),\ CAT(NAME,_canonicalize_reloc),\ @@ -299,12 +293,12 @@ BFD_JUMP_TABLE macros. 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. */ + /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); - /* Routines used when writing an object file. */ + /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME)\ CAT(NAME,_set_arch_mach),\ CAT(NAME,_set_section_contents) @@ -313,7 +307,7 @@ BFD_JUMP_TABLE macros. boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); - /* Routines used by the linker. */ + /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME)\ CAT(NAME,_sizeof_headers),\ CAT(NAME,_bfd_get_relocated_section_contents),\ @@ -332,37 +326,37 @@ BFD_JUMP_TABLE macros. boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *, struct bfd_link_info *, boolean *again)); - /* Create a hash table for the linker. Different backends store + /* 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. */ + /* Add symbols from this object file into the hash table. */ boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); - /* Do a link based on the link_order structures attached to each + /* 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 *)); - /* Should this section be split up into smaller pieces during linking. */ + /* Should this section be split up into smaller pieces during linking. */ boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); - /* Remove sections that are not referenced from the output. */ + /* Remove sections that are not referenced from the output. */ boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); - /* Routines to handle dynamic symbols and relocs. */ + /* 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) - /* Get the amount of memory required to hold the dynamic symbols. */ + /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); - /* Read in the dynamic symbols. */ + /* Read in the dynamic symbols. */ long (*_bfd_canonicalize_dynamic_symtab) PARAMS ((bfd *, struct symbol_cache_entry **)); - /* Get the amount of memory required to hold the dynamic relocs. */ + /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); - /* Read in the dynamic relocs. */ + /* Read in the dynamic relocs. */ long (*_bfd_canonicalize_dynamic_reloc) PARAMS ((bfd *, arelent **, struct symbol_cache_entry **)); A pointer to an alternative bfd_target in case the current one is not @@ -370,7 +364,7 @@ satisfactory. This can happen when the target cpu supports both big and little endian code, and target chosen by the linker has the wrong endianness. The function open_output() in ld/ldlang.c uses this field to find an alternative output format that is suitable. - /* Opposite endian version of this target. */ + /* Opposite endian version of this target. */ const struct bfd_target * alternative_target; Data for use by back-end routines, which isn't generic enough to belong in this structure. @@ -417,7 +411,7 @@ the valid BFD targets. Do not modify the names. ...................... *Synopsis* - const bfd_target * bfd_search_for_target (int (* search_func)(const bfd_target *, void *), void *); + const bfd_target * bfd_search_for_target (int (* search_func) (const bfd_target *, void *), void *); *Description* Return a pointer to the first transfer vector in the list of transfer vectors maintained by BFD that produces a non-zero result when passed @@ -463,9 +457,9 @@ architecture, containing, for example, 2 and 3 for Intel i960 KA and i960 KB, and 68020 and 68030 for Motorola 68020 and 68030. enum bfd_architecture { - bfd_arch_unknown, /* File arch not known */ - bfd_arch_obscure, /* Arch known, not one of these */ - bfd_arch_m68k, /* Motorola 68xxx */ + bfd_arch_unknown, /* File arch not known */ + bfd_arch_obscure, /* Arch known, not one of these */ + bfd_arch_m68k, /* Motorola 68xxx */ #define bfd_mach_m68000 1 #define bfd_mach_m68008 2 #define bfd_mach_m68010 3 @@ -474,9 +468,9 @@ i960 KB, and 68020 and 68030 for Motorola 68020 and 68030. #define bfd_mach_m68040 6 #define bfd_mach_m68060 7 #define bfd_mach_cpu32 8 - bfd_arch_vax, /* DEC Vax */ - bfd_arch_i960, /* Intel 960 */ - /* The order of the following is important. + bfd_arch_vax, /* DEC Vax */ + bfd_arch_i960, /* Intel 960 */ + /* The order of the following is important. lower number indicates a machine type that only accepts a subset of the instructions available to machines with higher numbers. @@ -493,21 +487,24 @@ i960 KB, and 68020 and 68030 for Motorola 68020 and 68030. #define bfd_mach_i960_jx 7 #define bfd_mach_i960_hx 8 - bfd_arch_a29k, /* AMD 29000 */ - bfd_arch_sparc, /* SPARC */ + bfd_arch_a29k, /* AMD 29000 */ + bfd_arch_sparc, /* SPARC */ #define bfd_mach_sparc 1 - /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ + /* The difference between v8plus and v9 is that v9 is a true 64 bit env. */ #define bfd_mach_sparc_sparclet 2 #define bfd_mach_sparc_sparclite 3 #define bfd_mach_sparc_v8plus 4 - #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */ + #define bfd_mach_sparc_v8plusa 5 /* with ultrasparc add'ns */ #define bfd_mach_sparc_sparclite_le 6 #define bfd_mach_sparc_v9 7 - #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */ - /* Nonzero if MACH has the v9 instruction set. */ + #define bfd_mach_sparc_v9a 8 /* with ultrasparc add'ns */ + #define bfd_mach_sparc_v8plusb 9 /* with cheetah add'ns */ + #define bfd_mach_sparc_v9b 10 /* with cheetah add'ns */ + /* Nonzero if MACH has the v9 instruction set. */ #define bfd_mach_sparc_v9_p(mach) \ - ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9a) - bfd_arch_mips, /* MIPS Rxxxx */ + ((mach) >= bfd_mach_sparc_v8plus && (mach) <= bfd_mach_sparc_v9b \ + && (mach) != bfd_mach_sparc_sparclite_le) + bfd_arch_mips, /* MIPS Rxxxx */ #define bfd_mach_mips3000 3000 #define bfd_mach_mips3900 3900 #define bfd_mach_mips4000 4000 @@ -523,36 +520,66 @@ i960 KB, and 68020 and 68030 for Motorola 68020 and 68030. #define bfd_mach_mips8000 8000 #define bfd_mach_mips10000 10000 #define bfd_mach_mips16 16 - bfd_arch_i386, /* Intel 386 */ + #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 */ + bfd_arch_i386, /* Intel 386 */ #define bfd_mach_i386_i386 0 #define bfd_mach_i386_i8086 1 #define bfd_mach_i386_i386_intel_syntax 2 - bfd_arch_we32k, /* AT&T WE32xxx */ - bfd_arch_tahoe, /* CCI/Harris Tahoe */ - bfd_arch_i860, /* Intel 860 */ - bfd_arch_i370, /* IBM 360/370 Mainframes */ - bfd_arch_romp, /* IBM ROMP PC/RT */ - bfd_arch_alliant, /* Alliant */ - bfd_arch_convex, /* Convex */ - bfd_arch_m88k, /* Motorola 88xxx */ - bfd_arch_pyramid, /* Pyramid Technology */ - bfd_arch_h8300, /* Hitachi H8/300 */ + #define bfd_mach_x86_64 3 + #define bfd_mach_x86_64_intel_syntax 4 + bfd_arch_we32k, /* AT&T WE32xxx */ + bfd_arch_tahoe, /* CCI/Harris Tahoe */ + bfd_arch_i860, /* Intel 860 */ + bfd_arch_i370, /* IBM 360/370 Mainframes */ + bfd_arch_romp, /* IBM ROMP PC/RT */ + bfd_arch_alliant, /* Alliant */ + bfd_arch_convex, /* Convex */ + bfd_arch_m88k, /* Motorola 88xxx */ + bfd_arch_pyramid, /* Pyramid Technology */ + bfd_arch_h8300, /* Hitachi H8/300 */ #define bfd_mach_h8300 1 #define bfd_mach_h8300h 2 #define bfd_mach_h8300s 3 - bfd_arch_powerpc, /* PowerPC */ - bfd_arch_rs6000, /* IBM RS/6000 */ - bfd_arch_hppa, /* HP PA RISC */ - bfd_arch_d10v, /* Mitsubishi D10V */ + bfd_arch_powerpc, /* PowerPC */ + #define bfd_mach_ppc 0 + #define bfd_mach_ppc_403 403 + #define bfd_mach_ppc_403gc 4030 + #define bfd_mach_ppc_505 505 + #define bfd_mach_ppc_601 601 + #define bfd_mach_ppc_602 602 + #define bfd_mach_ppc_603 603 + #define bfd_mach_ppc_ec603e 6031 + #define bfd_mach_ppc_604 604 + #define bfd_mach_ppc_620 620 + #define bfd_mach_ppc_630 630 + #define bfd_mach_ppc_750 750 + #define bfd_mach_ppc_860 860 + #define bfd_mach_ppc_a35 35 + #define bfd_mach_ppc_rs64ii 642 + #define bfd_mach_ppc_rs64iii 643 + #define bfd_mach_ppc_7400 7400 + bfd_arch_rs6000, /* IBM RS/6000 */ + #define bfd_mach_rs6k 0 + #define bfd_mach_rs6k_rs1 6001 + #define bfd_mach_rs6k_rsc 6003 + #define bfd_mach_rs6k_rs2 6002 + bfd_arch_hppa, /* HP PA RISC */ + bfd_arch_d10v, /* Mitsubishi D10V */ #define bfd_mach_d10v 0 #define bfd_mach_d10v_ts2 2 #define bfd_mach_d10v_ts3 3 - bfd_arch_d30v, /* Mitsubishi D30V */ - bfd_arch_z8k, /* Zilog Z8000 */ + bfd_arch_d30v, /* Mitsubishi D30V */ + bfd_arch_m68hc11, /* Motorola 68HC11 */ + bfd_arch_m68hc12, /* Motorola 68HC12 */ + bfd_arch_z8k, /* Zilog Z8000 */ #define bfd_mach_z8001 1 #define bfd_mach_z8002 2 - bfd_arch_h8500, /* Hitachi H8/500 */ - bfd_arch_sh, /* Hitachi SH */ + bfd_arch_h8500, /* Hitachi H8/500 */ + bfd_arch_sh, /* Hitachi SH */ #define bfd_mach_sh 0 #define bfd_mach_sh2 0x20 #define bfd_mach_sh_dsp 0x2d @@ -560,11 +587,11 @@ i960 KB, and 68020 and 68030 for Motorola 68020 and 68030. #define bfd_mach_sh3_dsp 0x3d #define bfd_mach_sh3e 0x3e #define bfd_mach_sh4 0x40 - bfd_arch_alpha, /* Dec Alpha */ + bfd_arch_alpha, /* Dec Alpha */ #define bfd_mach_alpha_ev4 0x10 #define bfd_mach_alpha_ev5 0x20 #define bfd_mach_alpha_ev6 0x30 - bfd_arch_arm, /* Advanced Risc Machines ARM */ + bfd_arch_arm, /* Advanced Risc Machines ARM */ #define bfd_mach_arm_2 1 #define bfd_mach_arm_2a 2 #define bfd_mach_arm_3 3 @@ -573,32 +600,43 @@ i960 KB, and 68020 and 68030 for Motorola 68020 and 68030. #define bfd_mach_arm_4T 6 #define bfd_mach_arm_5 7 #define bfd_mach_arm_5T 8 - bfd_arch_ns32k, /* National Semiconductors ns32000 */ - bfd_arch_w65, /* WDC 65816 */ - bfd_arch_tic30, /* Texas Instruments TMS320C30 */ - bfd_arch_tic80, /* TI TMS320c80 (MVP) */ - bfd_arch_v850, /* NEC V850 */ + #define bfd_mach_arm_5TE 9 + #define bfd_mach_arm_XScale 10 + bfd_arch_ns32k, /* National Semiconductors ns32000 */ + bfd_arch_w65, /* WDC 65816 */ + bfd_arch_tic30, /* Texas Instruments TMS320C30 */ + bfd_arch_tic54x, /* Texas Instruments TMS320C54X */ + bfd_arch_tic80, /* TI TMS320c80 (MVP) */ + bfd_arch_v850, /* NEC V850 */ #define bfd_mach_v850 0 #define bfd_mach_v850e 'E' #define bfd_mach_v850ea 'A' - bfd_arch_arc, /* Argonaut RISC Core */ - #define bfd_mach_arc_base 0 - bfd_arch_m32r, /* Mitsubishi M32R/D */ - #define bfd_mach_m32r 0 /* backwards compatibility */ + bfd_arch_arc, /* ARC Cores */ + #define bfd_mach_arc_5 0 + #define bfd_mach_arc_6 1 + #define bfd_mach_arc_7 2 + #define bfd_mach_arc_8 3 + bfd_arch_m32r, /* Mitsubishi M32R/D */ + #define bfd_mach_m32r 0 /* backwards compatibility */ #define bfd_mach_m32rx 'x' - bfd_arch_mn10200, /* Matsushita MN10200 */ - bfd_arch_mn10300, /* Matsushita MN10300 */ + bfd_arch_mn10200, /* Matsushita MN10200 */ + bfd_arch_mn10300, /* Matsushita MN10300 */ #define bfd_mach_mn10300 300 #define bfd_mach_am33 330 bfd_arch_fr30, #define bfd_mach_fr30 0x46523330 bfd_arch_mcore, + bfd_arch_ia64, /* HP/Intel ia64 */ + #define bfd_mach_ia64_elf64 0 + #define bfd_mach_ia64_elf32 1 bfd_arch_pj, - bfd_arch_avr, /* Atmel AVR microcontrollers */ + bfd_arch_avr, /* Atmel AVR microcontrollers */ #define bfd_mach_avr1 1 #define bfd_mach_avr2 2 #define bfd_mach_avr3 3 #define bfd_mach_avr4 4 + #define bfd_mach_avr5 5 + bfd_arch_cris, /* Axis CRIS */ bfd_arch_last }; @@ -618,7 +656,7 @@ This structure contains information on architectures for use within BFD. const char *arch_name; const char *printable_name; unsigned int section_align_power; - /* true if this is the default machine for the architecture */ + /* True if this is the default machine for the architecture. */ boolean the_default; const struct bfd_arch_info * (*compatible) PARAMS ((const struct bfd_arch_info *a, @@ -802,8 +840,10 @@ targets have 16, 32, or even 48 bits per byte. unsigned int bfd_arch_mach_octets_per_byte(enum bfd_architecture arch, unsigned long machine); *Description* -See bfd_octets_per_byte. This routine is provided for those cases -where a bfd * is not available +See bfd_octets_per_byte. + + This routine is provided for those cases where a bfd * is not +available  File: bfd.info, Node: Opening and Closing, Next: Internal, Prev: Architectures, Up: BFD front end @@ -997,16 +1037,16 @@ detecting sins such as passing a pointer. To detect calling these with less than a `bfd_vma', use `gcc -Wconversion' on a host with 64 bit `bfd_vma''s. - /* Byte swapping macros for user section data. */ + /* Byte swapping macros for user section data. */ #define bfd_put_8(abfd, val, ptr) \ - ((void) (*((unsigned char *)(ptr)) = (unsigned char)(val))) + ((void) (*((unsigned char *) (ptr)) = (unsigned char) (val))) #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(unsigned char *)(ptr)) + (*(unsigned char *) (ptr)) #define bfd_get_signed_8(abfd, ptr) \ - ((*(unsigned char *)(ptr) ^ 0x80) - 0x80) + ((*(unsigned char *) (ptr) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND(abfd, bfd_putx16, ((val),(ptr))) @@ -1059,7 +1099,7 @@ 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. - /* Byte swapping macros for file header data. */ + /* Byte swapping macros for file header data. */ #define bfd_h_put_8(abfd, val, ptr) \ bfd_put_8 (abfd, val, ptr) @@ -1148,7 +1188,7 @@ can't have changed since the last lookup; otherwise, it has to perform the complicated lookup function. #define bfd_cache_lookup(x) \ ((x)==bfd_last_cache? \ - (FILE*)(bfd_last_cache->iostream): \ + (FILE*) (bfd_last_cache->iostream): \ bfd_cache_lookup_worker(x)) `bfd_cache_init' @@ -1234,59 +1274,3 @@ throughout this section. * Adding Symbols to the Hash Table:: * Performing the Final Link:: - -File: bfd.info, Node: Creating a Linker Hash Table, Next: Adding Symbols to the Hash Table, Prev: Linker Functions, Up: Linker Functions - -Creating a linker hash table ----------------------------- - - The linker routines must create a hash table, which must be derived -from `struct bfd_link_hash_table' described in `bfdlink.c'. *Note Hash -Tables::, for information on how to create a derived hash table. This -entry point is called using the target vector of the linker output file. - - The `_bfd_link_hash_table_create' entry point must allocate and -initialize an instance of the desired hash table. If the back end does -not require any additional information to be stored with the entries in -the hash table, the entry point may simply create a `struct -bfd_link_hash_table'. Most likely, however, some additional -information will be needed. - - For example, with each entry in the hash table the a.out linker -keeps the index the symbol has in the final output file (this index -number is used so that when doing a relocateable link the symbol index -used in the output file can be quickly filled in when copying over a -reloc). The a.out linker code defines the required structures and -functions for a hash table derived from `struct bfd_link_hash_table'. -The a.out linker hash table is created by the function -`NAME(aout,link_hash_table_create)'; it simply allocates space for the -hash table, initializes it, and returns a pointer to it. - - When writing the linker routines for a new back end, you will -generally not know exactly which fields will be required until you have -finished. You should simply create a new hash table which defines no -additional fields, and then simply add fields as they become necessary. - - -File: bfd.info, Node: Adding Symbols to the Hash Table, Next: Performing the Final Link, Prev: Creating a Linker Hash Table, Up: Linker Functions - -Adding symbols to the hash table --------------------------------- - - The linker proper will call the `_bfd_link_add_symbols' entry point -for each object file or archive which is to be linked (typically these -are the files named on the command line, but some may also come from -the linker script). The entry point is responsible for examining the -file. For an object file, BFD must add any relevant symbol information -to the hash table. For an archive, BFD must determine which elements -of the archive should be used and adding them to the link. - - The a.out version of this entry point is -`NAME(aout,link_add_symbols)'. - -* Menu: - -* Differing file formats:: -* Adding symbols from an object file:: -* Adding symbols from an archive:: - diff --git a/gnu/dist/toolchain/bfd/doc/bfd.info-5 b/gnu/dist/toolchain/bfd/doc/bfd.info-5 index bfb707caeb51..0e65d28c5d36 100644 --- a/gnu/dist/toolchain/bfd/doc/bfd.info-5 +++ b/gnu/dist/toolchain/bfd/doc/bfd.info-5 @@ -6,21 +6,70 @@ END-INFO-DIR-ENTRY This file documents the BFD library. - Copyright (C) 1991 Free Software Foundation, Inc. + Copyright (C) 1991, 2000 Free Software Foundation, Inc. - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. + 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 and distribute modified versions of -this manual under the conditions for verbatim copying, subject to the -terms of the GNU General Public License, which includes the provision -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. + +File: bfd.info, Node: Creating a Linker Hash Table, Next: Adding Symbols to the Hash Table, Prev: Linker Functions, Up: Linker Functions - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. +Creating a linker hash table +---------------------------- + + The linker routines must create a hash table, which must be derived +from `struct bfd_link_hash_table' described in `bfdlink.c'. *Note Hash +Tables::, for information on how to create a derived hash table. This +entry point is called using the target vector of the linker output file. + + The `_bfd_link_hash_table_create' entry point must allocate and +initialize an instance of the desired hash table. If the back end does +not require any additional information to be stored with the entries in +the hash table, the entry point may simply create a `struct +bfd_link_hash_table'. Most likely, however, some additional +information will be needed. + + For example, with each entry in the hash table the a.out linker +keeps the index the symbol has in the final output file (this index +number is used so that when doing a relocateable link the symbol index +used in the output file can be quickly filled in when copying over a +reloc). The a.out linker code defines the required structures and +functions for a hash table derived from `struct bfd_link_hash_table'. +The a.out linker hash table is created by the function +`NAME(aout,link_hash_table_create)'; it simply allocates space for the +hash table, initializes it, and returns a pointer to it. + + When writing the linker routines for a new back end, you will +generally not know exactly which fields will be required until you have +finished. You should simply create a new hash table which defines no +additional fields, and then simply add fields as they become necessary. + + +File: bfd.info, Node: Adding Symbols to the Hash Table, Next: Performing the Final Link, Prev: Creating a Linker Hash Table, Up: Linker Functions + +Adding symbols to the hash table +-------------------------------- + + The linker proper will call the `_bfd_link_add_symbols' entry point +for each object file or archive which is to be linked (typically these +are the files named on the command line, but some may also come from +the linker script). The entry point is responsible for examining the +file. For an object file, BFD must add any relevant symbol information +to the hash table. For an archive, BFD must determine which elements +of the archive should be used and adding them to the link. + + The a.out version of this entry point is +`NAME(aout,link_add_symbols)'. + +* Menu: + +* Differing file formats:: +* Adding symbols from an object file:: +* Adding symbols from an archive::  File: bfd.info, Node: Differing file formats, Next: Adding symbols from an object file, Prev: Adding Symbols to the Hash Table, Up: Adding Symbols to the Hash Table @@ -532,7 +581,7 @@ table, uses macros for the lookup and traversal routines. These are `aout_link_hash_lookup' and `aout_link_hash_traverse' in aoutx.h.  -File: bfd.info, Node: BFD back ends, Next: Index, Prev: BFD front end, Up: Top +File: bfd.info, Node: BFD back ends, Next: GNU Free Documentation License, Prev: BFD front end, Up: Top BFD back ends ************* @@ -680,7 +729,7 @@ the buffer RAW_BYTES ready for writing to disk. *Synopsis* const bfd_target *aout_SIZE_some_aout_object_p (bfd *abfd, - const bfd_target *(*callback_to_real_object_p)()); + const bfd_target *(*callback_to_real_object_p) ()); *Description* Some a.out variant thinks that the file open in ABFD checking is an a.out file. Do some more checking, and set up for access if it really diff --git a/gnu/dist/toolchain/bfd/doc/bfd.info-6 b/gnu/dist/toolchain/bfd/doc/bfd.info-6 index 0c59a3dc63db..8ab13e5af7f5 100644 --- a/gnu/dist/toolchain/bfd/doc/bfd.info-6 +++ b/gnu/dist/toolchain/bfd/doc/bfd.info-6 @@ -6,21 +6,14 @@ END-INFO-DIR-ENTRY This file documents the BFD library. - Copyright (C) 1991 Free Software Foundation, Inc. + Copyright (C) 1991, 2000 Free Software Foundation, Inc. - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, subject to the -terms of the GNU General Public License, which includes the provision -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. + 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".  File: bfd.info, Node: coff, Next: elf, Prev: aout, Up: BFD back ends @@ -362,6 +355,8 @@ dependent COFF routines: 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, @@ -559,6 +554,12 @@ dependent COFF routines: #define 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) + + #define bfd_coff_debug_string_prefix_length(abfd)\ + (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)) @@ -681,3 +682,353 @@ them. Sun's .stabstr, in particular, isn't even pointed to by the .stab section, so ordinary mechanisms wouldn't work to find it, even if we had some. + +File: bfd.info, Node: GNU Free Documentation License, Next: Index, Prev: BFD back ends, Up: Top + +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: + + 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". + + 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. + diff --git a/gnu/dist/toolchain/bfd/doc/bfd.info-7 b/gnu/dist/toolchain/bfd/doc/bfd.info-7 index 18e8a5d8c89c..763185d07e3a 100644 --- a/gnu/dist/toolchain/bfd/doc/bfd.info-7 +++ b/gnu/dist/toolchain/bfd/doc/bfd.info-7 @@ -6,24 +6,17 @@ END-INFO-DIR-ENTRY This file documents the BFD library. - Copyright (C) 1991 Free Software Foundation, Inc. + Copyright (C) 1991, 2000 Free Software Foundation, Inc. - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, subject to the -terms of the GNU General Public License, which includes the provision -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. + 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".  -File: bfd.info, Node: Index, Prev: BFD back ends, Up: Top +File: bfd.info, Node: Index, Prev: GNU Free Documentation License, Up: Top Index ***** @@ -89,6 +82,7 @@ Index * bfd_generic_relax_section: howto manager. * bfd_get_arch: Architectures. * bfd_get_arch_info: Architectures. +* bfd_get_arch_size: BFD front end. * bfd_get_error: BFD front end. * bfd_get_error_handler: BFD front end. * bfd_get_gp_size: BFD front end. @@ -100,9 +94,11 @@ Index * bfd_get_reloc_upper_bound: BFD front end. * bfd_get_section_by_name: section prototypes. * bfd_get_section_contents: section prototypes. +* bfd_get_sign_extend_vma: BFD front end. * bfd_get_size <1>: Internal. * bfd_get_size: BFD front end. * bfd_get_symtab_upper_bound: symbol handling functions. +* bfd_get_unique_section_name: section prototypes. * bfd_h_put_size: Internal. * bfd_hash_allocate: Creating and Freeing a Hash Table. * bfd_hash_lookup: Looking Up or Entering a String. @@ -178,6 +174,38 @@ Index * BFD_RELOC_68K_JMP_SLOT: howto manager. * BFD_RELOC_68K_RELATIVE: howto manager. * BFD_RELOC_8: howto manager. +* BFD_RELOC_860_COPY: howto manager. +* BFD_RELOC_860_GLOB_DAT: howto manager. +* BFD_RELOC_860_HAGOT: howto manager. +* BFD_RELOC_860_HAGOTOFF: howto manager. +* BFD_RELOC_860_HAPC: howto manager. +* BFD_RELOC_860_HIGH: howto manager. +* BFD_RELOC_860_HIGHADJ: howto manager. +* BFD_RELOC_860_HIGOT: howto manager. +* BFD_RELOC_860_HIGOTOFF: howto manager. +* BFD_RELOC_860_JUMP_SLOT: howto manager. +* BFD_RELOC_860_LOGOT0: howto manager. +* BFD_RELOC_860_LOGOT1: howto manager. +* BFD_RELOC_860_LOGOTOFF0: howto manager. +* BFD_RELOC_860_LOGOTOFF1: howto manager. +* BFD_RELOC_860_LOGOTOFF2: howto manager. +* BFD_RELOC_860_LOGOTOFF3: howto manager. +* BFD_RELOC_860_LOPC: howto manager. +* BFD_RELOC_860_LOW0: howto manager. +* BFD_RELOC_860_LOW1: howto manager. +* BFD_RELOC_860_LOW2: howto manager. +* BFD_RELOC_860_LOW3: howto manager. +* BFD_RELOC_860_PC16: howto manager. +* BFD_RELOC_860_PC26: howto manager. +* BFD_RELOC_860_PLT26: howto manager. +* BFD_RELOC_860_RELATIVE: howto manager. +* BFD_RELOC_860_SPGOT0: howto manager. +* BFD_RELOC_860_SPGOT1: howto manager. +* BFD_RELOC_860_SPGOTOFF0: howto manager. +* BFD_RELOC_860_SPGOTOFF1: howto manager. +* BFD_RELOC_860_SPLIT0: howto manager. +* BFD_RELOC_860_SPLIT1: howto manager. +* BFD_RELOC_860_SPLIT2: howto manager. * BFD_RELOC_8_BASEREL: howto manager. * BFD_RELOC_8_FFnn: howto manager. * BFD_RELOC_8_GOT_PCREL: howto manager. @@ -221,6 +249,7 @@ Index * BFD_RELOC_ARM_MULTI: howto manager. * BFD_RELOC_ARM_OFFSET_IMM: howto manager. * BFD_RELOC_ARM_OFFSET_IMM8: howto manager. +* BFD_RELOC_ARM_PCREL_BLX: howto manager. * BFD_RELOC_ARM_PCREL_BRANCH: howto manager. * BFD_RELOC_ARM_PLT32: howto manager. * BFD_RELOC_ARM_RELATIVE: howto manager. @@ -247,6 +276,11 @@ Index * BFD_RELOC_AVR_LO8_LDI_PM: howto manager. * BFD_RELOC_AVR_LO8_LDI_PM_NEG: howto manager. * bfd_reloc_code_type: howto manager. +* BFD_RELOC_CRIS_BDISP8: howto manager. +* BFD_RELOC_CRIS_SIGNED_6: howto manager. +* BFD_RELOC_CRIS_UNSIGNED_4: howto manager. +* BFD_RELOC_CRIS_UNSIGNED_5: howto manager. +* BFD_RELOC_CRIS_UNSIGNED_6: howto manager. * BFD_RELOC_CTOR: howto manager. * BFD_RELOC_D10V_10_PCREL_L: howto manager. * BFD_RELOC_D10V_10_PCREL_R: howto manager. @@ -284,6 +318,70 @@ Index * BFD_RELOC_HI22: howto manager. * BFD_RELOC_I370_D12: howto manager. * BFD_RELOC_I960_CALLJ: howto manager. +* BFD_RELOC_IA64_COPY: howto manager. +* BFD_RELOC_IA64_DIR32LSB: howto manager. +* BFD_RELOC_IA64_DIR32MSB: howto manager. +* BFD_RELOC_IA64_DIR64LSB: howto manager. +* BFD_RELOC_IA64_DIR64MSB: howto manager. +* BFD_RELOC_IA64_FPTR32LSB: howto manager. +* BFD_RELOC_IA64_FPTR32MSB: howto manager. +* BFD_RELOC_IA64_FPTR64I: howto manager. +* BFD_RELOC_IA64_FPTR64LSB: howto manager. +* BFD_RELOC_IA64_FPTR64MSB: howto manager. +* BFD_RELOC_IA64_GPREL22: howto manager. +* BFD_RELOC_IA64_GPREL32LSB: howto manager. +* BFD_RELOC_IA64_GPREL32MSB: howto manager. +* BFD_RELOC_IA64_GPREL64I: howto manager. +* BFD_RELOC_IA64_GPREL64LSB: howto manager. +* BFD_RELOC_IA64_GPREL64MSB: howto manager. +* BFD_RELOC_IA64_IMM14: howto manager. +* BFD_RELOC_IA64_IMM22: howto manager. +* BFD_RELOC_IA64_IMM64: howto manager. +* BFD_RELOC_IA64_IPLTLSB: howto manager. +* BFD_RELOC_IA64_IPLTMSB: howto manager. +* BFD_RELOC_IA64_LDXMOV: howto manager. +* BFD_RELOC_IA64_LTOFF22: howto manager. +* BFD_RELOC_IA64_LTOFF22X: howto manager. +* BFD_RELOC_IA64_LTOFF64I: howto manager. +* BFD_RELOC_IA64_LTOFF_FPTR22: howto manager. +* BFD_RELOC_IA64_LTOFF_FPTR64I: howto manager. +* BFD_RELOC_IA64_LTOFF_FPTR64LSB: howto manager. +* BFD_RELOC_IA64_LTOFF_FPTR64MSB: howto manager. +* BFD_RELOC_IA64_LTOFF_TP22: howto manager. +* BFD_RELOC_IA64_LTV32LSB: howto manager. +* BFD_RELOC_IA64_LTV32MSB: howto manager. +* BFD_RELOC_IA64_LTV64LSB: howto manager. +* BFD_RELOC_IA64_LTV64MSB: howto manager. +* BFD_RELOC_IA64_PCREL21B: howto manager. +* BFD_RELOC_IA64_PCREL21BI: howto manager. +* BFD_RELOC_IA64_PCREL21F: howto manager. +* BFD_RELOC_IA64_PCREL21M: howto manager. +* BFD_RELOC_IA64_PCREL22: howto manager. +* BFD_RELOC_IA64_PCREL32LSB: howto manager. +* BFD_RELOC_IA64_PCREL32MSB: howto manager. +* BFD_RELOC_IA64_PCREL60B: howto manager. +* BFD_RELOC_IA64_PCREL64I: howto manager. +* BFD_RELOC_IA64_PCREL64LSB: howto manager. +* BFD_RELOC_IA64_PCREL64MSB: howto manager. +* BFD_RELOC_IA64_PLTOFF22: howto manager. +* BFD_RELOC_IA64_PLTOFF64I: howto manager. +* BFD_RELOC_IA64_PLTOFF64LSB: howto manager. +* BFD_RELOC_IA64_PLTOFF64MSB: howto manager. +* BFD_RELOC_IA64_REL32LSB: howto manager. +* BFD_RELOC_IA64_REL32MSB: howto manager. +* BFD_RELOC_IA64_REL64LSB: howto manager. +* BFD_RELOC_IA64_REL64MSB: howto manager. +* BFD_RELOC_IA64_SECREL32LSB: howto manager. +* BFD_RELOC_IA64_SECREL32MSB: howto manager. +* BFD_RELOC_IA64_SECREL64LSB: howto manager. +* BFD_RELOC_IA64_SECREL64MSB: howto manager. +* BFD_RELOC_IA64_SEGREL32LSB: howto manager. +* BFD_RELOC_IA64_SEGREL32MSB: howto manager. +* BFD_RELOC_IA64_SEGREL64LSB: howto manager. +* BFD_RELOC_IA64_SEGREL64MSB: howto manager. +* BFD_RELOC_IA64_TPREL22: howto manager. +* BFD_RELOC_IA64_TPREL64LSB: howto manager. +* BFD_RELOC_IA64_TPREL64MSB: howto manager. * BFD_RELOC_LO10: howto manager. * BFD_RELOC_LO16: howto manager. * BFD_RELOC_LO16_BASEREL: howto manager. @@ -297,6 +395,9 @@ Index * BFD_RELOC_M32R_HI16_ULO: howto manager. * BFD_RELOC_M32R_LO16: howto manager. * BFD_RELOC_M32R_SDA16: howto manager. +* BFD_RELOC_M68HC11_3B: howto manager. +* BFD_RELOC_M68HC11_HI8: howto manager. +* BFD_RELOC_M68HC11_LO8: howto manager. * BFD_RELOC_MCORE_PCREL_32: howto manager. * BFD_RELOC_MCORE_PCREL_IMM11BY2: howto manager. * BFD_RELOC_MCORE_PCREL_IMM4BY2: howto manager. @@ -375,19 +476,26 @@ Index * BFD_RELOC_RVA: howto manager. * BFD_RELOC_SH_ALIGN: howto manager. * BFD_RELOC_SH_CODE: howto manager. +* BFD_RELOC_SH_COPY: howto manager. * BFD_RELOC_SH_COUNT: howto manager. * BFD_RELOC_SH_DATA: howto manager. +* BFD_RELOC_SH_GLOB_DAT: howto manager. +* BFD_RELOC_SH_GOTPC: howto manager. * BFD_RELOC_SH_IMM4: howto manager. * BFD_RELOC_SH_IMM4BY2: howto manager. * BFD_RELOC_SH_IMM4BY4: howto manager. * BFD_RELOC_SH_IMM8: howto manager. * BFD_RELOC_SH_IMM8BY2: howto manager. * BFD_RELOC_SH_IMM8BY4: howto manager. +* BFD_RELOC_SH_JMP_SLOT: howto manager. * BFD_RELOC_SH_LABEL: howto manager. +* BFD_RELOC_SH_LOOP_END: howto manager. +* BFD_RELOC_SH_LOOP_START: howto manager. * BFD_RELOC_SH_PCDISP12BY2: howto manager. * BFD_RELOC_SH_PCDISP8BY2: howto manager. * BFD_RELOC_SH_PCRELIMM8BY2: howto manager. * BFD_RELOC_SH_PCRELIMM8BY4: howto manager. +* BFD_RELOC_SH_RELATIVE: howto manager. * BFD_RELOC_SH_SWITCH16: howto manager. * BFD_RELOC_SH_SWITCH32: howto manager. * BFD_RELOC_SH_USES: howto manager. @@ -431,10 +539,16 @@ Index * BFD_RELOC_SPARC_WDISP19: howto manager. * BFD_RELOC_SPARC_WDISP22: howto manager. * BFD_RELOC_SPARC_WPLT30: howto manager. +* BFD_RELOC_THUMB_PCREL_BLX: howto manager. * BFD_RELOC_THUMB_PCREL_BRANCH12: howto manager. * BFD_RELOC_THUMB_PCREL_BRANCH23: howto manager. * BFD_RELOC_THUMB_PCREL_BRANCH9: howto manager. * BFD_RELOC_TIC30_LDP: howto manager. +* BFD_RELOC_TIC54X_16_OF_23: howto manager. +* BFD_RELOC_TIC54X_23: howto manager. +* BFD_RELOC_TIC54X_MS7_OF_23: howto manager. +* BFD_RELOC_TIC54X_PARTLS7: howto manager. +* BFD_RELOC_TIC54X_PARTMS9: howto manager. * bfd_reloc_type_lookup: howto manager. * BFD_RELOC_V850_22_PCREL: howto manager. * BFD_RELOC_V850_9_PCREL: howto manager. @@ -454,6 +568,14 @@ Index * BFD_RELOC_V850_ZDA_16_16_SPLIT_OFFSET: howto manager. * BFD_RELOC_VTABLE_ENTRY: howto manager. * BFD_RELOC_VTABLE_INHERIT: howto manager. +* BFD_RELOC_X86_64_32S: howto manager. +* BFD_RELOC_X86_64_COPY: howto manager. +* BFD_RELOC_X86_64_GLOB_DAT: howto manager. +* BFD_RELOC_X86_64_GOT32: howto manager. +* BFD_RELOC_X86_64_GOTPCREL: howto manager. +* BFD_RELOC_X86_64_JUMP_SLOT: howto manager. +* BFD_RELOC_X86_64_PLT32: howto manager. +* BFD_RELOC_X86_64_RELATIVE: howto manager. * bfd_scan_arch: Architectures. * bfd_scan_vma: BFD front end. * bfd_seach_for_target: bfd_target. @@ -478,6 +600,7 @@ Index * bfd_write_bigendian_4byte_int: Internal. * coff_symbol_type: coff. * core_file_matches_executable_p: Core Files. +* GNU Free Documentation License: GNU Free Documentation License. * Hash tables: Hash Tables. * internal object-file format: Canonical format. * Linker: Linker Functions. diff --git a/gnu/dist/toolchain/bfd/doc/bfd.texinfo b/gnu/dist/toolchain/bfd/doc/bfd.texinfo index a302bcf82991..9803371453ea 100644 --- a/gnu/dist/toolchain/bfd/doc/bfd.texinfo +++ b/gnu/dist/toolchain/bfd/doc/bfd.texinfo @@ -1,6 +1,6 @@ \input texinfo.tex @setfilename bfd.info -@c $Id: bfd.texinfo,v 1.1.1.1 1999/05/03 07:28:58 rth Exp $ +@c $Id: bfd.texinfo,v 1.2 2000/11/15 18:24:49 nickc Exp $ @tex % NOTE LOCAL KLUGE TO AVOID TOO MUCH WHITESPACE \global\long\def\example{% @@ -28,11 +28,14 @@ END-INFO-DIR-ENTRY @ifinfo This file documents the BFD library. -Copyright (C) 1991 Free Software Foundation, Inc. +Copyright (C) 1991, 2000 Free Software Foundation, Inc. -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. + 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". @ignore Permission is granted to process this file through Tex and print the @@ -41,14 +44,6 @@ notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, subject to the terms -of the GNU General Public License, which includes the provision that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions. @end ifinfo @iftex @c@finalout @@ -67,7 +62,7 @@ into another language, under the above conditions for modified versions. @tex \def\$#1${{#1}} % Kluge: collect RCS revision info without $...$ -\xdef\manvers{\$Revision: 1.1.1.1 $} % For use in headers, footers too +\xdef\manvers{\$Revision: 1.2 $} % For use in headers, footers too {\parskip=0pt \hfill Cygnus Support\par \hfill sac\@cygnus.com\par @@ -80,18 +75,13 @@ into another language, under the above conditions for modified versions. @vskip 0pt plus 1filll Copyright @copyright{} 1991 Free Software Foundation, Inc. -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. + 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 and distribute modified versions of this -manual under the conditions for verbatim copying, subject to the terms -of the GNU General Public License, which includes the provision that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions. @end titlepage @end iftex @@ -104,6 +94,7 @@ This file documents the binary file descriptor library libbfd. * Overview:: Overview of BFD * BFD front end:: BFD front end * BFD back ends:: BFD back ends +* GNU Free Documentation License:: GNU Free Documentation License * Index:: Index @end menu @@ -298,7 +289,7 @@ structures. @node Hash Tables, , Linker Functions, BFD front end @include hash.texi -@node BFD back ends, Index, BFD front end, Top +@node BFD back ends, GNU Free Documentation License, BFD front end, Top @chapter BFD back ends @menu * What to Put Where:: @@ -325,7 +316,371 @@ All of BFD lives in one directory. @c Leave this out until the file has some actual contents... @c @include elfcode.texi -@node Index, , BFD back ends , Top +@node GNU Free Documentation License, Index, BFD back ends, Top +@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, , GNU Free Documentation License , Top @unnumbered Index @printindex cp diff --git a/gnu/dist/toolchain/bfd/doc/bfdint.texi b/gnu/dist/toolchain/bfd/doc/bfdint.texi index 39eaacfeaec1..b0a01829fc58 100644 --- a/gnu/dist/toolchain/bfd/doc/bfdint.texi +++ b/gnu/dist/toolchain/bfd/doc/bfdint.texi @@ -18,8 +18,7 @@ This document describes some BFD internal information which may be helpful when working on BFD. It is very incomplete. -This document is not updated regularly, and may be out of date. It was -last modified on $Date: 2000/04/30 15:07:52 $. +This document is not updated regularly, and may be out of date. The initial version of this document was written by Ian Lance Taylor @email{ian@@cygnus.com}. @@ -1607,6 +1606,10 @@ it should use the @samp{START_RELOC_NUMBERS}, @samp{RELOC_NUMBER}, macros to create a table mapping the number used to indentify a relocation to a name describing that relocation. +While not a BFD component, you probably also want to make the binutils +program @samp{readelf} parse your ELF objects. For this, you need to add +code for @code{EM_@var{cpu}} as appropriate in @file{binutils/readelf.c}. + @node BFD ELF processor linker @subsubsection Processor specific linker support diff --git a/gnu/dist/toolchain/bfd/doc/bfdt.texi b/gnu/dist/toolchain/bfd/doc/bfdt.texi index 98269fb6c6a3..b9e6fb79bfe9 100644 --- a/gnu/dist/toolchain/bfd/doc/bfdt.texi +++ b/gnu/dist/toolchain/bfd/doc/bfdt.texi @@ -10,10 +10,10 @@ to the rest of the data. @example -struct _bfd +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; @@ -46,7 +46,7 @@ struct _bfd /* When a file is closed by the caching routines, BFD retains state information on the file here: */ - file_ptr where; + file_ptr where; /* and here: (``once'' means at least once) */ @@ -59,7 +59,7 @@ struct _bfd /* File modified time, if mtime_set is true: */ - long mtime; + long mtime; /* Reserved for an unimplemented file locking extension.*/ @@ -78,13 +78,13 @@ struct _bfd /* Format_specific flags*/ - flagword flags; + flagword flags; /* Currently my_archive is tested before adding origin to anything. I believe that this can become always an add of origin, with origin set to 0 for non archive files. */ - file_ptr origin; + file_ptr origin; /* Remember when output has begun, to stop strange things from happening. */ @@ -96,7 +96,7 @@ struct _bfd /* The number of sections */ unsigned int section_count; - /* Stuff only useful for object files: + /* Stuff only useful for object files: The start address. */ bfd_vma start_address; @@ -104,17 +104,17 @@ struct _bfd unsigned int symcount; /* Symbol table for output BFD (with symcount entries) */ - struct symbol_cache_entry **outsymbols; + struct symbol_cache_entry **outsymbols; /* Pointer to structure which contains architecture information*/ const struct bfd_arch_info *arch_info; /* Stuff only useful for archives:*/ - PTR arelt_data; + PTR arelt_data; struct _bfd *my_archive; /* The containing archive BFD. */ struct _bfd *next; /* The next BFD in the archive. */ struct _bfd *archive_head; /* The first BFD in the archive. */ - boolean has_armap; + boolean has_armap; /* A chain of BFD structures involved in a link. */ struct _bfd *link_next; @@ -125,7 +125,7 @@ struct _bfd /* Used by the back end to hold private data. */ - union + union @{ struct aout_data_struct *aout_data; struct artdata *aout_ar_data; @@ -157,7 +157,7 @@ struct _bfd struct netbsd_core_struct *netbsd_core_data; PTR any; @} tdata; - + /* Used by the application to hold private data*/ PTR usrdata; @@ -366,6 +366,39 @@ type of file. E.g., an attempt was made to set the @code{D_PAGED} bit on a BFD format which does not support demand paging. @end itemize +@findex bfd_get_arch_size +@subsubsection @code{bfd_get_arch_size} +@strong{Synopsis} +@example +int bfd_get_arch_size (bfd *abfd); +@end example +@strong{Description}@* +Returns the architecture address size, in bits, as determined +by the object file's format. For ELF, this information is +included in the header. + +@strong{Returns}@* +Returns the arch size in bits if known, @code{-1} otherwise. + +@findex bfd_get_sign_extend_vma +@subsubsection @code{bfd_get_sign_extend_vma} +@strong{Synopsis} +@example +int bfd_get_sign_extend_vma (bfd *abfd); +@end example +@strong{Description}@* +Indicates if the target architecture "naturally" sign extends +an address. Some architectures implicitly sign extend address +values when they are converted to types larger than the size +of an address. For instance, bfd_get_start_address() will +return an address sign extended to fill a bfd_vma when this is +the case. + +@strong{Returns}@* +Returns @code{1} if the target architecture is known to sign +extend addresses, @code{0} if the target architecture is known to +not sign extend addresses, and @code{-1} otherwise. + @findex bfd_set_start_address @subsubsection @code{bfd_set_start_address} @strong{Synopsis} @@ -407,7 +440,7 @@ it so that such results were guaranteed. Instead, we want to ask questions like "is this NNN byte sized object I'm about to try read from file offset YYY reasonable?" As as example of where we might do this, some object formats -use string tables for which the first @code{sizeof(long)} bytes of the +use string tables for which the first @code{sizeof (long)} bytes of the table contain the size of the table itself, including the size bytes. If an application tries to read what it thinks is one of these string tables, without some way to validate the size, and for @@ -466,7 +499,7 @@ Overflow is not detected. boolean bfd_copy_private_bfd_data(bfd *ibfd, bfd *obfd); @end example @strong{Description}@* -Copy private BFD information from the BFD @var{ibfd} to the +Copy private BFD information from the BFD @var{ibfd} to the the BFD @var{obfd}. Return @code{true} on success, @code{false} on error. Possible error returns are: @@ -489,7 +522,7 @@ Not enough memory exists to create private data for @var{obfd}. boolean bfd_merge_private_bfd_data(bfd *ibfd, bfd *obfd); @end example @strong{Description}@* -Merge private BFD information from the BFD @var{ibfd} to the +Merge private BFD information from the BFD @var{ibfd} to the the output file BFD @var{obfd} when linking. Return @code{true} on success, @code{false} on error. Possible error returns are: @@ -539,7 +572,7 @@ Stuff which should be documented: #define bfd_find_nearest_line(abfd, sec, syms, off, file, func, line) \ BFD_SEND (abfd, _bfd_find_nearest_line, (abfd, sec, syms, off, file, func, line)) - /* Do these three do anything useful at all, for any back end? */ + /* Do these three do anything useful at all, for any back end? */ #define bfd_debug_info_start(abfd) \ BFD_SEND (abfd, _bfd_debug_info_start, (abfd)) diff --git a/gnu/dist/toolchain/bfd/doc/cache.texi b/gnu/dist/toolchain/bfd/doc/cache.texi index 4aafb69ca7a5..56d1f185c9f0 100644 --- a/gnu/dist/toolchain/bfd/doc/cache.texi +++ b/gnu/dist/toolchain/bfd/doc/cache.texi @@ -40,7 +40,7 @@ otherwise, it has to perform the complicated lookup function. @example #define bfd_cache_lookup(x) \ ((x)==bfd_last_cache? \ - (FILE*)(bfd_last_cache->iostream): \ + (FILE*) (bfd_last_cache->iostream): \ bfd_cache_lookup_worker(x)) @end example diff --git a/gnu/dist/toolchain/bfd/doc/chew.c b/gnu/dist/toolchain/bfd/doc/chew.c index eba69c2bb1d0..7b98ccfc87fa 100644 --- a/gnu/dist/toolchain/bfd/doc/chew.c +++ b/gnu/dist/toolchain/bfd/doc/chew.c @@ -1,5 +1,5 @@ /* chew - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1998 + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1998, 2000, 2001 Free Software Foundation, Inc. Contributed by steve chamberlain @cygnus @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* Yet another way of extracting documentation from source. No, I haven't finished it yet, but I hope you people like it better than the old way - + sac Basically, this is a sort of string forth, maybe we should call it @@ -81,7 +81,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Foo. */ - #include #include "sysdep.h" #include @@ -96,16 +95,15 @@ int internal_mode; int warning; -/* Here is a string type ... */ +/* Here is a string type ... */ -typedef struct buffer +typedef struct buffer { char *ptr; unsigned long write_idx; unsigned long size; } string_type; - #ifdef __STDC__ static void init_string_with_size (string_type *, unsigned int); static void init_string (string_type *); @@ -121,100 +119,104 @@ static void cattext (string_type *, char *); static void catstr (string_type *, string_type *); #endif - -static void DEFUN(init_string_with_size,(buffer, size), - string_type *buffer AND - unsigned int size ) +static void +init_string_with_size (buffer, size) + string_type *buffer; + unsigned int size; { - buffer->write_idx = 0; - buffer->size = size; - buffer->ptr = malloc(size); + buffer->write_idx = 0; + buffer->size = size; + buffer->ptr = malloc (size); } -static void DEFUN(init_string,(buffer), - string_type *buffer) +static void +init_string (buffer) + string_type *buffer; { - init_string_with_size(buffer, DEF_SIZE); - + init_string_with_size (buffer, DEF_SIZE); } -static int DEFUN(find, (str, what), - string_type *str AND - char *what) +static int +find (str, what) + string_type *str; + char *what; { - unsigned int i; - char *p; - p = what; - for (i = 0; i < str->write_idx && *p; i++) + unsigned int i; + char *p; + p = what; + for (i = 0; i < str->write_idx && *p; i++) { - if (*p == str->ptr[i]) - p++; - else - p = what; + if (*p == str->ptr[i]) + p++; + else + p = what; } - return (*p == 0); - + return (*p == 0); } -static void DEFUN(write_buffer,(buffer, f), - string_type *buffer AND - FILE *f) +static void +write_buffer (buffer, f) + string_type *buffer; + FILE *f; { - fwrite(buffer->ptr, buffer->write_idx, 1, f); + fwrite (buffer->ptr, buffer->write_idx, 1, f); } - -static void DEFUN(delete_string,(buffer), - string_type *buffer) +static void +delete_string (buffer) + string_type *buffer; { - free(buffer->ptr); + free (buffer->ptr); } - -static char *DEFUN(addr, (buffer, idx), - string_type *buffer AND - unsigned int idx) +static char * +addr (buffer, idx) + string_type *buffer; + unsigned int idx; { - return buffer->ptr + idx; + return buffer->ptr + idx; } -static char DEFUN(at,(buffer, pos), - string_type *buffer AND - unsigned int pos) +static char +at (buffer, pos) + string_type *buffer; + unsigned int pos; { - if (pos >= buffer->write_idx) + if (pos >= buffer->write_idx) return 0; return buffer->ptr[pos]; } -static void DEFUN(catchar,(buffer, ch), - string_type *buffer AND - int ch) +static void +catchar (buffer, ch) + string_type *buffer; + int ch; { - if (buffer->write_idx == buffer->size) + if (buffer->write_idx == buffer->size) { - buffer->size *=2; - buffer->ptr = realloc(buffer->ptr, buffer->size); + buffer->size *= 2; + buffer->ptr = realloc (buffer->ptr, buffer->size); } - buffer->ptr[buffer->write_idx ++ ] = ch; + buffer->ptr[buffer->write_idx++] = ch; } - -static void DEFUN(overwrite_string,(dst, src), - string_type *dst AND - string_type *src) +static void +overwrite_string (dst, src) + string_type *dst; + string_type *src; { - free(dst->ptr); - dst->size = src->size; - dst->write_idx = src->write_idx; - dst->ptr = src->ptr; + free (dst->ptr); + dst->size = src->size; + dst->write_idx = src->write_idx; + dst->ptr = src->ptr; } -static void DEFUN(catbuf,(buffer, buf, len), - string_type *buffer AND - char *buf AND - unsigned int len) +static void +catbuf (buffer, buf, len) + string_type *buffer; + char *buf; + unsigned int len; { if (buffer->write_idx + len >= buffer->size) { @@ -226,41 +228,41 @@ static void DEFUN(catbuf,(buffer, buf, len), buffer->write_idx += len; } -static void DEFUN(cattext,(buffer, string), - string_type *buffer AND - char *string) +static void +cattext (buffer, string) + string_type *buffer; + char *string; { catbuf (buffer, string, (unsigned int) strlen (string)); } -static void DEFUN(catstr,(dst, src), - string_type *dst AND - string_type *src) +static void +catstr (dst, src) + string_type *dst; + string_type *src; { catbuf (dst, src->ptr, src->write_idx); } - -static unsigned int -DEFUN(skip_white_and_stars,(src, idx), - string_type *src AND - unsigned int idx) +static unsigned int +skip_white_and_stars (src, idx) + string_type *src; + unsigned int idx; { char c; - while ((c = at(src,idx)), + while ((c = at (src, idx)), isspace ((unsigned char) c) || (c == '*' /* Don't skip past end-of-comment or star as first character on its line. */ - && at(src,idx +1) != '/' - && at(src,idx -1) != '\n')) + && at (src, idx +1) != '/' + && at (src, idx -1) != '\n')) idx++; return idx; } /***********************************************************************/ - string_type stack[STACK]; string_type *tos; @@ -275,19 +277,18 @@ long *isp = &istack[0]; typedef int *word_type; - - struct dict_struct { - char *word; - struct dict_struct *next; - stinst_type *code; - int code_length; - int code_end; - int var; - + char *word; + struct dict_struct *next; + stinst_type *code; + int code_length; + int code_end; + int var; }; + typedef struct dict_struct dict_type; + #define WORD(x) static void x() static void @@ -352,27 +353,28 @@ static void usage (void); static void chew_exit (void); #endif -static void DEFUN(exec,(word), - dict_type *word) +static void +exec (word) + dict_type *word; { pc = word->code; - while (*pc) - (*pc)(); -} -WORD(call) -{ - stinst_type *oldpc = pc; - dict_type *e; - e = (dict_type *)(pc [1]); - exec(e); - pc = oldpc + 2; - + while (*pc) + (*pc) (); } -WORD(remchar) +WORD (call) +{ + stinst_type *oldpc = pc; + dict_type *e; + e = (dict_type *) (pc[1]); + exec (e); + pc = oldpc + 2; +} + +WORD (remchar) { if (tos->write_idx) - tos->write_idx--; + tos->write_idx--; pc++; } @@ -386,81 +388,80 @@ strip_trailing_newlines () pc++; } -WORD(push_number) +WORD (push_number) { - isp++; - icheck_range (); - pc++; - *isp = (long)(*pc); - pc++; + isp++; + icheck_range (); + pc++; + *isp = (long) (*pc); + pc++; } -WORD(push_text) +WORD (push_text) { - tos++; - check_range (); - init_string(tos); - pc++; - cattext(tos,*((char **)pc)); - pc++; - + tos++; + check_range (); + init_string (tos); + pc++; + cattext (tos, *((char **) pc)); + pc++; } - /* This function removes everything not inside comments starting on the first char of the line from the string, also when copying comments, removes blank space and leading *'s. Blank lines are turned into one blank line. */ -static void -DEFUN(remove_noncomments,(src,dst), - string_type *src AND - string_type *dst) +static void +remove_noncomments (src, dst) + string_type *src; + string_type *dst; { - unsigned int idx = 0; - - while (at(src,idx)) - { - /* Now see if we have a comment at the start of the line */ - if (at(src,idx) == '\n' - && at(src,idx+1) == '/' - && at(src,idx+2) == '*') - { - idx+=3; - - idx = skip_white_and_stars(src,idx); + unsigned int idx = 0; - /* Remove leading dot */ - if (at(src, idx) == '.') - idx++; - - /* Copy to the end of the line, or till the end of the - comment */ - while (at(src, idx)) + while (at (src, idx)) + { + /* Now see if we have a comment at the start of the line. */ + if (at (src, idx) == '\n' + && at (src, idx + 1) == '/' + && at (src, idx + 2) == '*') + { + idx += 3; + + idx = skip_white_and_stars (src, idx); + + /* Remove leading dot */ + if (at (src, idx) == '.') + idx++; + + /* Copy to the end of the line, or till the end of the + comment. */ + while (at (src, idx)) { - if (at(src, idx) == '\n') + if (at (src, idx) == '\n') { - /* end of line, echo and scrape of leading blanks */ - if (at(src,idx +1) == '\n') - catchar(dst,'\n'); - catchar(dst,'\n'); - idx++; - idx = skip_white_and_stars(src, idx); + /* end of line, echo and scrape of leading blanks */ + if (at (src, idx + 1) == '\n') + catchar (dst, '\n'); + catchar (dst, '\n'); + idx++; + idx = skip_white_and_stars (src, idx); } - else if (at(src, idx) == '*' && at(src,idx+1) == '/') + else if (at (src, idx) == '*' && at (src, idx + 1) == '/') { - idx +=2 ; - cattext(dst,"\nENDDD\n"); - break; + idx += 2; + cattext (dst, "\nENDDD\n"); + break; } - else + else { - catchar(dst, at(src, idx)); - idx++; + catchar (dst, at (src, idx)); + idx++; } } } - else idx++; + else + idx++; } } @@ -481,98 +482,103 @@ print_stack_level () */ static void -DEFUN_VOID(paramstuff) +paramstuff (void) { - unsigned int openp; - unsigned int fname; - unsigned int idx; - string_type out; - init_string(&out); - + unsigned int openp; + unsigned int fname; + unsigned int idx; + unsigned int len; + string_type out; + init_string (&out); - /* make sure that it's not already param'd or proto'd */ - if(find(tos,"PARAMS") || find(tos,"PROTO") || !find(tos,"(")) { - catstr(&out,tos); - } - else + /* Make sure that it's not already param'd or proto'd. */ + if (find (tos, "PARAMS") || find (tos, "PROTO") || !find (tos, "(")) { - /* Find the open paren */ - for (openp = 0; at(tos, openp) != '(' && at(tos,openp); openp++) - ; - - fname = openp; - /* Step back to the fname */ - fname--; - while (fname && isspace((unsigned char) at(tos, fname))) - fname --; - while (fname - && !isspace((unsigned char) at(tos,fname)) - && at(tos,fname) != '*') - fname--; - - fname++; - - for (idx = 0; idx < fname; idx++) /* Output type */ - { - catchar(&out, at(tos,idx)); - } - - cattext(&out, "\n"); /* Insert a newline between type and fnname */ - - for (idx = fname; idx < openp; idx++) /* Output fnname */ - { - catchar(&out, at(tos,idx)); - } - - cattext(&out," PARAMS ("); - - while (at(tos,idx) && at(tos,idx) !=';') - { - catchar(&out, at(tos, idx)); - idx++; - } - cattext(&out,");\n\n"); + catstr (&out, tos); } - overwrite_string(tos, &out); - pc++; - + else + { + /* Find the open paren. */ + for (openp = 0; at (tos, openp) != '(' && at (tos, openp); openp++) + ; + + fname = openp; + /* Step back to the fname. */ + fname--; + while (fname && isspace ((unsigned char) at (tos, fname))) + fname--; + while (fname + && !isspace ((unsigned char) at (tos,fname)) + && at (tos,fname) != '*') + fname--; + + fname++; + + /* Output type, omitting trailing whitespace character(s), if + any. */ + for (len = fname; 0 < len; len--) + { + if (!isspace ((unsigned char) at (tos, len - 1))) + break; + } + for (idx = 0; idx < len; idx++) + catchar (&out, at (tos, idx)); + + cattext (&out, "\n"); /* Insert a newline between type and fnname */ + + /* Output function name, omitting trailing whitespace + character(s), if any. */ + for (len = openp; 0 < len; len--) + { + if (!isspace ((unsigned char) at (tos, len - 1))) + break; + } + for (idx = fname; idx < len; idx++) + catchar (&out, at (tos, idx)); + + cattext (&out, " PARAMS ("); + + for (idx = openp; at (tos, idx) && at (tos, idx) != ';'; idx++) + catchar (&out, at (tos, idx)); + + cattext (&out, ");\n\n"); + } + overwrite_string (tos, &out); + pc++; + } - - /* turn {* and *} into comments */ -WORD(translatecomments) +WORD (translatecomments) { - unsigned int idx = 0; - string_type out; - init_string(&out); - - while (at(tos, idx)) + unsigned int idx = 0; + string_type out; + init_string (&out); + + while (at (tos, idx)) { - if (at(tos,idx) == '{' && at(tos,idx+1) =='*') + if (at (tos, idx) == '{' && at (tos, idx + 1) == '*') { - cattext(&out,"/*"); - idx+=2; + cattext (&out, "/*"); + idx += 2; } - else if (at(tos,idx) == '*' && at(tos,idx+1) =='}') + else if (at (tos, idx) == '*' && at (tos, idx + 1) == '}') { - cattext(&out,"*/"); - idx+=2; + cattext (&out, "*/"); + idx += 2; } - else + else { - catchar(&out, at(tos, idx)); - idx++; + catchar (&out, at (tos, idx)); + idx++; } } + overwrite_string (tos, &out); - overwrite_string(tos, &out); - - pc++; - + pc++; } #if 0 @@ -581,843 +587,822 @@ WORD(translatecomments) /* turn everything not starting with a . into a comment */ -WORD(manglecomments) +WORD (manglecomments) { - unsigned int idx = 0; - string_type out; - init_string(&out); - - while (at(tos, idx)) + unsigned int idx = 0; + string_type out; + init_string (&out); + + while (at (tos, idx)) { - if (at(tos,idx) == '\n' && at(tos,idx+1) =='*') + if (at (tos, idx) == '\n' && at (tos, idx + 1) == '*') { - cattext(&out," /*"); - idx+=2; + cattext (&out, " /*"); + idx += 2; } - else if (at(tos,idx) == '*' && at(tos,idx+1) =='}') + else if (at (tos, idx) == '*' && at (tos, idx + 1) == '}') { - cattext(&out,"*/"); - idx+=2; + cattext (&out, "*/"); + idx += 2; } - else + else { - catchar(&out, at(tos, idx)); - idx++; + catchar (&out, at (tos, idx)); + idx++; } } + overwrite_string (tos, &out); - overwrite_string(tos, &out); - - pc++; - + pc++; } #endif /* Mod tos so that only lines with leading dots remain */ static void -DEFUN_VOID(outputdots) +outputdots (void) { - unsigned int idx = 0; - string_type out; - init_string(&out); - - while (at(tos, idx)) + unsigned int idx = 0; + string_type out; + init_string (&out); + + while (at (tos, idx)) { - if (at(tos, idx) == '\n' && at(tos, idx+1) == '.') + if (at (tos, idx) == '\n' && at (tos, idx + 1) == '.') { char c; idx += 2; - - while ((c = at(tos, idx)) && c != '\n') + + while ((c = at (tos, idx)) && c != '\n') { - if (c == '{' && at(tos,idx+1) =='*') + if (c == '{' && at (tos, idx + 1) == '*') { - cattext(&out," /*"); - idx+=2; + cattext (&out, "/*"); + idx += 2; } - else if (c == '*' && at(tos,idx+1) =='}') + else if (c == '*' && at (tos, idx + 1) == '}') { - cattext(&out,"*/"); - idx+=2; + cattext (&out, "*/"); + idx += 2; } else { - catchar(&out, c); - idx++; + catchar (&out, c); + idx++; } } - catchar(&out,'\n'); + catchar (&out, '\n'); } - else + else { - idx++; + idx++; } - } + } - overwrite_string(tos, &out); - pc++; - + overwrite_string (tos, &out); + pc++; } /* Find lines starting with . and | and put example around them on tos */ -WORD(courierize) +WORD (courierize) { - string_type out; - unsigned int idx = 0; - int command = 0; - - init_string(&out); - - while (at(tos, idx)) + string_type out; + unsigned int idx = 0; + int command = 0; + + init_string (&out); + + while (at (tos, idx)) { - if (at(tos, idx) == '\n' - && (at(tos, idx +1 ) == '.' - || at(tos,idx+1) == '|')) + if (at (tos, idx) == '\n' + && (at (tos, idx +1 ) == '.' + || at (tos, idx + 1) == '|')) { - cattext(&out,"\n@example\n"); - do + cattext (&out, "\n@example\n"); + do { - idx += 2; - - while (at(tos, idx) && at(tos, idx)!='\n') + idx += 2; + + while (at (tos, idx) && at (tos, idx) != '\n') { - if (at(tos,idx)=='{' && at(tos,idx+1) =='*') + if (at (tos, idx) == '{' && at (tos, idx + 1) == '*') { - cattext(&out," /*"); - idx+=2; + cattext (&out, "/*"); + idx += 2; } - else if (at(tos,idx)=='*' && at(tos,idx+1) =='}') + else if (at (tos, idx) == '*' && at (tos, idx + 1) == '}') { - cattext(&out,"*/"); - idx+=2; + cattext (&out, "*/"); + idx += 2; } - else if (at(tos,idx) == '{' && !command) + else if (at (tos, idx) == '{' && !command) { - cattext(&out,"@{"); - idx++; + cattext (&out, "@{"); + idx++; } - else if (at(tos,idx) == '}' && !command) + else if (at (tos, idx) == '}' && !command) { - cattext(&out,"@}"); - idx++; + cattext (&out, "@}"); + idx++; } - else + else { - if (at(tos,idx) == '@') - command = 1; - else if (isspace((unsigned char) at(tos,idx)) - || at(tos,idx) == '}') - command = 0; - catchar(&out, at(tos, idx)); - idx++; + if (at (tos, idx) == '@') + command = 1; + else if (isspace ((unsigned char) at (tos, idx)) + || at (tos, idx) == '}') + command = 0; + catchar (&out, at (tos, idx)); + idx++; } - + } - catchar(&out,'\n'); - } - while (at(tos, idx) == '\n' - && ((at(tos, idx+1) == '.') - || (at(tos,idx+1) == '|'))) - ; - cattext(&out,"@end example"); + catchar (&out, '\n'); + } + while (at (tos, idx) == '\n' + && ((at (tos, idx + 1) == '.') + || (at (tos, idx + 1) == '|'))) + ; + cattext (&out, "@end example"); } - else - { - catchar(&out, at(tos, idx)); - idx++; + else + { + catchar (&out, at (tos, idx)); + idx++; } - } + } - overwrite_string(tos, &out); - pc++; - - + overwrite_string (tos, &out); + pc++; } /* Finds any lines starting with "o ", if there are any, then turns on @itemize @bullet, and @items each of them. Then ends with @end itemize, inplace at TOS*/ - -WORD(bulletize) +WORD (bulletize) { - unsigned int idx = 0; - int on = 0; - string_type out; - init_string(&out); - - while (at(tos, idx)) { - if (at(tos, idx) == '@' && - at(tos, idx+1) == '*') - { - cattext(&out,"*"); - idx+=2; - } - - else - if (at(tos, idx) == '\n' && - at(tos, idx+1) == 'o' && - isspace((unsigned char) at(tos, idx +2))) - { - if (!on) - { - cattext(&out,"\n@itemize @bullet\n"); - on = 1; - - } - cattext(&out,"\n@item\n"); - idx+=3; - } - else - { - catchar(&out, at(tos, idx)); - if (on && at(tos, idx) == '\n' && - at(tos, idx+1) == '\n' && - at(tos, idx+2) != 'o') - { - cattext(&out, "@end itemize"); - on = 0; - } - idx++; - - } - } - if (on) - { - cattext(&out,"@end itemize\n"); - } + unsigned int idx = 0; + int on = 0; + string_type out; + init_string (&out); - delete_string(tos); - *tos = out; - pc++; - + while (at (tos, idx)) + { + if (at (tos, idx) == '@' + && at (tos, idx + 1) == '*') + { + cattext (&out, "*"); + idx += 2; + } + else if (at (tos, idx) == '\n' + && at (tos, idx + 1) == 'o' + && isspace ((unsigned char) at (tos, idx + 2))) + { + if (!on) + { + cattext (&out, "\n@itemize @bullet\n"); + on = 1; + + } + cattext (&out, "\n@item\n"); + idx += 3; + } + else + { + catchar (&out, at (tos, idx)); + if (on && at (tos, idx) == '\n' + && at (tos, idx + 1) == '\n' + && at (tos, idx + 2) != 'o') + { + cattext (&out, "@end itemize"); + on = 0; + } + idx++; + + } + } + if (on) + { + cattext (&out, "@end itemize\n"); + } + + delete_string (tos); + *tos = out; + pc++; } /* Turn <> into @code{foo} in place at TOS*/ - -WORD(do_fancy_stuff) +WORD (do_fancy_stuff) { - unsigned int idx = 0; - string_type out; - init_string(&out); - while (at(tos, idx)) + unsigned int idx = 0; + string_type out; + init_string (&out); + while (at (tos, idx)) { - if (at(tos, idx) == '<' - && at(tos, idx+1) == '<' - && !isspace((unsigned char) at(tos,idx + 2))) + if (at (tos, idx) == '<' + && at (tos, idx + 1) == '<' + && !isspace ((unsigned char) at (tos, idx + 2))) { - /* This qualifies as a << startup */ - idx +=2; - cattext(&out,"@code{"); - while(at(tos,idx) && - at(tos,idx) != '>' ) + /* This qualifies as a << startup. */ + idx += 2; + cattext (&out, "@code{"); + while (at (tos, idx) + && at (tos, idx) != '>' ) { - catchar(&out, at(tos, idx)); - idx++; - + catchar (&out, at (tos, idx)); + idx++; + } - cattext(&out,"}"); - idx+=2; + cattext (&out, "}"); + idx += 2; } - else + else { - catchar(&out, at(tos, idx)); - idx++; + catchar (&out, at (tos, idx)); + idx++; } } - delete_string(tos); - *tos = out; - pc++; - -} -/* A command is all upper case,and alone on a line */ -static int -DEFUN( iscommand,(ptr, idx), - string_type *ptr AND - unsigned int idx) -{ - unsigned int len = 0; - while (at(ptr,idx)) { - if (isupper((unsigned char) at(ptr,idx)) || at(ptr,idx) == ' ' || - at(ptr,idx) == '_') - { - len++; - idx++; - } - else if(at(ptr,idx) == '\n') - { - if (len > 3) return 1; - return 0; - } - else return 0; - } - return 0; + delete_string (tos); + *tos = out; + pc++; } +/* A command is all upper case,and alone on a line. */ static int -DEFUN(copy_past_newline,(ptr, idx, dst), - string_type *ptr AND - unsigned int idx AND - string_type *dst) +iscommand (ptr, idx) + string_type *ptr; + unsigned int idx; { - int column = 0; - - while (at(ptr, idx) && at(ptr, idx) != '\n') + unsigned int len = 0; + while (at (ptr, idx)) { - if (at (ptr, idx) == '\t') - { - /* Expand tabs. Neither makeinfo nor TeX can cope well with - them. */ - do - catchar (dst, ' '); - while (++column & 7); - } - else - { - catchar(dst, at(ptr, idx)); - column++; - } - idx++; - - } - catchar(dst, at(ptr, idx)); - idx++; - return idx; + if (isupper ((unsigned char) at (ptr, idx)) + || at (ptr, idx) == ' ' || at (ptr, idx) == '_') + { + len++; + idx++; + } + else if (at (ptr, idx) == '\n') + { + if (len > 3) + return 1; + return 0; + } + else + return 0; + } + return 0; +} + +static int +copy_past_newline (ptr, idx, dst) + string_type *ptr; + unsigned int idx; + string_type *dst; +{ + int column = 0; + + while (at (ptr, idx) && at (ptr, idx) != '\n') + { + if (at (ptr, idx) == '\t') + { + /* Expand tabs. Neither makeinfo nor TeX can cope well with + them. */ + do + catchar (dst, ' '); + while (++column & 7); + } + else + { + catchar (dst, at (ptr, idx)); + column++; + } + idx++; + + } + catchar (dst, at (ptr, idx)); + idx++; + return idx; } -WORD(icopy_past_newline) +WORD (icopy_past_newline) { - tos++; - check_range (); - init_string(tos); - idx = copy_past_newline(ptr, idx, tos); - pc++; + tos++; + check_range (); + init_string (tos); + idx = copy_past_newline (ptr, idx, tos); + pc++; } /* indent - Take the string at the top of the stack, do some prettying */ + Take the string at the top of the stack, do some prettying. */ - -WORD(kill_bogus_lines) +WORD (kill_bogus_lines) { - int sl ; - - int idx = 0; - int c; - int dot = 0 ; - - string_type out; - init_string(&out); - /* Drop leading nl */ - while (at(tos,idx) == '\n') - { - idx++; - } - c = idx; - - /* If the first char is a '.' prepend a newline so that it is - recognized properly later. */ - if (at (tos, idx) == '.') - catchar (&out, '\n'); + int sl; - /* Find the last char */ - while (at(tos,idx)) + int idx = 0; + int c; + int dot = 0; + + string_type out; + init_string (&out); + /* Drop leading nl. */ + while (at (tos, idx) == '\n') { - idx++; + idx++; } - - /* find the last non white before the nl */ + c = idx; + + /* If the first char is a '.' prepend a newline so that it is + recognized properly later. */ + if (at (tos, idx) == '.') + catchar (&out, '\n'); + + /* Find the last char. */ + while (at (tos, idx)) + { + idx++; + } + + /* Find the last non white before the nl. */ + idx--; + + while (idx && isspace ((unsigned char) at (tos, idx))) idx--; - - while (idx && isspace((unsigned char) at(tos,idx))) - idx--; - idx++; - - /* Copy buffer upto last char, but blank lines before and after - dots don't count */ - sl = 1; + idx++; - while (c < idx) + /* Copy buffer upto last char, but blank lines before and after + dots don't count. */ + sl = 1; + + while (c < idx) { - if (at(tos,c) == '\n' - && at(tos,c+1) == '\n' - && at(tos,c+2) == '.') + if (at (tos, c) == '\n' + && at (tos, c + 1) == '\n' + && at (tos, c + 2) == '.') { - /* Ignore two newlines before a dot*/ - c++; + /* Ignore two newlines before a dot. */ + c++; } - else if (at(tos,c) == '.' && sl) + else if (at (tos, c) == '.' && sl) { - /* remember that this line started with a dot */ - dot=2; + /* remember that this line started with a dot. */ + dot = 2; } - else if (at(tos,c) == '\n' - && at(tos,c+1) == '\n' - && dot) + else if (at (tos, c) == '\n' + && at (tos, c + 1) == '\n' + && dot) { - c++; - /* Ignore two newlines when last line was dot */ + c++; + /* Ignore two newlines when last line was dot. */ } - catchar(&out, at(tos,c)); - if (at(tos,c) == '\n') + catchar (&out, at (tos, c)); + if (at (tos, c) == '\n') { - sl = 1; - - if (dot == 2)dot=1;else dot = 0; + sl = 1; + + if (dot == 2) + dot = 1; + else + dot = 0; } - else - sl = 0; - - c++; + else + sl = 0; + + c++; } - - /* Append nl*/ - catchar(&out, '\n'); - pc++; - delete_string(tos); - *tos = out; - - + + /* Append nl. */ + catchar (&out, '\n'); + pc++; + delete_string (tos); + *tos = out; + } -WORD(indent) +WORD (indent) { - string_type out; - int tab = 0; - int idx = 0; - int ol =0; - init_string(&out); - while (at(tos,idx)) { - switch (at(tos,idx)) + string_type out; + int tab = 0; + int idx = 0; + int ol = 0; + init_string (&out); + while (at (tos, idx)) + { + switch (at (tos, idx)) + { + case '\n': + cattext (&out, "\n"); + idx++; + if (tab && at (tos, idx)) { - case '\n': - cattext(&out,"\n"); - idx++; - if (tab && at(tos,idx)) - { - cattext(&out," "); - } - ol = 0; - break; - case '(': - tab++; - if (ol == 0) - cattext(&out," "); - idx++; - cattext(&out,"("); - ol = 1; - break; - case ')': - tab--; - cattext(&out,")"); - idx++; - ol=1; - - break; - default: - catchar(&out,at(tos,idx)); - ol=1; - - idx++; - break; + cattext (&out, " "); } - } + ol = 0; + break; + case '(': + tab++; + if (ol == 0) + cattext (&out, " "); + idx++; + cattext (&out, "("); + ol = 1; + break; + case ')': + tab--; + cattext (&out, ")"); + idx++; + ol = 1; - pc++; - delete_string(tos); - *tos = out; + break; + default: + catchar (&out, at (tos, idx)); + ol = 1; -} - - -WORD(get_stuff_in_command) -{ - tos++; - check_range (); - init_string(tos); - - while (at(ptr, idx)) { - if (iscommand(ptr, idx)) break; - idx = copy_past_newline(ptr, idx, tos); + idx++; + break; } - pc++; + } + + pc++; + delete_string (tos); + *tos = out; + } -WORD(swap) +WORD (get_stuff_in_command) { - string_type t; - - t = tos[0]; - tos[0] = tos[-1]; - tos[-1] =t; - pc++; - + tos++; + check_range (); + init_string (tos); + + while (at (ptr, idx)) + { + if (iscommand (ptr, idx)) + break; + idx = copy_past_newline (ptr, idx, tos); + } + pc++; } -WORD(other_dup) +WORD (swap) { - tos++; - check_range (); - init_string(tos); - catstr(tos, tos-1); - pc++; + string_type t; + + t = tos[0]; + tos[0] = tos[-1]; + tos[-1] = t; + pc++; } -WORD(drop) +WORD (other_dup) +{ + tos++; + check_range (); + init_string (tos); + catstr (tos, tos - 1); + pc++; +} + +WORD (drop) { tos--; check_range (); pc++; } -WORD(idrop) +WORD (idrop) { isp--; icheck_range (); pc++; } -WORD(icatstr) +WORD (icatstr) { - tos--; - check_range (); - catstr(tos, tos+1); - delete_string(tos+1); - pc++; + tos--; + check_range (); + catstr (tos, tos + 1); + delete_string (tos + 1); + pc++; } -WORD(skip_past_newline) +WORD (skip_past_newline) { - while (at(ptr,idx) - && at(ptr,idx) != '\n') - idx++; + while (at (ptr, idx) + && at (ptr, idx) != '\n') idx++; - pc++; + idx++; + pc++; } - -WORD(internalmode) +WORD (internalmode) { - internal_mode = *(isp); - isp--; - icheck_range (); - pc++; -} - -WORD(maybecatstr) -{ - if (internal_wanted == internal_mode) - { - catstr(tos-1, tos); - } - delete_string(tos); - tos--; - check_range (); - pc++; -} - -char * -DEFUN(nextword,(string, word), - char *string AND - char **word) -{ - char *word_start; - int idx; - char *dst; - char *src; - - int length = 0; - - while (isspace((unsigned char) *string) || *string == '-') { - if (*string == '-') - { - while (*string && *string != '\n') - string++; - - } - else { - string++; - } - } - if (!*string) return 0; - - word_start = string; - if (*string == '"') - { - do - { - string++; - length++; - if (*string == '\\') - { - string += 2; - length += 2; - } - } - while (*string != '"'); - } - else - { - while (!isspace((unsigned char) *string)) - { - string++; - length++; - - } - } - - *word = malloc(length + 1); - - dst = *word; - src = word_start; - - - for (idx= 0; idx < length; idx++) - { - if (src[idx] == '\\') - switch (src[idx+1]) - { - case 'n': - *dst++ = '\n'; - idx++; - break; - case '"': - case '\\': - *dst++ = src[idx+1]; - idx++; - break; - default: - *dst++ = '\\'; - break; - } - else - *dst++ = src[idx]; - } - *dst++ = 0; - - - - - - if(*string) - return string + 1; - else - return 0; - -} -dict_type *root; -dict_type * -DEFUN(lookup_word,(word), - char *word) -{ - dict_type *ptr = root; - while (ptr) { - if (strcmp(ptr->word, word) == 0) return ptr; - ptr = ptr->next; - - } - if (warning) - fprintf(stderr,"Can't find %s\n",word); - return 0; - - -} - -static void DEFUN_VOID(perform) -{ - tos = stack; - - while (at(ptr, idx)) { - /* It's worth looking through the command list */ - if (iscommand(ptr, idx)) - { - char *next; - dict_type *word ; - - (void) nextword(addr(ptr, idx), &next); - - - word = lookup_word(next); - - - - - if (word) - { - exec(word); - } - else - { - if (warning) - fprintf(stderr,"warning, %s is not recognised\n", next); - skip_past_newline(); - } - - } - else skip_past_newline(); - - } -} - -dict_type * -DEFUN(newentry,(word), - char *word) -{ - dict_type *new = (dict_type *)malloc(sizeof(dict_type)); - new->word = word; - new->next = root; - root = new; - new->code = (stinst_type *)malloc(sizeof(stinst_type )); - new->code_length = 1; - new->code_end = 0; - return new; - -} - - -unsigned int -DEFUN(add_to_definition,(entry, word), - dict_type *entry AND - stinst_type word) -{ - if (entry->code_end == entry->code_length) - { - entry->code_length += 2; - entry->code = - (stinst_type *) realloc((char *)(entry->code), - entry->code_length *sizeof(word_type)); - } - entry->code[entry->code_end] = word; - -return entry->code_end++; -} - - - - - - - -void -DEFUN(add_intrinsic,(name, func), - char *name AND - void (*func)()) -{ - dict_type *new = newentry(name); - add_to_definition(new, func); - add_to_definition(new, 0); -} - -void -DEFUN(add_var,(name), - char *name) -{ - dict_type *new = newentry(name); - add_to_definition(new, push_number); - add_to_definition(new, (stinst_type)(&(new->var))); - add_to_definition(new,0); -} - - -void -DEFUN(compile, (string), - char *string) -{ - /* add words to the dictionary */ - char *word; - string = nextword(string, &word); - while (string && *string && word[0]) - { - if (strcmp(word,"var")==0) - { - string=nextword(string, &word); - - add_var(word); - string=nextword(string, &word); - } -else - - if (word[0] == ':') - { - dict_type *ptr; - /* Compile a word and add to dictionary */ - string = nextword(string, &word); - - ptr = newentry(word); - string = nextword(string, &word); - while (word[0] != ';' ) - { - switch (word[0]) - { - case '"': - /* got a string, embed magic push string - function */ - add_to_definition(ptr, push_text); - add_to_definition(ptr, (stinst_type)(word+1)); - break; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - /* Got a number, embedd the magic push number - function */ - add_to_definition(ptr, push_number); - add_to_definition(ptr, (stinst_type)atol(word)); - break; - default: - add_to_definition(ptr, call); - add_to_definition(ptr, (stinst_type)lookup_word(word)); - } - - string = nextword(string, &word); - } - add_to_definition(ptr,0); - string = nextword(string, &word); - } - else - { - fprintf(stderr,"syntax error at %s\n",string-1); - } - } - -} - - -static void DEFUN_VOID(bang) -{ - *(long *)((isp[0])) = isp[-1]; - isp-=2; + internal_mode = *(isp); + isp--; icheck_range (); pc++; } -WORD(atsign) +WORD (maybecatstr) { - isp[0] = *(long *)(isp[0]); - pc++; + if (internal_wanted == internal_mode) + { + catstr (tos - 1, tos); + } + delete_string (tos); + tos--; + check_range (); + pc++; } -WORD(hello) +char * +nextword (string, word) + char *string; + char **word; { - printf("hello\n"); - pc++; + char *word_start; + int idx; + char *dst; + char *src; + + int length = 0; + + while (isspace ((unsigned char) *string) || *string == '-') + { + if (*string == '-') + { + while (*string && *string != '\n') + string++; + + } + else + { + string++; + } + } + if (!*string) + return 0; + + word_start = string; + if (*string == '"') + { + do + { + string++; + length++; + if (*string == '\\') + { + string += 2; + length += 2; + } + } + while (*string != '"'); + } + else + { + while (!isspace ((unsigned char) *string)) + { + string++; + length++; + + } + } + + *word = malloc (length + 1); + + dst = *word; + src = word_start; + + for (idx = 0; idx < length; idx++) + { + if (src[idx] == '\\') + switch (src[idx + 1]) + { + case 'n': + *dst++ = '\n'; + idx++; + break; + case '"': + case '\\': + *dst++ = src[idx + 1]; + idx++; + break; + default: + *dst++ = '\\'; + break; + } + else + *dst++ = src[idx]; + } + *dst++ = 0; + + if (*string) + return string + 1; + else + return 0; } -WORD(stdout_) +dict_type *root; + +dict_type * +lookup_word (word) + char *word; +{ + dict_type *ptr = root; + while (ptr) + { + if (strcmp (ptr->word, word) == 0) + return ptr; + ptr = ptr->next; + } + if (warning) + fprintf (stderr, "Can't find %s\n", word); + return 0; +} + +static void +perform (void) +{ + tos = stack; + + while (at (ptr, idx)) + { + /* It's worth looking through the command list. */ + if (iscommand (ptr, idx)) + { + char *next; + dict_type *word; + + (void) nextword (addr (ptr, idx), &next); + + word = lookup_word (next); + + if (word) + { + exec (word); + } + else + { + if (warning) + fprintf (stderr, "warning, %s is not recognised\n", next); + skip_past_newline (); + } + + } + else + skip_past_newline (); + } +} + +dict_type * +newentry (word) + char *word; +{ + dict_type *new = (dict_type *) malloc (sizeof (dict_type)); + new->word = word; + new->next = root; + root = new; + new->code = (stinst_type *) malloc (sizeof (stinst_type)); + new->code_length = 1; + new->code_end = 0; + return new; +} + +unsigned int +add_to_definition (entry, word) + dict_type *entry; + stinst_type word; +{ + if (entry->code_end == entry->code_length) + { + entry->code_length += 2; + entry->code = + (stinst_type *) realloc ((char *) (entry->code), + entry->code_length * sizeof (word_type)); + } + entry->code[entry->code_end] = word; + + return entry->code_end++; +} + +void +add_intrinsic (name, func) + char *name; + void (*func) (); +{ + dict_type *new = newentry (name); + add_to_definition (new, func); + add_to_definition (new, 0); +} + +void +add_var (name) + char *name; +{ + dict_type *new = newentry (name); + add_to_definition (new, push_number); + add_to_definition (new, (stinst_type) (&(new->var))); + add_to_definition (new, 0); +} + +void +compile (string) + char *string; +{ + /* Add words to the dictionary. */ + char *word; + string = nextword (string, &word); + while (string && *string && word[0]) + { + if (strcmp (word, "var") == 0) + { + string = nextword (string, &word); + + add_var (word); + string = nextword (string, &word); + } + else if (word[0] == ':') + { + dict_type *ptr; + /* Compile a word and add to dictionary. */ + string = nextword (string, &word); + + ptr = newentry (word); + string = nextword (string, &word); + while (word[0] != ';') + { + switch (word[0]) + { + case '"': + /* got a string, embed magic push string + function */ + add_to_definition (ptr, push_text); + add_to_definition (ptr, (stinst_type) (word + 1)); + break; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + /* Got a number, embedd the magic push number + function */ + add_to_definition (ptr, push_number); + add_to_definition (ptr, (stinst_type) atol (word)); + break; + default: + add_to_definition (ptr, call); + add_to_definition (ptr, (stinst_type) lookup_word (word)); + } + + string = nextword (string, &word); + } + add_to_definition (ptr, 0); + string = nextword (string, &word); + } + else + { + fprintf (stderr, "syntax error at %s\n", string - 1); + } + } +} + +static void +bang (void) +{ + *(long *) ((isp[0])) = isp[-1]; + isp -= 2; + icheck_range (); + pc++; +} + +WORD (atsign) +{ + isp[0] = *(long *) (isp[0]); + pc++; +} + +WORD (hello) +{ + printf ("hello\n"); + pc++; +} + +WORD (stdout_) { isp++; icheck_range (); @@ -1425,7 +1410,7 @@ WORD(stdout_) pc++; } -WORD(stderr_) +WORD (stderr_) { isp++; icheck_range (); @@ -1433,7 +1418,7 @@ WORD(stderr_) pc++; } -WORD(print) +WORD (print) { if (*isp == 1) write_buffer (tos, stdout); @@ -1448,29 +1433,29 @@ WORD(print) pc++; } - -static void DEFUN(read_in, (str, file), - string_type *str AND - FILE *file) +static void +read_in (str, file) + string_type *str; + FILE *file; { - char buff[10000]; - unsigned int r; - do + char buff[10000]; + unsigned int r; + do { - r = fread(buff, 1, sizeof(buff), file); - catbuf(str, buff, r); + r = fread (buff, 1, sizeof (buff), file); + catbuf (str, buff, r); } - while (r); - buff[0] = 0; - - catbuf(str, buff,1); + while (r); + buff[0] = 0; + + catbuf (str, buff, 1); } - -static void DEFUN_VOID(usage) +static void +usage (void) { - fprintf(stderr,"usage: -[d|i|g] file\n"); - exit(33); + fprintf (stderr, "usage: -[d|i|g] file\n"); + exit (33); } /* There is no reliable way to declare exit. Sometimes it returns @@ -1484,95 +1469,98 @@ chew_exit () exit (0); } -int DEFUN(main,(ac,av), -int ac AND -char *av[]) +int +main (ac, av) + int ac; + char *av[]; { unsigned int i; string_type buffer; string_type pptr; - init_string(&buffer); - init_string(&pptr); - init_string(stack+0); - tos=stack+1; + init_string (&buffer); + init_string (&pptr); + init_string (stack + 0); + tos = stack + 1; ptr = &pptr; - - add_intrinsic("push_text", push_text); - add_intrinsic("!", bang); - add_intrinsic("@", atsign); - add_intrinsic("hello",hello); - add_intrinsic("stdout",stdout_); - add_intrinsic("stderr",stderr_); - add_intrinsic("print",print); - add_intrinsic("skip_past_newline", skip_past_newline ); - add_intrinsic("catstr", icatstr ); - add_intrinsic("copy_past_newline", icopy_past_newline ); - add_intrinsic("dup", other_dup ); - add_intrinsic("drop", drop); - add_intrinsic("idrop", idrop); - add_intrinsic("remchar", remchar ); - add_intrinsic("get_stuff_in_command", get_stuff_in_command ); - add_intrinsic("do_fancy_stuff", do_fancy_stuff ); - add_intrinsic("bulletize", bulletize ); - add_intrinsic("courierize", courierize ); + + add_intrinsic ("push_text", push_text); + add_intrinsic ("!", bang); + add_intrinsic ("@", atsign); + add_intrinsic ("hello", hello); + add_intrinsic ("stdout", stdout_); + add_intrinsic ("stderr", stderr_); + add_intrinsic ("print", print); + add_intrinsic ("skip_past_newline", skip_past_newline); + add_intrinsic ("catstr", icatstr); + add_intrinsic ("copy_past_newline", icopy_past_newline); + add_intrinsic ("dup", other_dup); + add_intrinsic ("drop", drop); + add_intrinsic ("idrop", idrop); + add_intrinsic ("remchar", remchar); + add_intrinsic ("get_stuff_in_command", get_stuff_in_command); + add_intrinsic ("do_fancy_stuff", do_fancy_stuff); + add_intrinsic ("bulletize", bulletize); + add_intrinsic ("courierize", courierize); /* If the following line gives an error, exit() is not declared in the ../hosts/foo.h file for this host. Fix it there, not here! */ /* No, don't fix it anywhere; see comment on chew_exit--Ian Taylor. */ - add_intrinsic("exit", chew_exit ); - add_intrinsic("swap", swap ); - add_intrinsic("outputdots", outputdots ); - add_intrinsic("paramstuff", paramstuff ); - add_intrinsic("maybecatstr", maybecatstr ); - add_intrinsic("translatecomments", translatecomments ); - add_intrinsic("kill_bogus_lines", kill_bogus_lines); - add_intrinsic("indent", indent); - add_intrinsic("internalmode", internalmode); - add_intrinsic("print_stack_level", print_stack_level); - add_intrinsic("strip_trailing_newlines", strip_trailing_newlines); - - /* Put a nl at the start */ - catchar(&buffer,'\n'); + add_intrinsic ("exit", chew_exit); + add_intrinsic ("swap", swap); + add_intrinsic ("outputdots", outputdots); + add_intrinsic ("paramstuff", paramstuff); + add_intrinsic ("maybecatstr", maybecatstr); + add_intrinsic ("translatecomments", translatecomments); + add_intrinsic ("kill_bogus_lines", kill_bogus_lines); + add_intrinsic ("indent", indent); + add_intrinsic ("internalmode", internalmode); + add_intrinsic ("print_stack_level", print_stack_level); + add_intrinsic ("strip_trailing_newlines", strip_trailing_newlines); - read_in(&buffer, stdin); - remove_noncomments(&buffer, ptr); - for (i= 1; i < (unsigned int) ac; i++) - { - if (av[i][0] == '-') + /* Put a nl at the start. */ + catchar (&buffer, '\n'); + + read_in (&buffer, stdin); + remove_noncomments (&buffer, ptr); + for (i = 1; i < (unsigned int) ac; i++) { - if (av[i][1] == 'f') - { - string_type b; - FILE *f; - init_string(&b); - - f = fopen(av[i+1],"r"); - if (!f) + if (av[i][0] == '-') { - fprintf(stderr,"Can't open the input file %s\n",av[i+1]); - return 33; - } + if (av[i][1] == 'f') + { + string_type b; + FILE *f; + init_string (&b); - read_in(&b, f); - compile(b.ptr); - perform(); - } - else if (av[i][1] == 'i') - { - internal_wanted = 1; - } - else if (av[i][1] == 'w') - { - warning = 1; - } - else - usage (); + f = fopen (av[i + 1], "r"); + if (!f) + { + fprintf (stderr, "Can't open the input file %s\n", + av[i + 1]); + return 33; + } + + read_in (&b, f); + compile (b.ptr); + perform (); + } + else if (av[i][1] == 'i') + { + internal_wanted = 1; + } + else if (av[i][1] == 'w') + { + warning = 1; + } + else + usage (); + } } - } - write_buffer(stack+0, stdout); + write_buffer (stack + 0, stdout); if (tos != stack) { - fprintf (stderr, "finishing with current stack level %d\n", tos - stack); + fprintf (stderr, "finishing with current stack level %d\n", + tos - stack); return 1; } return 0; diff --git a/gnu/dist/toolchain/bfd/doc/coffcode.texi b/gnu/dist/toolchain/bfd/doc/coffcode.texi index fcb7e757881a..8406a04f80ea 100644 --- a/gnu/dist/toolchain/bfd/doc/coffcode.texi +++ b/gnu/dist/toolchain/bfd/doc/coffcode.texi @@ -365,6 +365,8 @@ dependent COFF routines: 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, @@ -467,12 +469,12 @@ dependent COFF routines: struct bfd_link_info *info, bfd *abfd, const char *name, - flagword flags, + flagword flags, asection *section, bfd_vma value, const char *string, boolean copy, - boolean collect, + boolean collect, struct bfd_link_hash_entry **hashp)); boolean (*_bfd_coff_link_output_has_begun) PARAMS (( @@ -562,6 +564,12 @@ dependent COFF routines: #define 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) + +#define bfd_coff_debug_string_prefix_length(abfd)\ + (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)) diff --git a/gnu/dist/toolchain/bfd/doc/format.texi b/gnu/dist/toolchain/bfd/doc/format.texi index 3281c36eac8c..a181d1cd231a 100644 --- a/gnu/dist/toolchain/bfd/doc/format.texi +++ b/gnu/dist/toolchain/bfd/doc/format.texi @@ -1,6 +1,6 @@ @section File formats A format is a BFD concept of high level file contents type. The -formats supported by BFD are: +formats supported by BFD are: @itemize @bullet @@ -43,7 +43,7 @@ matches, it is used. If not, exactly one target must recognize the file, or an error results. The function returns @code{true} on success, otherwise @code{false} -with one of the following error codes: +with one of the following error codes: @itemize @bullet diff --git a/gnu/dist/toolchain/bfd/doc/hash.texi b/gnu/dist/toolchain/bfd/doc/hash.texi index 7ddc900cd2e5..eb87273eceb1 100644 --- a/gnu/dist/toolchain/bfd/doc/hash.texi +++ b/gnu/dist/toolchain/bfd/doc/hash.texi @@ -219,7 +219,7 @@ in a linker hash table entry: @code{type}, @code{written} and @node Write Other Derived Routines, , Write the Derived Creation Routine, Deriving a New Hash Table Type @subsubsection Write other derived routines You will want to write other routines for your new hash table, -as well. +as well. You will want an initialization routine which calls the initialization routine of the hash table you are deriving from diff --git a/gnu/dist/toolchain/bfd/doc/libbfd.texi b/gnu/dist/toolchain/bfd/doc/libbfd.texi index d202dc208dbb..b4b0a1470dc4 100644 --- a/gnu/dist/toolchain/bfd/doc/libbfd.texi +++ b/gnu/dist/toolchain/bfd/doc/libbfd.texi @@ -40,16 +40,16 @@ To detect calling these with less than a @code{bfd_vma}, use @code{gcc -Wconversion} on a host with 64 bit @code{bfd_vma}'s. @example - /* Byte swapping macros for user section data. */ +/* Byte swapping macros for user section data. */ #define bfd_put_8(abfd, val, ptr) \ - ((void) (*((unsigned char *)(ptr)) = (unsigned char)(val))) + ((void) (*((unsigned char *) (ptr)) = (unsigned char) (val))) #define bfd_put_signed_8 \ bfd_put_8 #define bfd_get_8(abfd, ptr) \ - (*(unsigned char *)(ptr)) + (*(unsigned char *) (ptr)) #define bfd_get_signed_8(abfd, ptr) \ - ((*(unsigned char *)(ptr) ^ 0x80) - 0x80) + ((*(unsigned char *) (ptr) ^ 0x80) - 0x80) #define bfd_put_16(abfd, val, ptr) \ BFD_SEND(abfd, bfd_putx16, ((val),(ptr))) @@ -104,7 +104,7 @@ some object files keep their header records in big endian order and their data in little endian order. @example - /* Byte swapping macros for file header data. */ +/* Byte swapping macros for file header data. */ #define bfd_h_put_8(abfd, val, ptr) \ bfd_put_8 (abfd, val, ptr) diff --git a/gnu/dist/toolchain/bfd/doc/linker.texi b/gnu/dist/toolchain/bfd/doc/linker.texi index b61815643f7c..5105cc77fb3e 100644 --- a/gnu/dist/toolchain/bfd/doc/linker.texi +++ b/gnu/dist/toolchain/bfd/doc/linker.texi @@ -30,7 +30,7 @@ ends which have implemented versions of these routines are a.out (in @code{aoutx.h}) and ECOFF (in @code{ecoff.c}). The a.out routines are used as examples throughout this section. -@menu +@menu * Creating a Linker Hash Table:: * Adding Symbols to the Hash Table:: * Performing the Final Link:: diff --git a/gnu/dist/toolchain/bfd/doc/reloc.texi b/gnu/dist/toolchain/bfd/doc/reloc.texi index 89811d811866..eb31eca1be89 100644 --- a/gnu/dist/toolchain/bfd/doc/reloc.texi +++ b/gnu/dist/toolchain/bfd/doc/reloc.texi @@ -764,6 +764,16 @@ MIPS ELF relocations. @deffnx {} BFD_RELOC_386_GOTPC i386/elf relocations @end deffn +@deffn {} BFD_RELOC_X86_64_GOT32 +@deffnx {} BFD_RELOC_X86_64_PLT32 +@deffnx {} BFD_RELOC_X86_64_COPY +@deffnx {} BFD_RELOC_X86_64_GLOB_DAT +@deffnx {} BFD_RELOC_X86_64_JUMP_SLOT +@deffnx {} BFD_RELOC_X86_64_RELATIVE +@deffnx {} BFD_RELOC_X86_64_GOTPCREL +@deffnx {} BFD_RELOC_X86_64_32S +x86-64/elf relocations +@end deffn @deffn {} BFD_RELOC_NS32K_IMM_8 @deffnx {} BFD_RELOC_NS32K_IMM_16 @deffnx {} BFD_RELOC_NS32K_IMM_32 @@ -830,6 +840,16 @@ It generally does map to one of the other relocation types. ARM 26 bit pc-relative branch. The lowest two bits must be zero and are not stored in the instruction. @end deffn +@deffn {} BFD_RELOC_ARM_PCREL_BLX +ARM 26 bit pc-relative branch. The lowest bit must be zero and is +not stored in the instruction. The 2nd lowest bit comes from a 1 bit +field in the instruction. +@end deffn +@deffn {} BFD_RELOC_THUMB_PCREL_BLX +Thumb 22 bit pc-relative branch. The lowest bit must be zero and is +not stored in the instruction. The 2nd lowest bit comes from a 1 bit +field in the instruction. +@end deffn @deffn {} BFD_RELOC_ARM_IMMEDIATE @deffnx {} BFD_RELOC_ARM_ADRL_IMMEDIATE @deffnx {} BFD_RELOC_ARM_OFFSET_IMM @@ -877,6 +897,13 @@ These relocs are only used within the ARM assembler. They are not @deffnx {} BFD_RELOC_SH_CODE @deffnx {} BFD_RELOC_SH_DATA @deffnx {} BFD_RELOC_SH_LABEL +@deffnx {} BFD_RELOC_SH_LOOP_START +@deffnx {} BFD_RELOC_SH_LOOP_END +@deffnx {} BFD_RELOC_SH_COPY +@deffnx {} BFD_RELOC_SH_GLOB_DAT +@deffnx {} BFD_RELOC_SH_JMP_SLOT +@deffnx {} BFD_RELOC_SH_RELATIVE +@deffnx {} BFD_RELOC_SH_GOTPC Hitachi SH relocs. Not all of these appear in object files. @end deffn @deffn {} BFD_RELOC_THUMB_PCREL_BRANCH9 @@ -886,7 +913,7 @@ Thumb 23-, 12- and 9-bit pc-relative branches. The lowest bit must be zero and is not stored in the instruction. @end deffn @deffn {} BFD_RELOC_ARC_B22_PCREL -Argonaut RISC Core (ARC) relocs. +ARC Cores relocs. ARC 22 bit pc-relative branch. The lowest two bits must be zero and are not stored in the instruction. The high 20 bits are installed in bits 26 through 7 of the instruction. @@ -1060,6 +1087,29 @@ This is a 8bit DP reloc for the tms320c30, where the most significant 8 bits of a 24 bit word are placed into the least significant 8 bits of the opcode. @end deffn +@deffn {} BFD_RELOC_TIC54X_PARTLS7 +This is a 7bit reloc for the tms320c54x, where the least +significant 7 bits of a 16 bit word are placed into the least +significant 7 bits of the opcode. +@end deffn +@deffn {} BFD_RELOC_TIC54X_PARTMS9 +This is a 9bit DP reloc for the tms320c54x, where the most +significant 9 bits of a 16 bit word are placed into the least +significant 9 bits of the opcode. +@end deffn +@deffn {} BFD_RELOC_TIC54X_23 +This is an extended address 23-bit reloc for the tms320c54x. +@end deffn +@deffn {} BFD_RELOC_TIC54X_16_OF_23 +This is a 16-bit reloc for the tms320c54x, where the least +significant 16 bits of a 23-bit extended address are placed into +the opcode. +@end deffn +@deffn {} BFD_RELOC_TIC54X_MS7_OF_23 +This is a reloc for the tms320c54x, where the most +significant 7 bits of a 23-bit extended address are placed into +the opcode. +@end deffn @deffn {} BFD_RELOC_FR30_48 This is a 48 bit reloc for the FR30 that stores 32 bits. @end deffn @@ -1187,6 +1237,126 @@ describes the entry that is being used. For Rela hosts, this offset is stored in the reloc's addend. For Rel hosts, we are forced to put this offset in the reloc's section offset. @end deffn +@deffn {} BFD_RELOC_IA64_IMM14 +@deffnx {} BFD_RELOC_IA64_IMM22 +@deffnx {} BFD_RELOC_IA64_IMM64 +@deffnx {} BFD_RELOC_IA64_DIR32MSB +@deffnx {} BFD_RELOC_IA64_DIR32LSB +@deffnx {} BFD_RELOC_IA64_DIR64MSB +@deffnx {} BFD_RELOC_IA64_DIR64LSB +@deffnx {} BFD_RELOC_IA64_GPREL22 +@deffnx {} BFD_RELOC_IA64_GPREL64I +@deffnx {} BFD_RELOC_IA64_GPREL32MSB +@deffnx {} BFD_RELOC_IA64_GPREL32LSB +@deffnx {} BFD_RELOC_IA64_GPREL64MSB +@deffnx {} BFD_RELOC_IA64_GPREL64LSB +@deffnx {} BFD_RELOC_IA64_LTOFF22 +@deffnx {} BFD_RELOC_IA64_LTOFF64I +@deffnx {} BFD_RELOC_IA64_PLTOFF22 +@deffnx {} BFD_RELOC_IA64_PLTOFF64I +@deffnx {} BFD_RELOC_IA64_PLTOFF64MSB +@deffnx {} BFD_RELOC_IA64_PLTOFF64LSB +@deffnx {} BFD_RELOC_IA64_FPTR64I +@deffnx {} BFD_RELOC_IA64_FPTR32MSB +@deffnx {} BFD_RELOC_IA64_FPTR32LSB +@deffnx {} BFD_RELOC_IA64_FPTR64MSB +@deffnx {} BFD_RELOC_IA64_FPTR64LSB +@deffnx {} BFD_RELOC_IA64_PCREL21B +@deffnx {} BFD_RELOC_IA64_PCREL21BI +@deffnx {} BFD_RELOC_IA64_PCREL21M +@deffnx {} BFD_RELOC_IA64_PCREL21F +@deffnx {} BFD_RELOC_IA64_PCREL22 +@deffnx {} BFD_RELOC_IA64_PCREL60B +@deffnx {} BFD_RELOC_IA64_PCREL64I +@deffnx {} BFD_RELOC_IA64_PCREL32MSB +@deffnx {} BFD_RELOC_IA64_PCREL32LSB +@deffnx {} BFD_RELOC_IA64_PCREL64MSB +@deffnx {} BFD_RELOC_IA64_PCREL64LSB +@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR22 +@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64I +@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64MSB +@deffnx {} BFD_RELOC_IA64_LTOFF_FPTR64LSB +@deffnx {} BFD_RELOC_IA64_SEGREL32MSB +@deffnx {} BFD_RELOC_IA64_SEGREL32LSB +@deffnx {} BFD_RELOC_IA64_SEGREL64MSB +@deffnx {} BFD_RELOC_IA64_SEGREL64LSB +@deffnx {} BFD_RELOC_IA64_SECREL32MSB +@deffnx {} BFD_RELOC_IA64_SECREL32LSB +@deffnx {} BFD_RELOC_IA64_SECREL64MSB +@deffnx {} BFD_RELOC_IA64_SECREL64LSB +@deffnx {} BFD_RELOC_IA64_REL32MSB +@deffnx {} BFD_RELOC_IA64_REL32LSB +@deffnx {} BFD_RELOC_IA64_REL64MSB +@deffnx {} BFD_RELOC_IA64_REL64LSB +@deffnx {} BFD_RELOC_IA64_LTV32MSB +@deffnx {} BFD_RELOC_IA64_LTV32LSB +@deffnx {} BFD_RELOC_IA64_LTV64MSB +@deffnx {} BFD_RELOC_IA64_LTV64LSB +@deffnx {} BFD_RELOC_IA64_IPLTMSB +@deffnx {} BFD_RELOC_IA64_IPLTLSB +@deffnx {} BFD_RELOC_IA64_COPY +@deffnx {} BFD_RELOC_IA64_TPREL22 +@deffnx {} BFD_RELOC_IA64_TPREL64MSB +@deffnx {} BFD_RELOC_IA64_TPREL64LSB +@deffnx {} BFD_RELOC_IA64_LTOFF_TP22 +@deffnx {} BFD_RELOC_IA64_LTOFF22X +@deffnx {} BFD_RELOC_IA64_LDXMOV +Intel IA64 Relocations. +@end deffn +@deffn {} BFD_RELOC_M68HC11_HI8 +Motorola 68HC11 reloc. +This is the 8 bits high part of an absolute address. +@end deffn +@deffn {} BFD_RELOC_M68HC11_LO8 +Motorola 68HC11 reloc. +This is the 8 bits low part of an absolute address. +@end deffn +@deffn {} BFD_RELOC_M68HC11_3B +Motorola 68HC11 reloc. +This is the 3 bits of a value. +@end deffn +@deffn {} BFD_RELOC_CRIS_BDISP8 +@deffnx {} BFD_RELOC_CRIS_UNSIGNED_5 +@deffnx {} BFD_RELOC_CRIS_SIGNED_6 +@deffnx {} BFD_RELOC_CRIS_UNSIGNED_6 +@deffnx {} BFD_RELOC_CRIS_UNSIGNED_4 +These relocs are only used within the CRIS assembler. They are not +(at present) written to any object files. +@end deffn +@deffn {} BFD_RELOC_860_COPY +@deffnx {} BFD_RELOC_860_GLOB_DAT +@deffnx {} BFD_RELOC_860_JUMP_SLOT +@deffnx {} BFD_RELOC_860_RELATIVE +@deffnx {} BFD_RELOC_860_PC26 +@deffnx {} BFD_RELOC_860_PLT26 +@deffnx {} BFD_RELOC_860_PC16 +@deffnx {} BFD_RELOC_860_LOW0 +@deffnx {} BFD_RELOC_860_SPLIT0 +@deffnx {} BFD_RELOC_860_LOW1 +@deffnx {} BFD_RELOC_860_SPLIT1 +@deffnx {} BFD_RELOC_860_LOW2 +@deffnx {} BFD_RELOC_860_SPLIT2 +@deffnx {} BFD_RELOC_860_LOW3 +@deffnx {} BFD_RELOC_860_LOGOT0 +@deffnx {} BFD_RELOC_860_SPGOT0 +@deffnx {} BFD_RELOC_860_LOGOT1 +@deffnx {} BFD_RELOC_860_SPGOT1 +@deffnx {} BFD_RELOC_860_LOGOTOFF0 +@deffnx {} BFD_RELOC_860_SPGOTOFF0 +@deffnx {} BFD_RELOC_860_LOGOTOFF1 +@deffnx {} BFD_RELOC_860_SPGOTOFF1 +@deffnx {} BFD_RELOC_860_LOGOTOFF2 +@deffnx {} BFD_RELOC_860_LOGOTOFF3 +@deffnx {} BFD_RELOC_860_LOPC +@deffnx {} BFD_RELOC_860_HIGHADJ +@deffnx {} BFD_RELOC_860_HAGOT +@deffnx {} BFD_RELOC_860_HAGOTOFF +@deffnx {} BFD_RELOC_860_HAPC +@deffnx {} BFD_RELOC_860_HIGH +@deffnx {} BFD_RELOC_860_HIGOT +@deffnx {} BFD_RELOC_860_HIGOTOFF +Intel i860 Relocations. +@end deffn @example diff --git a/gnu/dist/toolchain/bfd/doc/section.texi b/gnu/dist/toolchain/bfd/doc/section.texi index 256959005737..4b0ec017557e 100644 --- a/gnu/dist/toolchain/bfd/doc/section.texi +++ b/gnu/dist/toolchain/bfd/doc/section.texi @@ -107,10 +107,10 @@ Here is the section structure: @example - /* This structure is used for a comdat section, as in PE. A comdat - section is associated with a particular symbol. When the linker - sees a comdat section, it keeps only one of the sections with a - given name and associated with a given symbol. */ +/* This structure is used for a comdat section, as in PE. A comdat + section is associated with a particular symbol. When the linker + sees a comdat section, it keeps only one of the sections with a + given name and associated with a given symbol. */ struct bfd_comdat_info @{ @@ -122,340 +122,362 @@ struct bfd_comdat_info specific code; it is not an index into the list returned by bfd_canonicalize_symtab. */ long symbol; - - /* If this section is being discarded, the linker uses this field - to point to the input section which is being kept. */ - struct sec *sec; @}; typedef struct sec @{ - /* The name of the section; the name isn't a copy, the pointer is - the same as that passed to bfd_make_section. */ + /* The name of the section; the name isn't a copy, the pointer is + the same as that passed to bfd_make_section. */ - CONST char *name; + const char *name; - /* Which section is it; 0..nth. */ + /* A unique sequence number. */ - int index; + int id; - /* The next section in the list belonging to the BFD, or NULL. */ + /* Which section is it; 0..nth. */ - struct sec *next; + int index; - /* The field flags contains attributes of the section. Some - flags are read in from the object file, and some are - synthesized from other information. */ + /* The next section in the list belonging to the BFD, or NULL. */ - flagword flags; + struct sec *next; + + /* The field flags contains attributes of the section. Some + flags are read in from the object file, and some are + synthesized from other information. */ + + flagword flags; #define SEC_NO_FLAGS 0x000 - /* Tells the OS to allocate space for this section when loading. - This is clear for a section containing debug information - only. */ + /* Tells the OS to allocate space for this section when loading. + This is clear for a section containing debug information only. */ #define SEC_ALLOC 0x001 - /* Tells the OS to load the section from the file when loading. - This is clear for a .bss section. */ + /* Tells the OS to load the section from the file when loading. + This is clear for a .bss section. */ #define SEC_LOAD 0x002 - /* The section contains data still to be relocated, so there is - some relocation information too. */ + /* The section contains data still to be relocated, so there is + some relocation information too. */ #define SEC_RELOC 0x004 #if 0 /* Obsolete ? */ #define SEC_BALIGN 0x008 #endif - /* A signal to the OS that the section contains read only - data. */ + /* A signal to the OS that the section contains read only data. */ #define SEC_READONLY 0x010 - /* The section contains code only. */ + /* The section contains code only. */ #define SEC_CODE 0x020 - /* The section contains data only. */ + /* The section contains data only. */ #define SEC_DATA 0x040 - /* The section will reside in ROM. */ + /* The section will reside in ROM. */ #define SEC_ROM 0x080 - /* The section contains constructor information. This section - type is used by the linker to create lists of constructors and - destructors used by @code{g++}. When a back end sees a symbol - which should be used in a constructor list, it creates a new - section for the type of name (e.g., @code{__CTOR_LIST__}), attaches - the symbol to it, and builds a relocation. To build the lists - of constructors, all the linker has to do is catenate all the - sections called @code{__CTOR_LIST__} and relocate the data - contained within - exactly the operations it would peform on - standard data. */ + /* The section contains constructor information. This section + type is used by the linker to create lists of constructors and + destructors used by @code{g++}. When a back end sees a symbol + which should be used in a constructor list, it creates a new + section for the type of name (e.g., @code{__CTOR_LIST__}), attaches + the symbol to it, and builds a relocation. To build the lists + of constructors, all the linker has to do is catenate all the + sections called @code{__CTOR_LIST__} and relocate the data + contained within - exactly the operations it would peform on + standard data. */ #define SEC_CONSTRUCTOR 0x100 - /* The section is a constructor, and should be placed at the - end of the text, data, or bss section(?). */ + /* The section is a constructor, and should be placed at the + end of the text, data, or bss section(?). */ #define SEC_CONSTRUCTOR_TEXT 0x1100 #define SEC_CONSTRUCTOR_DATA 0x2100 #define SEC_CONSTRUCTOR_BSS 0x3100 - /* The section has contents - a data section could be - @code{SEC_ALLOC} | @code{SEC_HAS_CONTENTS}; a debug section could be - @code{SEC_HAS_CONTENTS} */ + /* The section has contents - a data section could be + @code{SEC_ALLOC} | @code{SEC_HAS_CONTENTS}; a debug section could be + @code{SEC_HAS_CONTENTS} */ #define SEC_HAS_CONTENTS 0x200 - /* An instruction to the linker to not output the section - even if it has information which would normally be written. */ + /* An instruction to the linker to not output the section + even if it has information which would normally be written. */ #define SEC_NEVER_LOAD 0x400 - /* The section is a COFF shared library section. This flag is - only for the linker. If this type of section appears in - the input file, the linker must copy it to the output file - without changing the vma or size. FIXME: Although this - was originally intended to be general, it really is COFF - specific (and the flag was renamed to indicate this). It - might be cleaner to have some more general mechanism to - allow the back end to control what the linker does with - sections. */ + /* The section is a COFF shared library section. This flag is + only for the linker. If this type of section appears in + the input file, the linker must copy it to the output file + without changing the vma or size. FIXME: Although this + was originally intended to be general, it really is COFF + specific (and the flag was renamed to indicate this). It + might be cleaner to have some more general mechanism to + allow the back end to control what the linker does with + sections. */ #define SEC_COFF_SHARED_LIBRARY 0x800 - /* The section contains common symbols (symbols may be defined - multiple times, the value of a symbol is the amount of - space it requires, and the largest symbol value is the one - used). Most targets have exactly one of these (which we - translate to bfd_com_section_ptr), but ECOFF has two. */ + /* The section has GOT references. This flag is only for the + linker, and is currently only used by the elf32-hppa back end. + It will be set if global offset table references were detected + in this section, which indicate to the linker that the section + contains PIC code, and must be handled specially when doing a + static link. */ +#define SEC_HAS_GOT_REF 0x4000 + + /* The section contains common symbols (symbols may be defined + multiple times, the value of a symbol is the amount of + space it requires, and the largest symbol value is the one + used). Most targets have exactly one of these (which we + translate to bfd_com_section_ptr), but ECOFF has two. */ #define SEC_IS_COMMON 0x8000 - /* The section contains only debugging information. For - example, this is set for ELF .debug and .stab sections. - strip tests this flag to see if a section can be - discarded. */ + /* The section contains only debugging information. For + example, this is set for ELF .debug and .stab sections. + strip tests this flag to see if a section can be + discarded. */ #define SEC_DEBUGGING 0x10000 - /* The contents of this section are held in memory pointed to - by the contents field. This is checked by - bfd_get_section_contents, and the data is retrieved from - memory if appropriate. */ + /* The contents of this section are held in memory pointed to + by the contents field. This is checked by bfd_get_section_contents, + and the data is retrieved from memory if appropriate. */ #define SEC_IN_MEMORY 0x20000 - /* The contents of this section are to be excluded by the - linker for executable and shared objects unless those - objects are to be further relocated. */ + /* The contents of this section are to be excluded by the + linker for executable and shared objects unless those + objects are to be further relocated. */ #define SEC_EXCLUDE 0x40000 - /* The contents of this section are to be sorted by the - based on the address specified in the associated symbol - table. */ + /* The contents of this section are to be sorted by the + based on the address specified in the associated symbol + table. */ #define SEC_SORT_ENTRIES 0x80000 - /* When linking, duplicate sections of the same name should be - discarded, rather than being combined into a single section as - is usually done. This is similar to how common symbols are - handled. See SEC_LINK_DUPLICATES below. */ + /* When linking, duplicate sections of the same name should be + discarded, rather than being combined into a single section as + is usually done. This is similar to how common symbols are + handled. See SEC_LINK_DUPLICATES below. */ #define SEC_LINK_ONCE 0x100000 - /* If SEC_LINK_ONCE is set, this bitfield describes how the linker - should handle duplicate sections. */ + /* If SEC_LINK_ONCE is set, this bitfield describes how the linker + should handle duplicate sections. */ #define SEC_LINK_DUPLICATES 0x600000 - /* This value for SEC_LINK_DUPLICATES means that duplicate - sections with the same name should simply be discarded. */ + /* This value for SEC_LINK_DUPLICATES means that duplicate + sections with the same name should simply be discarded. */ #define SEC_LINK_DUPLICATES_DISCARD 0x0 - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if there are any duplicate sections, although - it should still only link one copy. */ + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if there are any duplicate sections, although + it should still only link one copy. */ #define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000 - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections are a different size. */ + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if any duplicate sections are a different size. */ #define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000 - /* This value for SEC_LINK_DUPLICATES means that the linker - should warn if any duplicate sections contain different - contents. */ + /* This value for SEC_LINK_DUPLICATES means that the linker + should warn if any duplicate sections contain different + contents. */ #define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000 - /* This section was created by the linker as part of dynamic - relocation or other arcane processing. It is skipped when - going through the first-pass output, trusting that someone - else up the line will take care of it later. */ + /* This section was created by the linker as part of dynamic + relocation or other arcane processing. It is skipped when + going through the first-pass output, trusting that someone + else up the line will take care of it later. */ #define SEC_LINKER_CREATED 0x800000 - /* This section should not be subject to garbage collection. */ + /* This section should not be subject to garbage collection. */ #define SEC_KEEP 0x1000000 - /* This section contains "short" data, and should be placed - "near" the GP. */ + /* This section contains "short" data, and should be placed + "near" the GP. */ #define SEC_SMALL_DATA 0x2000000 - /* This section contains data which may be shared with other - executables or shared objects. */ + /* This section contains data which may be shared with other + executables or shared objects. */ #define SEC_SHARED 0x4000000 - /* End of section flags. */ + /* When a section with this flag is being linked, then if the size of + the input section is less than a page, it should not cross a page + boundary. If the size of the input section is one page or more, it + should be aligned on a page boundary. */ +#define SEC_BLOCK 0x8000000 - /* Some internal packed boolean fields. */ + /* Conditionally link this section; do not link if there are no + references found to any symbol in the section. */ +#define SEC_CLINK 0x10000000 - /* See the vma field. */ - unsigned int user_set_vma : 1; + /* End of section flags. */ - /* Whether relocations have been processed. */ - unsigned int reloc_done : 1; + /* Some internal packed boolean fields. */ - /* A mark flag used by some of the linker backends. */ - unsigned int linker_mark : 1; + /* See the vma field. */ + unsigned int user_set_vma : 1; - /* A mark flag used by some linker backends for garbage collection. */ - unsigned int gc_mark : 1; + /* Whether relocations have been processed. */ + unsigned int reloc_done : 1; - /* End of internal packed boolean fields. */ + /* A mark flag used by some of the linker backends. */ + unsigned int linker_mark : 1; - /* The virtual memory address of the section - where it will be - at run time. The symbols are relocated against this. The - user_set_vma flag is maintained by bfd; if it's not set, the - backend can assign addresses (for example, in @code{a.out}, where - the default address for @code{.data} is dependent on the specific - target and various flags). */ + /* A mark flag used by some linker backends for garbage collection. */ + unsigned int gc_mark : 1; - bfd_vma vma; + /* Used by the ELF code to mark sections which have been allocated to segments. */ + unsigned int segment_mark : 1; - /* The load address of the section - where it would be in a - rom image; really only used for writing section header - information. */ + /* End of internal packed boolean fields. */ - bfd_vma lma; + /* The virtual memory address of the section - where it will be + at run time. The symbols are relocated against this. The + user_set_vma flag is maintained by bfd; if it's not set, the + backend can assign addresses (for example, in @code{a.out}, where + the default address for @code{.data} is dependent on the specific + target and various flags). */ - /* The size of the section in octets, as it will be output. - Contains a value even if the section has no contents (e.g., the - size of @code{.bss}). This will be filled in after relocation. */ + bfd_vma vma; - bfd_size_type _cooked_size; + /* The load address of the section - where it would be in a + rom image; really only used for writing section header + information. */ - /* The original size on disk of the section, in octets. Normally this - value is the same as the size, but if some relaxing has - been done, then this value will be bigger. */ + bfd_vma lma; - bfd_size_type _raw_size; + /* The size of the section in octets, as it will be output. + Contains a value even if the section has no contents (e.g., the + size of @code{.bss}). This will be filled in after relocation. */ - /* If this section is going to be output, then this value is the - offset in *bytes* into the output section of the first byte in the - input section (byte ==> smallest addressable unit on the - target). In most cases, if this was going to start at the - 100th octet (8-bit quantity) in the output section, this value - would be 100. However, if the target byte size is 16 bits - (bfd_octets_per_byte is "2"), this value would be 50. */ + bfd_size_type _cooked_size; - bfd_vma output_offset; + /* The original size on disk of the section, in octets. Normally this + value is the same as the size, but if some relaxing has + been done, then this value will be bigger. */ - /* The output section through which to map on output. */ + bfd_size_type _raw_size; - struct sec *output_section; + /* If this section is going to be output, then this value is the + offset in *bytes* into the output section of the first byte in the + input section (byte ==> smallest addressable unit on the + target). In most cases, if this was going to start at the + 100th octet (8-bit quantity) in the output section, this value + would be 100. However, if the target byte size is 16 bits + (bfd_octets_per_byte is "2"), this value would be 50. */ - /* The alignment requirement of the section, as an exponent of 2 - - e.g., 3 aligns to 2^3 (or 8). */ + bfd_vma output_offset; - unsigned int alignment_power; + /* The output section through which to map on output. */ - /* If an input section, a pointer to a vector of relocation - records for the data in this section. */ + struct sec *output_section; - struct reloc_cache_entry *relocation; + /* The alignment requirement of the section, as an exponent of 2 - + e.g., 3 aligns to 2^3 (or 8). */ - /* If an output section, a pointer to a vector of pointers to - relocation records for the data in this section. */ + unsigned int alignment_power; - struct reloc_cache_entry **orelocation; + /* If an input section, a pointer to a vector of relocation + records for the data in this section. */ - /* The number of relocation records in one of the above */ + struct reloc_cache_entry *relocation; - unsigned reloc_count; + /* If an output section, a pointer to a vector of pointers to + relocation records for the data in this section. */ - /* Information below is back end specific - and not always used - or updated. */ + struct reloc_cache_entry **orelocation; - /* File position of section data */ + /* The number of relocation records in one of the above */ - file_ptr filepos; + unsigned reloc_count; - /* File position of relocation info */ + /* Information below is back end specific - and not always used + or updated. */ - file_ptr rel_filepos; + /* File position of section data. */ - /* File position of line data */ + file_ptr filepos; - file_ptr line_filepos; + /* File position of relocation info. */ - /* Pointer to data for applications */ + file_ptr rel_filepos; - PTR userdata; + /* File position of line data. */ - /* If the SEC_IN_MEMORY flag is set, this points to the actual - contents. */ - unsigned char *contents; + file_ptr line_filepos; - /* Attached line number information */ + /* Pointer to data for applications. */ - alent *lineno; + PTR userdata; - /* Number of line number records */ + /* If the SEC_IN_MEMORY flag is set, this points to the actual + contents. */ + unsigned char *contents; - unsigned int lineno_count; + /* Attached line number information. */ - /* Optional information about a COMDAT entry; NULL if not COMDAT */ + alent *lineno; - struct bfd_comdat_info *comdat; + /* Number of line number records. */ - /* When a section is being output, this value changes as more - linenumbers are written out */ + unsigned int lineno_count; - file_ptr moving_line_filepos; + /* Optional information about a COMDAT entry; NULL if not COMDAT. */ - /* What the section number is in the target world */ + struct bfd_comdat_info *comdat; - int target_index; + /* Points to the kept section if this section is a link-once section, + and is discarded. */ + struct sec *kept_section; - PTR used_by_bfd; + /* When a section is being output, this value changes as more + linenumbers are written out. */ - /* If this is a constructor section then here is a list of the - relocations created to relocate items within it. */ + file_ptr moving_line_filepos; - struct relent_chain *constructor_chain; + /* What the section number is in the target world. */ - /* The BFD which owns the section. */ + int target_index; - bfd *owner; + PTR used_by_bfd; - /* A symbol which points at this section only */ - struct symbol_cache_entry *symbol; - struct symbol_cache_entry **symbol_ptr_ptr; + /* If this is a constructor section then here is a list of the + relocations created to relocate items within it. */ - struct bfd_link_order *link_order_head; - struct bfd_link_order *link_order_tail; + struct relent_chain *constructor_chain; + + /* The BFD which owns the section. */ + + bfd *owner; + + /* A symbol which points at this section only */ + struct symbol_cache_entry *symbol; + struct symbol_cache_entry **symbol_ptr_ptr; + + struct bfd_link_order *link_order_head; + struct bfd_link_order *link_order_tail; @} asection ; - /* These sections are global, and are managed by BFD. The application - and target back end are not permitted to change the values in - these sections. New code should use the section_ptr macros rather - than referring directly to the const sections. The const sections - may eventually vanish. */ +/* These sections are global, and are managed by BFD. The application + and target back end are not permitted to change the values in + these sections. New code should use the section_ptr macros rather + than referring directly to the const sections. The const sections + may eventually vanish. */ #define BFD_ABS_SECTION_NAME "*ABS*" #define BFD_UND_SECTION_NAME "*UND*" #define BFD_COM_SECTION_NAME "*COM*" #define BFD_IND_SECTION_NAME "*IND*" - /* the absolute section */ +/* the absolute section */ extern const asection bfd_abs_section; #define bfd_abs_section_ptr ((asection *) &bfd_abs_section) #define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) - /* Pointer to the undefined section */ +/* Pointer to the undefined section */ extern const asection bfd_und_section; #define bfd_und_section_ptr ((asection *) &bfd_und_section) #define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) - /* Pointer to the common section */ +/* Pointer to the common section */ extern const asection bfd_com_section; #define bfd_com_section_ptr ((asection *) &bfd_com_section) - /* Pointer to the indirect section */ +/* Pointer to the indirect section */ 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) @@ -480,7 +502,7 @@ These are the functions exported by the section handling part of BFD. @subsubsection @code{bfd_get_section_by_name} @strong{Synopsis} @example -asection *bfd_get_section_by_name(bfd *abfd, CONST char *name); +asection *bfd_get_section_by_name(bfd *abfd, const char *name); @end example @strong{Description}@* Run through @var{abfd} and return the one of the @@ -492,11 +514,26 @@ all sections of a given name is to use @code{bfd_map_over_sections} and @code{strcmp} on the name (or better yet, base it on the section flags or something else) for each section. +@findex bfd_get_unique_section_name +@subsubsection @code{bfd_get_unique_section_name} +@strong{Synopsis} +@example +char *bfd_get_unique_section_name(bfd *abfd, + const char *templat, + int *count); +@end example +@strong{Description}@* +Invent a section name that is unique in @var{abfd} by tacking +a dot and a digit suffix onto the original @var{templat}. If +@var{count} is non-NULL, then it specifies the first number +tried as a suffix to generate a unique name. The value +pointed to by @var{count} will be incremented in this case. + @findex bfd_make_section_old_way @subsubsection @code{bfd_make_section_old_way} @strong{Synopsis} @example -asection *bfd_make_section_old_way(bfd *abfd, CONST char *name); +asection *bfd_make_section_old_way(bfd *abfd, const char *name); @end example @strong{Description}@* Create a new empty section called @var{name} @@ -523,7 +560,7 @@ If memory allocation fails. @subsubsection @code{bfd_make_section_anyway} @strong{Synopsis} @example -asection *bfd_make_section_anyway(bfd *abfd, CONST char *name); +asection *bfd_make_section_anyway(bfd *abfd, const char *name); @end example @strong{Description}@* Create a new empty section called @var{name} and attach it to the end of @@ -543,7 +580,7 @@ Return @code{NULL} and set @code{bfd_error} on error; possible errors are: @subsubsection @code{bfd_make_section} @strong{Synopsis} @example -asection *bfd_make_section(bfd *, CONST char *name); +asection *bfd_make_section(bfd *, const char *name); @end example @strong{Description}@* Like @code{bfd_make_section_anyway}, but return @code{NULL} (without calling @@ -576,7 +613,7 @@ have the @code{SEC_HAS_CONTENTS} field set. @strong{Synopsis} @example void bfd_map_over_sections(bfd *abfd, - void (*func)(bfd *abfd, + void (*func) (bfd *abfd, asection *sect, PTR obj), PTR obj); diff --git a/gnu/dist/toolchain/bfd/doc/syms.texi b/gnu/dist/toolchain/bfd/doc/syms.texi index 74c151b11954..400a10640d2f 100644 --- a/gnu/dist/toolchain/bfd/doc/syms.texi +++ b/gnu/dist/toolchain/bfd/doc/syms.texi @@ -376,8 +376,8 @@ class of @var{symbol}, or '?' for an unknown class. @example int bfd_decode_symclass(asymbol *symbol); @end example -@findex bfd_is_undefined_symclass -@subsubsection @code{bfd_is_undefined_symclass } +@findex bfd_is_undefined_symclass +@subsubsection @code{bfd_is_undefined_symclass} @strong{Description}@* Returns non-zero if the class symbol returned by bfd_decode_symclass represents an undefined symbol. diff --git a/gnu/dist/toolchain/bfd/doc/targets.texi b/gnu/dist/toolchain/bfd/doc/targets.texi index 50086c4d8254..0526fafc0534 100644 --- a/gnu/dist/toolchain/bfd/doc/targets.texi +++ b/gnu/dist/toolchain/bfd/doc/targets.texi @@ -7,7 +7,7 @@ of a target back end. All the back end provides to the root part of BFD is a structure containing pointers to functions which perform certain low level operations on files. BFD translates the applications's requests through a pointer into -calls to the back end routines. +calls to the back end routines. When a file is opened with @code{bfd_openr}, its format and target are unknown. BFD uses various mechanisms to determine @@ -18,12 +18,12 @@ how to interpret the file. The operations performed are: @item Create a BFD by calling the internal routine @code{_bfd_new_bfd}, then call @code{bfd_find_target} with the -target string supplied to @code{bfd_openr} and the new BFD pointer. +target string supplied to @code{bfd_openr} and the new BFD pointer. @item If a null target string was provided to @code{bfd_find_target}, look up the environment variable @code{GNUTARGET} and use -that as the target string. +that as the target string. @item If the target string is still @code{NULL}, or the target string is @@ -35,7 +35,7 @@ cause @code{bfd_check_format} to loop through all the targets. @item Otherwise, inspect the elements in the target vector one by one, until a match on target name is found. When found, -use it. +use it. @item Otherwise return the error @code{bfd_error_invalid_target} to @@ -47,7 +47,7 @@ Otherwise return the error @code{bfd_error_invalid_target} to @end itemize Once the BFD has been opened and the target selected, the file format may be determined. This is done by calling -@code{bfd_check_format} on the BFD with a suggested format. +@code{bfd_check_format} on the BFD with a suggested format. If @code{target_defaulted} has been set, each possible target type is tried to see if it recognizes the specified format. @code{bfd_check_format} returns @code{true} when the caller guesses right. @@ -63,17 +63,17 @@ type is tried to see if it recognizes the specified format. @strong{Description}@* This structure contains everything that BFD knows about a target. It includes things like its byte order, name, and which -routines to call to do various operations. +routines to call to do various operations. Every BFD points to a target structure with its @code{xvec} -member. +member. The macros below are used to dispatch to functions through the @code{bfd_target} vector. They are used in a number of macros further down in @file{bfd.h}, and are also used when calling various routines by hand inside the BFD implementation. The @var{arglist} argument must be parenthesized; it contains all the arguments -to the called function. +to the called function. They make the documentation (more) unpleasant to read, so if someone wants to fix this and not break the above, please do. @@ -92,13 +92,13 @@ someone wants to fix this and not break the above, please do. For operations which index on the BFD format: @example #define BFD_SEND_FMT(bfd, message, arglist) \ - (((bfd)->xvec->message[(int)((bfd)->format)]) arglist) + (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) #ifdef DEBUG_BFD_SEND #undef BFD_SEND_FMT #define BFD_SEND_FMT(bfd, message, arglist) \ (((bfd) && (bfd)->xvec && (bfd)->xvec->message) ? \ - (((bfd)->xvec->message[(int)((bfd)->format)]) arglist) : \ + (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist) : \ (bfd_assert (__FILE__,__LINE__), NULL)) #endif @end example @@ -109,13 +109,14 @@ defines one of these. FIXME, these names should be rationalised with the names of the entry points which call them. Too bad we can't have one -macro to define them both! +macro to define them both! @example enum bfd_flavour @{ bfd_target_unknown_flavour, bfd_target_aout_flavour, bfd_target_coff_flavour, bfd_target_ecoff_flavour, + bfd_target_xcoff_flavour, bfd_target_elf_flavour, bfd_target_ieee_flavour, bfd_target_nlm_flavour, @@ -133,7 +134,7 @@ enum bfd_flavour @{ enum bfd_endian @{ BFD_ENDIAN_BIG, BFD_ENDIAN_LITTLE, BFD_ENDIAN_UNKNOWN @}; - /* Forward declaration. */ +/* Forward declaration. */ typedef struct bfd_link_info _bfd_link_info; typedef struct bfd_target @@ -159,21 +160,21 @@ The order of bytes within the header parts of a file. A mask of all the flags which an executable may have set - from the set @code{BFD_NO_FLAGS}, @code{HAS_RELOC}, ...@code{D_PAGED}. @example - flagword object_flags; + flagword object_flags; @end example A mask of all the flags which a section may have set - from the set @code{SEC_NO_FLAGS}, @code{SEC_ALLOC}, ...@code{SET_NEVER_LOAD}. @example flagword section_flags; @end example -The character normally found at the front of a symbol +The character normally found at the front of a symbol (if any), perhaps `_'. @example char symbol_leading_char; @end example The pad character for file names within an archive header. @example - char ar_pad_char; + char ar_pad_char; @end example The maximum number of characters in an archive header. @example @@ -208,15 +209,15 @@ Byte swapping for the headers Format dependent routines: these are vectors of entry points within the target vector structure, one for each format to check. -Check the format of a file being read. Return a @code{bfd_target *} or zero. +Check the format of a file being read. Return a @code{bfd_target *} or zero. @example const struct bfd_target *(*_bfd_check_format[bfd_type_end]) PARAMS ((bfd *)); @end example -Set the format of a file being written. +Set the format of a file being written. @example boolean (*_bfd_set_format[bfd_type_end]) PARAMS ((bfd *)); @end example -Write cached information into a file being written, at @code{bfd_close}. +Write cached information into a file being written, at @code{bfd_close}. @example boolean (*_bfd_write_contents[bfd_type_end]) PARAMS ((bfd *)); @end example @@ -224,7 +225,7 @@ The general target vector. These vectors are initialized using the BFD_JUMP_TABLE macros. @example - /* Generic entry points. */ + /* Generic entry points. */ #define BFD_JUMP_TABLE_GENERIC(NAME)\ CAT(NAME,_close_and_cleanup),\ CAT(NAME,_bfd_free_cached_info),\ @@ -232,20 +233,20 @@ CAT(NAME,_new_section_hook),\ CAT(NAME,_get_section_contents),\ CAT(NAME,_get_section_contents_in_window) - /* Called when the BFD is being closed to do any necessary cleanup. */ + /* Called when the BFD is being closed to do any necessary cleanup. */ boolean (*_close_and_cleanup) PARAMS ((bfd *)); - /* Ask the BFD to free all cached information. */ + /* Ask the BFD to free all cached information. */ boolean (*_bfd_free_cached_info) PARAMS ((bfd *)); - /* Called when a new section is created. */ + /* Called when a new section is created. */ boolean (*_new_section_hook) PARAMS ((bfd *, sec_ptr)); - /* Read the contents of a section. */ - boolean (*_bfd_get_section_contents) PARAMS ((bfd *, sec_ptr, 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)); - /* Entry points to copy private data. */ + /* 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),\ @@ -253,27 +254,27 @@ 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)\ - /* Called to copy BFD general private data from one object file + /* Called to copy BFD general private data from one object file to another. */ boolean (*_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)); - /* Called to merge BFD general private data from one object file + /* 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 *)); - /* Called to copy BFD private section data from one object file + /* 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)); - /* Called to copy BFD private symbol data from one symbol + /* Called to copy BFD private symbol data from one symbol to another. */ boolean (*_bfd_copy_private_symbol_data) PARAMS ((bfd *, asymbol *, bfd *, asymbol *)); - /* Called to set private backend flags */ + /* Called to set private backend flags */ boolean (*_bfd_set_private_flags) PARAMS ((bfd *, flagword)); - /* Called to print private BFD data */ + /* Called to print private BFD data */ boolean (*_bfd_print_private_bfd_data) PARAMS ((bfd *, PTR)); - /* Core file entry points. */ + /* Core file entry points. */ #define BFD_JUMP_TABLE_CORE(NAME)\ CAT(NAME,_core_file_failing_command),\ CAT(NAME,_core_file_failing_signal),\ @@ -282,7 +283,7 @@ CAT(NAME,_core_file_matches_executable_p) int (*_core_file_failing_signal) PARAMS ((bfd *)); boolean (*_core_file_matches_executable_p) PARAMS ((bfd *, bfd *)); - /* Archive entry points. */ + /* Archive entry points. */ #define BFD_JUMP_TABLE_ARCHIVE(NAME)\ CAT(NAME,_slurp_armap),\ CAT(NAME,_slurp_extended_name_table),\ @@ -299,10 +300,10 @@ CAT(NAME,_update_armap_timestamp) 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, + boolean (*write_armap) PARAMS ((bfd *arch, unsigned int elength, struct orl *map, - unsigned int orl_count, + unsigned int orl_count, int stridx)); PTR (*_bfd_read_ar_hdr_fn) PARAMS ((bfd *)); bfd * (*openr_next_archived_file) PARAMS ((bfd *arch, bfd *prev)); @@ -311,7 +312,7 @@ CAT(NAME,_update_armap_timestamp) int (*_bfd_stat_arch_elt) PARAMS ((bfd *, struct stat *)); boolean (*_bfd_update_armap_timestamp) PARAMS ((bfd *)); - /* Entry points used for symbols. */ + /* Entry points used for symbols. */ #define BFD_JUMP_TABLE_SYMBOLS(NAME)\ CAT(NAME,_get_symtab_upper_bound),\ CAT(NAME,_get_symtab),\ @@ -344,7 +345,7 @@ CAT(NAME,_minisymbol_to_symbol) struct sec *section, struct symbol_cache_entry **symbols, bfd_vma offset, CONST char **file, CONST char **func, unsigned int *line)); - /* Back-door to allow format-aware applications to create debug symbols + /* 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 (( @@ -360,7 +361,7 @@ CAT(NAME,_minisymbol_to_symbol) asymbol *(*_minisymbol_to_symbol) PARAMS ((bfd *, boolean, const PTR, asymbol *)); - /* Routines for relocs. */ + /* Routines for relocs. */ #define BFD_JUMP_TABLE_RELOCS(NAME)\ CAT(NAME,_get_reloc_upper_bound),\ CAT(NAME,_canonicalize_reloc),\ @@ -368,12 +369,12 @@ 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 **)); - /* See documentation on reloc types. */ + /* See documentation on reloc types. */ reloc_howto_type * (*reloc_type_lookup) PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); - /* Routines used when writing an object file. */ + /* Routines used when writing an object file. */ #define BFD_JUMP_TABLE_WRITE(NAME)\ CAT(NAME,_set_arch_mach),\ CAT(NAME,_set_section_contents) @@ -382,7 +383,7 @@ CAT(NAME,_set_section_contents) boolean (*_bfd_set_section_contents) PARAMS ((bfd *, sec_ptr, PTR, file_ptr, bfd_size_type)); - /* Routines used by the linker. */ + /* Routines used by the linker. */ #define BFD_JUMP_TABLE_LINK(NAME)\ CAT(NAME,_sizeof_headers),\ CAT(NAME,_bfd_get_relocated_section_contents),\ @@ -401,37 +402,37 @@ CAT(NAME,_bfd_gc_sections) boolean (*_bfd_relax_section) PARAMS ((bfd *, struct sec *, struct bfd_link_info *, boolean *again)); - /* Create a hash table for the linker. Different backends store + /* 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. */ + /* Add symbols from this object file into the hash table. */ boolean (*_bfd_link_add_symbols) PARAMS ((bfd *, struct bfd_link_info *)); - /* Do a link based on the link_order structures attached to each + /* 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 *)); - /* Should this section be split up into smaller pieces during linking. */ + /* Should this section be split up into smaller pieces during linking. */ boolean (*_bfd_link_split_section) PARAMS ((bfd *, struct sec *)); - /* Remove sections that are not referenced from the output. */ + /* Remove sections that are not referenced from the output. */ boolean (*_bfd_gc_sections) PARAMS ((bfd *, struct bfd_link_info *)); - /* Routines to handle dynamic symbols and relocs. */ + /* 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) - /* Get the amount of memory required to hold the dynamic symbols. */ + /* Get the amount of memory required to hold the dynamic symbols. */ long (*_bfd_get_dynamic_symtab_upper_bound) PARAMS ((bfd *)); - /* Read in the dynamic symbols. */ + /* Read in the dynamic symbols. */ long (*_bfd_canonicalize_dynamic_symtab) PARAMS ((bfd *, struct symbol_cache_entry **)); - /* Get the amount of memory required to hold the dynamic relocs. */ + /* Get the amount of memory required to hold the dynamic relocs. */ long (*_bfd_get_dynamic_reloc_upper_bound) PARAMS ((bfd *)); - /* Read in the dynamic relocs. */ + /* Read in the dynamic relocs. */ long (*_bfd_canonicalize_dynamic_reloc) PARAMS ((bfd *, arelent **, struct symbol_cache_entry **)); @@ -442,15 +443,15 @@ and little endian code, and target chosen by the linker has the wrong endianness. The function open_output() in ld/ldlang.c uses this field to find an alternative output format that is suitable. @example - /* Opposite endian version of this target. */ + /* Opposite endian version of this target. */ const struct bfd_target * alternative_target; - + @end example Data for use by back-end routines, which isn't generic enough to belong in this structure. @example PTR backend_data; - + @} bfd_target; @end example @@ -497,7 +498,7 @@ modify the names. @subsubsection @code{bfd_seach_for_target} @strong{Synopsis} @example -const bfd_target * bfd_search_for_target (int (* search_func)(const bfd_target *, void *), void *); +const bfd_target * bfd_search_for_target (int (* search_func) (const bfd_target *, void *), void *); @end example @strong{Description}@* Return a pointer to the first transfer vector in the list of diff --git a/gnu/dist/toolchain/bfd/dwarf1.c b/gnu/dist/toolchain/bfd/dwarf1.c index da184cc70589..b96adc5b4525 100644 --- a/gnu/dist/toolchain/bfd/dwarf1.c +++ b/gnu/dist/toolchain/bfd/dwarf1.c @@ -1,7 +1,7 @@ /* DWARF 1 find nearest line (_bfd_dwarf1_find_nearest_line). - Copyright 1998, 1999 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. -Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com). +Written by Gavin Romig-Koch of Cygnus Solutions (gavin@cygnus.com). This file is part of BFD. @@ -26,121 +26,115 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf-bfd.h" #include "elf/dwarf.h" -/* dwarf1_debug is the starting point for all dwarf1 info. */ +/* dwarf1_debug is the starting point for all dwarf1 info. */ struct dwarf1_debug { - /* The bfd we are working with. */ + /* The bfd we are working with. */ bfd* abfd; - /* List of already parsed compilation units. */ + /* List of already parsed compilation units. */ struct dwarf1_unit* lastUnit; - /* The buffer for the .debug section. - Zero indicates that the .debug section failed to load. */ + /* The buffer for the .debug section. + Zero indicates that the .debug section failed to load. */ char* debug_section; - /* Pointer to the end of the .debug_info section memory buffer. */ + /* Pointer to the end of the .debug_info section memory buffer. */ char* debug_section_end; - /* The buffer for the .line section. */ + /* The buffer for the .line section. */ char* line_section; - /* End of that buffer. */ + /* End of that buffer. */ char* line_section_end; - /* The current or next unread die within the .debug section. */ + /* The current or next unread die within the .debug section. */ char* currentDie; }; -/* One dwarf1_unit for each parsed compilation unit die. */ +/* One dwarf1_unit for each parsed compilation unit die. */ struct dwarf1_unit { - /* Linked starting from stash->lastUnit. */ + /* Linked starting from stash->lastUnit. */ struct dwarf1_unit* prev; - /* Name of the compilation unit. */ + /* Name of the compilation unit. */ char* name; - /* The highest and lowest address used in the compilation unit. */ + /* The highest and lowest address used in the compilation unit. */ unsigned long low_pc; unsigned long high_pc; /* Does this unit have a statement list? */ int has_stmt_list; - /* If any, the offset of the line number table in the .line section. */ + /* If any, the offset of the line number table in the .line section. */ unsigned long stmt_list_offset; - /* If non-zero, a pointer to the first child of this unit. */ + /* If non-zero, a pointer to the first child of this unit. */ char* first_child; /* How many line entries? */ unsigned long line_count; - /* The decoded line number table (line_count entries). */ + /* The decoded line number table (line_count entries). */ struct linenumber* linenumber_table; - /* The list of functions in this unit. */ + /* The list of functions in this unit. */ struct dwarf1_func* func_list; }; - - /* One dwarf1_func for each parsed function die. */ struct dwarf1_func { - /* Linked starting from aUnit->func_list. */ + /* Linked starting from aUnit->func_list. */ struct dwarf1_func* prev; - - /* Name of function. */ + + /* Name of function. */ char* name; - - /* The highest and lowest address used in the compilation unit. */ + + /* The highest and lowest address used in the compilation unit. */ unsigned long low_pc; unsigned long high_pc; }; - -/* Used to return info about a parsed die. */ +/* Used to return info about a parsed die. */ struct die_info { unsigned long length; unsigned long sibling; unsigned long low_pc; unsigned long high_pc; unsigned long stmt_list_offset; - - char* name; - + + char* name; + int has_stmt_list; unsigned short tag; }; - -/* Parsed line number information. */ +/* Parsed line number information. */ struct linenumber { - /* First address in the line. */ + /* First address in the line. */ unsigned long addr; - /* The line number. */ + /* The line number. */ unsigned long linenumber; }; - -/* Find the form of an attr, from the attr field. */ +/* Find the form of an attr, from the attr field. */ #define FORM_FROM_ATTR(attr) ((attr) & 0xF) /* Implicitly specified */ - /* Return a newly allocated dwarf1_unit. It should be cleared and - then attached into the 'stash' at 'stash->lastUnit'. */ + then attached into the 'stash' at 'stash->lastUnit'. */ static struct dwarf1_unit* alloc_dwarf1_unit (stash) struct dwarf1_debug* stash; { - struct dwarf1_unit* x = - (struct dwarf1_unit*) bfd_zalloc (stash->abfd, + struct dwarf1_unit* x = + (struct dwarf1_unit*) bfd_zalloc (stash->abfd, sizeof (struct dwarf1_unit)); x->prev = stash->lastUnit; stash->lastUnit = x; @@ -149,28 +143,28 @@ alloc_dwarf1_unit (stash) } /* Return a newly allocated dwarf1_func. It must be cleared and - attached into 'aUnit' at 'aUnit->func_list'. */ + attached into 'aUnit' at 'aUnit->func_list'. */ static struct dwarf1_func* alloc_dwarf1_func (stash, aUnit) struct dwarf1_debug* stash; struct dwarf1_unit* aUnit; { - struct dwarf1_func* x = - (struct dwarf1_func*) bfd_zalloc (stash->abfd, + struct dwarf1_func* x = + (struct dwarf1_func*) bfd_zalloc (stash->abfd, sizeof (struct dwarf1_func)); x->prev = aUnit->func_list; aUnit->func_list = x; - + return x; } /* parse_die - parse a Dwarf1 die. Parse the die starting at 'aDiePtr' into 'aDieInfo'. 'abfd' must be the bfd from which the section that 'aDiePtr' - points to was pulled from. + points to was pulled from. - Return false if the die is invalidly formatted; true otherwise. */ + Return false if the die is invalidly formatted; true otherwise. */ static boolean parse_die (abfd, aDieInfo, aDiePtr) @@ -181,36 +175,36 @@ parse_die (abfd, aDieInfo, aDiePtr) char* this_die = aDiePtr; char* xptr = this_die; - memset (aDieInfo,0,sizeof(*aDieInfo)); + memset (aDieInfo,0,sizeof (*aDieInfo)); - /* First comes the length. */ - aDieInfo->length = bfd_get_32 (abfd, xptr); + /* First comes the length. */ + aDieInfo->length = bfd_get_32 (abfd, (bfd_byte *) xptr); xptr += 4; if (aDieInfo->length == 0) return false; if (aDieInfo->length < 6) { - /* Just padding bytes. */ + /* Just padding bytes. */ aDieInfo->tag = TAG_padding; return true; } - /* Then the tag. */ - aDieInfo->tag = bfd_get_16 (abfd, xptr); + /* Then the tag. */ + aDieInfo->tag = bfd_get_16 (abfd, (bfd_byte *) xptr); xptr += 2; - - /* Then the attributes. */ + + /* Then the attributes. */ while (xptr < (this_die + aDieInfo->length)) { unsigned short attr; - - /* Parse the attribute based on its form. This section - must handle all dwarf1 forms, but need only handle the - actual attributes that we care about. */ - attr = bfd_get_16 (abfd, xptr); + /* Parse the attribute based on its form. This section + must handle all dwarf1 forms, but need only handle the + actual attributes that we care about. */ + + attr = bfd_get_16 (abfd, (bfd_byte *) xptr); xptr += 2; - + switch (FORM_FROM_ATTR (attr)) { case FORM_DATA2: @@ -219,10 +213,10 @@ parse_die (abfd, aDieInfo, aDiePtr) case FORM_DATA4: case FORM_REF: if (attr == AT_sibling) - aDieInfo->sibling = bfd_get_32 (abfd, xptr); + aDieInfo->sibling = bfd_get_32 (abfd, (bfd_byte *) xptr); else if (attr == AT_stmt_list) { - aDieInfo->stmt_list_offset = bfd_get_32 (abfd, xptr); + aDieInfo->stmt_list_offset = bfd_get_32 (abfd, (bfd_byte *) xptr); aDieInfo->has_stmt_list = 1; } xptr += 4; @@ -232,16 +226,16 @@ parse_die (abfd, aDieInfo, aDiePtr) break; case FORM_ADDR: if (attr == AT_low_pc) - aDieInfo->low_pc = bfd_get_32 (abfd, xptr); + aDieInfo->low_pc = bfd_get_32 (abfd, (bfd_byte *) xptr); else if (attr == AT_high_pc) - aDieInfo->high_pc = bfd_get_32 (abfd, xptr); + aDieInfo->high_pc = bfd_get_32 (abfd, (bfd_byte *) xptr); xptr += 4; break; case FORM_BLOCK2: - xptr += 2 + bfd_get_16 (abfd, xptr); + xptr += 2 + bfd_get_16 (abfd, (bfd_byte *) xptr); break; case FORM_BLOCK4: - xptr += 4 + bfd_get_32 (abfd, xptr); + xptr += 4 + bfd_get_32 (abfd, (bfd_byte *) xptr); break; case FORM_STRING: if (attr == AT_name) @@ -255,9 +249,9 @@ parse_die (abfd, aDieInfo, aDiePtr) } /* Parse a dwarf1 line number table for 'aUnit->stmt_list_offset' - into 'aUnit->linenumber_table'. Return false if an error - occurs; true otherwise. */ - + into 'aUnit->linenumber_table'. Return false if an error + occurs; true otherwise. */ + static boolean parse_line_table (stash, aUnit) struct dwarf1_debug* stash; @@ -265,19 +259,19 @@ parse_line_table (stash, aUnit) { char* xptr; - /* Load the ".line" section from the bfd if we haven't already. */ + /* Load the ".line" section from the bfd if we haven't already. */ if (stash->line_section == 0) { asection *msec; unsigned long size; - + msec = bfd_get_section_by_name (stash->abfd, ".line"); if (! msec) return false; - + size = bfd_get_section_size_before_reloc (msec); - stash->line_section = (unsigned char*) bfd_alloc (stash->abfd, size); - + stash->line_section = (char *) bfd_alloc (stash->abfd, size); + if (! stash->line_section) return false; @@ -298,36 +292,36 @@ parse_line_table (stash, aUnit) char* tblend; unsigned long base; - /* First comes the length. */ - tblend = bfd_get_32 (stash->abfd, xptr) + xptr; + /* First comes the length. */ + tblend = bfd_get_32 (stash->abfd, (bfd_byte *) xptr) + xptr; xptr += 4; - /* Then the base address for each address in the table. */ - base = bfd_get_32 (stash->abfd, xptr); + /* Then the base address for each address in the table. */ + base = bfd_get_32 (stash->abfd, (bfd_byte *) xptr); xptr += 4; /* How many line entrys? 10 = 4 (line number) + 2 (pos in line) + 4 (address in line) */ aUnit->line_count = (tblend - xptr) / 10; - /* Allocate an array for the entries. */ - aUnit->linenumber_table = (struct linenumber*) - bfd_alloc (stash->abfd, + /* Allocate an array for the entries. */ + aUnit->linenumber_table = (struct linenumber *) + bfd_alloc (stash->abfd, sizeof (struct linenumber) * aUnit->line_count); - + for (eachLine = 0; eachLine < aUnit->line_count; eachLine++) { - /* A line number. */ + /* A line number. */ aUnit->linenumber_table[eachLine].linenumber - = bfd_get_32 (stash->abfd, xptr); + = bfd_get_32 (stash->abfd, (bfd_byte *) xptr); xptr += 4; - /* Skip the position within the line. */ + /* Skip the position within the line. */ xptr += 2; - /* And finally the address. */ - aUnit->linenumber_table[eachLine].addr - = base + bfd_get_32 (stash->abfd, xptr); + /* And finally the address. */ + aUnit->linenumber_table[eachLine].addr + = base + bfd_get_32 (stash->abfd, (bfd_byte *) xptr); xptr += 4; } } @@ -338,7 +332,7 @@ parse_line_table (stash, aUnit) /* Parse each function die in a compilation unit 'aUnit'. The first child die of 'aUnit' should be in 'aUnit->first_child', the result is placed in 'aUnit->func_list'. - Return false if error; true otherwise. */ + Return false if error; true otherwise. */ static boolean parse_functions_in_unit (stash, aUnit) @@ -353,37 +347,37 @@ parse_functions_in_unit (stash, aUnit) ) { struct die_info eachDieInfo; - + if (! parse_die (stash->abfd, &eachDieInfo, eachDie)) return false; - + if (eachDieInfo.tag == TAG_global_subroutine || eachDieInfo.tag == TAG_subroutine || eachDieInfo.tag == TAG_inlined_subroutine || eachDieInfo.tag == TAG_entry_point) { struct dwarf1_func* aFunc = alloc_dwarf1_func (stash,aUnit); - + aFunc->name = eachDieInfo.name; aFunc->low_pc = eachDieInfo.low_pc; aFunc->high_pc = eachDieInfo.high_pc; } - + /* Move to next sibling, if none, end loop */ if (eachDieInfo.sibling) eachDie = stash->debug_section + eachDieInfo.sibling; else break; } - + return true; } /* Find the nearest line to 'addr' in 'aUnit'. - Return whether we found the line (or a function) without error. */ + Return whether we found the line (or a function) without error. */ static boolean -dwarf1_unit_find_nearest_line (stash, aUnit, addr, +dwarf1_unit_find_nearest_line (stash, aUnit, addr, filename_ptr, functionname_ptr, linenumber_ptr) struct dwarf1_debug* stash; @@ -427,8 +421,8 @@ dwarf1_unit_find_nearest_line (stash, aUnit, addr, } } - for (eachFunc = aUnit->func_list; - eachFunc; + for (eachFunc = aUnit->func_list; + eachFunc; eachFunc = eachFunc->prev) { if (eachFunc->low_pc <= addr @@ -445,11 +439,8 @@ dwarf1_unit_find_nearest_line (stash, aUnit, addr, return line_p || func_p; } - - - /* The DWARF 1 version of find_nearest line. - Return true if the line is found without error. */ + Return true if the line is found without error. */ boolean _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, @@ -472,31 +463,30 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, *filename_ptr = NULL; *functionname_ptr = NULL; *linenumber_ptr = 0; - if (! stash) { asection *msec; unsigned long size; - + stash = elf_tdata (abfd)->dwarf1_find_line_info = (struct dwarf1_debug*) bfd_zalloc (abfd, sizeof (struct dwarf1_debug)); - + if (! stash) return false; - + msec = bfd_get_section_by_name (abfd, ".debug"); if (! msec) { /* No dwarf1 info. Note that at this point the stash has been allocated, but contains zeros, this lets - future calls to this function fail quicker. */ + future calls to this function fail quicker. */ return false; } size = bfd_get_section_size_before_reloc (msec); - stash->debug_section = (unsigned char*) bfd_alloc (abfd, size); - + stash->debug_section = (char *) bfd_alloc (abfd, size); + if (! stash->debug_section) return false; @@ -512,20 +502,19 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, } /* A null debug_section indicates that there was no dwarf1 info - or that an error occured while setting up the stash. */ + or that an error occured while setting up the stash. */ if (! stash->debug_section) return false; - /* Look at the previously parsed units to see if any contain - the addr. */ + the addr. */ for (eachUnit = stash->lastUnit; eachUnit; eachUnit = eachUnit->prev) { if (eachUnit->low_pc <= addr && addr < eachUnit->high_pc) return dwarf1_unit_find_nearest_line (stash, eachUnit, addr, - filename_ptr, - functionname_ptr, + filename_ptr, + functionname_ptr, linenumber_ptr); } @@ -535,36 +524,36 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, if (! parse_die (stash->abfd, &aDieInfo, stash->currentDie)) return false; - + if (aDieInfo.tag == TAG_compile_unit) { struct dwarf1_unit* aUnit = alloc_dwarf1_unit (stash); - + aUnit->name = aDieInfo.name; aUnit->low_pc = aDieInfo.low_pc; aUnit->high_pc = aDieInfo.high_pc; aUnit->has_stmt_list = aDieInfo.has_stmt_list; aUnit->stmt_list_offset = aDieInfo.stmt_list_offset; - + /* A die has a child if it's followed by a die that is - not it's sibling. */ - if (aDieInfo.sibling - && stash->currentDie + aDieInfo.length + not it's sibling. */ + if (aDieInfo.sibling + && stash->currentDie + aDieInfo.length < stash->debug_section_end - && stash->currentDie + aDieInfo.length + && stash->currentDie + aDieInfo.length != stash->debug_section + aDieInfo.sibling) aUnit->first_child = stash->currentDie + aDieInfo.length; else aUnit->first_child = 0; if (aUnit->low_pc <= addr && addr < aUnit->high_pc) - return dwarf1_unit_find_nearest_line (stash, aUnit, addr, - filename_ptr, - functionname_ptr, + return dwarf1_unit_find_nearest_line (stash, aUnit, addr, + filename_ptr, + functionname_ptr, linenumber_ptr); } - + if (aDieInfo.sibling != 0) stash->currentDie = stash->debug_section + aDieInfo.sibling; else @@ -574,5 +563,4 @@ _bfd_dwarf1_find_nearest_line (abfd, section, symbols, offset, return false; } - /* EOF */ diff --git a/gnu/dist/toolchain/bfd/dwarf2.c b/gnu/dist/toolchain/bfd/dwarf2.c index b6de26121896..141c6868fdd4 100644 --- a/gnu/dist/toolchain/bfd/dwarf2.c +++ b/gnu/dist/toolchain/bfd/dwarf2.c @@ -36,36 +36,38 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf/dwarf2.h" /* The data in the .debug_line statement prologue looks like this. */ + struct line_head - { - unsigned int total_length; - unsigned short version; - unsigned int prologue_length; - unsigned char minimum_instruction_length; - unsigned char default_is_stmt; - int line_base; - unsigned char line_range; - unsigned char opcode_base; - unsigned char *standard_opcode_lengths; - }; +{ + unsigned int total_length; + unsigned short version; + unsigned int prologue_length; + unsigned char minimum_instruction_length; + unsigned char default_is_stmt; + int line_base; + unsigned char line_range; + unsigned char opcode_base; + unsigned char *standard_opcode_lengths; +}; + +/* Attributes have a name and a value. */ -/* Attributes have a name and a value */ struct attribute +{ + enum dwarf_attribute name; + enum dwarf_form form; + union { - enum dwarf_attribute name; - enum dwarf_form form; - union - { - char *str; - struct dwarf_block *blk; - unsigned int unsnd; - int snd; - bfd_vma addr; - } - u; - }; + char *str; + struct dwarf_block *blk; + unsigned int unsnd; + int snd; + bfd_vma addr; + } + u; +}; -/* Get at parts of an attribute structure */ +/* Get at parts of an attribute structure. */ #define DW_STRING(attr) ((attr)->u.str) #define DW_UNSND(attr) ((attr)->u.unsnd) @@ -73,100 +75,100 @@ struct attribute #define DW_SND(attr) ((attr)->u.snd) #define DW_ADDR(attr) ((attr)->u.addr) -/* Blocks are a bunch of untyped bytes. */ +/* Blocks are a bunch of untyped bytes. */ struct dwarf_block - { - unsigned int size; - char *data; - }; +{ + unsigned int size; + char *data; +}; - -struct dwarf2_debug { - - /* A list of all previously read comp_units. */ +struct dwarf2_debug +{ + /* A list of all previously read comp_units. */ struct comp_unit* all_comp_units; /* The next unread compilation unit within the .debug_info section. Zero indicates that the .debug_info section has not been loaded - into a buffer yet.*/ + into a buffer yet. */ char* info_ptr; - /* Pointer to the end of the .debug_info section memory buffer. */ + /* Pointer to the end of the .debug_info section memory buffer. */ char* info_ptr_end; - /* Pointer to the .debug_abbrev section loaded into memory. */ + /* Pointer to the .debug_abbrev section loaded into memory. */ char* dwarf_abbrev_buffer; - /* Length of the loaded .debug_abbrev section. */ + /* Length of the loaded .debug_abbrev section. */ unsigned long dwarf_abbrev_size; /* Buffer for decode_line_info. */ char *dwarf_line_buffer; + + /* Length of the loaded .debug_line section. */ + unsigned long dwarf_line_size; }; -struct arange { +struct arange +{ struct arange *next; bfd_vma low; bfd_vma high; }; - /* A minimal decoding of DWARF2 compilation units. We only decode - what's needed to get to the line number information. */ + what's needed to get to the line number information. */ -struct comp_unit { - - /* Chain the previously read compilation units. */ +struct comp_unit +{ + /* Chain the previously read compilation units. */ struct comp_unit* next_unit; - /* Keep the bdf convenient (for memory allocation). */ + /* Keep the bdf convenient (for memory allocation). */ bfd* abfd; /* The lowest and higest addresses contained in this compilation - unit as specified in the compilation unit header. */ + unit as specified in the compilation unit header. */ struct arange arange; - /* The DW_AT_name attribute (for error messages). */ + /* The DW_AT_name attribute (for error messages). */ char* name; - /* The abbrev hash table. */ + /* The abbrev hash table. */ struct abbrev_info** abbrevs; - /* Note that an error was found by comp_unit_find_nearest_line. */ + /* Note that an error was found by comp_unit_find_nearest_line. */ int error; - /* The DW_AT_comp_dir attribute */ + /* The DW_AT_comp_dir attribute. */ char* comp_dir; - /* True if there is a line number table associated with this comp. unit. */ + /* True if there is a line number table associated with this comp. unit. */ int stmtlist; - - /* The offset into .debug_line of the line number table. */ + + /* The offset into .debug_line of the line number table. */ unsigned long line_offset; - /* Pointer to the first child die for the comp unit. */ + /* Pointer to the first child die for the comp unit. */ char *first_child_die_ptr; - /* The end of the comp unit. */ + /* The end of the comp unit. */ char *end_ptr; - /* The decoded line number, NULL if not yet decoded. */ + /* The decoded line number, NULL if not yet decoded. */ struct line_info_table* line_table; - /* A list of the functions found in this comp. unit. */ - struct funcinfo* function_table; + /* A list of the functions found in this comp. unit. */ + struct funcinfo* function_table; - /* Address size for this unit - from unit header */ + /* Address size for this unit - from unit header. */ unsigned char addr_size; }; +/* VERBATIM + The following function up to the END VERBATIM mark are + copied directly from dwarf2read.c. */ - -/* VERBATIM - The following function up to the END VERBATIM mark are - copied directly from dwarf2read.c. */ - -/* read dwarf information from a buffer */ +/* Read dwarf information from a buffer. */ static unsigned int read_1_byte (abfd, buf) @@ -192,9 +194,7 @@ read_2_bytes (abfd, buf) return bfd_get_16 (abfd, (bfd_byte *) buf); } -#if 0 - -/* This is not used. */ +#if 0 /* This is not used. */ static int read_2_signed_bytes (abfd, buf) @@ -214,9 +214,7 @@ read_4_bytes (abfd, buf) return bfd_get_32 (abfd, (bfd_byte *) buf); } -#if 0 - -/* This is not used. */ +#if 0 /* This is not used. */ static int read_4_signed_bytes (abfd, buf) @@ -262,6 +260,7 @@ read_string (abfd, buf, bytes_read_ptr) *bytes_read_ptr = 1; return NULL; } + *bytes_read_ptr = strlen (buf) + 1; return buf; } @@ -280,7 +279,7 @@ read_unsigned_leb128 (abfd, buf, bytes_read_ptr) result = 0; shift = 0; num_read = 0; - + do { byte = bfd_get_8 (abfd, (bfd_byte *) buf); @@ -290,9 +289,9 @@ read_unsigned_leb128 (abfd, buf, bytes_read_ptr) shift += 7; } while (byte & 0x80); - + * bytes_read_ptr = num_read; - + return result; } @@ -320,12 +319,12 @@ read_signed_leb128 (abfd, buf, bytes_read_ptr) shift += 7; } while (byte & 0x80); - + if ((shift < 32) && (byte & 0x40)) result |= -(1 << shift); * bytes_read_ptr = num_read; - + return result; } @@ -349,26 +348,22 @@ read_address (unit, buf) } } - - - - -/* This data structure holds the information of an abbrev. */ +/* 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 */ - }; +{ + 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; - }; +{ + enum dwarf_attribute name; + enum dwarf_form form; +}; #ifndef ABBREV_HASH_SIZE #define ABBREV_HASH_SIZE 121 @@ -397,6 +392,7 @@ lookup_abbrev (number,abbrevs) else abbrev = abbrev->next; } + return NULL; } @@ -406,18 +402,16 @@ lookup_abbrev (number,abbrevs) in a hash table. */ static struct abbrev_info** -read_abbrevs (abfd, offset) +read_abbrevs (abfd, offset, stash) bfd * abfd; unsigned int offset; + struct dwarf2_debug *stash; { struct abbrev_info **abbrevs; char *abbrev_ptr; struct abbrev_info *cur_abbrev; unsigned int abbrev_number, bytes_read, abbrev_name; unsigned int abbrev_form, hash_number; - struct dwarf2_debug *stash; - - stash = elf_tdata(abfd)->dwarf2_find_line_info; if (! stash->dwarf_abbrev_buffer) { @@ -430,13 +424,13 @@ read_abbrevs (abfd, offset) bfd_set_error (bfd_error_bad_value); return 0; } - + stash->dwarf_abbrev_size = msec->_raw_size; stash->dwarf_abbrev_buffer = (char*) bfd_alloc (abfd, stash->dwarf_abbrev_size); if (! stash->dwarf_abbrev_buffer) return 0; - - if (! bfd_get_section_contents (abfd, msec, + + if (! bfd_get_section_contents (abfd, msec, stash->dwarf_abbrev_buffer, 0, stash->dwarf_abbrev_size)) return 0; @@ -444,35 +438,36 @@ read_abbrevs (abfd, offset) if (offset > stash->dwarf_abbrev_size) { - (*_bfd_error_handler) (_("Dwarf Error: Abbrev offset (%u) bigger than abbrev size (%u)."), + (*_bfd_error_handler) (_("Dwarf Error: Abbrev offset (%u) bigger than abbrev size (%u)."), offset, stash->dwarf_abbrev_size ); bfd_set_error (bfd_error_bad_value); return 0; } - abbrevs = (struct abbrev_info**) bfd_zalloc (abfd, sizeof(struct abbrev_info*) * ABBREV_HASH_SIZE); + abbrevs = (struct abbrev_info**) bfd_zalloc (abfd, sizeof (struct abbrev_info*) * ABBREV_HASH_SIZE); abbrev_ptr = stash->dwarf_abbrev_buffer + offset; abbrev_number = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); abbrev_ptr += bytes_read; - /* loop until we reach an abbrev number of 0 */ + /* Loop until we reach an abbrev number of 0. */ while (abbrev_number) { cur_abbrev = (struct abbrev_info*)bfd_zalloc (abfd, sizeof (struct abbrev_info)); - /* read in abbrev header */ + /* Read in abbrev header. */ cur_abbrev->number = abbrev_number; cur_abbrev->tag = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); abbrev_ptr += bytes_read; cur_abbrev->has_children = read_1_byte (abfd, abbrev_ptr); abbrev_ptr += 1; - /* now read in declarations */ + /* Now read in declarations. */ abbrev_name = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); abbrev_ptr += bytes_read; abbrev_form = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); abbrev_ptr += bytes_read; + while (abbrev_name) { if ((cur_abbrev->num_attrs % ATTR_ALLOC_CHUNK) == 0) @@ -484,6 +479,7 @@ read_abbrevs (abfd, offset) if (! cur_abbrev->attrs) return 0; } + cur_abbrev->attrs[cur_abbrev->num_attrs].name = abbrev_name; cur_abbrev->attrs[cur_abbrev->num_attrs++].form = abbrev_form; abbrev_name = read_unsigned_leb128 (abfd, abbrev_ptr, &bytes_read); @@ -530,6 +526,7 @@ read_attribute (attr, abbrev, unit, info_ptr) attr->name = abbrev->name; attr->form = abbrev->form; + switch (abbrev->form) { case DW_FORM_addr: @@ -631,42 +628,41 @@ read_attribute (attr, abbrev, unit, info_ptr) return info_ptr; } - -/* Source line information table routines. */ +/* Source line information table routines. */ #define FILE_ALLOC_CHUNK 5 #define DIR_ALLOC_CHUNK 5 -struct line_info { +struct line_info +{ struct line_info* prev_line; - bfd_vma address; char* filename; unsigned int line; unsigned int column; - int end_sequence; /* end of (sequential) code sequence */ + int end_sequence; /* End of (sequential) code sequence. */ }; -struct fileinfo { +struct fileinfo +{ char *name; unsigned int dir; unsigned int time; unsigned int size; }; -struct line_info_table { +struct line_info_table +{ bfd* abfd; - unsigned int num_files; unsigned int num_dirs; - char* comp_dir; char** dirs; struct fileinfo* files; struct line_info* last_line; }; -static void +static void add_line_info (table, address, filename, line, column, end_sequence) struct line_info_table* table; bfd_vma address; @@ -688,7 +684,7 @@ add_line_info (table, address, filename, line, column, end_sequence) info->end_sequence = end_sequence; } -static char* +static char * concat_filename (table, file) struct line_info_table* table; unsigned int file; @@ -703,7 +699,7 @@ concat_filename (table, file) } filename = table->files[file - 1].name; - if (*filename == '/') + if (IS_ABSOLUTE_PATH(filename)) return filename; else @@ -723,8 +719,9 @@ arange_add (unit, low_pc, high_pc) { struct arange *arange; - /* first see if we can cheaply extend an existing range: */ + /* First see if we can cheaply extend an existing range. */ arange = &unit->arange; + do { if (low_pc == arange->high) @@ -743,14 +740,14 @@ arange_add (unit, low_pc, high_pc) if (unit->arange.high == 0) { - /* this is the first address range: store it in unit->arange: */ + /* This is the first address range: store it in unit->arange. */ unit->arange.next = 0; unit->arange.low = low_pc; unit->arange.high = high_pc; return; } - /* need to allocate a new arange and insert it into the arange list: */ + /* Need to allocate a new arange and insert it into the arange list. */ arange = bfd_zalloc (unit->abfd, sizeof (*arange)); arange->low = low_pc; arange->high = high_pc; @@ -759,18 +756,15 @@ arange_add (unit, low_pc, high_pc) unit->arange.next = arange; } -/* Decode the line number information for UNIT. */ +/* Decode the line number information for UNIT. */ static struct line_info_table* -decode_line_info (unit) +decode_line_info (unit, stash) struct comp_unit *unit; + struct dwarf2_debug *stash; { bfd *abfd = unit->abfd; - - struct dwarf2_debug *stash; - struct line_info_table* table; - char *line_ptr; char *line_end; struct line_head lh; @@ -778,12 +772,9 @@ decode_line_info (unit) char *cur_file, *cur_dir; unsigned char op_code, extended_op, adj_opcode; - stash = elf_tdata (abfd)->dwarf2_find_line_info; - if (! stash->dwarf_line_buffer) { asection *msec; - unsigned long size; msec = bfd_get_section_by_name (abfd, ".debug_line"); if (! msec) @@ -792,22 +783,33 @@ decode_line_info (unit) bfd_set_error (bfd_error_bad_value); return 0; } - - size = msec->_raw_size; - stash->dwarf_line_buffer = (char *) bfd_alloc (abfd, size); + + stash->dwarf_line_size = msec->_raw_size; + stash->dwarf_line_buffer = (char *) bfd_alloc (abfd, stash->dwarf_line_size); if (! stash->dwarf_line_buffer) return 0; - if (! bfd_get_section_contents (abfd, msec, + if (! bfd_get_section_contents (abfd, msec, stash->dwarf_line_buffer, 0, - size)) + stash->dwarf_line_size)) return 0; /* FIXME: We ought to apply the relocs against this section before - we process it.... */ + we process it... */ } - table = (struct line_info_table*) bfd_alloc (abfd, + /* Since we are using un-relocated data, it is possible to get a bad value + for the line_offset. Validate it here so that we won't get a segfault + below. */ + if (unit->line_offset >= stash->dwarf_line_size) + { + (*_bfd_error_handler) (_("Dwarf Error: Line offset (%u) bigger than line size (%u)."), + unit->line_offset, stash->dwarf_line_size); + bfd_set_error (bfd_error_bad_value); + return 0; + } + + table = (struct line_info_table*) bfd_alloc (abfd, sizeof (struct line_info_table)); table->abfd = abfd; table->comp_dir = unit->comp_dir; @@ -823,7 +825,7 @@ decode_line_info (unit) line_ptr = stash->dwarf_line_buffer + unit->line_offset; - /* read in the prologue */ + /* Read in the prologue. */ lh.total_length = read_4_bytes (abfd, line_ptr); line_ptr += 4; line_end = line_ptr + lh.total_length; @@ -845,16 +847,18 @@ decode_line_info (unit) bfd_alloc (abfd, lh.opcode_base * sizeof (unsigned char)); lh.standard_opcode_lengths[0] = 1; + for (i = 1; i < lh.opcode_base; ++i) { lh.standard_opcode_lengths[i] = read_1_byte (abfd, line_ptr); line_ptr += 1; } - /* Read directory table */ + /* Read directory table. */ while ((cur_dir = read_string (abfd, line_ptr, &bytes_read)) != NULL) { line_ptr += bytes_read; + if ((table->num_dirs % DIR_ALLOC_CHUNK) == 0) { table->dirs = (char **) @@ -863,14 +867,17 @@ decode_line_info (unit) if (! table->dirs) return 0; } + table->dirs[table->num_dirs++] = cur_dir; } + line_ptr += bytes_read; - /* Read file name table */ + /* Read file name table. */ while ((cur_file = read_string (abfd, line_ptr, &bytes_read)) != NULL) { line_ptr += bytes_read; + if ((table->num_files % FILE_ALLOC_CHUNK) == 0) { table->files = (struct fileinfo *) @@ -880,6 +887,7 @@ decode_line_info (unit) if (! table->files) return 0; } + table->files[table->num_files].name = cur_file; table->files[table->num_files].dir = read_unsigned_leb128 (abfd, line_ptr, &bytes_read); @@ -892,12 +900,13 @@ decode_line_info (unit) line_ptr += bytes_read; table->num_files++; } + line_ptr += bytes_read; /* Read the statement sequences until there's nothing left. */ while (line_ptr < line_end) { - /* state machine registers */ + /* State machine registers. */ bfd_vma address = 0; char* filename = concat_filename (table, 1); unsigned int line = 1; @@ -907,15 +916,16 @@ decode_line_info (unit) int end_sequence = 0, need_low_pc = 1; bfd_vma low_pc = 0; - /* Decode the table. */ + /* Decode the table. */ while (! end_sequence) { op_code = read_1_byte (abfd, line_ptr); line_ptr += 1; + switch (op_code) { case DW_LNS_extended_op: - line_ptr += 1; /* ignore length */ + line_ptr += 1; /* Ignore length. */ extended_op = read_1_byte (abfd, line_ptr); line_ptr += 1; switch (extended_op) @@ -1012,12 +1022,12 @@ decode_line_info (unit) address += read_2_bytes (abfd, line_ptr); line_ptr += 2; break; - default: /* special operand */ + 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 */ + /* Append row to matrix using current values. */ add_line_info (table, address, filename, line, column, 0); basic_block = 1; if (need_low_pc) @@ -1032,15 +1042,14 @@ decode_line_info (unit) return table; } - /* If ADDR is within TABLE set the output parameters and return true, otherwise return false. The output parameters, FILENAME_PTR and - LINENUMBER_PTR, are pointers to the objects to be filled in. */ + LINENUMBER_PTR, are pointers to the objects to be filled in. */ static boolean -lookup_address_in_line_info_table (table, +lookup_address_in_line_info_table (table, addr, - filename_ptr, + filename_ptr, linenumber_ptr) struct line_info_table* table; bfd_vma addr; @@ -1049,7 +1058,7 @@ lookup_address_in_line_info_table (table, { struct line_info* next_line = table->last_line; struct line_info* each_line; - + if (!next_line) return false; @@ -1067,28 +1076,24 @@ lookup_address_in_line_info_table (table, next_line = each_line; each_line = each_line->prev_line; } - + return false; } - +/* Function table functions. */ - -/* Function table functions. */ - -struct funcinfo { +struct funcinfo +{ struct funcinfo *prev_func; - char* name; bfd_vma low; bfd_vma high; }; - -/* If ADDR is within TABLE, set FUNCTIONNAME_PTR, and return true. */ +/* If ADDR is within TABLE, set FUNCTIONNAME_PTR, and return true. */ static boolean -lookup_address_in_function_table (table, +lookup_address_in_function_table (table, addr, functionname_ptr) struct funcinfo* table; @@ -1107,18 +1112,14 @@ lookup_address_in_function_table (table, return true; } } - + return false; } - - - -/* DWARF2 Compilation unit functions. */ - +/* DWARF2 Compilation unit functions. */ /* Scan over each die in a comp. unit looking for functions to add - to the function table. */ + to the function table. */ static boolean scan_unit_for_functions (unit) @@ -1144,16 +1145,16 @@ scan_unit_for_functions (unit) nesting_level--; continue; } - + abbrev = lookup_abbrev (abbrev_number,unit->abbrevs); if (! abbrev) { - (*_bfd_error_handler) (_("Dwarf Error: Could not find abbrev number %d."), + (*_bfd_error_handler) (_("Dwarf Error: Could not find abbrev number %d."), abbrev_number); bfd_set_error (bfd_error_bad_value); return false; } - + if (abbrev->tag == DW_TAG_subprogram) { func = (struct funcinfo*) bfd_zalloc (abfd, sizeof (struct funcinfo)); @@ -1162,24 +1163,24 @@ scan_unit_for_functions (unit) } else func = NULL; - + for (i = 0; i < abbrev->num_attrs; ++i) { info_ptr = read_attribute (&attr, &abbrev->attrs[i], unit, info_ptr); - + if (func) { switch (attr.name) { case DW_AT_name: - + name = DW_STRING (&attr); /* Prefer DW_AT_MIPS_linkage_name over DW_AT_name. */ if (func->name == NULL) func->name = DW_STRING (&attr); break; - + case DW_AT_MIPS_linkage_name: func->name = DW_STRING (&attr); break; @@ -1203,7 +1204,7 @@ scan_unit_for_functions (unit) case DW_AT_name: name = DW_STRING (&attr); break; - + default: break; } @@ -1217,11 +1218,6 @@ scan_unit_for_functions (unit) return true; } - - - - - /* Parse a DWARF2 compilation unit starting at INFO_PTR. This includes the compilation unit header that proceeds the DIE's, but does not include the length field that preceeds each compilation @@ -1233,10 +1229,10 @@ scan_unit_for_functions (unit) to get to the line number information for the compilation unit. */ static struct comp_unit * -parse_comp_unit (abfd, info_ptr, end_ptr, abbrev_length) +parse_comp_unit (abfd, stash, unit_length, abbrev_length) bfd* abfd; - char* info_ptr; - char* end_ptr; + struct dwarf2_debug *stash; + bfd_vma unit_length; unsigned int abbrev_length; { struct comp_unit* unit; @@ -1250,6 +1246,9 @@ parse_comp_unit (abfd, info_ptr, end_ptr, abbrev_length) struct abbrev_info *abbrev; struct attribute attr; + char *info_ptr = stash->info_ptr; + char *end_ptr = info_ptr + unit_length; + version = read_2_bytes (abfd, info_ptr); info_ptr += 2; BFD_ASSERT (abbrev_length == 0 @@ -1286,8 +1285,8 @@ parse_comp_unit (abfd, info_ptr, end_ptr, abbrev_length) return 0; } - /* Read the abbrevs for this compilation unit into a table */ - abbrevs = read_abbrevs (abfd, abbrev_offset); + /* Read the abbrevs for this compilation unit into a table. */ + abbrevs = read_abbrevs (abfd, abbrev_offset, stash); if (! abbrevs) return 0; @@ -1309,10 +1308,10 @@ parse_comp_unit (abfd, info_ptr, end_ptr, abbrev_length) bfd_set_error (bfd_error_bad_value); return 0; } - + unit = (struct comp_unit*) bfd_zalloc (abfd, sizeof (struct comp_unit)); unit->abfd = abfd; - unit->addr_size = addr_size; + unit->addr_size = addr_size; unit->abbrevs = abbrevs; unit->end_ptr = end_ptr; @@ -1366,11 +1365,7 @@ parse_comp_unit (abfd, info_ptr, end_ptr, abbrev_length) return unit; } - - - - -/* Return true if UNIT contains the address given by ADDR. */ +/* Return true if UNIT contains the address given by ADDR. */ static boolean comp_unit_contains_address (unit, addr) @@ -1390,30 +1385,32 @@ comp_unit_contains_address (unit, addr) arange = arange->next; } while (arange); + return 0; } - /* If UNIT contains ADDR, set the output parameters to the values for the line containing ADDR. The output parameters, FILENAME_PTR, FUNCTIONNAME_PTR, and LINENUMBER_PTR, are pointers to the objects - to be filled in. + to be filled in. Return true of UNIT contains ADDR, and no errors were encountered; false otherwise. */ static boolean comp_unit_find_nearest_line (unit, addr, - filename_ptr, functionname_ptr, linenumber_ptr) + filename_ptr, functionname_ptr, linenumber_ptr, + stash) struct comp_unit* unit; bfd_vma addr; const char **filename_ptr; const char **functionname_ptr; unsigned int *linenumber_ptr; + struct dwarf2_debug *stash; { boolean line_p; boolean func_p; - + if (unit->error) return false; @@ -1424,15 +1421,15 @@ comp_unit_find_nearest_line (unit, addr, unit->error = 1; return false; } - - unit->line_table = decode_line_info (unit); + + unit->line_table = decode_line_info (unit, stash); if (! unit->line_table) { unit->error = 1; return false; } - + if (! scan_unit_for_functions (unit)) { unit->error = 1; @@ -1442,14 +1439,51 @@ comp_unit_find_nearest_line (unit, addr, line_p = lookup_address_in_line_info_table (unit->line_table, addr, - filename_ptr, + filename_ptr, linenumber_ptr); - func_p = lookup_address_in_function_table (unit->function_table, + func_p = lookup_address_in_function_table (unit->function_table, addr, functionname_ptr); return line_p || func_p; } +/* Locate a section in a BFD containing debugging info. The search starts from the + section after AFTER_SEC, or from the first section in the BFD if AFTER_SEC is + NULL. The search works by examining the names of the sections. There are two + permissiable names. The first is .debug_info. This is the standard DWARF2 name. + The second is a prefix .gnu.linkonce.wi. This is a variation on the .debug_info + section which has a checksum describing the contents appended onto the name. This + allows the linker to identify and discard duplicate debugging sections for + different compilation units. */ +#define DWARF2_DEBUG_INFO ".debug_info" +#define GNU_LINKONCE_INFO ".gnu.linkonce.wi." + +static asection * +find_debug_info (abfd, after_sec) + bfd * abfd; + asection * after_sec; +{ + asection * msec; + + if (after_sec) + msec = after_sec->next; + else + msec = abfd->sections; + + while (msec) + { + if (strcmp (msec->name, DWARF2_DEBUG_INFO) == 0) + return msec; + + if (strncmp (msec->name, GNU_LINKONCE_INFO, strlen (GNU_LINKONCE_INFO)) == 0) + return msec; + + msec = msec->next; + } + + return NULL; +} + /* The DWARF2 version of find_nearest line. Return true if the line is found without error. ADDR_SIZE is the number of bytes in the initial .debug_info length field and in the abbreviation offset. @@ -1460,7 +1494,7 @@ boolean _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, filename_ptr, functionname_ptr, linenumber_ptr, - addr_size) + addr_size, pinfo) bfd *abfd; asection *section; asymbol **symbols ATTRIBUTE_UNUSED; @@ -1469,24 +1503,23 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, const char **functionname_ptr; unsigned int *linenumber_ptr; unsigned int addr_size; + PTR *pinfo; { /* Read each compilation unit from the section .debug_info, and check to see if it contains the address we are searching for. If yes, lookup the address, and return the line number info. If no, go - on to the next compilation unit. + on to the next compilation unit. We keep a list of all the previously read compilation units, and - a pointer to the next un-read compilation unit. Check the - previously read units before reading more. - */ + a pointer to the next un-read compilation unit. Check the + previously read units before reading more. */ + struct dwarf2_debug *stash = (struct dwarf2_debug *) *pinfo; - struct dwarf2_debug *stash = elf_tdata (abfd)->dwarf2_find_line_info; - - /* What address are we looking for? */ + /* What address are we looking for? */ bfd_vma addr = offset + section->vma; struct comp_unit* each; - + *filename_ptr = NULL; *functionname_ptr = NULL; *linenumber_ptr = 0; @@ -1497,74 +1530,90 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, if (addr_size == 0) addr_size = 4; BFD_ASSERT (addr_size == 4 || addr_size == 8); - + if (! stash) { + unsigned long total_size; asection *msec; - unsigned long size; - - stash = elf_tdata (abfd)->dwarf2_find_line_info = + + stash = (struct dwarf2_debug*) bfd_zalloc (abfd, sizeof (struct dwarf2_debug)); - if (! stash) return false; - - msec = bfd_get_section_by_name (abfd, ".debug_info"); + + *pinfo = (PTR) stash; + + msec = find_debug_info (abfd, NULL); if (! msec) - { - /* No dwarf2 info. Note that at this point the stash - has been allocated, but contains zeros, this lets - future calls to this function fail quicker. */ - return false; - } + /* No dwarf2 info. Note that at this point the stash + has been allocated, but contains zeros, this lets + future calls to this function fail quicker. */ + return false; - size = msec->_raw_size; - if (size == 0) - return false; - - stash->info_ptr = (char *) bfd_alloc (abfd, size); - - if (! stash->info_ptr) + /* There can be more than one DWARF2 info section in a BFD these days. + Read them all in and produce one large stash. We do this in two + passes - in the first pass we just accumulate the section sizes. + In the second pass we read in the section's contents. The allows + us to avoid reallocing the data as we add sections to the stash. */ + for (total_size = 0; msec; msec = find_debug_info (abfd, msec)) + total_size += msec->_raw_size; + + stash->info_ptr = (char *) bfd_alloc (abfd, total_size); + if (stash->info_ptr == NULL) return false; - if (! bfd_get_section_contents (abfd, msec, stash->info_ptr, 0, size)) + stash->info_ptr_end = stash->info_ptr; + + for (msec = find_debug_info (abfd, NULL); + msec; + msec = find_debug_info (abfd, msec)) { - stash->info_ptr = 0; - return false; + unsigned long size; + unsigned long start; + + size = msec->_raw_size; + if (size == 0) + continue; + + start = stash->info_ptr_end - stash->info_ptr; + + if (! bfd_get_section_contents (abfd, msec, stash->info_ptr + start, 0, size)) + continue; + + stash->info_ptr_end = stash->info_ptr + start + size; } - stash->info_ptr_end = stash->info_ptr + size; - - /* FIXME: There is a problem with the contents of the - .debug_info section. The 'low' and 'high' addresses of the - comp_units are computed by relocs against symbols in the - .text segment. We need these addresses in order to determine - the nearest line number, and so we have to resolve the - relocs. There is a similar problem when the .debug_line - section is processed as well (e.g., there may be relocs - against the operand of the DW_LNE_set_address operator). - - Unfortunately getting hold of the reloc information is hard... - - For now, this means that disassembling object files (as - opposed to fully executables) does not always work as well as - we would like. */ + BFD_ASSERT (stash->info_ptr_end = stash->info_ptr + total_size); } - - /* A null info_ptr indicates that there is no dwarf2 info - (or that an error occured while setting up the stash). */ + /* FIXME: There is a problem with the contents of the + .debug_info section. The 'low' and 'high' addresses of the + comp_units are computed by relocs against symbols in the + .text segment. We need these addresses in order to determine + the nearest line number, and so we have to resolve the + relocs. There is a similar problem when the .debug_line + section is processed as well (e.g., there may be relocs + against the operand of the DW_LNE_set_address operator). + + Unfortunately getting hold of the reloc information is hard... + + For now, this means that disassembling object files (as + opposed to fully executables) does not always work as well as + we would like. */ + + /* A null info_ptr indicates that there is no dwarf2 info + (or that an error occured while setting up the stash). */ if (! stash->info_ptr) return false; - /* Check the previously read comp. units first. */ - + /* Check the previously read comp. units first. */ for (each = stash->all_comp_units; each; each = each->next_unit) if (comp_unit_contains_address (each, addr)) - return comp_unit_find_nearest_line (each, addr, filename_ptr, - functionname_ptr, linenumber_ptr); + return comp_unit_find_nearest_line (each, addr, filename_ptr, + functionname_ptr, linenumber_ptr, + stash); - /* Read each remaining comp. units checking each as they are read. */ + /* Read each remaining comp. units checking each as they are read. */ while (stash->info_ptr < stash->info_ptr_end) { struct comp_unit* each; @@ -1579,9 +1628,7 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, if (length > 0) { - each = parse_comp_unit (abfd, stash->info_ptr, - stash->info_ptr + length, - addr_size); + each = parse_comp_unit (abfd, stash, length, addr_size); stash->info_ptr += length; if (each) @@ -1593,21 +1640,23 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, compilation units. If we don't have them (i.e., unit->high == 0), we need to consult the line info table to see if a compilation unit contains the given - address. */ + address. */ if (each->arange.high > 0) { if (comp_unit_contains_address (each, addr)) return comp_unit_find_nearest_line (each, addr, filename_ptr, functionname_ptr, - linenumber_ptr); + linenumber_ptr, + stash); } else { found = comp_unit_find_nearest_line (each, addr, filename_ptr, functionname_ptr, - linenumber_ptr); + linenumber_ptr, + stash); if (found) return true; } @@ -1617,5 +1666,3 @@ _bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, return false; } - -/* end of file */ diff --git a/gnu/dist/toolchain/bfd/ecoff.c b/gnu/dist/toolchain/bfd/ecoff.c index 4b136ee1f885..f22112bd75bd 100644 --- a/gnu/dist/toolchain/bfd/ecoff.c +++ b/gnu/dist/toolchain/bfd/ecoff.c @@ -1,5 +1,5 @@ /* Generic ECOFF (Extended-COFF) routines. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Original version by Per Bothner. Full support added by Ian Lance Taylor, ian@cygnus.com. @@ -344,9 +344,9 @@ ecoff_sec_to_styp_flags (name, flags) } else if (strcmp (name, _RCONST) == 0) styp = STYP_RCONST; - else if (flags & SEC_CODE) + else if (flags & SEC_CODE) styp = STYP_TEXT; - else if (flags & SEC_DATA) + else if (flags & SEC_DATA) styp = STYP_DATA; else if (flags & SEC_READONLY) styp = STYP_RDATA; @@ -363,7 +363,6 @@ ecoff_sec_to_styp_flags (name, flags) /* Get the BFD flags to use for a section. */ -/*ARGSUSED*/ flagword _bfd_ecoff_styp_to_sec_flags (abfd, hdr, name, section) bfd *abfd ATTRIBUTE_UNUSED; @@ -452,7 +451,7 @@ ecoff_slurp_symbolic_header (abfd) HDRR *internal_symhdr; /* See if we've already read it in. */ - if (ecoff_data (abfd)->debug_info.symbolic_header.magic == + if (ecoff_data (abfd)->debug_info.symbolic_header.magic == backend->debug_swap.sym_magic) return true; @@ -509,7 +508,6 @@ ecoff_slurp_symbolic_header (abfd) object file. This is called by gdb via the read_debug_info entry point in the backend structure. */ -/*ARGSUSED*/ boolean _bfd_ecoff_slurp_symbolic_info (abfd, ignore, debug) bfd *abfd; @@ -1090,7 +1088,7 @@ ecoff_emit_aggregate (abfd, fdr, string, rndx, isym, which) unsigned int ifd = rndx->rfd; unsigned int indx = rndx->index; const char *name; - + if (ifd == 0xfff) ifd = isym; @@ -1340,7 +1338,6 @@ ecoff_type_to_string (abfd, fdr, indx) p1 += strlen (buffer1); } - /* * Deal with any qualifiers. */ @@ -1406,7 +1403,7 @@ ecoff_type_to_string (abfd, fdr, indx) int j; /* Print array bounds reversed (ie, in the order the C - programmer writes them). C is such a fun language.... */ + programmer writes them). C is such a fun language.... */ while (i < 5 && qualifiers[i+1].type == tqArray) i++; @@ -1447,7 +1444,6 @@ ecoff_type_to_string (abfd, fdr, indx) /* Return information about ECOFF symbol SYMBOL in RET. */ -/*ARGSUSED*/ void _bfd_ecoff_get_symbol_info (abfd, symbol, ret) bfd *abfd ATTRIBUTE_UNUSED; @@ -1459,7 +1455,6 @@ _bfd_ecoff_get_symbol_info (abfd, symbol, ret) /* Return whether this is a local label. */ -/*ARGSUSED*/ boolean _bfd_ecoff_bfd_is_local_label_name (abfd, name) bfd *abfd ATTRIBUTE_UNUSED; @@ -1490,7 +1485,7 @@ _bfd_ecoff_print_symbol (abfd, filep, symbol, how) if (ecoffsymbol (symbol)->local) { SYMR ecoff_sym; - + (*debug_swap->swap_sym_in) (abfd, ecoffsymbol (symbol)->native, &ecoff_sym); fprintf (file, "ecoff local "); @@ -1604,7 +1599,7 @@ _bfd_ecoff_print_symbol (abfd, filep, symbol, how) fprintf (file, _("\n First symbol: %ld"), (long) (indx + sym_base)); else - fprintf (file, _("\n First symbol: %ld"), + fprintf (file, _("\n First symbol: %ld"), ((long) (AUX_GET_ISYM (bigendian, &aux_base[ecoff_ext.asym.index]) @@ -1680,7 +1675,7 @@ 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)); @@ -1778,7 +1773,7 @@ _bfd_ecoff_canonicalize_reloc (abfd, section, relptr, symbols) { unsigned int count; - if (section->flags & SEC_CONSTRUCTOR) + if (section->flags & SEC_CONSTRUCTOR) { arelent_chain *chain; @@ -1791,7 +1786,7 @@ _bfd_ecoff_canonicalize_reloc (abfd, section, relptr, symbols) *relptr++ = &chain->relent; } else - { + { arelent *tblptr; if (ecoff_slurp_reloc_table (abfd, section, symbols) == false) @@ -1812,7 +1807,6 @@ _bfd_ecoff_canonicalize_reloc (abfd, section, relptr, symbols) and return the name of the source file and the line nearest to the wanted location. */ -/*ARGSUSED*/ boolean _bfd_ecoff_find_nearest_line (abfd, section, ignore_symbols, offset, filename_ptr, functionname_ptr, retline_ptr) @@ -1984,7 +1978,6 @@ _bfd_ecoff_set_arch_mach (abfd, arch, machine) /* Get the size of the section headers. */ -/*ARGSUSED*/ int _bfd_ecoff_sizeof_headers (abfd, reloc) bfd *abfd; @@ -1996,8 +1989,8 @@ _bfd_ecoff_sizeof_headers (abfd, reloc) c = 0; for (current = abfd->sections; - current != (asection *)NULL; - current = current->next) + current != (asection *)NULL; + current = current->next) ++c; ret = (bfd_coff_filhsz (abfd) @@ -2218,13 +2211,13 @@ ecoff_compute_reloc_file_positions (abfd) abort (); abfd->output_has_begun = true; } - + reloc_base = ecoff_data (abfd)->reloc_filepos; reloc_size = 0; for (current = abfd->sections; - current != (asection *)NULL; - current = current->next) + current != (asection *)NULL; + current = current->next) { if (current->reloc_count == 0) current->rel_filepos = 0; @@ -2312,7 +2305,7 @@ bfd_ecoff_get_gp_value (abfd) bfd_set_error (bfd_error_invalid_operation); return 0; } - + return ecoff_data (abfd)->gp; } @@ -2491,8 +2484,8 @@ _bfd_ecoff_write_object_contents (abfd) count = 1; for (current = abfd->sections; - current != (asection *)NULL; - current = current->next) + current != (asection *)NULL; + current = current->next) { current->target_index = count; ++count; @@ -2630,7 +2623,7 @@ _bfd_ecoff_write_object_contents (abfd) /* Do nothing */ ; else abort (); - } + } /* Set up the file header. */ @@ -2782,7 +2775,7 @@ _bfd_ecoff_write_object_contents (abfd) arelent *reloc; asymbol *sym; struct internal_reloc in; - + memset ((PTR) &in, 0, sizeof in); reloc = *reloc_ptr_ptr; @@ -2982,7 +2975,7 @@ _bfd_ecoff_slurp_armap (abfd) char *raw_ptr; struct symdef *symdef_ptr; char *stringbase; - + /* Get the name of the first element. */ i = bfd_read ((PTR) nextname, 1, 16, abfd); if (i == 0) @@ -3034,11 +3027,11 @@ _bfd_ecoff_slurp_armap (abfd) return false; parsed_size = mapdata->parsed_size; bfd_release (abfd, (PTR) mapdata); - + raw_armap = (char *) bfd_alloc (abfd, parsed_size); if (raw_armap == (char *) NULL) return false; - + if (bfd_read ((PTR) raw_armap, 1, parsed_size, abfd) != parsed_size) { if (bfd_get_error () != bfd_error_system_call) @@ -3046,7 +3039,7 @@ _bfd_ecoff_slurp_armap (abfd) bfd_release (abfd, (PTR) raw_armap); return false; } - + ardata->tdata = (PTR) raw_armap; count = bfd_h_get_32 (abfd, (PTR) raw_armap); @@ -3075,7 +3068,7 @@ _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)); if (file_offset == 0) @@ -3167,7 +3160,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) padit = stridx % 2; stringsize = stridx + padit; - /* Include 8 bytes to store symdefsize and stringsize in output. */ + /* Include 8 bytes to store symdefsize and stringsize in output. */ mapsize = symdefsize + stringsize + 8; firstreal = SARMAG + sizeof (struct ar_hdr) + mapsize + elength; @@ -3201,7 +3194,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) #if 0 hdr.ar_mode[0] = '0'; #else - /* Building gcc ends up extracting the armap as a file - twice. */ + /* Building gcc ends up extracting the armap as a file - twice. */ hdr.ar_mode[0] = '6'; hdr.ar_mode[1] = '4'; hdr.ar_mode[2] = '4'; @@ -3214,8 +3207,8 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) /* Turn all null bytes in the header into spaces. */ for (i = 0; i < sizeof (struct ar_hdr); i++) - if (((char *)(&hdr))[i] == '\0') - (((char *)(&hdr))[i]) = ' '; + if (((char *) (&hdr))[i] == '\0') + (((char *) (&hdr))[i]) = ' '; if (bfd_write ((PTR) &hdr, 1, sizeof (struct ar_hdr), abfd) != sizeof (struct ar_hdr)) @@ -3224,7 +3217,7 @@ _bfd_ecoff_write_armap (abfd, elength, map, orl_count, stridx) bfd_h_put_32 (abfd, (bfd_vma) hashsize, temp); if (bfd_write ((PTR) temp, 1, 4, abfd) != 4) return false; - + hashtable = (bfd_byte *) bfd_zalloc (abfd, symdefsize); if (!hashtable) return false; @@ -3266,7 +3259,7 @@ _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, @@ -3345,7 +3338,7 @@ _bfd_ecoff_archive_p (abfd) bfd_ardata (abfd)->symdefs = NULL; bfd_ardata (abfd)->extended_names = NULL; bfd_ardata (abfd)->tdata = NULL; - + if (_bfd_ecoff_slurp_armap (abfd) == false || _bfd_ecoff_slurp_extended_name_table (abfd) == false) { @@ -3353,7 +3346,7 @@ _bfd_ecoff_archive_p (abfd) abfd->tdata.aout_ar_data = tdata_hold; return (const bfd_target *) NULL; } - + if (bfd_has_map (abfd)) { bfd *first; @@ -4391,7 +4384,7 @@ ecoff_link_write_external (h, data) bfd *output_bfd = einfo->abfd; boolean strip; - /* We need to check if this symbol is being stripped. */ + /* We need to check if this symbol is being stripped. */ if (h->root.type == bfd_link_hash_undefined || h->root.type == bfd_link_hash_undefweak) strip = false; @@ -4427,7 +4420,7 @@ ecoff_link_write_external (h, data) output_section = h->root.u.def.section->output_section; name = bfd_section_name (output_section->owner, output_section); - + if (strcmp (name, _TEXT) == 0) h->esym.asym.sc = scText; else if (strcmp (name, _DATA) == 0) diff --git a/gnu/dist/toolchain/bfd/ecoffswap.h b/gnu/dist/toolchain/bfd/ecoffswap.h index 0d28d16883e1..70d548da775f 100644 --- a/gnu/dist/toolchain/bfd/ecoffswap.h +++ b/gnu/dist/toolchain/bfd/ecoffswap.h @@ -1,5 +1,5 @@ /* Generic ECOFF swapping routines, for BFD. - Copyright 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright 1992, 1993, 1994, 1995, 1996, 2000 Free Software Foundation, Inc. Written by Cygnus Support. This file is part of BFD, the Binary File Descriptor library. @@ -27,10 +27,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ on them in gdb by naming the including source file; e.g., 'coff-mips.c':ecoff_swap_hdr_in. - Before including this header file, one of ECOFF_32 or ECOFF_64 must - be defined. These are checked when swapping information that - depends upon the target size. This code works for 32 bit and 64 - bit ECOFF, but may need to be generalized in the future. + Before including this header file, one of ECOFF_32, ECOFF_64, + ECOFF_SIGNED_32 or ECOFF_SIGNED_64 must be defined. These are + checked when swapping information that depends upon the target + size. This code works for 32 bit and 64 bit ECOFF, but may need to + be generalized in the future. Some header file which defines the external forms of these structures must also be included before including this header file. @@ -50,6 +51,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define ecoff_get_off bfd_h_get_64 #define ecoff_put_off bfd_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 +#endif +#ifdef ECOFF_SIGNED_64 +#define ecoff_get_off bfd_h_get_signed_64 +#define ecoff_put_off bfd_h_put_signed_64 +#endif /* ECOFF auxiliary information swapping routines. These are the same for all ECOFF targets, so they are defined in ecofflink.c. */ @@ -122,7 +131,7 @@ ecoff_swap_hdr_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -167,7 +176,7 @@ ecoff_swap_hdr_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -182,10 +191,10 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern) struct fdr_ext ext[1]; *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); -#ifdef ECOFF_64 +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) if (intern->rss == 0xffffffff) intern->rss = -1; #endif @@ -197,11 +206,11 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern) 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); -#ifdef ECOFF_32 +#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); #endif -#ifdef ECOFF_64 +#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); #endif @@ -210,7 +219,7 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern) intern->rfdBase = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_rfdBase); intern->crfd = bfd_h_get_32 (abfd, (bfd_byte *)ext->f_crfd); - /* now the fun stuff... */ + /* 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; @@ -235,7 +244,7 @@ ecoff_swap_fdr_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -251,7 +260,7 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr) FDR intern[1]; *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); @@ -262,11 +271,11 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr) 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); -#ifdef ECOFF_32 +#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); #endif -#ifdef ECOFF_64 +#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); #endif @@ -275,7 +284,7 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr) bfd_h_put_32 (abfd, intern->rfdBase, (bfd_byte *)ext->f_rfdBase); bfd_h_put_32 (abfd, intern->crfd, (bfd_byte *)ext->f_crfd); - /* now the fun stuff... */ + /* 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) @@ -303,7 +312,7 @@ ecoff_swap_fdr_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -341,7 +350,7 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern) intern->lnHigh = bfd_h_get_32 (abfd, (bfd_byte *)ext->p_lnHigh); intern->cbLineOffset = ecoff_get_off (abfd, (bfd_byte *)ext->p_cbLineOffset); -#ifdef ECOFF_64 +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) intern->gp_prologue = bfd_h_get_8 (abfd, (bfd_byte *) ext->p_gp_prologue); if (bfd_header_big_endian (abfd)) { @@ -364,11 +373,11 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern) << PDR_BITS2_RESERVED_SH_LEFT_LITTLE)); } intern->localoff = bfd_h_get_8 (abfd, (bfd_byte *) ext->p_localoff); -#endif +#endif #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -384,7 +393,7 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) PDR intern[1]; *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); @@ -400,7 +409,7 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) bfd_h_put_32 (abfd, intern->lnHigh, (bfd_byte *)ext->p_lnHigh); ecoff_put_off (abfd, intern->cbLineOffset, (bfd_byte *)ext->p_cbLineOffset); -#ifdef ECOFF_64 +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) bfd_h_put_8 (abfd, intern->gp_prologue, (bfd_byte *) ext->p_gp_prologue); if (bfd_header_big_endian (abfd)) { @@ -425,17 +434,17 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) & PDR_BITS2_RESERVED_LITTLE); } bfd_h_put_8 (abfd, intern->localoff, (bfd_byte *) ext->p_localoff); -#endif +#endif #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } #else /* MPW_C */ /* Same routines, but with ECOFF_64 code removed, so ^&%$#&! MPW C doesn't - corrupt itself and then freak out. */ + corrupt itself and then freak out. */ /* Swap in the procedure descriptor record. */ static void @@ -447,7 +456,7 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern) struct pdr_ext ext[1]; *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); @@ -468,7 +477,7 @@ ecoff_swap_pdr_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -484,7 +493,7 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) PDR intern[1]; *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); @@ -502,7 +511,7 @@ ecoff_swap_pdr_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } #endif /* MPW_C */ @@ -518,11 +527,11 @@ ecoff_swap_sym_in (abfd, ext_copy, intern) struct sym_ext ext[1]; *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); - /* now the fun stuff... */ + /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { intern->st = (ext->s_bits1[0] & SYM_BITS1_ST_BIG) >> SYM_BITS1_ST_SH_BIG; @@ -552,7 +561,7 @@ ecoff_swap_sym_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -568,11 +577,11 @@ ecoff_swap_sym_out (abfd, intern_copy, ext_ptr) SYMR intern[1]; *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); - /* now the fun stuff... */ + /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { ext->s_bits1[0] = (((intern->st << SYM_BITS1_ST_SH_BIG) & SYM_BITS1_ST_BIG) @@ -601,7 +610,7 @@ ecoff_swap_sym_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -616,8 +625,8 @@ ecoff_swap_ext_in (abfd, ext_copy, intern) struct ext_ext ext[1]; *ext = *(struct ext_ext *) ext_copy; - - /* now the fun stuff... */ + + /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { intern->jmptbl = 0 != (ext->es_bits1[0] & EXT_BITS1_JMPTBL_BIG); intern->cobol_main = 0 != (ext->es_bits1[0] & EXT_BITS1_COBOL_MAIN_BIG); @@ -629,10 +638,10 @@ ecoff_swap_ext_in (abfd, ext_copy, intern) } intern->reserved = 0; -#ifdef ECOFF_32 +#if defined (ECOFF_32) || defined (ECOFF_SIGNED_32) intern->ifd = bfd_h_get_signed_16 (abfd, (bfd_byte *)ext->es_ifd); #endif -#ifdef ECOFF_64 +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) intern->ifd = bfd_h_get_signed_32 (abfd, (bfd_byte *)ext->es_ifd); #endif @@ -640,7 +649,7 @@ ecoff_swap_ext_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -656,14 +665,14 @@ ecoff_swap_ext_out (abfd, intern_copy, ext_ptr) EXTR intern[1]; *intern = *intern_copy; /* Make it reasonable to do in-place. */ - - /* now the fun stuff... */ + + /* now the fun stuff... */ if (bfd_header_big_endian (abfd)) { ext->es_bits1[0] = ((intern->jmptbl ? EXT_BITS1_JMPTBL_BIG : 0) | (intern->cobol_main ? EXT_BITS1_COBOL_MAIN_BIG : 0) | (intern->weakext ? EXT_BITS1_WEAKEXT_BIG : 0)); ext->es_bits2[0] = 0; -#ifdef ECOFF_64 +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) ext->es_bits2[1] = 0; ext->es_bits2[2] = 0; #endif @@ -672,16 +681,16 @@ ecoff_swap_ext_out (abfd, intern_copy, ext_ptr) | (intern->cobol_main ? EXT_BITS1_COBOL_MAIN_LITTLE : 0) | (intern->weakext ? EXT_BITS1_WEAKEXT_LITTLE : 0)); ext->es_bits2[0] = 0; -#ifdef ECOFF_64 +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) ext->es_bits2[1] = 0; ext->es_bits2[2] = 0; #endif } -#ifdef ECOFF_32 +#if defined (ECOFF_32) || defined (ECOFF_SIGNED_32) bfd_h_put_signed_16 (abfd, intern->ifd, (bfd_byte *)ext->es_ifd); #endif -#ifdef ECOFF_64 +#if defined (ECOFF_64) || defined (ECOFF_SIGNED_64) bfd_h_put_signed_32 (abfd, intern->ifd, (bfd_byte *)ext->es_ifd); #endif @@ -689,7 +698,7 @@ ecoff_swap_ext_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -707,7 +716,7 @@ ecoff_swap_rfd_in (abfd, ext_ptr, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -725,7 +734,7 @@ ecoff_swap_rfd_out (abfd, intern, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -766,7 +775,7 @@ ecoff_swap_opt_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -805,7 +814,7 @@ ecoff_swap_opt_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -826,7 +835,7 @@ ecoff_swap_dnr_in (abfd, ext_copy, intern) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } @@ -848,6 +857,6 @@ ecoff_swap_dnr_out (abfd, intern_copy, ext_ptr) #ifdef TEST if (memcmp ((char *)ext, (char *)intern, sizeof (*intern)) != 0) - abort(); + abort (); #endif } diff --git a/gnu/dist/toolchain/bfd/efi-app-ia32.c b/gnu/dist/toolchain/bfd/efi-app-ia32.c new file mode 100644 index 000000000000..5784178935a1 --- /dev/null +++ b/gnu/dist/toolchain/bfd/efi-app-ia32.c @@ -0,0 +1,35 @@ +/* BFD back-end for Intel IA-32 EFI application files. + Copyright 1999 Free Software Foundation, Inc. + Contributed by David Mosberger + +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" + +#define TARGET_SYM bfd_efi_app_ia32_vec +#define TARGET_NAME "efi-app-ia32" +#define COFF_IMAGE_WITH_PE +#define COFF_WITH_PE +#define PCRELOFFSET true +#define TARGET_UNDERSCORE '_' +#define COFF_LONG_SECTION_NAMES +#define ALIGN_SECTIONS_IN_FILE +#define PEI_DEFAULT_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_APPLICATION +#define PEI_FORCE_MINIMUM_ALIGNMENT + +#include "coff-i386.c" diff --git a/gnu/dist/toolchain/bfd/efi-app-ia64.c b/gnu/dist/toolchain/bfd/efi-app-ia64.c new file mode 100644 index 000000000000..b3182dc8b3f1 --- /dev/null +++ b/gnu/dist/toolchain/bfd/efi-app-ia64.c @@ -0,0 +1,35 @@ +/* BFD back-end for HP/Intel IA-64 EFI application files. + Copyright 1999 Free Software Foundation, Inc. + Contributed by David Mosberger + +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" + +#define TARGET_SYM bfd_efi_app_ia64_vec +#define TARGET_NAME "efi-app-ia64" +#define COFF_IMAGE_WITH_PE +#define COFF_WITH_PE +#define COFF_WITH_PEP64 +#define PCRELOFFSET true +#define TARGET_UNDERSCORE '_' +#define COFF_LONG_SECTION_NAMES +#define PEI_DEFAULT_TARGET_SUBSYSTEM IMAGE_SUBSYSTEM_EFI_APPLICATION +#define PEI_FORCE_MINIMUM_ALIGNMENT + +#include "coff-ia64.c" diff --git a/gnu/dist/toolchain/bfd/elf-bfd.h b/gnu/dist/toolchain/bfd/elf-bfd.h index 0dcecdf58847..4a36629fa19d 100644 --- a/gnu/dist/toolchain/bfd/elf-bfd.h +++ b/gnu/dist/toolchain/bfd/elf-bfd.h @@ -208,7 +208,7 @@ struct elf_link_local_dynamic_entry /* The index in the outgoing dynamic symbol table. */ long dynindx; - + /* A copy of the input symbol. */ Elf_Internal_Sym isym; }; @@ -243,6 +243,9 @@ struct elf_link_hash_table PTR stab_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; }; /* Look up an entry in an ELF linker hash table. */ @@ -372,9 +375,9 @@ struct elf_backend_data 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)); - + types should be handled here. */ + 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 @@ -388,8 +391,13 @@ struct elf_backend_data 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 *)); + /* A function to handle unusual program segment types when creating BFD - sections from ELF program segments. */ + sections from ELF program segments. */ boolean (*elf_backend_section_from_phdr) PARAMS ((bfd *, Elf32_Internal_Phdr *, int)); @@ -601,7 +609,7 @@ struct elf_backend_data /* Modify any information related to dynamic linking such that the symbol is not exported. */ void (*elf_backend_hide_symbol) - PARAMS ((struct elf_link_hash_entry *)); + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); /* The swapping table to use when dealing with ECOFF information. Used for the MIPS ELF .mdebug section. */ @@ -638,7 +646,7 @@ struct elf_backend_data both REL and RELA relocations, and this flag is set for those backends.) */ unsigned may_use_rel_p : 1; - + /* Whether the backend may use RELA relocations. (Some backends use both REL and RELA relocations, and this flag is set for those backends.) */ @@ -647,8 +655,8 @@ struct elf_backend_data /* Whether the default relocation type is RELA. If a backend with this flag set wants REL relocations for a particular section, it must note that explicitly. Similarly, if this flag is clear, - and the backend wants RELA relocations for a particular - section. */ + and the backend wants RELA relocations for a particular + section. */ unsigned default_use_rela_p : 1; /* True if addresses "naturally" sign extend. This is used when @@ -788,14 +796,14 @@ struct elf_obj_tdata file_ptr next_file_pos; #if 0 /* we don't need these inside bfd anymore, and I think - these weren't used outside bfd. */ + these weren't used outside bfd. */ 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) */ - /* Information grabbed from an elf core file. */ + /* Information grabbed from an elf core file. */ int core_signal; int core_pid; int core_lwpid; @@ -817,7 +825,7 @@ struct elf_obj_tdata 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 an entry - is -1, then the symbol does not require a global offset table entry. */ + is -1, then the symbol does not require a global offset table entry. */ union { bfd_signed_vma *refcounts; @@ -838,6 +846,14 @@ struct elf_obj_tdata one. */ const char *dt_name; + /* When a reference in a regular object is resolved by a shared + object is loaded into via the DT_NEEDED entries by the linker + ELF emulation code, we need to add the shared object to the + DT_NEEDED list of the resulting binary to indicate the dependency + as if the -l option is passed to the linker. This field holds the + name of the loaded shared object. */ + const char *dt_soname; + /* Irix 5 often screws up the symbol table, sorting local symbols after global symbols. This flag is set if the symbol table in this BFD appears to be screwed up. If it is, we ignore the @@ -857,11 +873,11 @@ struct elf_obj_tdata find_nearest_line. */ struct mips_elf_find_line *find_line_info; - /* A place to stash dwarf1 info for this bfd. */ + /* A place to stash dwarf1 info for this bfd. */ struct dwarf1_debug *dwarf1_find_line_info; - /* A place to stash dwarf2 info for this bfd. */ - struct dwarf2_debug *dwarf2_find_line_info; + /* A place to stash dwarf2 info for this bfd. */ + PTR dwarf2_find_line_info; /* An array of stub sections indexed by symbol number, used by the MIPS ELF linker. FIXME: We should figure out some way to only @@ -885,6 +901,13 @@ struct elf_obj_tdata /* Linker sections that we are interested in. */ struct elf_linker_section *linker_section[ (int)LINKER_SECTION_MAX ]; + + /* The Irix 5 support uses two virtual sections, which represent + text/data symbols defined in dynamic objects. */ + asymbol *elf_data_symbol; + asymbol *elf_text_symbol; + asection *elf_data_section; + asection *elf_text_section; }; #define elf_tdata(bfd) ((bfd) -> tdata.elf_obj_data) @@ -908,6 +931,7 @@ struct elf_obj_tdata #define elf_local_got_offsets(bfd) (elf_tdata(bfd) -> local_got.offsets) #define elf_local_ptr_offsets(bfd) (elf_tdata(bfd) -> linker_section_pointers) #define elf_dt_name(bfd) (elf_tdata(bfd) -> dt_name) +#define elf_dt_soname(bfd) (elf_tdata(bfd) -> dt_soname) #define elf_bad_symtab(bfd) (elf_tdata(bfd) -> bad_symtab) #define elf_flags_init(bfd) (elf_tdata(bfd) -> flags_init) #define elf_linker_section(bfd,n) (elf_tdata(bfd) -> linker_section[(int)n]) @@ -970,7 +994,7 @@ 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 elf_link_hash_entry *)); + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); extern boolean _bfd_elf_link_hash_table_init PARAMS ((struct elf_link_hash_table *, bfd *, struct bfd_hash_entry *(*) (struct bfd_hash_entry *, @@ -1006,14 +1030,14 @@ 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 **, + 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 boolean _bfd_elf_init_reloc_shdr +extern boolean _bfd_elf_init_reloc_shdr PARAMS ((bfd *, Elf_Internal_Shdr *, asection *, boolean)); /* If the target doesn't have reloc handling written yet: */ @@ -1142,6 +1166,10 @@ extern long bfd_elf32_slurp_symbol_table extern boolean bfd_elf32_write_shdrs_and_ehdr PARAMS ((bfd *)); extern int bfd_elf32_write_out_phdrs PARAMS ((bfd *, const Elf_Internal_Phdr *, int)); +extern void bfd_elf32_write_relocs + PARAMS ((bfd *, asection *, PTR)); +extern boolean bfd_elf32_slurp_reloc_table + PARAMS ((bfd *, asection *, asymbol **, boolean)); extern boolean bfd_elf32_add_dynamic_entry PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma)); extern boolean bfd_elf32_link_create_dynamic_sections @@ -1185,6 +1213,10 @@ extern long bfd_elf64_slurp_symbol_table extern boolean bfd_elf64_write_shdrs_and_ehdr PARAMS ((bfd *)); extern int bfd_elf64_write_out_phdrs PARAMS ((bfd *, const Elf_Internal_Phdr *, int)); +extern void bfd_elf64_write_relocs + PARAMS ((bfd *, asection *, PTR)); +extern boolean bfd_elf64_slurp_reloc_table + PARAMS ((bfd *, asection *, asymbol **, boolean)); extern boolean bfd_elf64_add_dynamic_entry PARAMS ((struct bfd_link_info *, bfd_vma, bfd_vma)); extern boolean bfd_elf64_link_create_dynamic_sections @@ -1274,11 +1306,11 @@ extern boolean _bfd_mips_elf_finish_dynamic_symbol Elf_Internal_Sym *)); extern boolean _bfd_mips_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); -extern asection * _bfd_mips_elf_gc_mark_hook +extern asection * _bfd_mips_elf_gc_mark_hook PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, struct elf_link_hash_entry *, Elf_Internal_Sym *)); -extern boolean _bfd_mips_elf_gc_sweep_hook - PARAMS ((bfd *, struct bfd_link_info *, asection *, +extern boolean _bfd_mips_elf_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, const Elf_Internal_Rela *)); extern boolean _bfd_mips_elf_always_size_sections PARAMS ((bfd *, struct bfd_link_info *)); @@ -1289,7 +1321,7 @@ extern boolean _bfd_mips_elf_check_relocs const Elf_Internal_Rela *)); extern struct bfd_link_hash_table *_bfd_mips_elf_link_hash_table_create PARAMS ((bfd *)); -extern boolean _bfd_mips_elf_print_private_bfd_data +extern boolean _bfd_mips_elf_print_private_bfd_data PARAMS ((bfd *, PTR)); extern boolean _bfd_mips_elf_link_output_symbol_hook PARAMS ((bfd *, struct bfd_link_info *, const char *, Elf_Internal_Sym *, diff --git a/gnu/dist/toolchain/bfd/elf-hppa.h b/gnu/dist/toolchain/bfd/elf-hppa.h index 000ffea3c759..006a2c4a1fb4 100644 --- a/gnu/dist/toolchain/bfd/elf-hppa.h +++ b/gnu/dist/toolchain/bfd/elf-hppa.h @@ -1,5 +1,5 @@ /* Common code for PA ELF implementations. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -28,6 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if ARCH_SIZE == 64 #define ELF_R_TYPE(X) ELF64_R_TYPE(X) #define ELF_R_SYM(X) ELF64_R_SYM(X) +#define elf_hppa_internal_shdr Elf64_Internal_Shdr #define _bfd_elf_hppa_gen_reloc_type _bfd_elf64_hppa_gen_reloc_type #define elf_hppa_relocate_section elf64_hppa_relocate_section #define bfd_elf_bfd_final_link bfd_elf64_bfd_final_link @@ -36,33 +37,39 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #if ARCH_SIZE == 32 #define ELF_R_TYPE(X) ELF32_R_TYPE(X) #define ELF_R_SYM(X) ELF32_R_SYM(X) +#define elf_hppa_internal_shdr Elf32_Internal_Shdr #define _bfd_elf_hppa_gen_reloc_type _bfd_elf32_hppa_gen_reloc_type #define elf_hppa_relocate_section elf32_hppa_relocate_section #define bfd_elf_bfd_final_link bfd_elf32_bfd_final_link #define elf_hppa_final_link elf32_hppa_final_link #endif -static boolean -elf_hppa_relocate_section - PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, - bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); +elf_hppa_reloc_type ** _bfd_elf_hppa_gen_reloc_type + PARAMS ((bfd *, elf_hppa_reloc_type, int, unsigned int, int, asymbol *)); -static bfd_reloc_status_type elf_hppa_final_link_relocate - PARAMS ((Elf_Internal_Rela *, bfd *, bfd *, asection *, - bfd_byte *, bfd_vma, struct bfd_link_info *, - asection *, struct elf_link_hash_entry *, - struct elf64_hppa_dyn_hash_entry *)); +static void elf_hppa_info_to_howto + PARAMS ((bfd *, arelent *, Elf_Internal_Rela *)); -static unsigned long elf_hppa_relocate_insn - PARAMS ((unsigned long, long, unsigned long)); +static void elf_hppa_info_to_howto_rel + PARAMS ((bfd *, arelent *, Elf_Internal_Rel *)); +static reloc_howto_type * elf_hppa_reloc_type_lookup + PARAMS ((bfd *, bfd_reloc_code_real_type)); + +static boolean elf_hppa_is_local_label_name + PARAMS ((bfd *, const char *)); + +static boolean elf_hppa_fake_sections + PARAMS ((bfd *abfd, elf_hppa_internal_shdr *, asection *)); + +static void elf_hppa_final_write_processing + PARAMS ((bfd *, boolean)); + +#if ARCH_SIZE == 64 static boolean elf_hppa_add_symbol_hook PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, const char **, flagword *, asection **, bfd_vma *)); -static boolean elf_hppa_final_link - PARAMS ((bfd *, struct bfd_link_info *)); - static boolean elf_hppa_unmark_useless_dynamic_symbols PARAMS ((struct elf_link_hash_entry *, PTR)); @@ -72,268 +79,527 @@ static boolean elf_hppa_remark_useless_dynamic_symbols static void elf_hppa_record_segment_addrs PARAMS ((bfd *, asection *, PTR)); +static boolean elf_hppa_final_link + PARAMS ((bfd *, struct bfd_link_info *)); + +static boolean elf_hppa_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, + bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); + +static bfd_reloc_status_type elf_hppa_final_link_relocate + PARAMS ((Elf_Internal_Rela *, bfd *, bfd *, asection *, + bfd_byte *, bfd_vma, struct bfd_link_info *, + asection *, struct elf_link_hash_entry *, + struct elf64_hppa_dyn_hash_entry *)); + +static unsigned int elf_hppa_relocate_insn + PARAMS ((unsigned int, unsigned int, unsigned int)); +#endif + /* ELF/PA relocation howto entries. */ static reloc_howto_type elf_hppa_howto_table[ELF_HOWTO_TABLE_SIZE] = { - {R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_NONE"}, + { R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_NONE", false, 0, 0, false }, /* The values in DIR32 are to placate the check in _bfd_stab_section_find_nearest_line. */ - {R_PARISC_DIR32, 0, 2, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR32", false, 0, 0xffffffff, false}, - {R_PARISC_DIR21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR21L"}, - {R_PARISC_DIR17R, 0, 0, 17, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR17R"}, - {R_PARISC_DIR17F, 0, 0, 17, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR17F"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_DIR14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR14R"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_PCREL32, 0, 0, 32, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL32"}, - - {R_PARISC_PCREL21L, 0, 0, 21, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL21L"}, - {R_PARISC_PCREL17R, 0, 0, 17, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL17R"}, - {R_PARISC_PCREL17F, 0, 0, 17, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL17F"}, - {R_PARISC_PCREL17C, 0, 0, 17, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL17C"}, - {R_PARISC_PCREL14R, 0, 0, 14, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14R"}, - {R_PARISC_PCREL14F, 0, 0, 14, true, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14F"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_DPREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL21L"}, - {R_PARISC_DPREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14WR"}, - - {R_PARISC_DPREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14DR"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_DPREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14R"}, - {R_PARISC_DPREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DPREL14F"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_DLTREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL21L"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_DLTREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14R"}, - {R_PARISC_DLTREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14F"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_DLTIND21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND21L"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_DLTIND14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14R"}, - {R_PARISC_DLTIND14F, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14F"}, - - {R_PARISC_SETBASE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SETBASE"}, - {R_PARISC_SECREL32, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SECREL32"}, - {R_PARISC_BASEREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL21L"}, - {R_PARISC_BASEREL17R, 0, 0, 17, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL17R"}, - {R_PARISC_BASEREL17F, 0, 0, 17, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL17F"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_BASEREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL14R"}, - {R_PARISC_BASEREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL14F"}, - {R_PARISC_SEGBASE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SEGBASE"}, - {R_PARISC_SEGREL32, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SEGREL32"}, - - {R_PARISC_PLTOFF21L, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF21L"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_PLTOFF14R, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14R"}, - {R_PARISC_PLTOFF14F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14F"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_LTOFF_FPTR32, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR32"}, - {R_PARISC_LTOFF_FPTR21L, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR21L"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_LTOFF_FPTR14R, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14R"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_FPTR64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_FPTR64"}, - {R_PARISC_PLABEL32, 0, 0, 32, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLABEL32"}, - {R_PARISC_PLABEL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLABEL21L"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_PLABEL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLABEL14R"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_PCREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL64"}, - {R_PARISC_PCREL22C, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL22C"}, - {R_PARISC_PCREL22F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL22F"}, - {R_PARISC_PCREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14WR"}, - {R_PARISC_PCREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL14DR"}, - {R_PARISC_PCREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL16F"}, - {R_PARISC_PCREL16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL16WF"}, - {R_PARISC_PCREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PCREL16DF"}, - - {R_PARISC_DIR64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR64"}, - {R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_NONE"}, - {R_PARISC_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_NONE"}, - {R_PARISC_DIR14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR14WR"}, - {R_PARISC_DIR14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR14DR"}, - {R_PARISC_DIR16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR16F"}, - {R_PARISC_DIR16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR16WF"}, - {R_PARISC_DIR16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DIR16DF"}, - {R_PARISC_GPREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL64"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_DLTREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14WR"}, - {R_PARISC_DLTREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTREL14DR"}, - {R_PARISC_GPREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL16F"}, - {R_PARISC_GPREL16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL16WF"}, - {R_PARISC_GPREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_GPREL16DF"}, - {R_PARISC_LTOFF64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF64"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_DLTIND14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14WR"}, - - {R_PARISC_DLTIND14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_DLTIND14DR"}, - {R_PARISC_LTOFF16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF16F"}, - {R_PARISC_LTOFF16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF"}, - {R_PARISC_LTOFF16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_BASEREL14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BSEREL14WR"}, - {R_PARISC_BASEREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_BASEREL14DR"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_SEGREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_SEGREL64"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_PLTOFF14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14WR"}, - {R_PARISC_PLTOFF14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF14DR"}, - {R_PARISC_PLTOFF16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF16F"}, - {R_PARISC_PLTOFF16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF16WF"}, - {R_PARISC_PLTOFF16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_PLTOFF16DF"}, - - {R_PARISC_LTOFF_FPTR64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_LTOFF_FPTR14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14WR"}, - {R_PARISC_LTOFF_FPTR14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14DR"}, - {R_PARISC_LTOFF_FPTR16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16F"}, - {R_PARISC_LTOFF_FPTR16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16WF"}, - {R_PARISC_LTOFF_FPTR16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_COPY, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_COPY"}, - {R_PARISC_IPLT, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_IPLT"}, - - {R_PARISC_EPLT, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_EPLT"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_TPREL32, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL32"}, - {R_PARISC_TPREL21L, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL21L"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_TPREL14R, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL14R"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_LTOFF_TP21L, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP21L"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_LTOFF_TP14R, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_LTOFF_TP14F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14F"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_TPREL64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL64"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_TPREL14WR, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL14WR"}, - - {R_PARISC_TPREL14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL14DR"}, - {R_PARISC_TPREL16F, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL16F"}, - {R_PARISC_TPREL16WF, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_TPREL16WF"}, - {R_PARISC_TPREL16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_TPREL16DF"}, - {R_PARISC_LTOFF_TP64, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP64"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED"}, - {R_PARISC_LTOFF_TP14WR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14WR"}, - {R_PARISC_LTOFF_TP14DR, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14DR"}, - {R_PARISC_LTOFF_TP16F, 0, 0, 0, false, 0, complain_overflow_dont, NULL, "R_PARISC_LTOFF_TP16F"}, - - {R_PARISC_LTOFF_TP16WF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16WF"}, - {R_PARISC_LTOFF_TP16DF, 0, 0, 0, false, 0, complain_overflow_bitfield, bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16DF"}, + { R_PARISC_DIR32, 0, 2, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR32", false, 0, 0xffffffff, false }, + { R_PARISC_DIR21L, 0, 0, 21, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR21L", false, 0, 0, false }, + { R_PARISC_DIR17R, 0, 0, 17, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR17R", false, 0, 0, false }, + { R_PARISC_DIR17F, 0, 0, 17, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR17F", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DIR14R, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR14R", false, 0, 0, false }, + { R_PARISC_DIR14F, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR14F", false, 0, 0, false }, + /* 8 */ + { R_PARISC_PCREL12F, 0, 0, 12, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL12F", false, 0, 0, false }, + { R_PARISC_PCREL32, 0, 0, 32, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL32", false, 0, 0, false }, + { R_PARISC_PCREL21L, 0, 0, 21, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL21L", false, 0, 0, false }, + { R_PARISC_PCREL17R, 0, 0, 17, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL17R", false, 0, 0, false }, + { R_PARISC_PCREL17F, 0, 0, 17, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL17F", false, 0, 0, false }, + { R_PARISC_PCREL17C, 0, 0, 17, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL17C", false, 0, 0, false }, + { R_PARISC_PCREL14R, 0, 0, 14, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL14R", false, 0, 0, false }, + { R_PARISC_PCREL14F, 0, 0, 14, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL14F", false, 0, 0, false }, + /* 16 */ + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DPREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DPREL21L", false, 0, 0, false }, + { R_PARISC_DPREL14WR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DPREL14WR", false, 0, 0, false }, + { R_PARISC_DPREL14DR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DPREL14DR", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DPREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DPREL14R", false, 0, 0, false }, + { R_PARISC_DPREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DPREL14F", false, 0, 0, false }, + /* 24 */ + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DLTREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTREL21L", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DLTREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTREL14R", false, 0, 0, false }, + { R_PARISC_DLTREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTREL14F", false, 0, 0, false }, + /* 32 */ + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DLTIND21L, 0, 0, 21, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTIND21L", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DLTIND14R, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTIND14R", false, 0, 0, false }, + { R_PARISC_DLTIND14F, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTIND14F", false, 0, 0, false }, + /* 40 */ + { R_PARISC_SETBASE, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_SETBASE", false, 0, 0, false }, + { R_PARISC_SECREL32, 0, 0, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_SECREL32", false, 0, 0, false }, + { R_PARISC_BASEREL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_BASEREL21L", false, 0, 0, false }, + { R_PARISC_BASEREL17R, 0, 0, 17, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_BASEREL17R", false, 0, 0, false }, + { R_PARISC_BASEREL17F, 0, 0, 17, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_BASEREL17F", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_BASEREL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_BASEREL14R", false, 0, 0, false }, + { R_PARISC_BASEREL14F, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_BASEREL14F", false, 0, 0, false }, + /* 48 */ + { R_PARISC_SEGBASE, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_SEGBASE", false, 0, 0, false }, + { R_PARISC_SEGREL32, 0, 0, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_SEGREL32", false, 0, 0, false }, + { R_PARISC_PLTOFF21L, 0, 0, 21, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLTOFF21L", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_PLTOFF14R, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLTOFF14R", false, 0, 0, false }, + { R_PARISC_PLTOFF14F, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLTOFF14F", false, 0, 0, false }, + /* 56 */ + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_LTOFF_FPTR32, 0, 0, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR32", false, 0, 0, false }, + { R_PARISC_LTOFF_FPTR21L, 0, 0, 21, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR21L", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_LTOFF_FPTR14R, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14R", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + /* 64 */ + { R_PARISC_FPTR64, 0, 0, 64, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_FPTR64", false, 0, 0, false }, + { R_PARISC_PLABEL32, 0, 0, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLABEL32", false, 0, 0, false }, + { R_PARISC_PLABEL21L, 0, 0, 21, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLABEL21L", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_PLABEL14R, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLABEL14R", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + /* 72 */ + { R_PARISC_PCREL64, 0, 0, 64, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL64", false, 0, 0, false }, + { R_PARISC_PCREL22C, 0, 0, 22, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL22C", false, 0, 0, false }, + { R_PARISC_PCREL22F, 0, 0, 22, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL22F", false, 0, 0, false }, + { R_PARISC_PCREL14WR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL14WR", false, 0, 0, false }, + { R_PARISC_PCREL14DR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL14DR", false, 0, 0, false }, + { R_PARISC_PCREL16F, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL16F", false, 0, 0, false }, + { R_PARISC_PCREL16WF, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL16WF", false, 0, 0, false }, + { R_PARISC_PCREL16DF, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PCREL16DF", false, 0, 0, false }, + /* 80 */ + { R_PARISC_DIR64, 0, 0, 64, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR64", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DIR14WR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR14WR", false, 0, 0, false }, + { R_PARISC_DIR14DR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR14DR", false, 0, 0, false }, + { R_PARISC_DIR16F, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR16F", false, 0, 0, false }, + { R_PARISC_DIR16WF, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR16WF", false, 0, 0, false }, + { R_PARISC_DIR16DF, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DIR16DF", false, 0, 0, false }, + /* 88 */ + { R_PARISC_GPREL64, 0, 0, 64, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_GPREL64", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DLTREL14WR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTREL14WR", false, 0, 0, false }, + { R_PARISC_DLTREL14DR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTREL14DR", false, 0, 0, false }, + { R_PARISC_GPREL16F, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_GPREL16F", false, 0, 0, false }, + { R_PARISC_GPREL16WF, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_GPREL16WF", false, 0, 0, false }, + { R_PARISC_GPREL16DF, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_GPREL16DF", false, 0, 0, false }, + /* 96 */ + { R_PARISC_LTOFF64, 0, 0, 64, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF64", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_DLTIND14WR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTIND14WR", false, 0, 0, false }, + { R_PARISC_DLTIND14DR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_DLTIND14DR", false, 0, 0, false }, + { R_PARISC_LTOFF16F, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF16F", false, 0, 0, false }, + { R_PARISC_LTOFF16WF, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF", false, 0, 0, false }, + { R_PARISC_LTOFF16DF, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF16DF", false, 0, 0, false }, + /* 104 */ + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_BASEREL14WR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_BASEREL14WR", false, 0, 0, false }, + { R_PARISC_BASEREL14DR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_BASEREL14DR", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + /* 112 */ + { R_PARISC_SEGREL64, 0, 0, 64, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_SEGREL64", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_PLTOFF14WR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLTOFF14WR", false, 0, 0, false }, + { R_PARISC_PLTOFF14DR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLTOFF14DR", false, 0, 0, false }, + { R_PARISC_PLTOFF16F, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLTOFF16F", false, 0, 0, false }, + { R_PARISC_PLTOFF16WF, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLTOFF16WF", false, 0, 0, false }, + { R_PARISC_PLTOFF16DF, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_PLTOFF16DF", false, 0, 0, false }, + /* 120 */ + { R_PARISC_LTOFF_FPTR64, 0, 0, 64, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_LTOFF_FPTR14WR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14WR", false, 0, 0, false }, + { R_PARISC_LTOFF_FPTR14DR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR14DR", false, 0, 0, false }, + { R_PARISC_LTOFF_FPTR16F, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16F", false, 0, 0, false }, + { R_PARISC_LTOFF_FPTR16WF, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_FPTR16WF", false, 0, 0, false }, + { R_PARISC_LTOFF_FPTR16DF, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + /* 128 */ + { R_PARISC_COPY, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_COPY", false, 0, 0, false }, + { R_PARISC_IPLT, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_IPLT", false, 0, 0, false }, + { R_PARISC_EPLT, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_EPLT", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + /* 136 */ + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + /* 144 */ + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + /* 152 */ + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_TPREL32, 0, 0, 32, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_TPREL32", false, 0, 0, false }, + { R_PARISC_TPREL21L, 0, 0, 21, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_TPREL21L", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_TPREL14R, 0, 0, 14, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_TPREL14R", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + /* 160 */ + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_LTOFF_TP21L, 0, 0, 21, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP21L", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_LTOFF_TP14R, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_LTOFF_TP14F, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14F", false, 0, 0, false }, + /* 168 */ + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + /* 176 */ + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + /* 184 */ + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + /* 192 */ + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + /* 200 */ + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + /* 208 */ + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + /* 216 */ + { R_PARISC_TPREL64, 0, 0, 64, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TPREL64", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_TPREL14WR, 0, 0, 14, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_TPREL14WR", false, 0, 0, false }, + { R_PARISC_TPREL14DR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TPREL14DR", false, 0, 0, false }, + { R_PARISC_TPREL16F, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TPREL16F", false, 0, 0, false }, + { R_PARISC_TPREL16WF, 0, 0, 16, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_TPREL16WF", false, 0, 0, false }, + { R_PARISC_TPREL16DF, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_TPREL16DF", false, 0, 0, false }, + /* 224 */ + { R_PARISC_LTOFF_TP64, 0, 0, 64, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP64", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_UNIMPLEMENTED, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_UNIMPLEMENTED", false, 0, 0, false }, + { R_PARISC_LTOFF_TP14WR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14WR", false, 0, 0, false }, + { R_PARISC_LTOFF_TP14DR, 0, 0, 14, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP14DR", false, 0, 0, false }, + { R_PARISC_LTOFF_TP16F, 0, 0, 16, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16F", false, 0, 0, false }, + { R_PARISC_LTOFF_TP16WF, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16WF", false, 0, 0, false }, + { R_PARISC_LTOFF_TP16DF, 0, 0, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_PARISC_LTOFF_TP16DF", false, 0, 0, false }, + /* 232 */ + { R_PARISC_GNU_VTENTRY, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_GNU_VTENTRY", false, 0, 0, false }, + { R_PARISC_GNU_VTINHERIT, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_PARISC_GNU_VTINHERIT", false, 0, 0, false }, }; #define OFFSET_14R_FROM_21L 4 @@ -347,9 +613,9 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym) bfd *abfd; elf_hppa_reloc_type base_type; int format; - int field; - int ignore; - asymbol *sym; + unsigned int field; + int ignore ATTRIBUTE_UNUSED; + asymbol *sym ATTRIBUTE_UNUSED; { elf_hppa_reloc_type *finaltype; elf_hppa_reloc_type **final_types; @@ -390,8 +656,12 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym) case 14: switch (field) { + case e_fsel: + final_type = R_PARISC_DIR14F; + break; case e_rsel: case e_rrsel: + case e_rdsel: final_type = R_PARISC_DIR14R; break; case e_rtsel: @@ -419,6 +689,7 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym) break; case e_rsel: case e_rrsel: + case e_rdsel: final_type = R_PARISC_DIR17R; break; default: @@ -431,6 +702,9 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym) { case e_lsel: case e_lrsel: + case e_ldsel: + case e_nlsel: + case e_nlrsel: final_type = R_PARISC_DIR21L; break; case e_ltsel: @@ -485,7 +759,6 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym) } break; - case R_HPPA_GOTOFF: switch (format) { @@ -494,9 +767,12 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym) { case e_rsel: case e_rrsel: + case e_rdsel: + /* R_PARISC_DLTREL14R for elf64, R_PARISC_DPREL14R for elf32 */ final_type = base_type + OFFSET_14R_FROM_21L; break; case e_fsel: + /* R_PARISC_DLTREL14F for elf64, R_PARISC_DPREL14F for elf32 */ final_type = base_type + OFFSET_14F_FROM_21L; break; default: @@ -507,8 +783,12 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym) case 21: switch (field) { - case e_lrsel: case e_lsel: + case e_lrsel: + case e_ldsel: + case e_nlsel: + case e_nlrsel: + /* R_PARISC_DLTREL21L for elf64, R_PARISC_DPREL21L for elf32 */ final_type = base_type; break; default: @@ -521,15 +801,28 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym) } break; - case R_HPPA_PCREL_CALL: switch (format) { + case 12: + switch (field) + { + case e_fsel: + final_type = R_PARISC_PCREL12F; + break; + default: + return NULL; + } + break; + case 14: + /* Contrary to appearances, these are not calls of any sort. + Rather, they are loads/stores with a pcrel reloc. */ switch (field) { case e_rsel: case e_rrsel: + case e_rdsel: final_type = R_PARISC_PCREL14R; break; case e_fsel: @@ -545,6 +838,7 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym) { case e_rsel: case e_rrsel: + case e_rdsel: final_type = R_PARISC_PCREL17R; break; case e_fsel: @@ -555,6 +849,21 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym) } break; + case 21: + switch (field) + { + case e_lsel: + case e_lrsel: + case e_ldsel: + case e_nlsel: + case e_nlrsel: + final_type = R_PARISC_PCREL21L; + break; + default: + return NULL; + } + break; + case 22: switch (field) { @@ -566,23 +875,13 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym) } break; - case 21: - switch (field) - { - case e_lsel: - case e_lrsel: - final_type = R_PARISC_PCREL21L; - break; - default: - return NULL; - } - break; - default: return NULL; } break; + case R_PARISC_GNU_VTENTRY: + case R_PARISC_GNU_VTINHERIT: case R_PARISC_SEGREL32: case R_PARISC_SEGBASE: /* The defaults are fine for these cases. */ @@ -599,7 +898,7 @@ _bfd_elf_hppa_gen_reloc_type (abfd, base_type, format, field, ignore, sym) static void elf_hppa_info_to_howto (abfd, bfd_reloc, elf_reloc) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *bfd_reloc; Elf_Internal_Rela *elf_reloc; { @@ -612,7 +911,7 @@ elf_hppa_info_to_howto (abfd, bfd_reloc, elf_reloc) static void elf_hppa_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *bfd_reloc; Elf_Internal_Rel *elf_reloc; { @@ -626,7 +925,7 @@ elf_hppa_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) static reloc_howto_type * elf_hppa_reloc_type_lookup (abfd, code) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { if ((int) code < (int) R_PARISC_UNIMPLEMENTED) @@ -637,10 +936,68 @@ elf_hppa_reloc_type_lookup (abfd, code) return NULL; } +/* Return true if SYM represents a local label symbol. */ + +static boolean +elf_hppa_is_local_label_name (abfd, name) + bfd *abfd ATTRIBUTE_UNUSED; + const char *name; +{ + if (name[0] == 'L' && name[1] == '$') + return 1; + return _bfd_elf_is_local_label_name (abfd, name); +} + +/* Set the correct type for an ELF section. We do this by the + section name, which is a hack, but ought to work. */ + +static boolean +elf_hppa_fake_sections (abfd, hdr, sec) + bfd *abfd; + elf_hppa_internal_shdr *hdr; + asection *sec; +{ + register const char *name; + + name = bfd_get_section_name (abfd, sec); + + if (strcmp (name, ".PARISC.unwind") == 0) + { + int indx; + asection *asec; +#if ARCH_SIZE == 64 + hdr->sh_type = SHT_LOPROC + 1; +#else + hdr->sh_type = 1; +#endif + /* ?!? How are unwinds supposed to work for symbols in arbitrary + sections? Or what if we have multiple .text sections in a single + .o file? HP really messed up on this one. + + Ugh. We can not use elf_section_data (sec)->this_idx at this + point because it is not initialized yet. + + So we (gasp) recompute it here. Hopefully nobody ever changes the + way sections are numbered in elf.c! */ + for (asec = abfd->sections, indx = 1; asec; asec = asec->next, indx++) + { + if (asec->name && strcmp (asec->name, ".text") == 0) + { + hdr->sh_info = indx; + break; + } + } + + /* I have no idea if this is really necessary or what it means. */ + hdr->sh_entsize = 4; + } + return true; +} + static void elf_hppa_final_write_processing (abfd, linker) bfd *abfd; - boolean linker; + boolean linker ATTRIBUTE_UNUSED; { int mach = bfd_get_mach (abfd); @@ -665,58 +1022,7 @@ elf_hppa_final_write_processing (abfd, linker) | EF_PARISC_TRAPNIL); } -/* Return true if SYM represents a local label symbol. */ - -static boolean -elf_hppa_is_local_label_name (abfd, name) - bfd *abfd ATTRIBUTE_UNUSED; - const char *name; -{ - return (name[0] == 'L' && name[1] == '$'); -} - -/* Set the correct type for an ELF section. We do this by the - section name, which is a hack, but ought to work. */ - -static boolean -elf_hppa_fake_sections (abfd, hdr, sec) - bfd *abfd; - Elf64_Internal_Shdr *hdr; - asection *sec; -{ - register const char *name; - - name = bfd_get_section_name (abfd, sec); - - if (strcmp (name, ".PARISC.unwind") == 0) - { - int indx; - asection *sec; - hdr->sh_type = SHT_LOPROC + 1; - /* ?!? How are unwinds supposed to work for symbols in arbitrary - sections? Or what if we have multiple .text sections in a single - .o file? HP really messed up on this one. - - Ugh. We can not use elf_section_data (sec)->this_idx at this - point because it is not initialized yet. - - So we (gasp) recompute it here. Hopefully nobody ever changes the - way sections are numbered in elf.c! */ - for (sec = abfd->sections, indx = 1; sec; sec = sec->next, indx++) - { - if (sec->name && strcmp (sec->name, ".text") == 0) - { - hdr->sh_info = indx; - break; - } - } - - /* I have no idea if this is really necessary or what it means. */ - hdr->sh_entsize = 4; - } - return true; -} - +#if ARCH_SIZE == 64 /* Hook called by the linker routine which adds symbols from an object file. HP's libraries define symbols with HP specific section indices, which we have to handle. */ @@ -763,10 +1069,10 @@ elf_hppa_unmark_useless_dynamic_symbols (h, data) the generic code will warn that it is undefined. This behavior is undesirable on HPs since the standard shared - libraries contain reerences to undefined symbols. + libraries contain references to undefined symbols. So we twiddle the flags associated with such symbols so that they - will not trigger the warning. ?!? FIXME. This is horribly fraglie. + will not trigger the warning. ?!? FIXME. This is horribly fragile. Ultimately we should have better controls over the generic ELF BFD linker code. */ @@ -784,7 +1090,6 @@ elf_hppa_unmark_useless_dynamic_symbols (h, data) return true; } - static boolean elf_hppa_remark_useless_dynamic_symbols (h, data) struct elf_link_hash_entry *h; @@ -828,18 +1133,18 @@ elf_hppa_record_segment_addrs (abfd, section, data) { struct elf64_hppa_link_hash_table *hppa_info; bfd_vma value; - + hppa_info = (struct elf64_hppa_link_hash_table *)data; value = section->vma - section->filepos; - if ((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY) + if (((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY)) == (SEC_ALLOC | SEC_LOAD | SEC_READONLY)) && value < hppa_info->text_segment_base) hppa_info->text_segment_base = value; - else if ((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY) - == (SEC_ALLOC | SEC_LOAD)) - && value < hppa_info->data_segment_base) + else if (((section->flags & (SEC_ALLOC | SEC_LOAD | SEC_READONLY)) + == (SEC_ALLOC | SEC_LOAD)) + && value < hppa_info->data_segment_base) hppa_info->data_segment_base = value; } @@ -855,14 +1160,12 @@ elf_hppa_final_link (abfd, info) struct bfd_link_info *info; { boolean retval; + struct elf64_hppa_link_hash_table *hppa_info = elf64_hppa_hash_table (info); if (! info->relocateable) { struct elf_link_hash_entry *gp; bfd_vma gp_val; - struct elf64_hppa_link_hash_table *hppa_info; - - hppa_info = elf64_hppa_hash_table (info); /* The linker script defines a value for __gp iff it was referenced by one of the objects being linked. First try to find the symbol @@ -877,7 +1180,7 @@ elf_hppa_final_link (abfd, info) /* Adjust the value of __gp as we may want to slide it into the .plt section so that the stubs can access PLT entries without using an addil sequence. */ - gp->root.u.def.value += elf64_hppa_hash_table (info)->gp_offset; + gp->root.u.def.value += hppa_info->gp_offset; gp_val = (gp->root.u.def.section->output_section->vma + gp->root.u.def.section->output_offset @@ -886,7 +1189,6 @@ elf_hppa_final_link (abfd, info) else { asection *sec; - /* First look for a .plt section. If found, then __gp is the address of the .plt + gp_offset. @@ -919,10 +1221,10 @@ elf_hppa_final_link (abfd, info) } /* We need to know the base of the text and data segments so that we - can perform SEGREL relocations. We will recore the base addresses + can perform SEGREL relocations. We will record the base addresses when we encounter the first SEGREL relocation. */ - elf64_hppa_hash_table (info)->text_segment_base = (bfd_vma)-1; - elf64_hppa_hash_table (info)->data_segment_base = (bfd_vma)-1; + hppa_info->text_segment_base = (bfd_vma)-1; + hppa_info->data_segment_base = (bfd_vma)-1; /* HP's shared libraries have references to symbols that are not defined anywhere. The generic ELF BFD linker code will complaim @@ -981,7 +1283,7 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma relocation; bfd_reloc_status_type r; const char *sym_name; - char *dyn_name; + const char *dyn_name; char *dynh_buf = NULL; size_t dynh_buflen = 0; struct elf64_hppa_dyn_hash_entry *dyn_h = NULL; @@ -1030,7 +1332,7 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section, /* If this symbol has an entry in the PA64 dynamic hash table, then get it. */ - dyn_name = get_dyn_name (input_bfd, h, rel, + dyn_name = get_dyn_name (input_section, h, rel, &dynh_buf, &dynh_buflen); dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, dyn_name, false, false); @@ -1053,7 +1355,7 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section, /* If this symbol has an entry in the PA64 dynamic hash table, then get it. */ - dyn_name = get_dyn_name (input_bfd, h, rel, + dyn_name = get_dyn_name (input_section, h, rel, &dynh_buf, &dynh_buflen); dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, dyn_name, false, false); @@ -1089,7 +1391,7 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section, /* If this symbol has an entry in the PA64 dynamic hash table, then get it. */ - dyn_name = get_dyn_name (input_bfd, h, rel, + dyn_name = get_dyn_name (input_section, h, rel, &dynh_buf, &dynh_buflen); dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, dyn_name, false, false); @@ -1154,15 +1456,14 @@ elf_hppa_relocate_section (output_bfd, info, input_bfd, input_section, return true; } - /* Compute the value for a relocation (REL) during a final link stage, - then insert the value into the proper location in CONTENTS. + then insert the value into the proper location in CONTENTS. VALUE is a tentative value for the relocation and may be overridden and modified here based on the specific relocation to be performed. For example we do conversions for PC-relative branches in this routine - or redirection of calls to external routines to stubs. + or redirection of calls to external routines to stubs. The work of actually applying the relocation is left to a helper routine in an attempt to reduce the complexity and size of this @@ -1180,15 +1481,14 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, bfd_vma value; struct bfd_link_info *info; asection *sym_sec; - struct elf_link_hash_entry *h; + struct elf_link_hash_entry *h ATTRIBUTE_UNUSED; struct elf64_hppa_dyn_hash_entry *dyn_h; { - unsigned long insn; + unsigned int insn; bfd_vma offset = rel->r_offset; bfd_vma addend = rel->r_addend; reloc_howto_type *howto = elf_hppa_howto_table + ELF_R_TYPE (rel->r_info); - unsigned long r_type = howto->type; - unsigned long r_field = e_fsel; + unsigned int r_type = howto->type; bfd_byte *hit_data = contents + offset; struct elf64_hppa_link_hash_table *hppa_info = elf64_hppa_hash_table (info); @@ -1199,6 +1499,12 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, case R_PARISC_NONE: break; + /* Basic function call support. I'm not entirely sure if PCREL14F is + actually needed or even handled correctly. + + Note for a call to a function defined in another dynamic library + we want to redirect the call to a stub. */ + /* Random PC relative relocs. */ case R_PARISC_PCREL21L: case R_PARISC_PCREL14R: @@ -1209,64 +1515,56 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, case R_PARISC_PCREL16WF: case R_PARISC_PCREL16DF: { - if (r_type == R_PARISC_PCREL21L) - r_field = e_lsel; - else if (r_type == R_PARISC_PCREL14F - || r_type == R_PARISC_PCREL16F - || r_type == R_PARISC_PCREL16WF - || r_type == R_PARISC_PCREL16DF) - r_field = e_fsel; - else - r_field = e_rsel; - /* If this is a call to a function defined in another dynamic library, then redirect the call to the local stub for this function. */ if (sym_sec == NULL || sym_sec->output_section == NULL) value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset + hppa_info->stub_sec->output_section->vma); - + /* Turn VALUE into a proper PC relative address. */ value -= (offset + input_section->output_offset + input_section->output_section->vma); /* Adjust for any field selectors. */ - value = hppa_field_adjust (value, -8 + addend, r_field); + if (r_type == R_PARISC_PCREL21L) + value = hppa_field_adjust (value, -8 + addend, e_lsel); + else if (r_type == R_PARISC_PCREL14F + || r_type == R_PARISC_PCREL16F + || r_type == R_PARISC_PCREL16WF + || r_type == R_PARISC_PCREL16DF) + value = hppa_field_adjust (value, -8 + addend, e_fsel); + else + value = hppa_field_adjust (value, -8 + addend, e_rsel); /* Apply the relocation to the given instruction. */ insn = elf_hppa_relocate_insn (insn, value, r_type); break; } - /* Basic function call support. I'm not entirely sure if PCREL14F is - actually needed or even handled correctly. - - Note for a call to a function defined in another dynamic library - we want to redirect the call to a stub. */ + case R_PARISC_PCREL12F: case R_PARISC_PCREL22F: case R_PARISC_PCREL17F: case R_PARISC_PCREL22C: case R_PARISC_PCREL17C: case R_PARISC_PCREL17R: { - if (r_type == R_PARISC_PCREL17R) - r_field = e_rsel; - else - r_field = e_fsel; - /* If this is a call to a function defined in another dynamic library, then redirect the call to the local stub for this function. */ if (sym_sec == NULL || sym_sec->output_section == NULL) value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset + hppa_info->stub_sec->output_section->vma); - + /* Turn VALUE into a proper PC relative address. */ value -= (offset + input_section->output_offset + input_section->output_section->vma); /* Adjust for any field selectors. */ - value = hppa_field_adjust (value, -8 + addend, e_fsel); + if (r_type == R_PARISC_PCREL17R) + value = hppa_field_adjust (value, -8 + addend, e_rsel); + else + value = hppa_field_adjust (value, -8 + addend, e_fsel); /* All branches are implicitly shifted by 2 places. */ value >>= 2; @@ -1302,12 +1600,12 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, case R_PARISC_LTOFF16DF: { /* If this relocation was against a local symbol, then we still - have not set up the DLT entry (it's not convienent to do so + have not set up the DLT entry (it's not convenient to do so in the "finalize_dlt" routine because it is difficult to get to the local symbol's value). So, if this is a local symbol (h == NULL), then we need to - fill in its DLT entry. + fill in its DLT entry. Similarly we may still need to set up an entry in .opd for a local function which had its address taken. */ @@ -1353,7 +1651,6 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, + hppa_info->dlt_sec->output_section->vma); value -= _bfd_get_gp_value (output_bfd); - /* All DLTIND relocations are basically the same at this point, except that we need different field selectors for the 21bit version vs the 14bit versions. */ @@ -1420,6 +1717,7 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, case R_PARISC_DIR17R: case R_PARISC_DIR17F: case R_PARISC_DIR14R: + case R_PARISC_DIR14F: case R_PARISC_DIR14WR: case R_PARISC_DIR14DR: case R_PARISC_DIR16F: @@ -1427,18 +1725,27 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, case R_PARISC_DIR16DF: { /* All DIR relocations are basically the same at this point, - except that we need different field selectors for the 21bit - version vs the 14bit versions. */ + except that branch offsets need to be divided by four, and + we need different field selectors. Note that we don't + redirect absolute calls to local stubs. */ + if (r_type == R_PARISC_DIR21L) value = hppa_field_adjust (value, addend, e_lrsel); else if (r_type == R_PARISC_DIR17F || r_type == R_PARISC_DIR16F || r_type == R_PARISC_DIR16WF - || r_type == R_PARISC_DIR16DF) + || r_type == R_PARISC_DIR16DF + || r_type == R_PARISC_DIR14F) value = hppa_field_adjust (value, addend, e_fsel); else value = hppa_field_adjust (value, addend, e_rrsel); + if (r_type == R_PARISC_DIR17R || r_type == R_PARISC_DIR17F) + { + /* All branches are implicitly shifted by 2 places. */ + value >>= 2; + } + insn = elf_hppa_relocate_insn (insn, value, r_type); break; } @@ -1557,7 +1864,6 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, /* Subtract out the global pointer value to make value a DLT relative address. */ value -= _bfd_get_gp_value (output_bfd); - value += addend; bfd_put_64 (input_bfd, value + addend, hit_data); return bfd_reloc_ok; @@ -1583,14 +1889,14 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, if (sym_sec == NULL || sym_sec->output_section == NULL) value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset + hppa_info->stub_sec->output_section->vma); - + /* Turn VALUE into a proper PC relative address. */ value -= (offset + input_section->output_offset + input_section->output_section->vma); value += addend; value -= 8; - bfd_put_64 (input_bfd, value, hit_data); + bfd_put_32 (input_bfd, value, hit_data); return bfd_reloc_ok; } @@ -1602,8 +1908,7 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, if (sym_sec == NULL || sym_sec->output_section == NULL) value = (dyn_h->stub_offset + hppa_info->stub_sec->output_offset + hppa_info->stub_sec->output_section->vma); - - + /* Turn VALUE into a proper PC relative address. */ value -= (offset + input_section->output_offset + input_section->output_section->vma); @@ -1614,7 +1919,6 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, return bfd_reloc_ok; } - case R_PARISC_FPTR64: { /* We may still need to create the FPTR itself if it was for @@ -1641,15 +1945,14 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, value = (dyn_h->opd_offset + hppa_info->opd_sec->output_offset + hppa_info->opd_sec->output_section->vma); - + bfd_put_64 (input_bfd, value + addend, hit_data); return bfd_reloc_ok; } case R_PARISC_SECREL32: bfd_put_32 (input_bfd, - (value + addend - - sym_sec->output_section->vma), + value + addend - sym_sec->output_section->vma, hit_data); return bfd_reloc_ok; @@ -1660,7 +1963,7 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, the segment base values. */ if (hppa_info->text_segment_base == (bfd_vma) -1) bfd_map_over_sections (output_bfd, elf_hppa_record_segment_addrs, - elf64_hppa_hash_table (info)); + hppa_info); /* VALUE holds the absolute address. We want to include the addend, then turn it into a segment relative address. @@ -1681,7 +1984,6 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, bfd_put_64 (input_bfd, value, hit_data); return bfd_reloc_ok; } - /* Something we don't know how to handle. */ default: @@ -1690,7 +1992,7 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, /* Update the instruction word. */ bfd_put_32 (input_bfd, insn, hit_data); - return (bfd_reloc_ok); + return bfd_reloc_ok; } /* Relocate the given INSN. VALUE should be the actual value we want @@ -1699,62 +2001,32 @@ elf_hppa_final_link_relocate (rel, input_bfd, output_bfd, Instead this routine is meant to handle the bit manipulations needed to insert the relocation into the given instruction. */ -static unsigned long +static unsigned int elf_hppa_relocate_insn (insn, sym_value, r_type) - unsigned long insn; - long sym_value; - unsigned long r_type; + unsigned int insn; + unsigned int sym_value; + unsigned int r_type; { switch (r_type) { - /* This is any 22bit branch. In PA2.0 syntax it corresponds to + /* This is any 22 bit branch. In PA2.0 syntax it corresponds to the "B" instruction. */ case R_PARISC_PCREL22F: case R_PARISC_PCREL22C: - { - unsigned int w3, w2, w1, w; + return (insn & ~ 0x3ff1ffd) | re_assemble_22 (sym_value); - /* These are 22 bit branches. Mask off bits we do not care - about. */ - sym_value &= 0x3fffff; + /* This is any 12 bit branch. */ + case R_PARISC_PCREL12F: + return (insn & ~ 0x1ffd) | re_assemble_12 (sym_value); - /* Now extract the W1, W2, W3 and W fields from the value. */ - dis_assemble_22 (sym_value, &w3, &w1, &w2, &w); - - /* Mask out bits for the value in the instruction. */ - insn &= 0xfc00e002; - - /* Insert the bits for the W1, W2 and W fields into the - instruction. */ - insn |= (w3 << 21) | (w2 << 2) | (w1 << 16) | w; - return insn; - } - - /* This is any 17bit branch. In PA2.0 syntax it also corresponds to - the "B" instruction as well as BE. */ + /* This is any 17 bit branch. In PA2.0 syntax it also corresponds + to the "B" instruction as well as BE. */ case R_PARISC_PCREL17F: case R_PARISC_DIR17F: case R_PARISC_DIR17R: case R_PARISC_PCREL17C: case R_PARISC_PCREL17R: - { - unsigned int w2, w1, w; - - /* These are 17 bit branches. Mask off bits we do not care - about. */ - sym_value &= 0x1ffff; - - /* Now extract the W1, W2 and W fields from the value. */ - dis_assemble_17 (sym_value, &w1, &w2, &w); - - /* Mask out bits for the value in the instruction. */ - insn &= 0xffe0e002; - - /* Insert the bits for the W1, W2 and W fields into the - instruction. */ - insn |= (w2 << 2) | (w1 << 16) | w; - return insn; - } + return (insn & ~ 0x1f1ffd) | re_assemble_17 (sym_value); /* ADDIL or LDIL instructions. */ case R_PARISC_DLTREL21L: @@ -1765,20 +2037,9 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_DPREL21L: case R_PARISC_PLTOFF21L: case R_PARISC_DIR21L: - { - int w; + return (insn & ~ 0x1fffff) | re_assemble_21 (sym_value); - /* Mask off bits in INSN we do not want. */ - insn &= 0xffe00000; - - /* Turn the 21bit value into the proper format. */ - dis_assemble_21 (sym_value, &w); - - /* And insert the proper bits into INSN. */ - return insn | w; - } - - /* LDO and integer loads/stores with 14bit displacements. */ + /* LDO and integer loads/stores with 14 bit displacements. */ case R_PARISC_DLTREL14R: case R_PARISC_DLTREL14F: case R_PARISC_DLTIND14R: @@ -1798,22 +2059,12 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_PLTOFF14F: case R_PARISC_PLTOFF16F: case R_PARISC_DIR14R: + case R_PARISC_DIR14F: case R_PARISC_DIR16F: case R_PARISC_LTOFF16F: - { - int w; + return (insn & ~ 0x3fff) | low_sign_unext (sym_value, 14); - /* Mask off bits in INSN we do not want. */ - insn &= 0xffffc000; - - /* Turn the 14bit value into the proper format. */ - low_sign_unext (sym_value, 14, &w); - - /* And insert the proper bits into INSN. */ - return insn | w; - } - - /* Doubleword loads and stores with a 14bit displacement. */ + /* Doubleword loads and stores with a 14 bit displacement. */ case R_PARISC_DLTREL14DR: case R_PARISC_DLTIND14DR: case R_PARISC_LTOFF_FPTR14DR: @@ -1829,22 +2080,8 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_DIR14DR: case R_PARISC_DIR16DF: case R_PARISC_LTOFF16DF: - { - /* Mask off bits in INSN we do not want. */ - insn &= 0xffffc00e; - - /* The sign bit at 14 moves into bit zero in the destination. */ - insn |= ((sym_value & 0x2000) >> 13); - - /* Turn off the bits in sym_value we do not care about. */ - sym_value &= 0x1ff8; - - /* Now shift it one bit position left so that it lines up with the - destination field in INSN. */ - sym_value <<= 1; - - return insn | sym_value; - } + return (insn & ~ 0x3ff1) | (((sym_value & 0x2000) >> 13) + | ((sym_value & 0x1ff8) << 1)); /* Floating point single word load/store instructions. */ case R_PARISC_DLTREL14WR: @@ -1862,24 +2099,11 @@ elf_hppa_relocate_insn (insn, sym_value, r_type) case R_PARISC_DIR16WF: case R_PARISC_DIR14WR: case R_PARISC_LTOFF16WF: - { - /* Mask off bits in INSN we do not want. */ - insn &= 0xffffc006; - - /* The sign bit at 14 moves into bit zero in the destination. */ - insn |= ((sym_value & 0x2000) >> 13); - - /* Turn off the bits in sym_value we do not care about. */ - sym_value &= 0x1ffc; - - /* Now shift it one bit position left so that it lines up with the - destination field in INSN. */ - sym_value <<= 1; - - return insn | sym_value; - } + return (insn & ~ 0x3ff9) | (((sym_value & 0x2000) >> 13) + | ((sym_value & 0x1ffc) << 1)); default: return insn; } } +#endif diff --git a/gnu/dist/toolchain/bfd/elf-m10200.c b/gnu/dist/toolchain/bfd/elf-m10200.c index 1939635cb2b0..0053e0e0452b 100644 --- a/gnu/dist/toolchain/bfd/elf-m10200.c +++ b/gnu/dist/toolchain/bfd/elf-m10200.c @@ -318,7 +318,6 @@ mn10200_elf_final_link_relocate (howto, input_bfd, output_bfd, return bfd_reloc_notsupported; } } - /* Relocate an MN10200 ELF section. */ static boolean @@ -505,11 +504,11 @@ mn10200_elf_relocate_section (output_bfd, info, input_bfd, input_section, abs24, imm24, d24 all look the same at the reloc level. It might make the code simpler if we had different relocs for the various relaxable operand types. - + We don't handle imm16->imm8 or d16->d8 as they're very rare and somewhat more difficult to support. */ -static boolean +static boolean mn10200_elf_relax_section (abfd, sec, link_info, again) bfd *abfd; asection *sec; @@ -654,7 +653,6 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) that would be more work, but would require less memory when the linker is run. */ - /* Try to turn a 24bit pc-relative branch/call into a 16bit pc-relative branch/call. */ if (ELF32_R_TYPE (irel->r_info) == (int) R_MN10200_PCREL24) @@ -774,7 +772,6 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) bra lab2 lab1: lab1: - This happens when the bCC can't reach lab2 at assembly time, but due to other relaxations it can reach at link time. */ if (ELF32_R_TYPE (irel->r_info) == (int) R_MN10200_PCREL8) @@ -814,7 +811,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) continue; /* Now make sure we are a conditional branch. This may not - be necessary, but why take the chance. + be necessary, but why take the chance. Note these checks assume that R_MN10200_PCREL8 relocs only occur on bCC and bCCx insns. If they occured @@ -904,7 +901,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) break; } bfd_put_8 (abfd, code, contents + irel->r_offset - 1); - + /* Set the reloc type and symbol for the first branch from the second branch. */ irel->r_info = nrel->r_info; @@ -929,7 +926,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) { bfd_vma value = symval; - /* See if the value will fit in 16 bits. + /* See if the value will fit in 16 bits. We allow any 16bit match here. We prune those we can't handle below. */ if ((long)value < 0x7fff && (long)value > -0x8000) @@ -991,7 +988,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) *again = true; break; - /* mov imm24,an -> mov imm16,an + /* mov imm24,an -> mov imm16,an cmp imm24,an -> cmp imm16,an mov (abs24),dn -> mov (abs16),dn mov dn,(abs24) -> mov dn,(abs16) @@ -1053,7 +1050,7 @@ mn10200_elf_relax_section (abfd, sec, link_info, again) add imm24,dn -> add imm16,dn add imm24,an -> add imm16,an sub imm24,dn -> sub imm16,dn - sub imm24,an -> sub imm16,an + sub imm24,an -> sub imm16,an And all d24->d16 in memory ops. */ case 0x78: case 0xd0: @@ -1506,7 +1503,6 @@ mn10200_elf_get_relocated_section_contents (output_bfd, link_info, link_order, return NULL; } - #define TARGET_LITTLE_SYM bfd_elf32_mn10200_vec #define TARGET_LITTLE_NAME "elf32-mn10200" #define ELF_ARCH bfd_arch_mn10200 diff --git a/gnu/dist/toolchain/bfd/elf-m10300.c b/gnu/dist/toolchain/bfd/elf-m10300.c index 498f538a77f0..920885709024 100644 --- a/gnu/dist/toolchain/bfd/elf-m10300.c +++ b/gnu/dist/toolchain/bfd/elf-m10300.c @@ -1,5 +1,5 @@ /* Matsushita 10300 specific support for 32-bit ELF - Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -119,7 +119,6 @@ static void compute_function_info does absolutely nothing. */ #define USE_RELA - static reloc_howto_type elf_mn10300_howto_table[] = { /* Dummy relocation. Does nothing. */ @@ -342,7 +341,7 @@ mn10300_elf_check_relocs (abfd, info, sec, relocs) symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); - sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym); + sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof (Elf32_External_Sym); if (!elf_bad_symtab (abfd)) sym_hashes_end -= symtab_hdr->sh_info; @@ -527,7 +526,6 @@ mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd, return bfd_reloc_notsupported; } } - /* Relocate an MN10300 ELF section. */ static boolean @@ -767,7 +765,6 @@ elf32_mn10300_finish_hash_table_entry (gen_entry, in_args) This is only done if the resulting code is no larger than the original code. - * jmp:32 -> jmp:16 2 bytes * jmp:16 -> bra:8 1 byte @@ -930,7 +927,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) sym_sec = bfd_abs_section_ptr; else if (isym.st_shndx == SHN_COMMON) sym_sec = bfd_com_section_ptr; - + sym_name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, isym.st_name); @@ -993,7 +990,6 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) shndx = _bfd_elf_section_from_bfd_section (input_bfd, section); - /* Look at each function defined in this section and update info for that function. */ esym = extsyms; @@ -1182,7 +1178,6 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) goto error_return; } - shndx = _bfd_elf_section_from_bfd_section (input_bfd, section); /* Now look for any function in this section which needs @@ -1213,7 +1208,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) sym_sec = bfd_com_section_ptr; else abort (); - + sym_name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, isym.st_name); @@ -1370,7 +1365,6 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) } } - /* (Re)initialize for the basic instruction shortening/relaxing pass. */ contents = NULL; extsyms = NULL; @@ -1482,7 +1476,7 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) sym_sec = bfd_com_section_ptr; else abort (); - + symval = (isym.st_value + sym_sec->output_section->vma + sym_sec->output_offset); @@ -1771,7 +1765,6 @@ mn10300_elf_relax_section (abfd, sec, link_info, again) bra lab2 lab1: lab1: - This happens when the bCC can't reach lab2 at assembly time, but due to other relaxations it can reach at link time. */ if (ELF32_R_TYPE (irel->r_info) == (int) R_MN10300_PCREL8) @@ -2642,7 +2635,7 @@ mn10300_elf_symbol_address_p (abfd, sec, extsyms, addr) return true; } - sym_hash = (struct elf32_mn10300_link_hash_entry **)(elf_sym_hashes (abfd)); + sym_hash = (struct elf32_mn10300_link_hash_entry **) (elf_sym_hashes (abfd)); sym_hash_end = (sym_hash + (symtab_hdr->sh_size / sizeof (Elf32_External_Sym) - symtab_hdr->sh_info)); @@ -2892,7 +2885,6 @@ elf_mn10300_mach (flags) file. This gets the MN10300 architecture right based on the machine number. */ -/*ARGSUSED*/ void _bfd_mn10300_elf_final_write_processing (abfd, linker) bfd *abfd; @@ -2948,7 +2940,6 @@ _bfd_mn10300_elf_merge_private_bfd_data (ibfd, obfd) return true; } - #define TARGET_LITTLE_SYM bfd_elf32_mn10300_vec #define TARGET_LITTLE_NAME "elf32-mn10300" #define ELF_ARCH bfd_arch_mn10300 @@ -2977,5 +2968,4 @@ _bfd_mn10300_elf_merge_private_bfd_data (ibfd, obfd) #define bfd_elf32_bfd_merge_private_bfd_data \ _bfd_mn10300_elf_merge_private_bfd_data - #include "elf32-target.h" diff --git a/gnu/dist/toolchain/bfd/elf32-arc.c b/gnu/dist/toolchain/bfd/elf32-arc.c index 318dc704e06c..254b346362f3 100644 --- a/gnu/dist/toolchain/bfd/elf32-arc.c +++ b/gnu/dist/toolchain/bfd/elf32-arc.c @@ -1,22 +1,22 @@ /* ARC-specific support for 32-bit ELF - Copyright (C) 1994, 1995, 1997, 1999 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1997, 1999, 2000 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). -This file is part of BFD, the Binary File Descriptor library. + 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 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. */ #include "bfd.h" #include "sysdep.h" @@ -25,77 +25,80 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf/arc.h" static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup - PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); + PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); static void arc_info_to_howto_rel PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); -static boolean arc_elf_object_p PARAMS ((bfd *)); -static void arc_elf_final_write_processing PARAMS ((bfd *, boolean)); +static boolean arc_elf_object_p + PARAMS ((bfd *)); +static void arc_elf_final_write_processing + PARAMS ((bfd *, boolean)); /* Try to minimize the amount of space occupied by relocation tables on the ROM (not that the ROM won't be swamped by other ELF overhead). */ + #define USE_REL static reloc_howto_type elf_arc_howto_table[] = { /* This reloc does nothing. */ - HOWTO (R_ARC_NONE, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARC_NONE", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ - false), /* pcrel_offset */ + HOWTO (R_ARC_NONE, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARC_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ /* A standard 32 bit relocation. */ - HOWTO (R_ARC_32, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARC_32", /* name */ - false, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ - false), /* pcrel_offset */ + HOWTO (R_ARC_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARC_32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ /* A 26 bit absolute branch, right shifted by 2. */ - HOWTO (R_ARC_B26, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ - complain_overflow_bitfield, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARC_B26", /* name */ - false, /* partial_inplace */ - 0x00ffffff, /* src_mask */ - 0x00ffffff, /* dst_mask */ - false), /* pcrel_offset */ + HOWTO (R_ARC_B26, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARC_B26", /* name */ + false, /* partial_inplace */ + 0x00ffffff, /* src_mask */ + 0x00ffffff, /* dst_mask */ + false), /* pcrel_offset */ /* A relative 22 bit branch; bits 21-2 are stored in bits 26-7. */ - HOWTO (R_ARC_B22_PCREL, /* type */ - 2, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 22, /* bitsize */ - true, /* pc_relative */ - 7, /* bitpos */ - complain_overflow_signed, /* complain_on_overflow */ - bfd_elf_generic_reloc, /* special_function */ - "R_ARC_B22_PCREL", /* name */ - false, /* partial_inplace */ - 0x07ffff80, /* src_mask */ - 0x07ffff80, /* dst_mask */ - true), /* pcrel_offset */ + HOWTO (R_ARC_B22_PCREL, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 22, /* bitsize */ + true, /* pc_relative */ + 7, /* bitpos */ + complain_overflow_signed, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_ARC_B22_PCREL", /* name */ + false, /* partial_inplace */ + 0x07ffff80, /* src_mask */ + 0x07ffff80, /* dst_mask */ + true), /* pcrel_offset */ }; @@ -123,14 +126,11 @@ 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++) + for (i = 0; i < sizeof (arc_reloc_map) / sizeof (struct arc_reloc_map); i++) { if (arc_reloc_map[i].bfd_reloc_val == code) return &elf_arc_howto_table[arc_reloc_map[i].elf_reloc_val]; } - return NULL; } @@ -155,21 +155,30 @@ static boolean arc_elf_object_p (abfd) bfd *abfd; { - int mach; - unsigned long arch = elf_elfheader (abfd)->e_flags & EF_ARC_MACH; + int mach = bfd_mach_arc_5; - switch (arch) + if (elf_elfheader(abfd)->e_machine == EM_ARC) { - case E_ARC_MACH_BASE: - mach = bfd_mach_arc_base; - break; - default: - /* Unknown cpu type. ??? What to do? */ - return false; - } + unsigned long arch = elf_elfheader (abfd)->e_flags & EF_ARC_MACH; - (void) bfd_default_set_arch_mach (abfd, bfd_arch_arc, mach); - return true; + switch (arch) + { + default: + case E_ARC_MACH_ARC5: + mach = bfd_mach_arc_5; + break; + case E_ARC_MACH_ARC6: + mach = bfd_mach_arc_6; + break; + case E_ARC_MACH_ARC7: + mach = bfd_mach_arc_7; + break; + case E_ARC_MACH_ARC8: + mach = bfd_mach_arc_8; + break; + } + } + return bfd_default_set_arch_mach (abfd, bfd_arch_arc, mach); } /* The final processing done just before writing out an ARC ELF object file. @@ -180,34 +189,40 @@ arc_elf_final_write_processing (abfd, linker) bfd *abfd; boolean linker ATTRIBUTE_UNUSED; { - int mach; unsigned long val; - switch (mach = bfd_get_mach (abfd)) + switch (bfd_get_mach (abfd)) { - case bfd_mach_arc_base: - val = E_ARC_MACH_BASE; - break; default: - return; + case bfd_mach_arc_5: + val = E_ARC_MACH_ARC5; + break; + case bfd_mach_arc_6: + val = E_ARC_MACH_ARC6; + break; + case bfd_mach_arc_7: + val = E_ARC_MACH_ARC7; + break; + case bfd_mach_arc_8: + 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; } -#define TARGET_LITTLE_SYM bfd_elf32_littlearc_vec -#define TARGET_LITTLE_NAME "elf32-littlearc" -#define TARGET_BIG_SYM bfd_elf32_bigarc_vec -#define TARGET_BIG_NAME "elf32-bigarc" -#define ELF_ARCH bfd_arch_arc -#define ELF_MACHINE_CODE EM_CYGNUS_ARC -#define ELF_MAXPAGESIZE 0x1000 +#define TARGET_LITTLE_SYM bfd_elf32_littlearc_vec +#define TARGET_LITTLE_NAME "elf32-littlearc" +#define TARGET_BIG_SYM bfd_elf32_bigarc_vec +#define TARGET_BIG_NAME "elf32-bigarc" +#define ELF_ARCH bfd_arch_arc +#define ELF_MACHINE_CODE EM_ARC +#define ELF_MAXPAGESIZE 0x1000 -#define elf_info_to_howto 0 -#define elf_info_to_howto_rel arc_info_to_howto_rel -#define elf_backend_object_p arc_elf_object_p -#define elf_backend_final_write_processing \ - arc_elf_final_write_processing +#define elf_info_to_howto 0 +#define elf_info_to_howto_rel arc_info_to_howto_rel +#define elf_backend_object_p arc_elf_object_p +#define elf_backend_final_write_processing arc_elf_final_write_processing #include "elf32-target.h" diff --git a/gnu/dist/toolchain/bfd/elf32-arm.h b/gnu/dist/toolchain/bfd/elf32-arm.h index 2e8a657ec816..0f2ac8a9d16a 100644 --- a/gnu/dist/toolchain/bfd/elf32-arm.h +++ b/gnu/dist/toolchain/bfd/elf32-arm.h @@ -1,5 +1,5 @@ /* 32-bit ELF support for ARM - Copyright 1998, 1999 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,7 +17,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - typedef unsigned long int insn32; typedef unsigned short int insn16; @@ -37,7 +36,6 @@ 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 *)); - static insn32 insert_thumb_branch PARAMS ((insn32, int)); static struct elf_link_hash_entry *find_thumb_glue @@ -57,14 +55,12 @@ 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)); +#define INTERWORK_FLAG(abfd) (elf_elfheader (abfd)->e_flags & EF_INTERWORK) + /* 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. - */ - -#define INTERWORK_FLAG( abfd ) (elf_elfheader (abfd)->e_flags & EF_INTERWORK) - + 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" @@ -76,14 +72,12 @@ static int elf32_thumb_to_arm_stub #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 16 /* The first entry in a procedure linkage table looks like 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 */ - + linker first. */ static const bfd_byte elf32_arm_plt0_entry [PLT_ENTRY_SIZE] = { 0x04, 0xe0, 0x2d, 0xe5, /* str lr, [sp, #-4]! */ @@ -94,7 +88,6 @@ static const bfd_byte elf32_arm_plt0_entry [PLT_ENTRY_SIZE] = /* Subsequent entries in a procedure linkage table look like this. */ - static const bfd_byte elf32_arm_plt_entry [PLT_ENTRY_SIZE] = { 0x04, 0xc0, 0x9f, 0xe5, /* ldr ip, [pc, #4] */ @@ -103,7 +96,6 @@ static const bfd_byte elf32_arm_plt_entry [PLT_ENTRY_SIZE] = 0x00, 0x00, 0x00, 0x00 /* 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 it can discard PC relative relocs if it doesn't need them when @@ -112,7 +104,6 @@ static const bfd_byte elf32_arm_plt_entry [PLT_ENTRY_SIZE] = /* 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. */ @@ -124,7 +115,6 @@ struct elf32_arm_pcrel_relocs_copied }; /* Arm ELF linker hash entry. */ - struct elf32_arm_link_hash_entry { struct elf_link_hash_entry root; @@ -134,12 +124,10 @@ struct elf32_arm_link_hash_entry }; /* Declare this now that the above structures are defined. */ - static boolean elf32_arm_discard_copies PARAMS ((struct elf32_arm_link_hash_entry *, PTR)); /* Traverse an arm ELF linker hash table. */ - #define elf32_arm_link_hash_traverse(table, func, info) \ (elf_link_hash_traverse \ (&(table)->root, \ @@ -150,26 +138,25 @@ static boolean elf32_arm_discard_copies #define elf32_arm_hash_table(info) \ ((struct elf32_arm_link_hash_table *) ((info)->hash)) -/* ARM ELF linker hash table */ +/* 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. */ + long int 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. */ + long int arm_glue_size; - /* 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; - }; + /* An arbitary input BFD chosen to hold the glue sections. */ + bfd * bfd_of_glue_owner; + /* A boolean indicating whether knowledge of the ARM's pipeline + length should be applied by the linker. */ + int no_pipeline_knowledge; +}; /* Create an entry in an ARM ELF linker hash table. */ @@ -201,7 +188,7 @@ elf32_arm_link_hash_newfunc (entry, table, string) return (struct bfd_hash_entry *) ret; } -/* Create an ARM elf linker hash table */ +/* Create an ARM elf linker hash table. */ static struct bfd_link_hash_table * elf32_arm_link_hash_table_create (abfd) @@ -229,6 +216,8 @@ elf32_arm_link_hash_table_create (abfd) return &ret->root.root; } +/* Locate the Thumb encoded calling stub for NAME. */ + static struct elf_link_hash_entry * find_thumb_glue (link_info, name, input_bfd) struct bfd_link_info *link_info; @@ -242,7 +231,6 @@ 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)); @@ -255,7 +243,7 @@ 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_error_handler (_("%s: unable to find THUMB glue '%s' for `%s'"), bfd_get_filename (input_bfd), tmp_name, name); free (tmp_name); @@ -263,6 +251,8 @@ find_thumb_glue (link_info, name, input_bfd) return hash; } +/* Locate the ARM encoded calling stub for NAME. */ + static struct elf_link_hash_entry * find_arm_glue (link_info, name, input_bfd) struct bfd_link_info *link_info; @@ -288,7 +278,7 @@ 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_error_handler (_("%s: unable to find ARM glue '%s' for `%s'"), bfd_get_filename (input_bfd), tmp_name, name); free (tmp_name); @@ -296,24 +286,21 @@ find_arm_glue (link_info, name, input_bfd) return myh; } -/* - ARM->Thumb glue: +/* ARM->Thumb glue: .arm __func_from_arm: ldr r12, __func_addr bx r12 __func_addr: - .word func @ behave as if you saw a ARM_32 reloc - */ + .word func @ behave as if you saw a ARM_32 reloc. */ #define ARM2THUMB_GLUE_SIZE 12 static const insn32 a2t1_ldr_insn = 0xe59fc000; static const insn32 a2t2_bx_r12_insn = 0xe12fff1c; static const insn32 a2t3_func_addr_insn = 0x00000001; -/* - Thumb->ARM: Thumb->(non-interworking aware) ARM +/* Thumb->ARM: Thumb->(non-interworking aware) ARM .thumb .thumb .align 2 .align 2 @@ -327,8 +314,7 @@ static const insn32 a2t3_func_addr_insn = 0x00000001; ldmia r13! {r6, lr} bx lr __func_addr: - .word func - */ + .word func */ #define THUMB2ARM_GLUE_SIZE 8 static const insn16 t2a1_bx_pc_insn = 0x4778; @@ -408,7 +394,6 @@ record_arm_to_thumb_glue (link_info, h) s = bfd_get_section_by_name (globals->bfd_of_glue_owner, ARM2THUMB_GLUE_SECTION_NAME); - BFD_ASSERT (s != NULL); tmp_name = ((char *) @@ -423,14 +408,14 @@ record_arm_to_thumb_glue (link_info, h) if (myh != NULL) { + /* We've already seen this guy. */ free (tmp_name); - return; /* we've already seen this guy */ + return; } /* 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, @@ -477,8 +462,9 @@ record_thumb_to_arm_glue (link_info, h) if (myh != NULL) { + /* We've already seen this guy. */ free (tmp_name); - return; /* we've already seen this guy */ + return; } _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner, tmp_name, @@ -486,17 +472,16 @@ record_thumb_to_arm_glue (link_info, h) NULL, true, false, (struct bfd_link_hash_entry **) &myh); - /* If we mark it 'thumb', the disassembler will do a better job. */ + /* If we mark it 'Thumb', the disassembler will do a better job. */ bind = ELF_ST_BIND (myh->type); myh->type = ELF_ST_INFO (bind, STT_ARM_TFUNC); free (tmp_name); - /* Allocate another symbol to mark where we switch to arm mode. */ - #define CHANGE_TO_ARM "__%s_change_to_arm" #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); BFD_ASSERT (tmp_name); @@ -520,6 +505,7 @@ record_thumb_to_arm_glue (link_info, h) /* Select a BFD to be used to hold the sections used by the glue code. This function is called from the linker scripts in ld/emultempl/ {armelf/pe}.em */ + boolean bfd_elf32_arm_get_bfd_for_interworking (abfd, info) bfd *abfd; @@ -556,7 +542,7 @@ bfd_elf32_arm_get_bfd_for_interworking (abfd, info) || !bfd_set_section_flags (abfd, sec, flags) || !bfd_set_section_alignment (abfd, sec, 2)) return false; - + /* Set the gc mark to prevent the section from being removed by garbage collection, despite the fact that no relocs refer to this section. */ sec->gc_mark = 1; @@ -574,7 +560,7 @@ bfd_elf32_arm_get_bfd_for_interworking (abfd, info) || !bfd_set_section_flags (abfd, sec, flags) || !bfd_set_section_alignment (abfd, sec, 2)) return false; - + sec->gc_mark = 1; } @@ -608,7 +594,6 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) /* Here we have a bfd that is to be included on the link. We have a hook to do reloc rummaging, before section sizes are nailed down. */ - globals = elf32_arm_hash_table (link_info); BFD_ASSERT (globals != NULL); @@ -628,8 +613,8 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) continue; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; - /* Load the relocs. */ + /* Load the relocs. */ irel = (_bfd_elf32_link_read_relocs (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, false)); @@ -646,7 +631,7 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) r_type = ELF32_R_TYPE (irel->r_info); r_index = ELF32_R_SYM (irel->r_info); - /* These are the only relocation types we care about */ + /* These are the only relocation types we care about. */ if ( r_type != R_ARM_PC24 && r_type != R_ARM_THM_PC22) continue; @@ -663,6 +648,7 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) contents = (bfd_byte *) bfd_malloc (sec->_raw_size); if (contents == NULL) goto error_return; + free_contents = contents; if (!bfd_get_section_contents (abfd, sec, contents, @@ -684,7 +670,9 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) bfd_malloc (symtab_hdr->sh_size)); if (extsyms == NULL) goto error_return; + free_extsyms = extsyms; + if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 || (bfd_read (extsyms, 1, symtab_hdr->sh_size, abfd) != symtab_hdr->sh_size)) @@ -692,15 +680,14 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) } } - /* If the relocation is not against a symbol it cannot concern us. */ - + /* If the relocation is not against a symbol it cannot concern us. */ h = NULL; - /* We don't care about local symbols */ + /* We don't care about local symbols. */ if (r_index < symtab_hdr->sh_info) continue; - /* This is an external symbol */ + /* This is an external symbol. */ r_index -= symtab_hdr->sh_info; h = (struct elf_link_hash_entry *) elf_sym_hashes (abfd)[r_index]; @@ -716,7 +703,6 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) /* This one is a call from arm code. We need to look up the target of the call. If it is a thumb target, we insert glue. */ - if (ELF_ST_TYPE(h->type) == STT_ARM_TFUNC) record_arm_to_thumb_glue (link_info, h); break; @@ -725,7 +711,6 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) /* This one is a call from thumb code. We look up the target of the call. If it is not a thumb target, we insert glue. */ - if (ELF_ST_TYPE (h->type) != STT_ARM_TFUNC) record_thumb_to_arm_glue (link_info, h); break; @@ -737,7 +722,7 @@ bfd_elf32_arm_process_before_allocation (abfd, link_info, no_pipeline_knowledge) } return true; - + error_return: if (free_relocs != NULL) free (free_relocs); @@ -745,7 +730,7 @@ error_return: free (free_contents); if (free_extsyms != NULL) free (free_extsyms); - + return false; } @@ -775,10 +760,10 @@ error_return: 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 +#define LOW_HI_ORDER 0xF800F000 +#define HI_LOW_ORDER 0xF000F800 static insn32 insert_thumb_branch (br_insn, rel_off) @@ -788,26 +773,25 @@ insert_thumb_branch (br_insn, rel_off) unsigned int low_bits; unsigned int high_bits; - BFD_ASSERT ((rel_off & 1) != 1); - rel_off >>= 1; /* half word aligned address */ - low_bits = rel_off & 0x000007FF; /* the bottom 11 bits */ - high_bits = (rel_off >> 11) & 0x000007FF; /* the top 11 bits */ + rel_off >>= 1; /* Half word aligned address. */ + low_bits = rel_off & 0x000007FF; /* The bottom 11 bits. */ + high_bits = (rel_off >> 11) & 0x000007FF; /* The top 11 bits. */ if ((br_insn & LOW_HI_ORDER) == LOW_HI_ORDER) br_insn = LOW_HI_ORDER | (low_bits << 16) | high_bits; 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: abort is probably not the right call. krk@cygnus.com */ + abort (); /* error - not a valid branch instruction form. */ return br_insn; } -/* Thumb code calling an ARM function */ +/* Thumb code calling an ARM function. */ + static int elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, hit_data, sym_sec, offset, addend, val) @@ -854,10 +838,10 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, && !INTERWORK_FLAG (sym_sec->owner)) { _bfd_error_handler - (_ ("%s(%s): warning: interworking not enabled."), + (_("%s(%s): warning: interworking not enabled."), bfd_get_filename (sym_sec->owner), name); _bfd_error_handler - (_ (" first occurrence: %s: thumb call to arm"), + (_(" first occurrence: %s: thumb call to arm"), bfd_get_filename (input_bfd)); return false; @@ -873,13 +857,19 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, s->contents + my_offset + 2); ret_offset = - ((bfd_signed_vma) val) /* Address of destination of the stub */ + /* Address of destination of the stub. */ + ((bfd_signed_vma) val) - ((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. */ - + s->output_section->vma) /* Address of the start of the current section. */ - + 4 /* The branch instruction is 4 bytes into the stub. */ - + 8); /* ARM branches work from the pc of the instruction + 8. */ + /* Offset from the start of the current section to the start of the stubs. */ + (s->output_offset + /* Offset of the start of this stub from the start of the stubs. */ + + my_offset + /* Address of the start of the current section. */ + + s->output_section->vma) + /* The branch instruction is 4 bytes into the stub. */ + + 4 + /* ARM branches work from the pc of the instruction + 8. */ + + 8); bfd_put_32 (output_bfd, t2a3_b_insn | ((ret_offset >> 2) & 0x00FFFFFF), @@ -907,7 +897,8 @@ elf32_thumb_to_arm_stub (info, name, input_bfd, output_bfd, input_section, return true; } -/* Arm code calling a Thumb function */ +/* Arm code calling a Thumb function. */ + static int elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section, hit_data, sym_sec, offset, addend, val) @@ -952,12 +943,13 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section, && !INTERWORK_FLAG (sym_sec->owner)) { _bfd_error_handler - (_ ("%s(%s): warning: interworking not enabled."), + (_("%s(%s): warning: interworking not enabled."), bfd_get_filename (sym_sec->owner), name); _bfd_error_handler - (_ (" first occurrence: %s: arm call to thumb"), + (_(" first occurrence: %s: arm call to thumb"), bfd_get_filename (input_bfd)); } + --my_offset; myh->root.u.def.value = my_offset; @@ -977,7 +969,7 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section, tmp = bfd_get_32 (input_bfd, hit_data); tmp = tmp & 0xFF000000; - /* Somehow these are both 4 too far, so subtract 8. */ + /* Somehow these are both 4 too far, so subtract 8. */ ret_offset = s->output_offset + my_offset + s->output_section->vma @@ -985,7 +977,7 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section, + input_section->output_section->vma + offset + addend) - 8; - + tmp = tmp | ((ret_offset >> 2) & 0x00FFFFFF); bfd_put_32 (output_bfd, tmp, hit_data @@ -995,6 +987,7 @@ elf32_arm_to_thumb_stub (info, name, input_bfd, output_bfd, input_section, } /* Perform a relocation as part of a final link. */ + static bfd_reloc_status_type elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, input_section, contents, rel, value, @@ -1062,9 +1055,11 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, case R_ARM_PC24: case R_ARM_ABS32: case R_ARM_REL32: +#ifndef OLD_ARM_ABI + case R_ARM_XPC25: +#endif /* When generating a shared object, these relocations are copied - into the output file to be resolved at run time. */ - + into the output file to be resolved at run time. */ if (info->shared && (r_type != R_ARM_PC24 || (h != NULL @@ -1157,30 +1152,46 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, sreloc->contents) + sreloc->reloc_count)); ++sreloc->reloc_count; - + /* If this reloc is against an external symbol, we do not want to fiddle with the addend. Otherwise, we need to include the symbol - value so that it becomes an addend for the dynamic reloc. */ + value so that it becomes an addend for the dynamic reloc. */ if (! relocate) return bfd_reloc_ok; - return _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, value, (bfd_vma) 0); } else switch (r_type) { - case R_ARM_PC24: - /* Arm B/BL instruction */ - - /* Check for arm calling thumb function. */ - if (sym_flags == STT_ARM_TFUNC) +#ifndef OLD_ARM_ABI + case R_ARM_XPC25: /* Arm BLX instruction. */ +#endif + case R_ARM_PC24: /* Arm B/BL instruction */ +#ifndef OLD_ARM_ABI + if (r_type == R_ARM_XPC25) { - elf32_arm_to_thumb_stub (info, sym_name, input_bfd, output_bfd, - input_section, hit_data, sym_sec, rel->r_offset, - signed_addend, value); - return bfd_reloc_ok; + /* Check for Arm calling Arm function. */ + /* FIXME: Should we translate the instruction into a BL + instruction instead ? */ + if (sym_flags != STT_ARM_TFUNC) + _bfd_error_handler (_("\ +%s: Warning: Arm BLX instruction targets Arm function '%s'."), + bfd_get_filename (input_bfd), + h ? h->root.root.string : "(local)"); + } + else +#endif + { + /* Check for Arm calling Thumb function. */ + if (sym_flags == STT_ARM_TFUNC) + { + elf32_arm_to_thumb_stub (info, sym_name, input_bfd, output_bfd, + input_section, hit_data, sym_sec, rel->r_offset, + signed_addend, value); + return bfd_reloc_ok; + } } if ( strcmp (bfd_get_target (input_bfd), "elf32-littlearm-oabi") == 0 @@ -1188,7 +1199,6 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, { /* The old way of doing things. Trearing the addend as a byte sized field and adding in the pipeline offset. */ - value -= (input_section->output_section->vma + input_section->output_offset); value -= rel->r_offset; @@ -1217,7 +1227,6 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, Note: None of these operations have knowledge of the pipeline size of the processor, thus it is up to the assembler to encode this information into the addend. */ - value -= (input_section->output_section->vma + input_section->output_offset); value -= rel->r_offset; @@ -1239,22 +1248,31 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, } } + signed_addend = value; + signed_addend >>= howto->rightshift; + /* It is not an error for an undefined weak reference to be out of range. Any program that branches to such a symbol - is going to crash anyway, so there is no point worrying - about getting the destination exactly right. */ + is going to crash anyway, so there is no point worrying + about getting the destination exactly right. */ if (! h || h->root.type != bfd_link_hash_undefweak) { /* Perform a signed range check. */ - signed_addend = value; - signed_addend >>= howto->rightshift; - if (signed_addend > ((bfd_signed_vma)(howto->dst_mask >> 1)) + if ( signed_addend > ((bfd_signed_vma) (howto->dst_mask >> 1)) || signed_addend < - ((bfd_signed_vma) ((howto->dst_mask + 1) >> 1))) return bfd_reloc_overflow; } - - value = (signed_addend & howto->dst_mask) - | (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask)); + +#ifndef OLD_ARM_ABI + /* If necessary set the H bit in the BLX instruction. */ + if (r_type == R_ARM_XPC25 && ((value & 2) == 2)) + value = (signed_addend & howto->dst_mask) + | (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask)) + | (1 << 24); + else +#endif + value = (signed_addend & howto->dst_mask) + | (bfd_get_32 (input_bfd, hit_data) & (~ howto->dst_mask)); break; case R_ARM_ABS32: @@ -1303,7 +1321,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, return bfd_reloc_ok; case R_ARM_THM_ABS5: - /* Support ldr and str instructions for the thumb. */ + /* Support ldr and str instructions for the thumb. */ #ifdef USE_REL /* Need to refetch addend. */ addend = bfd_get_16 (input_bfd, hit_data) & howto->src_mask; @@ -1321,8 +1339,11 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, bfd_put_16 (input_bfd, value, hit_data); return bfd_reloc_ok; +#ifndef OLD_ARM_ABI + case R_ARM_THM_XPC22: +#endif case R_ARM_THM_PC22: - /* Thumb BL (branch long instruction). */ + /* Thumb BL (branch long instruction). */ { bfd_vma relocation; boolean overflow = false; @@ -1339,23 +1360,38 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, { bfd_vma upper = upper_insn & 0x7ff; bfd_vma lower = lower_insn & 0x7ff; - upper = (upper ^ 0x400) - 0x400; /* sign extend */ + upper = (upper ^ 0x400) - 0x400; /* Sign extend. */ addend = (upper << 12) | (lower << 1); signed_addend = addend; } #endif - - /* If it is not a call to thumb, assume call to arm. - If it is a call relative to a section name, then it is not a - function call at all, but rather a long jump. */ - if (sym_flags != STT_ARM_TFUNC && sym_flags != STT_SECTION) +#ifndef OLD_ARM_ABI + if (r_type == R_ARM_THM_XPC22) { - if (elf32_thumb_to_arm_stub - (info, sym_name, input_bfd, output_bfd, input_section, - hit_data, sym_sec, rel->r_offset, signed_addend, value)) - return bfd_reloc_ok; - else - return bfd_reloc_dangerous; + /* Check for Thumb to Thumb call. */ + /* FIXME: Should we translate the instruction into a BL + instruction instead ? */ + if (sym_flags == STT_ARM_TFUNC) + _bfd_error_handler (_("\ +%s: Warning: Thumb BLX instruction targets thumb function '%s'."), + bfd_get_filename (input_bfd), + h ? h->root.root.string : "(local)"); + } + else +#endif + { + /* If it is not a call to Thumb, assume call to Arm. + If it is a call relative to a section name, then it is not a + function call at all, but rather a long jump. */ + if (sym_flags != STT_ARM_TFUNC && sym_flags != STT_SECTION) + { + if (elf32_thumb_to_arm_stub + (info, sym_name, input_bfd, output_bfd, input_section, + hit_data, sym_sec, rel->r_offset, signed_addend, value)) + return bfd_reloc_ok; + else + return bfd_reloc_dangerous; + } } relocation = value + signed_addend; @@ -1363,11 +1399,11 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, relocation -= (input_section->output_section->vma + input_section->output_offset + rel->r_offset); - + if (! globals->no_pipeline_knowledge) { - Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form */ - + Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form. */ + i_ehdrp = elf_elfheader (input_bfd); /* Previous versions of this code also used to add in the pipline @@ -1429,21 +1465,19 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, BFD_ASSERT (sgot != NULL); if (sgot == NULL) return bfd_reloc_notsupported; - + /* Note that sgot->output_offset is not involved in this calculation. We always want the start of .got. If we define _GLOBAL_OFFSET_TABLE in a different way, as is permitted by the ABI, we might have to change this - calculation. */ - + calculation. */ value -= sgot->output_section->vma; return _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, value, (bfd_vma) 0); case R_ARM_GOTPC: - /* Use global offset table as symbol value. */ - + /* Use global offset table as symbol value. */ BFD_ASSERT (sgot != NULL); if (sgot == NULL) @@ -1456,7 +1490,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, case R_ARM_GOT32: /* Relocation is to the entry for this symbol in the - global offset table. */ + global offset table. */ if (sgot == NULL) return bfd_reloc_notsupported; @@ -1479,8 +1513,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, 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. */ - + finish_dynamic_symbol routine. */ if ((off & 1) != 0) off &= ~1; else @@ -1503,7 +1536,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, /* 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. */ + generated the necessary reloc. */ if ((off & 1) != 0) off &= ~1; else @@ -1534,7 +1567,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, value = sgot->output_offset + off; } - + return _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, value, (bfd_vma) 0); @@ -1544,7 +1577,7 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd, 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) return _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, value, @@ -1607,44 +1640,67 @@ arm_add_to_rel (abfd, address, howto, increment) reloc_howto_type * howto; bfd_signed_vma increment; { - bfd_vma contents; bfd_signed_vma addend; - contents = bfd_get_32 (abfd, address); - - /* Get the (signed) value from the instruction. */ - addend = contents & howto->src_mask; - if (addend & ((howto->src_mask + 1) >> 1)) + if (howto->type == R_ARM_THM_PC22) { - bfd_signed_vma mask; - - mask = -1; - mask &= ~ howto->src_mask; - addend |= mask; - } + int upper_insn, lower_insn; + int upper, lower; - /* Add in the increment, (which is a byte value). */ - switch (howto->type) - { - case R_ARM_THM_PC22: - default: + upper_insn = bfd_get_16 (abfd, address); + lower_insn = bfd_get_16 (abfd, address + 2); + upper = upper_insn & 0x7ff; + lower = lower_insn & 0x7ff; + + addend = (upper << 12) | (lower << 1); addend += increment; - break; - - case R_ARM_PC24: - addend <<= howto->size; - addend += increment; - - /* Should we check for overflow here ? */ + addend >>= 1; - /* Drop any undesired bits. */ - addend >>= howto->rightshift; - break; + 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); + } + else + { + bfd_vma contents; + + contents = bfd_get_32 (abfd, address); + + /* Get the (signed) value from the instruction. */ + addend = contents & howto->src_mask; + if (addend & ((howto->src_mask + 1) >> 1)) + { + bfd_signed_vma mask; + + mask = -1; + mask &= ~ howto->src_mask; + addend |= mask; + } + + /* Add in the increment, (which is a byte value). */ + switch (howto->type) + { + default: + addend += increment; + break; + + case R_ARM_PC24: + addend <<= howto->size; + addend += increment; + + /* Should we check for overflow here ? */ + + /* Drop any undesired bits. */ + addend >>= howto->rightshift; + break; + } + + contents = (contents & ~ howto->dst_mask) | (addend & howto->dst_mask); + + bfd_put_32 (abfd, contents, address); } - - contents = (contents & ~ howto->dst_mask) | (addend & howto->dst_mask); - - bfd_put_32 (abfd, contents, address); } #endif /* USE_REL */ @@ -1723,6 +1779,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, h = NULL; sym = NULL; sec = NULL; + if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; @@ -1734,10 +1791,12 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, else { h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - while (h->root.type == bfd_link_hash_indirect + + 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 + + if ( h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { int relocation_needed = 1; @@ -1746,7 +1805,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, /* In these cases, we don't need the relocation value. We check specially because in some obscure cases - sec->output_section will be NULL. */ + sec->output_section will be NULL. */ switch (r_type) { case R_ARM_PC24: @@ -1865,19 +1924,19 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, break; case bfd_reloc_outofrange: - msg = _ ("internal error: out of range error"); + msg = _("internal error: out of range error"); goto common_error; case bfd_reloc_notsupported: - msg = _ ("internal error: unsupported relocation error"); + msg = _("internal error: unsupported relocation error"); goto common_error; case bfd_reloc_dangerous: - msg = _ ("internal error: dangerous error"); + msg = _("internal error: dangerous error"); goto common_error; default: - msg = _ ("internal error: unknown error"); + msg = _("internal error: unknown error"); /* fall through */ common_error: @@ -1893,7 +1952,7 @@ elf32_arm_relocate_section (output_bfd, info, input_bfd, input_section, return true; } -/* Function to keep ARM specific flags in the ELF header. */ +/* Function to keep ARM specific flags in the ELF header. */ static boolean elf32_arm_set_private_flags (abfd, flags) bfd *abfd; @@ -1902,14 +1961,17 @@ elf32_arm_set_private_flags (abfd, flags) if (elf_flags_init (abfd) && elf_elfheader (abfd)->e_flags != flags) { - if (flags & EF_INTERWORK) - _bfd_error_handler (_ ("\ + if (EF_ARM_EABI_VERSION (flags) == EF_ARM_EABI_UNKNOWN) + { + if (flags & EF_INTERWORK) + _bfd_error_handler (_("\ Warning: Not setting interwork flag of %s since it has already been specified as non-interworking"), - bfd_get_filename (abfd)); - else - _bfd_error_handler (_ ("\ + bfd_get_filename (abfd)); + else + _bfd_error_handler (_("\ Warning: Clearing the interwork flag of %s due to outside request"), - bfd_get_filename (abfd)); + bfd_get_filename (abfd)); + } } else { @@ -1920,7 +1982,8 @@ Warning: Clearing the interwork flag of %s due to outside request"), return true; } -/* Copy backend specific data from one object module to another */ +/* Copy backend specific data from one object module to another. */ + static boolean elf32_arm_copy_private_bfd_data (ibfd, obfd) bfd *ibfd; @@ -1929,14 +1992,16 @@ elf32_arm_copy_private_bfd_data (ibfd, obfd) flagword in_flags; flagword out_flags; - if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) return true; - in_flags = elf_elfheader (ibfd)->e_flags; + in_flags = elf_elfheader (ibfd)->e_flags; out_flags = elf_elfheader (obfd)->e_flags; - if (elf_flags_init (obfd) && in_flags != out_flags) + if (elf_flags_init (obfd) + && EF_ARM_EABI_VERSION (out_flags) == EF_ARM_EABI_UNKNOWN + && in_flags != out_flags) { /* Cannot mix APCS26 and APCS32 code. */ if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26)) @@ -1951,7 +2016,7 @@ elf32_arm_copy_private_bfd_data (ibfd, obfd) if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK)) { if (out_flags & EF_INTERWORK) - _bfd_error_handler (_ ("\ + _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)); @@ -1971,10 +2036,11 @@ Warning: Clearing the interwork flag in %s because non-interworking code in %s h /* Merge backend specific data from an object file to the output object file when linking. */ + static boolean elf32_arm_merge_private_bfd_data (ibfd, obfd) - bfd *ibfd; - bfd *obfd; + bfd * ibfd; + bfd * obfd; { flagword out_flags; flagword in_flags; @@ -1982,29 +2048,18 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd) boolean null_input_bfd = true; asection *sec; + /* Check if we have the same endianess. */ + if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + return false; + if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) return true; - /* Check if we have the same endianess */ - if ( ibfd->xvec->byteorder != obfd->xvec->byteorder - && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN - && ibfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) - { - (*_bfd_error_handler) - (_("%s: compiled for a %s endian system and target is %s endian"), - bfd_get_filename (ibfd), - bfd_big_endian (ibfd) ? "big" : "little", - bfd_big_endian (obfd) ? "big" : "little"); - - bfd_set_error (bfd_error_wrong_format); - return false; - } - /* The input BFD must have had its flags initialised. */ /* The following seems bogus to me -- The flags are initialized in the assembler but I don't think an elf_flags_init field is - written into the object */ + written into the object. */ /* BFD_ASSERT (elf_flags_init (ibfd)); */ in_flags = elf_elfheader (ibfd)->e_flags; @@ -2052,96 +2107,152 @@ elf32_arm_merge_private_bfd_data (ibfd, obfd) if (null_input_bfd) return true; - /* If any of the input BFDs is non-PIC, the output is also position - dependent. */ - if (!(in_flags & EF_PIC)) - elf_elfheader (obfd)->e_flags &= ~EF_PIC; - /* Complain about various flag mismatches. */ - if ((in_flags & EF_APCS_26) != (out_flags & EF_APCS_26)) + if (EF_ARM_EABI_VERSION (in_flags) != EF_ARM_EABI_VERSION (out_flags)) { - _bfd_error_handler (_ ("\ + _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); + 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)) + { + _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); - flags_compatible = false; - } + flags_compatible = false; + } - if ((in_flags & EF_APCS_FLOAT) != (out_flags & EF_APCS_FLOAT)) - { - _bfd_error_handler (_ ("\ + if ((in_flags & EF_APCS_FLOAT) != (out_flags & EF_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"), + in_flags & EF_APCS_FLOAT ? _("float") : _("integer"), bfd_get_filename (obfd), - out_flags & EF_APCS_26 ? _ ("float") : _ ("integer")); - flags_compatible = false; - } + out_flags & EF_APCS_26 ? _("float") : _("integer")); + flags_compatible = false; + } #ifdef EF_SOFT_FLOAT - if ((in_flags & EF_SOFT_FLOAT) != (out_flags & EF_SOFT_FLOAT)) - { - _bfd_error_handler (_ ("\ + if ((in_flags & EF_SOFT_FLOAT) != (out_flags & EF_SOFT_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")); - flags_compatible = false; - } + bfd_get_filename (ibfd), + in_flags & EF_SOFT_FLOAT ? _("soft") : _("hard"), + bfd_get_filename (obfd), + out_flags & EF_SOFT_FLOAT ? _("soft") : _("hard")); + flags_compatible = false; + } #endif - /* Interworking mismatch is only a warning. */ - if ((in_flags & EF_INTERWORK) != (out_flags & EF_INTERWORK)) - _bfd_error_handler (_ ("\ + /* 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"), + in_flags & EF_INTERWORK ? _("supports") : _("does not support"), bfd_get_filename (obfd), - out_flags & EF_INTERWORK ? _ ("does not") : _ ("does")); + out_flags & EF_INTERWORK ? _("does not") : _("does")); + } return flags_compatible; } -/* Display the flags field */ +/* Display the flags field. */ + static boolean elf32_arm_print_private_bfd_data (abfd, ptr) bfd *abfd; PTR ptr; { - FILE *file = (FILE *) ptr; + FILE * file = (FILE *) ptr; + unsigned long flags; BFD_ASSERT (abfd != NULL && ptr != NULL); /* Print normal ELF private data. */ _bfd_elf_print_private_bfd_data (abfd, ptr); - /* Ignore init flag - it may not be set, despite the flags field containing valid data. */ + flags = elf_elfheader (abfd)->e_flags; + /* Ignore init flag - it may not be set, despite the flags field + containing valid data. */ /* xgettext:c-format */ - fprintf (file, _ ("private flags = %lx:"), elf_elfheader (abfd)->e_flags); + fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags); - if (elf_elfheader (abfd)->e_flags & EF_INTERWORK) - fprintf (file, _ (" [interworking enabled]")); - else - fprintf (file, _ (" [interworking not enabled]")); + switch (EF_ARM_EABI_VERSION (flags)) + { + case EF_ARM_EABI_UNKNOWN: + /* 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) + fprintf (file, _(" [interworking enabled]")); - if (elf_elfheader (abfd)->e_flags & EF_APCS_26) - fprintf (file, _ (" [APCS-26]")); - else - fprintf (file, _ (" [APCS-32]")); + if (flags & EF_APCS_26) + fprintf (file, _(" [APCS-26]")); + else + fprintf (file, _(" [APCS-32]")); - if (elf_elfheader (abfd)->e_flags & EF_APCS_FLOAT) - fprintf (file, _ (" [floats passed in float registers]")); - else - fprintf (file, _ (" [floats passed in integer registers]")); + if (flags & EF_APCS_FLOAT) + fprintf (file, _(" [floats passed in float registers]")); - if (elf_elfheader (abfd)->e_flags & EF_PIC) - fprintf (file, _ (" [position independent]")); - else - fprintf (file, _ (" [absolute position]")); + if (flags & EF_PIC) + fprintf (file, _(" [position independent]")); + + if (flags & EF_NEW_ABI) + fprintf (file, _(" [new ABI]")); + + if (flags & EF_OLD_ABI) + fprintf (file, _(" [old ABI]")); + + if (flags & EF_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); + break; + + case EF_ARM_EABI_VER1: + fprintf (file, _(" [Version1 EABI]")); + + if (flags & EF_ARM_SYMSARESORTED) + fprintf (file, _(" [sorted symbol table]")); + else + fprintf (file, _(" [unsorted symbol table]")); + + flags &= ~ EF_ARM_SYMSARESORTED; + break; + + default: + fprintf (file, _(" ")); + break; + } + + flags &= ~ EF_ARM_EABIMASK; + + if (flags & EF_ARM_RELEXEC) + fprintf (file, _(" [relocatable executable]")); + + if (flags & EF_ARM_HASENTRY) + fprintf (file, _(" [has entry point]")); + + flags &= ~ (EF_ARM_RELEXEC | EF_ARM_HASENTRY); + + if (flags) + fprintf (file, _("")); fputc ('\n', file); @@ -2157,7 +2268,7 @@ elf32_arm_get_symbol_type (elf_sym, type) { case STT_ARM_TFUNC: return ELF_ST_TYPE (elf_sym->st_info); - break; + case STT_ARM_16BIT: /* If the symbol is not an object, return the STT_ARM_16BIT flag. This allows us to distinguish between data used by Thumb instructions @@ -2166,6 +2277,9 @@ elf32_arm_get_symbol_type (elf_sym, type) if (type != STT_OBJECT) return ELF_ST_TYPE (elf_sym->st_info); break; + + default: + break; } return type; @@ -2245,33 +2359,35 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) bfd * dynobj; asection * sgot, *srelgot, *sreloc; bfd_vma * local_got_offsets; - + if (info->relocateable) return true; - + sgot = srelgot = sreloc = NULL; - + dynobj = elf_hash_table (info)->dynobj; local_got_offsets = elf_local_got_offsets (abfd); symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); - sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym); + sym_hashes_end = sym_hashes + + symtab_hdr->sh_size / sizeof (Elf32_External_Sym); + if (!elf_bad_symtab (abfd)) sym_hashes_end -= symtab_hdr->sh_info; - + rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { struct elf_link_hash_entry *h; unsigned long r_symndx; - + r_symndx = ELF32_R_SYM (rel->r_info); if (r_symndx < symtab_hdr->sh_info) h = NULL; else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - + /* Some relocs require a global offset table. */ if (dynobj == NULL) { @@ -2305,7 +2421,7 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) && (h != NULL || info->shared)) { srelgot = bfd_get_section_by_name (dynobj, ".rel.got"); - + /* If no got relocation section, make one and initialize. */ if (srelgot == NULL) { @@ -2490,7 +2606,7 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) if (!_bfd_elf32_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_ARM_GNU_VTENTRY: @@ -2503,10 +2619,9 @@ elf32_arm_check_relocs (abfd, info, sec, relocs) return true; } - /* Find the nearest line to a particular section and offset, for error reporting. This code is a duplicate of the code in elf.c, except - that it also accepts STT_ARM_TFUNC as a symbol that names a function. */ + that it also accepts STT_ARM_TFUNC as a symbol that names a function. */ static boolean elf32_arm_find_nearest_line @@ -2527,7 +2642,8 @@ elf32_arm_find_nearest_line if (_bfd_dwarf2_find_nearest_line (abfd, section, symbols, offset, filename_ptr, functionname_ptr, - line_ptr, 0)) + line_ptr, 0, + &elf_tdata (abfd)->dwarf2_find_line_info)) return true; if (! _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, @@ -2667,7 +2783,6 @@ elf32_arm_adjust_dynamic_symbol (info, h) /* 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; @@ -2712,7 +2827,6 @@ elf32_arm_adjust_dynamic_symbol (info, h) 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. */ - s = bfd_get_section_by_name (dynobj, ".dynbss"); BFD_ASSERT (s != NULL); @@ -2872,7 +2986,7 @@ elf32_arm_size_dynamic_sections (output_bfd, info) 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) @@ -2925,7 +3039,7 @@ elf32_arm_size_dynamic_sections (output_bfd, info) if (plt) { - if (! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 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)) @@ -2934,7 +3048,7 @@ elf32_arm_size_dynamic_sections (output_bfd, info) if (relocs) { - if (! bfd_elf32_add_dynamic_entry (info, DT_REL, 0) + 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))) @@ -2945,6 +3059,7 @@ elf32_arm_size_dynamic_sections (output_bfd, info) { if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; + info->flags |= DF_TEXTREL; } } @@ -3052,6 +3167,13 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym) /* Mark the symbol as undefined, rather than as defined in the .plt section. Leave the value alone. */ sym->st_shndx = SHN_UNDEF; + /* If the symbol is weak, we do need to clear the value. + Otherwise, the PLT entry would provide a definition for + the symbol even if the symbol wasn't defined anywhere, + and so the symbol would never be NULL. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK) + == 0) + sym->st_value = 0; } } @@ -3063,7 +3185,6 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym) /* 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); @@ -3098,7 +3219,6 @@ elf32_arm_finish_dynamic_symbol (output_bfd, info, h, sym) Elf_Internal_Rel rel; /* 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)); @@ -3152,6 +3272,7 @@ elf32_arm_finish_dynamic_sections (output_bfd, info) dyncon = (Elf32_External_Dyn *) sdyn->contents; dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size); + for (; dyncon < dynconend; dyncon++) { Elf_Internal_Dyn dyn; @@ -3242,7 +3363,7 @@ elf32_arm_post_process_headers (abfd, link_info) bfd * abfd; struct bfd_link_info * link_info ATTRIBUTE_UNUSED; { - Elf_Internal_Ehdr * i_ehdrp; /* Elf file header, internal form */ + Elf_Internal_Ehdr * i_ehdrp; /* ELF file header, internal form. */ i_ehdrp = elf_elfheader (abfd); @@ -3250,12 +3371,10 @@ elf32_arm_post_process_headers (abfd, link_info) i_ehdrp->e_ident[EI_ABIVERSION] = ARM_ELF_ABI_VERSION; } - #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_set_private_flags elf32_arm_set_private_flags diff --git a/gnu/dist/toolchain/bfd/elf32-avr.c b/gnu/dist/toolchain/bfd/elf32-avr.c index c64ab28d2951..ab8b57203633 100644 --- a/gnu/dist/toolchain/bfd/elf32-avr.c +++ b/gnu/dist/toolchain/bfd/elf32-avr.c @@ -18,7 +18,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. */ - #include "bfd.h" #include "sysdep.h" #include "libbfd.h" @@ -47,7 +46,6 @@ static boolean elf32_avr_relocate_section static void bfd_elf_avr_final_write_processing PARAMS ((bfd *, boolean)); static boolean elf32_avr_object_p PARAMS ((bfd *)); - /* Use RELA instead of REL */ #undef USE_REL @@ -369,7 +367,7 @@ struct avr_reloc_map static reloc_howto_type * bfd_elf32_bfd_reloc_type_lookup (abfd, code) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { unsigned int i; @@ -389,7 +387,7 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code) static void avr_info_to_howto_rela (abfd, cache_ptr, dst) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *cache_ptr; Elf32_Internal_Rela *dst; { @@ -403,7 +401,7 @@ avr_info_to_howto_rela (abfd, cache_ptr, dst) static asection * elf32_avr_gc_mark_hook (abfd, info, rel, h, sym) bfd *abfd; - struct bfd_link_info *info; + struct bfd_link_info *info ATTRIBUTE_UNUSED; Elf_Internal_Rela *rel; struct elf_link_hash_entry *h; Elf_Internal_Sym *sym; @@ -442,10 +440,10 @@ elf32_avr_gc_mark_hook (abfd, info, rel, h, sym) static boolean elf32_avr_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd; - struct bfd_link_info *info; - asection *sec; - const Elf_Internal_Rela *relocs; + bfd *abfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + asection *sec ATTRIBUTE_UNUSED; + const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; { /* We don't use got and plt entries for avr. */ return true; @@ -472,7 +470,7 @@ elf32_avr_check_relocs (abfd, info, sec, relocs) symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); - sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym); + sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof (Elf32_External_Sym); if (!elf_bad_symtab (abfd)) sym_hashes_end -= symtab_hdr->sh_info; @@ -516,7 +514,7 @@ avr_final_link_relocate (howto, input_bfd, input_section, srel = (bfd_signed_vma) relocation; srel += rel->r_addend; srel -= rel->r_offset; - srel -= 2; /* Branch instructions add 2 to the PC... */ + srel -= 2; /* Branch instructions add 2 to the PC... */ srel -= (input_section->output_section->vma + input_section->output_offset); @@ -534,7 +532,7 @@ avr_final_link_relocate (howto, input_bfd, input_section, srel = (bfd_signed_vma) relocation; srel += rel->r_addend; srel -= rel->r_offset; - srel -= 2; /* Branch instructions add 2 to the PC... */ + srel -= 2; /* Branch instructions add 2 to the PC... */ srel -= (input_section->output_section->vma + input_section->output_offset); @@ -548,15 +546,15 @@ avr_final_link_relocate (howto, input_bfd, input_section, if (srel < -2048 || srel > 2047) { /* Apply WRAPAROUND if possible. */ - if (bfd_get_mach (input_bfd) == bfd_mach_avr2) + switch (bfd_get_mach (input_bfd)) { - if (srel > 2047) - srel -= 4096; - else - srel += 4096; + case bfd_mach_avr2: + case bfd_mach_avr4: + break; + + default: + return bfd_reloc_overflow; } - else - return bfd_reloc_overflow; } x = bfd_get_16 (input_bfd, contents); @@ -717,7 +715,7 @@ avr_final_link_relocate (howto, input_bfd, input_section, static boolean elf32_avr_relocate_section (output_bfd, info, input_bfd, input_section, contents, relocs, local_syms, local_sections) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; bfd *input_bfd; asection *input_section; @@ -899,6 +897,9 @@ bfd_elf_avr_final_write_processing (abfd, linker) val = E_AVR_MACH_AVR4; break; + case bfd_mach_avr5: + val = E_AVR_MACH_AVR5; + break; } elf_elfheader (abfd)->e_machine = EM_AVR; @@ -934,13 +935,16 @@ elf32_avr_object_p (abfd) case E_AVR_MACH_AVR4: e_set = bfd_mach_avr4; break; + + case E_AVR_MACH_AVR5: + e_set = bfd_mach_avr5; + break; } } return bfd_default_set_arch_mach (abfd, bfd_arch_avr, e_set); } - #define ELF_ARCH bfd_arch_avr #define ELF_MACHINE_CODE EM_AVR #define ELF_MAXPAGESIZE 1 @@ -959,5 +963,4 @@ elf32_avr_object_p (abfd) bfd_elf_avr_final_write_processing #define elf_backend_object_p elf32_avr_object_p - #include "elf32-target.h" diff --git a/gnu/dist/toolchain/bfd/elf32-cris.c b/gnu/dist/toolchain/bfd/elf32-cris.c new file mode 100644 index 000000000000..9f92c735dc3a --- /dev/null +++ b/gnu/dist/toolchain/bfd/elf32-cris.c @@ -0,0 +1,712 @@ +/* CRIS-specific support for 32-bit ELF. + Copyright (C) 2000 Free Software Foundation, Inc. + Contributed by Axis Communications AB. + Written by Hans-Peter Nilsson, based on elf32-fr30.c + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "elf-bfd.h" +#include "elf/cris.h" + +/* Forward declarations. */ +static reloc_howto_type * cris_reloc_type_lookup + PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); + +static void cris_info_to_howto_rela + PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); + +static boolean cris_elf_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); + +static bfd_reloc_status_type cris_final_link_relocate + PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, bfd_vma)); + +static boolean cris_elf_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, asection *, + const Elf_Internal_Rela *)); + +static asection * cris_elf_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); + +static boolean cris_elf_object_p PARAMS ((bfd *)); + +static void cris_elf_final_write_processing PARAMS ((bfd *, boolean)); + +static boolean cris_elf_print_private_bfd_data PARAMS ((bfd *, PTR)); + +static boolean cris_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); + +static reloc_howto_type cris_elf_howto_table [] = +{ + /* This reloc does nothing. */ + HOWTO (R_CRIS_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_CRIS_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* An 8 bit absolute relocation. */ + HOWTO (R_CRIS_8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CRIS_8", /* name */ + false, /* partial_inplace */ + 0x0000, /* src_mask */ + 0x00ff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 16 bit absolute relocation. */ + HOWTO (R_CRIS_16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CRIS_16", /* name */ + false, /* partial_inplace */ + 0x00000000, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 32 bit absolute relocation. */ + HOWTO (R_CRIS_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CRIS_32", /* name */ + false, /* partial_inplace */ + 0x00000000, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* An 8 bit absolute relocation. */ + HOWTO (R_CRIS_8_PCREL, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CRIS_8_PCREL", /* name */ + false, /* partial_inplace */ + 0x0000, /* src_mask */ + 0x00ff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 16 bit absolute relocation. */ + HOWTO (R_CRIS_16_PCREL, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_CRIS_16", /* name */ + false, /* partial_inplace */ + 0x00000000, /* src_mask */ + 0x0000ffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 32 bit absolute relocation. */ + HOWTO (R_CRIS_32_PCREL, /* 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_CRIS_32", /* name */ + false, /* partial_inplace */ + 0x00000000, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy */ + HOWTO (R_CRIS_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_CRIS_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_CRIS_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_CRIS_GNU_VTENTRY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false) /* pcrel_offset */ +}; + +/* Map BFD reloc types to CRIS ELF reloc types. */ + +struct cris_reloc_map +{ + bfd_reloc_code_real_type bfd_reloc_val; + unsigned int cris_reloc_val; +}; + +static const struct cris_reloc_map cris_reloc_map [] = +{ + { BFD_RELOC_NONE, R_CRIS_NONE }, + { BFD_RELOC_8, R_CRIS_8 }, + { BFD_RELOC_16, R_CRIS_16 }, + { BFD_RELOC_32, R_CRIS_32 }, + { BFD_RELOC_8_PCREL, R_CRIS_8_PCREL }, + { BFD_RELOC_16_PCREL, R_CRIS_16_PCREL }, + { BFD_RELOC_32_PCREL, R_CRIS_32_PCREL }, + { BFD_RELOC_VTABLE_INHERIT, R_CRIS_GNU_VTINHERIT }, + { BFD_RELOC_VTABLE_ENTRY, R_CRIS_GNU_VTENTRY } +}; + +static reloc_howto_type * +cris_reloc_type_lookup (abfd, code) + bfd * abfd ATTRIBUTE_UNUSED; + bfd_reloc_code_real_type code; +{ + unsigned int i; + + for (i = sizeof (cris_reloc_map) / sizeof (cris_reloc_map[0]); + --i;) + if (cris_reloc_map [i].bfd_reloc_val == code) + return & cris_elf_howto_table [cris_reloc_map[i].cris_reloc_val]; + + return NULL; +} + +/* Set the howto pointer for an CRIS ELF reloc. */ + +static void +cris_info_to_howto_rela (abfd, cache_ptr, dst) + bfd * abfd ATTRIBUTE_UNUSED; + arelent * cache_ptr; + Elf32_Internal_Rela * dst; +{ + unsigned int r_type; + + r_type = ELF32_R_TYPE (dst->r_info); + BFD_ASSERT (r_type < (unsigned int) R_CRIS_max); + cache_ptr->howto = & cris_elf_howto_table [r_type]; +} + +/* Perform a single relocation. By default we use the standard BFD + routines, but we might have to do a few relocs ourselves in the future. */ + +static bfd_reloc_status_type +cris_final_link_relocate (howto, input_bfd, input_section, contents, rel, + relocation) + reloc_howto_type * howto; + bfd * input_bfd; + asection * input_section; + bfd_byte * contents; + Elf_Internal_Rela * rel; + bfd_vma relocation; +{ + bfd_reloc_status_type r + = _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, rel->r_offset, + relocation, rel->r_addend); + return r; +} + +/* Relocate an CRIS ELF section. See elf32-fr30.c, from where this was + copied, for further comments. */ + +static boolean +cris_elf_relocate_section (output_bfd, info, input_bfd, input_section, + contents, relocs, local_syms, local_sections) + bfd * output_bfd ATTRIBUTE_UNUSED; + struct bfd_link_info * info; + bfd * input_bfd; + asection * input_section; + bfd_byte * contents; + Elf_Internal_Rela * relocs; + Elf_Internal_Sym * local_syms; + asection ** local_sections; +{ + Elf_Internal_Shdr * symtab_hdr; + struct elf_link_hash_entry ** sym_hashes; + Elf_Internal_Rela * rel; + Elf_Internal_Rela * relend; + + symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + relend = relocs + input_section->reloc_count; + + /* It seems this can happen with erroneous or unsupported input (mixing + a.out and elf in an archive, for example.) */ + if (sym_hashes == NULL) + return false; + + for (rel = relocs; rel < relend; rel ++) + { + reloc_howto_type * howto; + unsigned long r_symndx; + Elf_Internal_Sym * sym; + asection * sec; + struct elf_link_hash_entry * h; + bfd_vma relocation; + bfd_reloc_status_type r; + const char * name = NULL; + int r_type; + + r_type = ELF32_R_TYPE (rel->r_info); + + if ( r_type == R_CRIS_GNU_VTINHERIT + || r_type == R_CRIS_GNU_VTENTRY) + continue; + + r_symndx = ELF32_R_SYM (rel->r_info); + + if (info->relocateable) + { + /* This is a relocateable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + + if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + sec = local_sections [r_symndx]; + rel->r_addend += sec->output_offset + sym->st_value; + } + } + + continue; + } + + /* This is a final link. */ + howto = cris_elf_howto_table + ELF32_R_TYPE (rel->r_info); + h = NULL; + sym = NULL; + sec = NULL; + + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections [r_symndx]; + relocation = (sec->output_section->vma + + sec->output_offset + + sym->st_value); + + name = bfd_elf_string_from_elf_section + (input_bfd, symtab_hdr->sh_link, sym->st_name); + name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name; +#if 0 + fprintf (stderr, "local: sec: %s, sym: %s (%d), value: %x + %x + %x addend %x\n", + sec->name, name, sym->st_name, + sec->output_section->vma, sec->output_offset, + sym->st_value, rel->r_addend); +#endif + } + else + { + h = sym_hashes [r_symndx - symtab_hdr->sh_info]; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + name = h->root.root.string; + + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sec = h->root.u.def.section; + relocation = (h->root.u.def.value + + sec->output_section->vma + + sec->output_offset); +#if 0 + fprintf (stderr, + "defined: sec: %s, name: %s, value: %x + %x + %x gives: %x\n", + sec->name, name, h->root.u.def.value, + sec->output_section->vma, sec->output_offset, relocation); +#endif + } + else if (h->root.type == bfd_link_hash_undefweak) + { +#if 0 + fprintf (stderr, "undefined: sec: %s, name: %s\n", + sec->name, name); +#endif + relocation = 0; + } + else if (info->shared + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) + relocation = 0; + else + { + if (! ((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, + input_section, rel->r_offset, true))) + return false; +#if 0 + fprintf (stderr, "unknown: name: %s\n", name); +#endif + relocation = 0; + } + } + + r = cris_final_link_relocate (howto, input_bfd, input_section, + contents, rel, relocation); + + if (r != bfd_reloc_ok) + { + const char * msg = (const char *) NULL; + + switch (r) + { + case bfd_reloc_overflow: + r = info->callbacks->reloc_overflow + (info, name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset); + break; + + case bfd_reloc_undefined: + r = info->callbacks->undefined_symbol + (info, name, input_bfd, input_section, rel->r_offset, + true); + break; + + case bfd_reloc_outofrange: + msg = _("internal error: out of range error"); + break; + + case bfd_reloc_notsupported: + msg = _("internal error: unsupported relocation error"); + break; + + case bfd_reloc_dangerous: + msg = _("internal error: dangerous relocation"); + break; + + default: + msg = _("internal error: unknown error"); + break; + } + + if (msg) + r = info->callbacks->warning + (info, msg, name, input_bfd, input_section, rel->r_offset); + + if (! r) + return false; + } + } + + return true; +} + +/* Return the section that should be marked against GC for a given + relocation. */ + +static asection * +cris_elf_gc_mark_hook (abfd, info, rel, h, sym) + bfd * abfd; + struct bfd_link_info * info ATTRIBUTE_UNUSED; + Elf_Internal_Rela * rel; + struct elf_link_hash_entry * h; + Elf_Internal_Sym * sym; +{ + if (h != NULL) + { + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_CRIS_GNU_VTINHERIT: + case R_CRIS_GNU_VTENTRY: + break; + + default: + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } + } + } + else + { + if (!(elf_bad_symtab (abfd) + && ELF_ST_BIND (sym->st_info) != STB_LOCAL) + && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) + && sym->st_shndx != SHN_COMMON)) + { + return bfd_section_from_elf_index (abfd, sym->st_shndx); + } + } + + return NULL; +} + +/* Update the got entry reference counts for the section being removed. */ + +static boolean +cris_elf_gc_sweep_hook (abfd, info, sec, relocs) + bfd * abfd ATTRIBUTE_UNUSED; + struct bfd_link_info * info ATTRIBUTE_UNUSED; + asection * sec ATTRIBUTE_UNUSED; + const Elf_Internal_Rela * relocs ATTRIBUTE_UNUSED; +{ + return true; +} + +/* Look through the relocs for a section during the first phase. + Since we don't do .gots or .plts, we just need to consider the + virtual table relocs for gc. */ + +static boolean +cris_elf_check_relocs (abfd, info, sec, relocs) + bfd *abfd; + struct bfd_link_info *info; + asection *sec; + const Elf_Internal_Rela *relocs; +{ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; + const Elf_Internal_Rela *rel; + const Elf_Internal_Rela *rel_end; + + if (info->relocateable) + return true; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof (Elf32_External_Sym); + if (!elf_bad_symtab (abfd)) + sym_hashes_end -= symtab_hdr->sh_info; + + rel_end = relocs + sec->reloc_count; + for (rel = relocs; rel < rel_end; rel++) + { + struct elf_link_hash_entry *h; + unsigned long r_symndx; + + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx < symtab_hdr->sh_info) + h = NULL; + else + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + + switch (ELF32_R_TYPE (rel->r_info)) + { + /* This relocation describes the C++ object vtable hierarchy. + Reconstruct it for later use during GC. */ + case R_CRIS_GNU_VTINHERIT: + if (!_bfd_elf32_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_CRIS_GNU_VTENTRY: + if (!_bfd_elf32_gc_record_vtentry (abfd, sec, h, rel->r_addend)) + return false; + break; + } + } + + return true; +} + +/* Reject a file depending on underscores on symbols. */ + +static boolean +cris_elf_object_p (abfd) + bfd *abfd; +{ + if ((elf_elfheader (abfd)->e_flags & EF_CRIS_UNDERSCORE)) + return (bfd_get_symbol_leading_char (abfd) == '_'); + else + return (bfd_get_symbol_leading_char (abfd) == 0); +} + +/* Mark presence or absence of leading underscore. */ + +static void +cris_elf_final_write_processing (abfd, linker) + bfd *abfd; + boolean linker ATTRIBUTE_UNUSED; +{ + if (bfd_get_symbol_leading_char (abfd) == '_') + elf_elfheader (abfd)->e_flags |= EF_CRIS_UNDERSCORE; + else + elf_elfheader (abfd)->e_flags &= ~EF_CRIS_UNDERSCORE; +} + +/* Display the flags field. */ + +static boolean +cris_elf_print_private_bfd_data (abfd, ptr) + bfd *abfd; + PTR ptr; +{ + FILE *file = (FILE *) ptr; + + BFD_ASSERT (abfd != NULL && ptr != NULL) + + _bfd_elf_print_private_bfd_data (abfd, ptr); + + fprintf (file, _("private flags = %lx:"), elf_elfheader (abfd)->e_flags); + + if (elf_elfheader (abfd)->e_flags & EF_CRIS_UNDERSCORE) + fprintf (file, _(" [symbols have a _ prefix]")); + + fputc ('\n', file); + return true; +} + +/* Don't mix files with and without a leading underscore. */ + +static boolean +cris_elf_merge_private_bfd_data (ibfd, obfd) + bfd *ibfd; + bfd *obfd; +{ + flagword old_flags, new_flags; + + if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + return false; + + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return true; + + if (! elf_flags_init (obfd)) + { + /* This happens when ld starts out with a 'blank' output file. */ + elf_flags_init (obfd) = true; + + /* Set flags according to current bfd_target. */ + cris_elf_final_write_processing (obfd, false); + } + + old_flags = elf_elfheader (obfd)->e_flags; + new_flags = elf_elfheader (ibfd)->e_flags; + + /* Is this good or bad? We'll follow with other excluding flags. */ + if ((old_flags & EF_CRIS_UNDERSCORE) != (new_flags & EF_CRIS_UNDERSCORE)) + { + (*_bfd_error_handler) + ((new_flags & EF_CRIS_UNDERSCORE) + ? _("%s: uses _-prefixed symbols, but writing file with non-prefixed symbols") + : _("%s: uses non-prefixed symbols, but writing file with _-prefixed symbols"), + bfd_get_filename (ibfd)); + bfd_set_error (bfd_error_bad_value); + return false; + } + + return true; +} + +#define ELF_ARCH bfd_arch_cris +#define ELF_MACHINE_CODE EM_CRIS +#define ELF_MAXPAGESIZE 0x2000 + +#define TARGET_LITTLE_SYM bfd_elf32_cris_vec +#define TARGET_LITTLE_NAME "elf32-cris" +#define elf_symbol_leading_char 0 + +#define elf_info_to_howto_rel NULL +#define elf_info_to_howto cris_info_to_howto_rela +#define elf_backend_relocate_section cris_elf_relocate_section +#define elf_backend_gc_mark_hook cris_elf_gc_mark_hook +#define elf_backend_gc_sweep_hook cris_elf_gc_sweep_hook +#define elf_backend_check_relocs cris_elf_check_relocs + +#define elf_backend_can_gc_sections 1 + +#define elf_backend_object_p cris_elf_object_p +#define elf_backend_final_write_processing \ + cris_elf_final_write_processing +#define bfd_elf32_bfd_print_private_bfd_data \ + cris_elf_print_private_bfd_data +#define bfd_elf32_bfd_merge_private_bfd_data \ + cris_elf_merge_private_bfd_data + +#define bfd_elf32_bfd_reloc_type_lookup cris_reloc_type_lookup + +/* Later, we my want to optimize RELA entries into REL entries for dynamic + linking and libraries (if it's a win of any significance). Until then, + take the easy route. */ +#define elf_backend_may_use_rel_p 0 +#define elf_backend_may_use_rela_p 1 + +#include "elf32-target.h" + +#define INCLUDED_TARGET_FILE + +#undef TARGET_LITTLE_SYM +#undef TARGET_LITTLE_NAME +#undef elf_symbol_leading_char + +#define TARGET_LITTLE_SYM bfd_elf32_us_cris_vec +#define TARGET_LITTLE_NAME "elf32-us-cris" +#define elf_symbol_leading_char '_' + +#include "elf32-target.h" diff --git a/gnu/dist/toolchain/bfd/elf32-d10v.c b/gnu/dist/toolchain/bfd/elf32-d10v.c index dd2e892ad086..a4075a5a757c 100644 --- a/gnu/dist/toolchain/bfd/elf32-d10v.c +++ b/gnu/dist/toolchain/bfd/elf32-d10v.c @@ -1,5 +1,5 @@ /* D10V-specific support for 32-bit ELF - Copyright (C) 1996, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1996, 1998, 1999, 2000 Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -22,31 +22,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" #include "elf-bfd.h" -/* #include "elf/d10v.h" */ +#include "elf/d10v.h" static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); static void d10v_info_to_howto_rel PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); - /* Use REL instead of RELA to save space */ #define USE_REL -enum reloc_type -{ - R_D10V_NONE = 0, - R_D10V_10_PCREL_R, - R_D10V_10_PCREL_L, - R_D10V_16, - R_D10V_18, - R_D10V_18_PCREL, - R_D10V_32, - R_D10V_GNU_VTINHERIT, - R_D10V_GNU_VTENTRY, - R_D10V_max -}; - static reloc_howto_type elf_d10v_howto_table[] = { /* This reloc does nothing. */ @@ -185,7 +170,7 @@ static reloc_howto_type elf_d10v_howto_table[] = 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ - + }; /* Map BFD reloc types to D10V ELF reloc types. */ @@ -300,7 +285,7 @@ elf32_d10v_gc_sweep_hook (abfd, info, sec, relocs) /* Look through the relocs for a section during the first phase. Since we don't do .gots or .plts, we just need to consider the virtual table relocs for gc. */ - + static boolean elf32_d10v_check_relocs (abfd, info, sec, relocs) bfd *abfd; @@ -312,28 +297,28 @@ elf32_d10v_check_relocs (abfd, info, sec, relocs) struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - + if (info->relocateable) return true; - + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); - sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym); + sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof (Elf32_External_Sym); if (!elf_bad_symtab (abfd)) sym_hashes_end -= symtab_hdr->sh_info; - + rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { struct elf_link_hash_entry *h; unsigned long r_symndx; - + r_symndx = ELF32_R_SYM (rel->r_info); if (r_symndx < symtab_hdr->sh_info) h = NULL; else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - + switch (ELF32_R_TYPE (rel->r_info)) { /* This relocation describes the C++ object vtable hierarchy. @@ -342,7 +327,7 @@ elf32_d10v_check_relocs (abfd, info, sec, relocs) if (!_bfd_elf32_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_D10V_GNU_VTENTRY: @@ -351,7 +336,7 @@ elf32_d10v_check_relocs (abfd, info, sec, relocs) break; } } - + return true; } @@ -464,7 +449,7 @@ elf32_d10v_relocate_section (output_bfd, info, input_bfd, input_section, if (name == NULL || *name == '\0') name = bfd_section_name (input_bfd, sec); } - + r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, relocation, rel->r_addend); diff --git a/gnu/dist/toolchain/bfd/elf32-d30v.c b/gnu/dist/toolchain/bfd/elf32-d30v.c index 263b5c010e56..43fc9b637ea9 100644 --- a/gnu/dist/toolchain/bfd/elf32-d30v.c +++ b/gnu/dist/toolchain/bfd/elf32-d30v.c @@ -1,5 +1,5 @@ /* D30V-specific support for 32-bit ELF - Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1997, 98, 99, 2000 Free Software Foundation, Inc. Contributed by Martin Hunt (hunt@cygnus.com). This file is part of BFD, the Binary File Descriptor library. @@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" #include "elf-bfd.h" +#include "elf/d30v.h" static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); @@ -46,24 +47,6 @@ static bfd_reloc_status_type bfd_elf_d30v_reloc_21 PARAMS (( bfd *output_bfd, char **error_message)); -enum reloc_type -{ - R_D30V_NONE = 0, - R_D30V_6, - R_D30V_9_PCREL, - R_D30V_9_PCREL_R, - R_D30V_15, - R_D30V_15_PCREL, - R_D30V_15_PCREL_R, - R_D30V_21, - R_D30V_21_PCREL, - R_D30V_21_PCREL_R, - R_D30V_32, - R_D30V_32_PCREL, - R_D30V_32_NORMAL, - R_D30V_max -}; - static reloc_howto_type elf_d30v_howto_table[] = { /* This reloc does nothing. */ @@ -263,8 +246,8 @@ static reloc_howto_type elf_d30v_howto_table[] = }; -#define MIN32 (long long)0xffffffff80000000LL -#define MAX32 0x7fffffffLL +#define MAX32 ((bfd_signed_vma) 0x7fffffff) +#define MIN32 (- MAX32 - 1) static bfd_reloc_status_type bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) @@ -276,7 +259,7 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, bfd *output_bfd; char **error_message; { - long long relocation; + bfd_signed_vma relocation; bfd_vma in1, in2, num; bfd_vma tmp_addr = 0; bfd_reloc_status_type r; @@ -287,10 +270,17 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, reloc_howto_type *howto = reloc_entry->howto; int make_absolute = 0; + if (output_bfd != (bfd *) NULL) + { + /* Partial linking -- do nothing. */ + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + r = bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); if (r != bfd_reloc_continue) - return r; + return r; /* a hacked-up version of bfd_perform_reloc() follows */ if (bfd_is_und_section (symbol->section) @@ -314,11 +304,7 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, reloc_target_output_section = symbol->section->output_section; /* Convert input-section-relative symbol value to absolute. */ - if (output_bfd) - output_base = 0; - else - output_base = reloc_target_output_section->vma; - + output_base = reloc_target_output_section->vma; relocation += output_base + symbol->section->output_offset; /* Add in supplied addend. */ @@ -329,23 +315,11 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, if (howto->pc_relative == true) { - tmp_addr = input_section->output_section->vma + input_section->output_offset + tmp_addr = input_section->output_section->vma + input_section->output_offset + reloc_entry->address; relocation -= tmp_addr; } - - if (output_bfd != (bfd *) NULL) - { - /* This is a partial relocation, and we want to apply the relocation - to the reloc entry rather than the raw data. Modify the reloc - inplace to reflect what we now know. */ - reloc_entry->addend = relocation; - reloc_entry->address += input_section->output_offset; - return flag; - } - else - reloc_entry->addend = 0; - + in1 = bfd_get_32 (abfd, (bfd_byte *) data + addr); in2 = bfd_get_32 (abfd, (bfd_byte *) data + addr + 4); @@ -355,30 +329,25 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, | ((in1 & 0x3F) << 26)); in1 &= 0xFFFFFFC0; in2 = 0x80000000; - + relocation += num; if (howto->pc_relative == true && howto->bitsize == 32) { - /* the D30V has a PC that doesn't wrap and PC-relative jumps */ - /* are signed, so a PC-relative jump can'tbe more than +/- 2^31 byrtes */ - /* if one exceeds this, change it to an absolute jump */ - if (relocation > MAX32) - { - relocation = (relocation + tmp_addr) & 0xffffffff; - make_absolute = 1; - } - else if (relocation < MIN32) + /* The D30V has a PC that doesn't wrap and PC-relative jumps are + signed, so a PC-relative jump can't be more than +/- 2^31 bytes. + If one exceeds this, change it to an absolute jump. */ + if (relocation > MAX32 || relocation < MIN32) { relocation = (relocation + tmp_addr) & 0xffffffff; make_absolute = 1; } } - + in1 |= (relocation >> 26) & 0x3F; /* top 6 bits */ - in2 |= ((relocation & 0x03FC0000) << 2); /* next 8 bits */ + in2 |= ((relocation & 0x03FC0000) << 2); /* next 8 bits */ in2 |= relocation & 0x0003FFFF; /* bottom 18 bits */ - + /* change a PC-relative instruction to its absolute equivalent */ /* with this simple hack */ if (make_absolute) @@ -386,10 +355,9 @@ bfd_elf_d30v_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, bfd_put_32 (abfd, in1, (bfd_byte *) data + addr); bfd_put_32 (abfd, in2, (bfd_byte *) data + addr + 4); - - return flag; -} + return flag; +} static bfd_reloc_status_type bfd_elf_d30v_reloc_21 (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) @@ -411,10 +379,17 @@ bfd_elf_d30v_reloc_21 (abfd, reloc_entry, symbol, data, input_section, output_bf reloc_howto_type *howto = reloc_entry->howto; int mask, max; + if (output_bfd != (bfd *) NULL) + { + /* Partial linking -- do nothing. */ + reloc_entry->address += input_section->output_offset; + return bfd_reloc_ok; + } + r = bfd_elf_generic_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); if (r != bfd_reloc_continue) - return r; + return r; /* a hacked-up version of bfd_perform_reloc() follows */ if (bfd_is_und_section (symbol->section) @@ -438,11 +413,7 @@ bfd_elf_d30v_reloc_21 (abfd, reloc_entry, symbol, data, input_section, output_bf reloc_target_output_section = symbol->section->output_section; /* Convert input-section-relative symbol value to absolute. */ - if (output_bfd) - output_base = 0; - else - output_base = reloc_target_output_section->vma; - + output_base = reloc_target_output_section->vma; relocation += output_base + symbol->section->output_offset; /* Add in supplied addend. */ @@ -453,23 +424,12 @@ bfd_elf_d30v_reloc_21 (abfd, reloc_entry, symbol, data, input_section, output_bf if (howto->pc_relative == true) { - relocation -= input_section->output_section->vma + input_section->output_offset; + relocation -= (input_section->output_section->vma + + input_section->output_offset); if (howto->pcrel_offset == true) relocation -= reloc_entry->address; } - if (output_bfd != (bfd *) NULL) - { - /* This is a partial relocation, and we want to apply the relocation - to the reloc entry rather than the raw data. Modify the reloc - inplace to reflect what we now know. */ - reloc_entry->addend = relocation; - reloc_entry->address += input_section->output_offset; - return flag; - } - else - reloc_entry->addend = 0; - in1 = bfd_get_32 (abfd, (bfd_byte *) data + addr); mask = (1 << howto->bitsize) - 1; @@ -501,16 +461,16 @@ bfd_elf_d30v_reloc_21 (abfd, reloc_entry, symbol, data, input_section, output_bf if ((int)relocation > max) flag = bfd_reloc_overflow; } - relocation >>= 3; + relocation >>= 3; if (howto->bitsize == 6) in1 |= ((relocation & (mask >> 12)) << 12); else in1 |= relocation & mask; bfd_put_32 (abfd, in1, (bfd_byte *) data + addr); - + return flag; -} +} /* Map BFD reloc types to D30V ELF reloc types. */ @@ -520,7 +480,6 @@ struct d30v_reloc_map unsigned char elf_reloc_val; }; - static const struct d30v_reloc_map d30v_reloc_map[] = { { BFD_RELOC_NONE, R_D30V_NONE, }, diff --git a/gnu/dist/toolchain/bfd/elf32-fr30.c b/gnu/dist/toolchain/bfd/elf32-fr30.c index 6b295d3e52a2..0339b0ac6346 100644 --- a/gnu/dist/toolchain/bfd/elf32-fr30.c +++ b/gnu/dist/toolchain/bfd/elf32-fr30.c @@ -1,5 +1,5 @@ /* FR30-specific support for 32-bit ELF. - Copyright (C) 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -30,9 +30,9 @@ static bfd_reloc_status_type fr30_elf_i32_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static reloc_howto_type * fr30_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); -static void fr30_info_to_howto_rela +static void fr30_info_to_howto_rela PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); -static boolean fr30_elf_relocate_section +static boolean fr30_elf_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); static bfd_reloc_status_type fr30_final_link_relocate PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, bfd_vma)); @@ -132,7 +132,7 @@ static reloc_howto_type fr30_elf_howto_table [] = 0x0000, /* src_mask */ 0x00f0, /* dst_mask */ false), /* pcrel_offset */ - + /* An 8 bit absolute relocation. */ HOWTO (R_FR30_8_IN_8, /* type */ 0, /* rightshift */ @@ -147,7 +147,7 @@ static reloc_howto_type fr30_elf_howto_table [] = 0x0000, /* src_mask */ 0x0ff0, /* dst_mask */ false), /* pcrel_offset */ - + /* A 9 bit absolute relocation. */ HOWTO (R_FR30_9_IN_8, /* type */ 1, /* rightshift */ @@ -162,7 +162,7 @@ static reloc_howto_type fr30_elf_howto_table [] = 0x0000, /* src_mask */ 0x0ff0, /* dst_mask */ false), /* pcrel_offset */ - + /* A 10 bit absolute relocation. */ HOWTO (R_FR30_10_IN_8, /* type */ 2, /* rightshift */ @@ -236,7 +236,6 @@ static reloc_howto_type fr30_elf_howto_table [] = 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ - }; /* Utility to actually perform an R_FR30_20 reloc. */ @@ -254,7 +253,7 @@ fr30_elf_i20_reloc (abfd, reloc_entry, symbol, data, { bfd_vma relocation; unsigned long x; - + /* This part is from bfd_elf_generic_reloc. */ if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) == 0 @@ -275,16 +274,15 @@ fr30_elf_i20_reloc (abfd, reloc_entry, symbol, data, + symbol->section->output_offset + reloc_entry->addend; - if (relocation > ((1U << 20) - 1)) + if (relocation > (((bfd_vma) 1 << 20) - 1)) return bfd_reloc_overflow; - x = bfd_get_32 (abfd, data + reloc_entry->address); + x = bfd_get_32 (abfd, (char *) data + reloc_entry->address); x = (x & 0xff0f0000) | (relocation & 0x0000ffff) | ((relocation & 0x000f0000) << 4); - bfd_put_32 (abfd, x, data + reloc_entry->address); + bfd_put_32 (abfd, x, (char *) data + reloc_entry->address); return bfd_reloc_ok; } - /* Utility to actually perform a R_FR30_48 reloc. */ @@ -321,7 +319,7 @@ fr30_elf_i32_reloc (abfd, reloc_entry, symbol, data, + symbol->section->output_offset + reloc_entry->addend; - bfd_put_32 (abfd, relocation, data + reloc_entry->address + 2); + bfd_put_32 (abfd, relocation, (char *) data + reloc_entry->address + 2); return bfd_reloc_ok; } @@ -362,7 +360,7 @@ fr30_reloc_type_lookup (abfd, code) --i;) if (fr30_reloc_map [i].bfd_reloc_val == code) return & fr30_elf_howto_table [fr30_reloc_map[i].fr30_reloc_val]; - + return NULL; } @@ -396,7 +394,7 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca bfd_reloc_status_type r = bfd_reloc_ok; bfd_vma x; bfd_signed_vma srel; - + switch (howto->type) { case R_FR30_20: @@ -405,12 +403,12 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca if (relocation > ((1 << 20) - 1)) return bfd_reloc_overflow; - + x = bfd_get_32 (input_bfd, contents); x = (x & 0xff0f0000) | (relocation & 0x0000ffff) | ((relocation & 0x000f0000) << 4); bfd_put_32 (input_bfd, x, contents); break; - + case R_FR30_48: contents += rel->r_offset + 2; relocation += rel->r_addend; @@ -422,10 +420,10 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca srel = (bfd_signed_vma) relocation; srel += rel->r_addend; srel -= rel->r_offset; - srel -= 2; /* Branch instructions add 2 to the PC... */ + srel -= 2; /* Branch instructions add 2 to the PC... */ srel -= (input_section->output_section->vma + input_section->output_offset); - + if (srel & 1) return bfd_reloc_outofrange; if (srel > ((1 << 8) - 1) || (srel < - (1 << 8))) @@ -439,15 +437,15 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca srel = (bfd_signed_vma) relocation; srel += rel->r_addend; srel -= rel->r_offset; - srel -= 2; /* Branch instructions add 2 to the PC... */ + srel -= 2; /* Branch instructions add 2 to the PC... */ srel -= (input_section->output_section->vma + input_section->output_offset); - + if (srel & 1) return bfd_reloc_outofrange; if (srel > ((1 << 11) - 1) || (srel < - (1 << 11))) return bfd_reloc_overflow; - + x = bfd_get_16 (input_bfd, contents); x = (x & 0xf800) | ((srel >> 1) & 0x7ff); bfd_put_16 (input_bfd, x, contents); @@ -461,7 +459,6 @@ fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, reloca return r; } - /* Relocate an FR30 ELF section. There is some attempt to make this function usable for many architectures, @@ -528,13 +525,13 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_reloc_status_type r; const char * name = NULL; int r_type; - + r_type = ELF32_R_TYPE (rel->r_info); - + if ( r_type == R_FR30_GNU_VTINHERIT || r_type == R_FR30_GNU_VTENTRY) continue; - + r_symndx = ELF32_R_SYM (rel->r_info); if (info->relocateable) @@ -546,7 +543,7 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; - + if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) { sec = local_sections [r_symndx]; @@ -562,7 +559,7 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section, h = NULL; sym = NULL; sec = NULL; - + if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; @@ -570,7 +567,7 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (sec->output_section->vma + sec->output_offset + sym->st_value); - + name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name); name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name; @@ -584,13 +581,13 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section, else { h = sym_hashes [r_symndx - symtab_hdr->sh_info]; - + while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; name = h->root.root.string; - + if (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { @@ -625,7 +622,7 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = 0; } } - + r = fr30_final_link_relocate (howto, input_bfd, input_section, contents, rel, relocation); @@ -640,13 +637,13 @@ fr30_elf_relocate_section (output_bfd, info, input_bfd, input_section, (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section, rel->r_offset); break; - + case bfd_reloc_undefined: r = info->callbacks->undefined_symbol (info, name, input_bfd, input_section, rel->r_offset, true); break; - + case bfd_reloc_outofrange: msg = _("internal error: out of range error"); break; @@ -739,7 +736,7 @@ fr30_elf_gc_sweep_hook (abfd, info, sec, relocs) /* Look through the relocs for a section during the first phase. Since we don't do .gots or .plts, we just need to consider the virtual table relocs for gc. */ - + static boolean fr30_elf_check_relocs (abfd, info, sec, relocs) bfd *abfd; @@ -751,28 +748,28 @@ fr30_elf_check_relocs (abfd, info, sec, relocs) struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - + if (info->relocateable) return true; - + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); - sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym); + sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof (Elf32_External_Sym); if (!elf_bad_symtab (abfd)) sym_hashes_end -= symtab_hdr->sh_info; - + rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { struct elf_link_hash_entry *h; unsigned long r_symndx; - + r_symndx = ELF32_R_SYM (rel->r_info); if (r_symndx < symtab_hdr->sh_info) h = NULL; else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - + switch (ELF32_R_TYPE (rel->r_info)) { /* This relocation describes the C++ object vtable hierarchy. @@ -781,7 +778,7 @@ fr30_elf_check_relocs (abfd, info, sec, relocs) if (!_bfd_elf32_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_FR30_GNU_VTENTRY: @@ -790,7 +787,7 @@ fr30_elf_check_relocs (abfd, info, sec, relocs) break; } } - + return true; } diff --git a/gnu/dist/toolchain/bfd/elf32-gen.c b/gnu/dist/toolchain/bfd/elf32-gen.c index 47da53b1bc68..7a39f4778efd 100644 --- a/gnu/dist/toolchain/bfd/elf32-gen.c +++ b/gnu/dist/toolchain/bfd/elf32-gen.c @@ -58,6 +58,37 @@ elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) bfd_reloc->howto = &dummy; } +static boolean +elf32_generic_link_add_symbols (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + asection *o; + + /* Check if there are any relocations. */ + for (o = abfd->sections; o != NULL; o = o->next) + if ((o->flags & SEC_RELOC) != 0) + { + 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_set_error (bfd_error_wrong_format); + return false; + } + + return bfd_elf32_bfd_link_add_symbols (abfd, info); +} + #define TARGET_LITTLE_SYM bfd_elf32_little_generic_vec #define TARGET_LITTLE_NAME "elf32-little" #define TARGET_BIG_SYM bfd_elf32_big_generic_vec @@ -66,6 +97,7 @@ elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) #define ELF_MACHINE_CODE EM_NONE #define ELF_MAXPAGESIZE 0x1 #define bfd_elf32_bfd_reloc_type_lookup bfd_default_reloc_type_lookup +#define bfd_elf32_bfd_link_add_symbols elf32_generic_link_add_symbols #define elf_info_to_howto elf_generic_info_to_howto #define elf_info_to_howto_rel elf_generic_info_to_howto_rel diff --git a/gnu/dist/toolchain/bfd/elf32-hppa.c b/gnu/dist/toolchain/bfd/elf32-hppa.c index 683a308515af..06b60200dcd6 100644 --- a/gnu/dist/toolchain/bfd/elf32-hppa.c +++ b/gnu/dist/toolchain/bfd/elf32-hppa.c @@ -1,12 +1,12 @@ /* BFD back-end for HP PA-RISC ELF files. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000, 2001 Free Software Foundation, Inc. - Written by - + Original code by Center for Software Science Department of Computer Science University of Utah + Largely rewritten by Alan Modra This file is part of BFD, the Binary File Descriptor library. @@ -33,10 +33,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "elf32-hppa.h" #define ARCH_SIZE 32 #include "elf-hppa.h" +#include "elf32-hppa.h" +/* In order to gain some understanding of code in this file without + knowing all the intricate details of the linker, note the + following: -/* We use three different hash tables to hold information for - linking PA ELF objects. + Functions named elf32_hppa_* are called by external routines, other + functions are only called locally. elf32_hppa_* functions appear + in this file more or less in the order in which they are called + from external routines. eg. elf32_hppa_check_relocs is called + early in the link process, elf32_hppa_finish_dynamic_sections is + one of the last functions. */ + +/* We use two hash tables to hold information for linking PA ELF objects. The first is the elf32_hppa_link_hash_table which is derived from the standard ELF linker hash table. We use this as a place to @@ -44,149 +54,367 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ The second is the stub hash table which is derived from the base BFD hash table. The stub hash table holds the information - necessary to build the linker stubs during a link. */ + necessary to build the linker stubs during a link. -/* Hash table for linker stubs. */ + There are a number of different stubs generated by the linker. -struct elf32_hppa_stub_hash_entry + Long branch stub: + : ldil LR'X,%r1 + : be,n RR'X(%sr4,%r1) + + PIC long branch stub: + : b,l .+8,%r1 + : addil LR'X - ($PIC_pcrel$0 - 4),%r1 + : be,n RR'X - ($PIC_pcrel$0 - 8)(%sr4,%r1) + + Import stub to call shared library routine from normal object file + (single sub-space version) + : addil LR'lt_ptr+ltoff,%dp ; get procedure entry point + : ldw RR'lt_ptr+ltoff(%r1),%r21 + : bv %r0(%r21) + : ldw RR'lt_ptr+ltoff+4(%r1),%r19 ; get new dlt value. + + Import stub to call shared library routine from shared library + (single sub-space version) + : addil LR'ltoff,%r19 ; get procedure entry point + : ldw RR'ltoff(%r1),%r21 + : bv %r0(%r21) + : ldw RR'ltoff+4(%r1),%r19 ; get new dlt value. + + Import stub to call shared library routine from normal object file + (multiple sub-space support) + : addil LR'lt_ptr+ltoff,%dp ; get procedure entry point + : ldw RR'lt_ptr+ltoff(%r1),%r21 + : ldw RR'lt_ptr+ltoff+4(%r1),%r19 ; get new dlt value. + : ldsid (%r21),%r1 + : mtsp %r1,%sr0 + : be 0(%sr0,%r21) ; branch to target + : stw %rp,-24(%sp) ; save rp + + Import stub to call shared library routine from shared library + (multiple sub-space support) + : addil LR'ltoff,%r19 ; get procedure entry point + : ldw RR'ltoff(%r1),%r21 + : ldw RR'ltoff+4(%r1),%r19 ; get new dlt value. + : ldsid (%r21),%r1 + : mtsp %r1,%sr0 + : be 0(%sr0,%r21) ; branch to target + : stw %rp,-24(%sp) ; save rp + + Export stub to return from shared lib routine (multiple sub-space support) + One of these is created for each exported procedure in a shared + library (and stored in the shared lib). Shared lib routines are + called via the first instruction in the export stub so that we can + do an inter-space return. Not required for single sub-space. + : bl,n X,%rp ; trap the return + : nop + : ldw -24(%sp),%rp ; restore the original rp + : ldsid (%rp),%r1 + : mtsp %r1,%sr0 + : be,n 0(%sr0,%rp) ; inter-space return */ + +#define PLT_ENTRY_SIZE 8 +#define PLABEL_PLT_ENTRY_SIZE PLT_ENTRY_SIZE +#define GOT_ENTRY_SIZE 4 +#define ELF_DYNAMIC_INTERPRETER "/lib/ld.so.1" + +static const bfd_byte plt_stub[] = { - /* Base hash table entry structure, we can get the name of the stub - (and thus know exactly what actions it performs) from the base - hash table entry. */ + 0x0e, 0x80, 0x10, 0x96, /* 1: ldw 0(%r20),%r22 */ + 0xea, 0xc0, 0xc0, 0x00, /* bv %r0(%r22) */ + 0x0e, 0x88, 0x10, 0x95, /* ldw 4(%r20),%r21 */ +#define PLT_STUB_ENTRY (3*4) + 0xea, 0x9f, 0x1f, 0xdd, /* b,l 1b,%r20 */ + 0xd6, 0x80, 0x1c, 0x1e, /* depi 0,31,2,%r20 */ + 0x00, 0xc0, 0xff, 0xee, /* 9: .word fixup_func */ + 0xde, 0xad, 0xbe, 0xef /* .word fixup_ltp */ +}; + +/* Section name for stubs is the associated section name plus this + string. */ +#define STUB_SUFFIX ".stub" + +/* Setting the following non-zero makes all long branch stubs + generated during a shared link of the PIC variety. This saves on + relocs, but costs one extra instruction per stub. */ +#ifndef LONG_BRANCH_PIC_IN_SHLIB +#define LONG_BRANCH_PIC_IN_SHLIB 1 +#endif + +/* Set this non-zero to use import stubs instead of long branch stubs + where a .plt entry exists for the symbol. This is a fairly useless + option as import stubs are bigger than PIC long branch stubs. */ +#ifndef LONG_BRANCH_VIA_PLT +#define LONG_BRANCH_VIA_PLT 0 +#endif + +/* We don't need to copy any PC- or GP-relative dynamic relocs into a + shared object's dynamic section. */ +#ifndef RELATIVE_DYNAMIC_RELOCS +#define RELATIVE_DYNAMIC_RELOCS 0 +#endif + +enum elf32_hppa_stub_type { + hppa_stub_long_branch, + hppa_stub_long_branch_shared, + hppa_stub_import, + hppa_stub_import_shared, + hppa_stub_export, + hppa_stub_none +}; + +struct elf32_hppa_stub_hash_entry { + + /* Base hash table entry structure. */ struct bfd_hash_entry root; - /* Offset of the beginning of this stub. */ - bfd_vma offset; + /* The stub section. */ + asection *stub_sec; + +#if ! LONG_BRANCH_PIC_IN_SHLIB + /* It's associated reloc section. */ + asection *reloc_sec; +#endif + + /* Offset within stub_sec of the beginning of this stub. */ + bfd_vma stub_offset; /* Given the symbol's value and its section we can determine its final value when building the stubs (so the stub knows where to jump. */ - symvalue target_value; + bfd_vma target_value; asection *target_section; + + enum elf32_hppa_stub_type stub_type; + + /* The symbol table entry, if any, that this was derived from. */ + struct elf32_hppa_link_hash_entry *h; + + /* Where this stub is being called from, or, in the case of combined + stub sections, the first input section in the group. */ + asection *id_sec; }; -struct elf32_hppa_stub_hash_table -{ - /* The hash table itself. */ - struct bfd_hash_table root; +struct elf32_hppa_link_hash_entry { - /* The stub BFD. */ - bfd *stub_bfd; + struct elf_link_hash_entry elf; - /* Where to place the next stub. */ - bfd_byte *location; + /* A pointer to the most recently used stub hash entry against this + symbol. */ + struct elf32_hppa_stub_hash_entry *stub_cache; - /* Current offset in the stub section. */ - unsigned int offset; +#if ! LONG_BRANCH_PIC_IN_SHLIB + /* Used to track whether we have allocated space for a long branch + stub relocation for this symbol in the given section. */ + asection *stub_reloc_sec; +#endif +#if ! LONG_BRANCH_PIC_IN_SHLIB || RELATIVE_DYNAMIC_RELOCS + /* Used to count relocations for delayed sizing of relocation + sections. */ + struct elf32_hppa_dyn_reloc_entry { + + /* Next relocation in the chain. */ + struct elf32_hppa_dyn_reloc_entry *next; + + /* The section in dynobj. */ + asection *section; + + /* Number of relocs copied in this section. */ + bfd_size_type count; + } *reloc_entries; +#endif + + /* Set during a static link if we detect a function is PIC. */ + unsigned int maybe_pic_call:1; + + /* Set if the only reason we need a .plt entry is for a non-PIC to + PIC function call. */ + unsigned int pic_call:1; + + /* Set if this symbol is used by a plabel reloc. */ + unsigned int plabel:1; + + /* Set if this symbol is an init or fini function and thus should + use an absolute reloc. */ + unsigned int plt_abs:1; }; -struct elf32_hppa_link_hash_entry -{ - struct elf_link_hash_entry root; -}; +struct elf32_hppa_link_hash_table { -struct elf32_hppa_link_hash_table -{ /* The main hash table. */ struct elf_link_hash_table root; /* The stub hash table. */ - struct elf32_hppa_stub_hash_table *stub_hash_table; + struct bfd_hash_table stub_hash_table; - /* A count of the number of output symbols. */ - unsigned int output_symbol_count; + /* Linker stub bfd. */ + bfd *stub_bfd; - /* Stuff so we can handle DP relative relocations. */ - long global_value; - int global_sym_defined; + /* Linker call-backs. */ + asection * (*add_stub_section) PARAMS ((const char *, asection *)); + void (*layout_sections_again) PARAMS ((void)); + + /* Array to keep track of which stub sections have been created, and + information on stub grouping. */ + struct map_stub { + /* This is the section to which stubs in the group will be + attached. */ + asection *link_sec; + /* The stub section. */ + asection *stub_sec; +#if ! LONG_BRANCH_PIC_IN_SHLIB + /* The stub section's reloc section. */ + asection *reloc_sec; +#endif + } *stub_group; + + /* Short-cuts to get to dynamic linker sections. */ + asection *sgot; + asection *srelgot; + asection *splt; + asection *srelplt; + asection *sdynbss; + asection *srelbss; + + /* Used during a final link to store the base of the text and data + segments so that we can perform SEGREL relocations. */ + bfd_vma text_segment_base; + bfd_vma data_segment_base; + + /* Whether we support multiple sub-spaces for shared libs. */ + unsigned int multi_subspace:1; + + /* Flags set when PCREL12F and PCREL17F branches detected. Used to + select suitable defaults for the stub group size. */ + unsigned int has_12bit_branch:1; + unsigned int has_17bit_branch:1; + + /* Set if we need a .plt stub to support lazy dynamic linking. */ + unsigned int need_plt_stub:1; }; -/* ELF32/HPPA relocation support +/* Various hash macros and functions. */ +#define hppa_link_hash_table(p) \ + ((struct elf32_hppa_link_hash_table *) ((p)->hash)) - This file contains ELF32/HPPA relocation support as specified - in the Stratus FTX/Golf Object File Format (SED-1762) dated - February 1994. */ +#define hppa_stub_hash_lookup(table, string, create, copy) \ + ((struct elf32_hppa_stub_hash_entry *) \ + bfd_hash_lookup ((table), (string), (create), (copy))) -#include "elf32-hppa.h" -#include "hppa_stubs.h" +static struct bfd_hash_entry *stub_hash_newfunc + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); -static unsigned long hppa_elf_relocate_insn - PARAMS ((bfd *, asection *, unsigned long, unsigned long, long, - long, unsigned long, unsigned long, unsigned long)); +static struct bfd_hash_entry *hppa_link_hash_newfunc + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); + +static struct bfd_link_hash_table *elf32_hppa_link_hash_table_create + PARAMS ((bfd *)); + +/* Stub handling functions. */ +static char *hppa_stub_name + PARAMS ((const asection *, const asection *, + const struct elf32_hppa_link_hash_entry *, + const Elf_Internal_Rela *)); + +static struct elf32_hppa_stub_hash_entry *hppa_get_stub_entry + PARAMS ((const asection *, const asection *, + struct elf32_hppa_link_hash_entry *, + const Elf_Internal_Rela *, + struct elf32_hppa_link_hash_table *)); + +static struct elf32_hppa_stub_hash_entry *hppa_add_stub + PARAMS ((const char *, asection *, struct elf32_hppa_link_hash_table *)); + +static enum elf32_hppa_stub_type hppa_type_of_stub + PARAMS ((asection *, const Elf_Internal_Rela *, + struct elf32_hppa_link_hash_entry *, bfd_vma)); + +static boolean hppa_build_one_stub + PARAMS ((struct bfd_hash_entry *, PTR)); + +static boolean hppa_size_one_stub + PARAMS ((struct bfd_hash_entry *, PTR)); + +/* BFD and elf backend functions. */ +static boolean elf32_hppa_object_p PARAMS ((bfd *)); static boolean elf32_hppa_add_symbol_hook PARAMS ((bfd *, struct bfd_link_info *, const Elf_Internal_Sym *, const char **, flagword *, asection **, bfd_vma *)); -static bfd_reloc_status_type elf32_hppa_bfd_final_link_relocate - PARAMS ((reloc_howto_type *, bfd *, bfd *, asection *, - bfd_byte *, bfd_vma, bfd_vma, bfd_vma, struct bfd_link_info *, - asection *, const char *, int)); +static boolean elf32_hppa_create_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); -static struct bfd_link_hash_table *elf32_hppa_link_hash_table_create - PARAMS ((bfd *)); +static boolean elf32_hppa_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, + asection *, const Elf_Internal_Rela *)); -static struct bfd_hash_entry * -elf32_hppa_stub_hash_newfunc - PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); +static asection *elf32_hppa_gc_mark_hook + PARAMS ((bfd *, struct bfd_link_info *, Elf_Internal_Rela *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static boolean -elf32_hppa_relocate_section +static boolean elf32_hppa_gc_sweep_hook + PARAMS ((bfd *, struct bfd_link_info *, + asection *, const Elf_Internal_Rela *)); + +static void elf32_hppa_hide_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); + +static boolean elf32_hppa_adjust_dynamic_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); + +static boolean hppa_handle_PIC_calls + PARAMS ((struct elf_link_hash_entry *, PTR)); + +#if ((! LONG_BRANCH_PIC_IN_SHLIB && LONG_BRANCH_VIA_PLT) \ + || RELATIVE_DYNAMIC_RELOCS) +static boolean hppa_discard_copies + PARAMS ((struct elf_link_hash_entry *, PTR)); +#endif + +static boolean clobber_millicode_symbols + PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *)); + +static boolean elf32_hppa_size_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); + +static boolean elf32_hppa_final_link + PARAMS ((bfd *, struct bfd_link_info *)); + +static void hppa_record_segment_addr + PARAMS ((bfd *, asection *, PTR)); + +static bfd_reloc_status_type final_link_relocate + PARAMS ((asection *, bfd_byte *, const Elf_Internal_Rela *, + bfd_vma, struct elf32_hppa_link_hash_table *, asection *, + struct elf32_hppa_link_hash_entry *)); + +static boolean elf32_hppa_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); -static boolean -elf32_hppa_stub_hash_table_init - PARAMS ((struct elf32_hppa_stub_hash_table *, bfd *, - struct bfd_hash_entry *(*) PARAMS ((struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *)))); +static int hppa_unwind_entry_compare + PARAMS ((const PTR, const PTR)); -static boolean -elf32_hppa_build_one_stub PARAMS ((struct bfd_hash_entry *, PTR)); +static boolean elf32_hppa_finish_dynamic_symbol + PARAMS ((bfd *, struct bfd_link_info *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); -static unsigned int elf32_hppa_size_of_stub - PARAMS ((bfd_vma, bfd_vma, const char *)); +static boolean elf32_hppa_finish_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); -static void elf32_hppa_name_of_stub - PARAMS ((bfd_vma, bfd_vma, char *)); - -/* For linker stub hash tables. */ -#define elf32_hppa_stub_hash_lookup(table, string, create, copy) \ - ((struct elf32_hppa_stub_hash_entry *) \ - bfd_hash_lookup (&(table)->root, (string), (create), (copy))) - -#define elf32_hppa_stub_hash_traverse(table, func, info) \ - (bfd_hash_traverse \ - (&(table)->root, \ - (boolean (*) PARAMS ((struct bfd_hash_entry *, PTR))) (func), \ - (info))) - -/* For HPPA linker hash table. */ - -#define elf32_hppa_link_hash_lookup(table, string, create, copy, follow)\ - ((struct elf32_hppa_link_hash_entry *) \ - elf_link_hash_lookup (&(table)->root, (string), (create), \ - (copy), (follow))) - -#define elf32_hppa_link_hash_traverse(table, func, info) \ - (elf_link_hash_traverse \ - (&(table)->root, \ - (boolean (*) PARAMS ((struct elf_link_hash_entry *, PTR))) (func), \ - (info))) - -/* Get the PA ELF linker hash table from a link_info structure. */ - -#define elf32_hppa_hash_table(p) \ - ((struct elf32_hppa_link_hash_table *) ((p)->hash)) +static void elf32_hppa_post_process_headers + PARAMS ((bfd *, struct bfd_link_info *)); +static int elf32_hppa_elf_get_symbol_type + PARAMS ((Elf_Internal_Sym *, int)); /* Assorted hash table functions. */ /* Initialize an entry in the stub hash table. */ static struct bfd_hash_entry * -elf32_hppa_stub_hash_newfunc (entry, table, string) +stub_hash_newfunc (entry, table, string) struct bfd_hash_entry *entry; struct bfd_hash_table *table; const char *string; @@ -198,11 +426,13 @@ elf32_hppa_stub_hash_newfunc (entry, table, string) /* Allocate the structure if it has not already been allocated by a subclass. */ if (ret == NULL) - ret = ((struct elf32_hppa_stub_hash_entry *) - bfd_hash_allocate (table, - sizeof (struct elf32_hppa_stub_hash_entry))); - if (ret == NULL) - return NULL; + { + ret = ((struct elf32_hppa_stub_hash_entry *) + bfd_hash_allocate (table, + sizeof (struct elf32_hppa_stub_hash_entry))); + if (ret == NULL) + return NULL; + } /* Call the allocation method of the superclass. */ ret = ((struct elf32_hppa_stub_hash_entry *) @@ -211,28 +441,66 @@ elf32_hppa_stub_hash_newfunc (entry, table, string) if (ret) { /* Initialize the local fields. */ - ret->offset = 0; + ret->stub_sec = NULL; +#if ! LONG_BRANCH_PIC_IN_SHLIB + ret->reloc_sec = NULL; +#endif + ret->stub_offset = 0; ret->target_value = 0; ret->target_section = NULL; + ret->stub_type = hppa_stub_long_branch; + ret->h = NULL; + ret->id_sec = NULL; } return (struct bfd_hash_entry *) ret; } -/* Initialize a stub hash table. */ +/* Initialize an entry in the link hash table. */ -static boolean -elf32_hppa_stub_hash_table_init (table, stub_bfd, newfunc) - struct elf32_hppa_stub_hash_table *table; - bfd *stub_bfd; - struct bfd_hash_entry *(*newfunc) PARAMS ((struct bfd_hash_entry *, - struct bfd_hash_table *, - const char *)); +static struct bfd_hash_entry * +hppa_link_hash_newfunc (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; { - table->offset = 0; - table->location = 0; - table->stub_bfd = stub_bfd; - return (bfd_hash_table_init (&table->root, newfunc)); + struct elf32_hppa_link_hash_entry *ret; + + ret = (struct elf32_hppa_link_hash_entry *) entry; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (ret == NULL) + { + ret = ((struct elf32_hppa_link_hash_entry *) + bfd_hash_allocate (table, + sizeof (struct elf32_hppa_link_hash_entry))); + if (ret == NULL) + return NULL; + } + + /* Call the allocation method of the superclass. */ + ret = ((struct elf32_hppa_link_hash_entry *) + _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret, + table, string)); + + if (ret) + { + /* Initialize the local fields. */ +#if ! LONG_BRANCH_PIC_IN_SHLIB + ret->stub_reloc_sec = NULL; +#endif + ret->stub_cache = NULL; +#if ! LONG_BRANCH_PIC_IN_SHLIB || RELATIVE_DYNAMIC_RELOCS + ret->reloc_entries = NULL; +#endif + ret->maybe_pic_call = 0; + ret->pic_call = 0; + ret->plabel = 0; + ret->plt_abs = 0; + } + + return (struct bfd_hash_entry *) ret; } /* Create the derived linker hash table. The PA ELF port uses the derived @@ -245,549 +513,643 @@ elf32_hppa_link_hash_table_create (abfd) { struct elf32_hppa_link_hash_table *ret; - ret = ((struct elf32_hppa_link_hash_table *) - bfd_alloc (abfd, sizeof (struct elf32_hppa_link_hash_table))); + ret = ((struct elf32_hppa_link_hash_table *) bfd_alloc (abfd, sizeof (*ret))); if (ret == NULL) return NULL; - if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, - _bfd_elf_link_hash_newfunc)) + + if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, hppa_link_hash_newfunc)) { bfd_release (abfd, ret); return NULL; } - ret->stub_hash_table = NULL; - ret->output_symbol_count = 0; - ret->global_value = 0; - ret->global_sym_defined = 0; + + /* Init the stub hash table too. */ + if (!bfd_hash_table_init (&ret->stub_hash_table, stub_hash_newfunc)) + return NULL; + + ret->stub_bfd = NULL; + ret->add_stub_section = NULL; + ret->layout_sections_again = NULL; + ret->stub_group = NULL; + ret->sgot = NULL; + ret->srelgot = NULL; + ret->splt = NULL; + ret->srelplt = NULL; + ret->sdynbss = NULL; + ret->srelbss = NULL; + ret->text_segment_base = (bfd_vma) -1; + ret->data_segment_base = (bfd_vma) -1; + ret->multi_subspace = 0; + ret->has_12bit_branch = 0; + ret->has_17bit_branch = 0; + ret->need_plt_stub = 0; return &ret->root.root; } -/* Relocate the given INSN given the various input parameters. +/* Build a name for an entry in the stub hash table. */ - FIXME: endianness and sizeof (long) issues abound here. */ - -static unsigned long -hppa_elf_relocate_insn (abfd, input_sect, insn, address, sym_value, - r_addend, r_format, r_field, pcrel) - bfd *abfd; - asection *input_sect; - unsigned long insn; - unsigned long address; - long sym_value; - long r_addend; - unsigned long r_format; - unsigned long r_field; - unsigned long pcrel; +static char * +hppa_stub_name (input_section, sym_sec, hash, rel) + const asection *input_section; + const asection *sym_sec; + const struct elf32_hppa_link_hash_entry *hash; + const Elf_Internal_Rela *rel; { - unsigned char opcode = get_opcode (insn); - long constant_value; + char *stub_name; + size_t len; - switch (opcode) + if (hash) { - case LDO: - case LDB: - case LDH: - case LDW: - case LDWM: - case STB: - case STH: - case STW: - case STWM: - case COMICLR: - case SUBI: - case ADDIT: - case ADDI: - case LDIL: - case ADDIL: - constant_value = HPPA_R_CONSTANT (r_addend); - - if (pcrel) - sym_value -= address; - - sym_value = hppa_field_adjust (sym_value, constant_value, r_field); - return hppa_rebuild_insn (abfd, insn, sym_value, r_format); - - case BL: - case BE: - case BLE: - /* XXX computing constant_value is not needed??? */ - constant_value = assemble_17 ((insn & 0x001f0000) >> 16, - (insn & 0x00001ffc) >> 2, - insn & 1); - - constant_value = (constant_value << 15) >> 15; - if (pcrel) + len = 8 + 1 + strlen (hash->elf.root.root.string) + 1 + 8 + 1; + stub_name = bfd_malloc (len); + if (stub_name != NULL) { - sym_value -= - address + input_sect->output_offset - + input_sect->output_section->vma; - sym_value = hppa_field_adjust (sym_value, -8, r_field); + sprintf (stub_name, "%08x_%s+%x", + input_section->id & 0xffffffff, + hash->elf.root.root.string, + (int) rel->r_addend & 0xffffffff); } - else - sym_value = hppa_field_adjust (sym_value, constant_value, r_field); - - return hppa_rebuild_insn (abfd, insn, sym_value >> 2, r_format); - - default: - if (opcode == 0) - { - constant_value = HPPA_R_CONSTANT (r_addend); - - if (pcrel) - sym_value -= address; - - return hppa_field_adjust (sym_value, constant_value, r_field); - } - else - abort (); } + else + { + len = 8 + 1 + 8 + 1 + 8 + 1 + 8 + 1; + stub_name = bfd_malloc (len); + if (stub_name != NULL) + { + sprintf (stub_name, "%08x_%x:%x+%x", + input_section->id & 0xffffffff, + sym_sec->id & 0xffffffff, + (int) ELF32_R_SYM (rel->r_info) & 0xffffffff, + (int) rel->r_addend & 0xffffffff); + } + } + return stub_name; } -/* Relocate an HPPA ELF section. */ +/* Look up an entry in the stub hash. Stub entries are cached because + creating the stub name takes a bit of time. */ + +static struct elf32_hppa_stub_hash_entry * +hppa_get_stub_entry (input_section, sym_sec, hash, rel, hplink) + const asection *input_section; + const asection *sym_sec; + struct elf32_hppa_link_hash_entry *hash; + const Elf_Internal_Rela *rel; + struct elf32_hppa_link_hash_table *hplink; +{ + struct elf32_hppa_stub_hash_entry *stub_entry; + const asection *id_sec; + + /* If this input section is part of a group of sections sharing one + stub section, then use the id of the first section in the group. + Stub names need to include a section id, as there may well be + more than one stub used to reach say, printf, and we need to + distinguish between them. */ + id_sec = hplink->stub_group[input_section->id].link_sec; + + if (hash != NULL && hash->stub_cache != NULL + && hash->stub_cache->h == hash + && hash->stub_cache->id_sec == id_sec) + { + stub_entry = hash->stub_cache; + } + else + { + char *stub_name; + + stub_name = hppa_stub_name (id_sec, sym_sec, hash, rel); + if (stub_name == NULL) + return NULL; + + stub_entry = hppa_stub_hash_lookup (&hplink->stub_hash_table, + stub_name, false, false); + if (stub_entry == NULL) + { + if (hash == NULL || hash->elf.root.type != bfd_link_hash_undefweak) + (*_bfd_error_handler) (_("%s(%s+0x%lx): cannot find stub entry %s"), + bfd_get_filename (input_section->owner), + input_section->name, + (long) rel->r_offset, + stub_name); + } + else + { + if (hash != NULL) + hash->stub_cache = stub_entry; + } + + free (stub_name); + } + + return stub_entry; +} + +/* Add a new stub entry to the stub hash. Not all fields of the new + stub entry are initialised. */ + +static struct elf32_hppa_stub_hash_entry * +hppa_add_stub (stub_name, section, hplink) + const char *stub_name; + asection *section; + struct elf32_hppa_link_hash_table *hplink; +{ + asection *link_sec; + asection *stub_sec; + struct elf32_hppa_stub_hash_entry *stub_entry; + + link_sec = hplink->stub_group[section->id].link_sec; + stub_sec = hplink->stub_group[section->id].stub_sec; + if (stub_sec == NULL) + { + stub_sec = hplink->stub_group[link_sec->id].stub_sec; + if (stub_sec == NULL) + { + size_t len; + char *s_name; + + len = strlen (link_sec->name) + sizeof (STUB_SUFFIX); + s_name = bfd_alloc (hplink->stub_bfd, len); + if (s_name == NULL) + return NULL; + + strcpy (s_name, link_sec->name); + strcpy (s_name + len - sizeof (STUB_SUFFIX), STUB_SUFFIX); + stub_sec = (*hplink->add_stub_section) (s_name, link_sec); + if (stub_sec == NULL) + return NULL; + hplink->stub_group[link_sec->id].stub_sec = stub_sec; + } + hplink->stub_group[section->id].stub_sec = stub_sec; + } + + /* Enter this entry into the linker stub hash table. */ + stub_entry = hppa_stub_hash_lookup (&hplink->stub_hash_table, stub_name, + true, false); + if (stub_entry == NULL) + { + (*_bfd_error_handler) (_("%s: cannot create stub entry %s"), + bfd_get_filename (section->owner), + stub_name); + return NULL; + } + + stub_entry->stub_sec = stub_sec; +#if ! LONG_BRANCH_PIC_IN_SHLIB + stub_entry->reloc_sec = hplink->stub_group[section->id].reloc_sec; +#endif + stub_entry->stub_offset = 0; + stub_entry->id_sec = link_sec; + return stub_entry; +} + +/* Determine the type of stub needed, if any, for a call. */ + +static enum elf32_hppa_stub_type +hppa_type_of_stub (input_sec, rel, hash, destination) + asection *input_sec; + const Elf_Internal_Rela *rel; + struct elf32_hppa_link_hash_entry *hash; + bfd_vma destination; +{ + bfd_vma location; + bfd_vma branch_offset; + bfd_vma max_branch_offset; + unsigned int r_type; + + if (hash != NULL + && (((hash->elf.root.type == bfd_link_hash_defined + || hash->elf.root.type == bfd_link_hash_defweak) + && hash->elf.root.u.def.section->output_section == NULL) + || (hash->elf.root.type == bfd_link_hash_defweak + && hash->elf.dynindx != -1 + && hash->elf.plt.offset != (bfd_vma) -1) + || hash->elf.root.type == bfd_link_hash_undefweak + || hash->elf.root.type == bfd_link_hash_undefined + || (hash->maybe_pic_call && !(input_sec->flags & SEC_HAS_GOT_REF)))) + { + /* If output_section is NULL, then it's a symbol defined in a + shared library. We will need an import stub. Decide between + hppa_stub_import and hppa_stub_import_shared later. For + shared links we need stubs for undefined or weak syms too; + They will presumably be resolved by the dynamic linker. */ + return hppa_stub_import; + } + + /* Determine where the call point is. */ + location = (input_sec->output_offset + + input_sec->output_section->vma + + rel->r_offset); + + branch_offset = destination - location - 8; + r_type = ELF32_R_TYPE (rel->r_info); + + /* Determine if a long branch stub is needed. parisc branch offsets + are relative to the second instruction past the branch, ie. +8 + bytes on from the branch instruction location. The offset is + signed and counts in units of 4 bytes. */ + if (r_type == (unsigned int) R_PARISC_PCREL17F) + { + max_branch_offset = (1 << (17-1)) << 2; + } + else if (r_type == (unsigned int) R_PARISC_PCREL12F) + { + max_branch_offset = (1 << (12-1)) << 2; + } + else /* R_PARISC_PCREL22F. */ + { + max_branch_offset = (1 << (22-1)) << 2; + } + + if (branch_offset + max_branch_offset >= 2*max_branch_offset) + { +#if LONG_BRANCH_VIA_PLT + if (hash != NULL + && hash->elf.dynindx != -1 + && hash->elf.plt.offset != (bfd_vma) -1) + { + /* If we are doing a shared link and find we need a long + branch stub, then go via the .plt if possible. */ + return hppa_stub_import; + } + else +#endif + return hppa_stub_long_branch; + } + return hppa_stub_none; +} + +/* Build one linker stub as defined by the stub hash table entry GEN_ENTRY. + IN_ARG contains the link info pointer. */ + +#define LDIL_R1 0x20200000 /* ldil LR'XXX,%r1 */ +#define BE_SR4_R1 0xe0202002 /* be,n RR'XXX(%sr4,%r1) */ + +#define BL_R1 0xe8200000 /* b,l .+8,%r1 */ +#define ADDIL_R1 0x28200000 /* addil LR'XXX,%r1,%r1 */ +#define DEPI_R1 0xd4201c1e /* depi 0,31,2,%r1 */ + +#define ADDIL_DP 0x2b600000 /* addil LR'XXX,%dp,%r1 */ +#define LDW_R1_R21 0x48350000 /* ldw RR'XXX(%sr0,%r1),%r21 */ +#define BV_R0_R21 0xeaa0c000 /* bv %r0(%r21) */ +#define LDW_R1_R19 0x48330000 /* ldw RR'XXX(%sr0,%r1),%r19 */ + +#define ADDIL_R19 0x2a600000 /* addil LR'XXX,%r19,%r1 */ +#define LDW_R1_DP 0x483b0000 /* ldw RR'XXX(%sr0,%r1),%dp */ + +#define LDSID_R21_R1 0x02a010a1 /* ldsid (%sr0,%r21),%r1 */ +#define MTSP_R1 0x00011820 /* mtsp %r1,%sr0 */ +#define BE_SR0_R21 0xe2a00000 /* be 0(%sr0,%r21) */ +#define STW_RP 0x6bc23fd1 /* stw %rp,-24(%sr0,%sp) */ + +#define BL_RP 0xe8400002 /* b,l,n XXX,%rp */ +#define NOP 0x08000240 /* nop */ +#define LDW_RP 0x4bc23fd1 /* ldw -24(%sr0,%sp),%rp */ +#define LDSID_RP_R1 0x004010a1 /* ldsid (%sr0,%rp),%r1 */ +#define BE_SR0_RP 0xe0400002 /* be,n 0(%sr0,%rp) */ + +#ifndef R19_STUBS +#define R19_STUBS 1 +#endif + +#if R19_STUBS +#define LDW_R1_DLT LDW_R1_R19 +#else +#define LDW_R1_DLT LDW_R1_DP +#endif static boolean -elf32_hppa_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; +hppa_build_one_stub (gen_entry, in_arg) + struct bfd_hash_entry *gen_entry; + PTR in_arg; { - Elf_Internal_Shdr *symtab_hdr; - Elf_Internal_Rela *rel; - Elf_Internal_Rela *relend; + struct elf32_hppa_stub_hash_entry *stub_entry; + struct bfd_link_info *info; + struct elf32_hppa_link_hash_table *hplink; + asection *stub_sec; + bfd *stub_bfd; + bfd_byte *loc; + bfd_vma sym_value; + bfd_vma insn; + int val; + int size; - symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + /* Massage our args to the form they really have. */ + stub_entry = (struct elf32_hppa_stub_hash_entry *) gen_entry; + info = (struct bfd_link_info *) in_arg; - rel = relocs; - relend = relocs + input_section->reloc_count; - for (; rel < relend; rel++) + hplink = hppa_link_hash_table (info); + stub_sec = stub_entry->stub_sec; + + /* Make a note of the offset within the stubs for this entry. */ + stub_entry->stub_offset = stub_sec->_raw_size; + loc = stub_sec->contents + stub_entry->stub_offset; + + stub_bfd = stub_sec->owner; + + switch (stub_entry->stub_type) { - int r_type; - reloc_howto_type *howto; - unsigned long r_symndx; - struct elf_link_hash_entry *h; - Elf_Internal_Sym *sym; - asection *sym_sec; - bfd_vma relocation; - bfd_reloc_status_type r; - const char *sym_name; + case hppa_stub_long_branch: + /* Create the long branch. A long branch is formed with "ldil" + loading the upper bits of the target address into a register, + then branching with "be" which adds in the lower bits. + The "be" has its delay slot nullified. */ + sym_value = (stub_entry->target_value + + stub_entry->target_section->output_offset + + stub_entry->target_section->output_section->vma); - r_type = ELF32_R_TYPE (rel->r_info); - if (r_type < 0 || r_type >= (int) R_PARISC_UNIMPLEMENTED) + val = hppa_field_adjust (sym_value, (bfd_signed_vma) 0, e_lrsel); + insn = hppa_rebuild_insn ((int) LDIL_R1, val, 21); + bfd_put_32 (stub_bfd, insn, loc); + + val = hppa_field_adjust (sym_value, (bfd_signed_vma) 0, e_rrsel) >> 2; + insn = hppa_rebuild_insn ((int) BE_SR4_R1, val, 17); + bfd_put_32 (stub_bfd, insn, loc + 4); + +#if ! LONG_BRANCH_PIC_IN_SHLIB + if (info->shared) { + /* Output a dynamic relocation for this stub. We only + output one PCREL21L reloc per stub, trusting that the + dynamic linker will also fix the implied PCREL17R for the + second instruction. PCREL21L dynamic relocs had better + never be emitted for some other purpose... */ + asection *srel; + Elf_Internal_Rela outrel; + + if (stub_entry->h == NULL) + { + (*_bfd_error_handler) + (_("%s(%s+0x%lx): cannot relocate %s, recompile with -ffunction-sections"), + bfd_get_filename (stub_entry->target_section->owner), + stub_sec->name, + (long) stub_entry->stub_offset, + stub_entry->root.string); + bfd_set_error (bfd_error_bad_value); + return false; + } + + srel = stub_entry->reloc_sec; + if (srel == NULL) + { + (*_bfd_error_handler) + (_("Could not find relocation section for %s"), + stub_sec->name); + bfd_set_error (bfd_error_bad_value); + return false; + } + + outrel.r_offset = (stub_entry->stub_offset + + stub_sec->output_offset + + stub_sec->output_section->vma); + outrel.r_info = ELF32_R_INFO (0, R_PARISC_PCREL21L); + outrel.r_addend = sym_value; + bfd_elf32_swap_reloca_out (stub_sec->output_section->owner, + &outrel, + ((Elf32_External_Rela *) + srel->contents + srel->reloc_count)); + ++srel->reloc_count; + } +#endif + size = 8; + break; + + case hppa_stub_long_branch_shared: + /* Branches are relative. This is where we are going to. */ + sym_value = (stub_entry->target_value + + stub_entry->target_section->output_offset + + stub_entry->target_section->output_section->vma); + + /* And this is where we are coming from, more or less. */ + sym_value -= (stub_entry->stub_offset + + stub_sec->output_offset + + stub_sec->output_section->vma); + + bfd_put_32 (stub_bfd, (bfd_vma) BL_R1, loc); + val = hppa_field_adjust (sym_value, (bfd_signed_vma) -8, e_lrsel); + insn = hppa_rebuild_insn ((int) ADDIL_R1, val, 21); + bfd_put_32 (stub_bfd, insn, loc + 4); + + val = hppa_field_adjust (sym_value, (bfd_signed_vma) -8, e_rrsel) >> 2; + insn = hppa_rebuild_insn ((int) BE_SR4_R1, val, 17); + bfd_put_32 (stub_bfd, insn, loc + 8); + size = 12; + break; + + case hppa_stub_import: + case hppa_stub_import_shared: + sym_value = (stub_entry->h->elf.plt.offset + + hplink->splt->output_offset + + hplink->splt->output_section->vma + - elf_gp (hplink->splt->output_section->owner)); + + insn = ADDIL_DP; +#if R19_STUBS + if (stub_entry->stub_type == hppa_stub_import_shared) + insn = ADDIL_R19; +#endif + val = hppa_field_adjust (sym_value, (bfd_signed_vma) 0, e_lrsel), + insn = hppa_rebuild_insn ((int) insn, val, 21); + bfd_put_32 (stub_bfd, insn, loc); + + /* It is critical to use lrsel/rrsel here because we are using + two different offsets (+0 and +4) from sym_value. If we use + lsel/rsel then with unfortunate sym_values we will round + sym_value+4 up to the next 2k block leading to a mis-match + between the lsel and rsel value. */ + val = hppa_field_adjust (sym_value, (bfd_signed_vma) 0, e_rrsel); + insn = hppa_rebuild_insn ((int) LDW_R1_R21, val, 14); + bfd_put_32 (stub_bfd, insn, loc + 4); + + if (hplink->multi_subspace) + { + val = hppa_field_adjust (sym_value, (bfd_signed_vma) 4, e_rrsel); + insn = hppa_rebuild_insn ((int) LDW_R1_DLT, val, 14); + bfd_put_32 (stub_bfd, insn, loc + 8); + + bfd_put_32 (stub_bfd, (bfd_vma) LDSID_R21_R1, loc + 12); + bfd_put_32 (stub_bfd, (bfd_vma) MTSP_R1, loc + 16); + bfd_put_32 (stub_bfd, (bfd_vma) BE_SR0_R21, loc + 20); + bfd_put_32 (stub_bfd, (bfd_vma) STW_RP, loc + 24); + + size = 28; + } + else + { + bfd_put_32 (stub_bfd, (bfd_vma) BV_R0_R21, loc + 8); + val = hppa_field_adjust (sym_value, (bfd_signed_vma) 4, e_rrsel); + insn = hppa_rebuild_insn ((int) LDW_R1_DLT, val, 14); + bfd_put_32 (stub_bfd, insn, loc + 12); + + size = 16; + } + + if (!info->shared + && stub_entry->h != NULL + && stub_entry->h->pic_call) + { + /* Build the .plt entry needed to call a PIC function from + statically linked code. We don't need any relocs. */ + bfd *dynobj; + struct elf32_hppa_link_hash_entry *eh; + bfd_vma value; + + dynobj = hplink->root.dynobj; + eh = (struct elf32_hppa_link_hash_entry *) stub_entry->h; + + BFD_ASSERT (eh->elf.root.type == bfd_link_hash_defined + || eh->elf.root.type == bfd_link_hash_defweak); + + value = (eh->elf.root.u.def.value + + eh->elf.root.u.def.section->output_offset + + eh->elf.root.u.def.section->output_section->vma); + + /* Fill in the entry in the procedure linkage table. + + The format of a plt entry is + + <__gp>. */ + + bfd_put_32 (hplink->splt->owner, value, + hplink->splt->contents + eh->elf.plt.offset); + value = elf_gp (hplink->splt->output_section->owner); + bfd_put_32 (hplink->splt->owner, value, + hplink->splt->contents + eh->elf.plt.offset + 4); + } + break; + + case hppa_stub_export: + /* Branches are relative. This is where we are going to. */ + sym_value = (stub_entry->target_value + + stub_entry->target_section->output_offset + + stub_entry->target_section->output_section->vma); + + /* And this is where we are coming from. */ + sym_value -= (stub_entry->stub_offset + + stub_sec->output_offset + + stub_sec->output_section->vma); + + if (sym_value - 8 + 0x40000 >= 0x80000) + { + (*_bfd_error_handler) + (_("%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections"), + bfd_get_filename (stub_entry->target_section->owner), + stub_sec->name, + (long) stub_entry->stub_offset, + stub_entry->root.string); bfd_set_error (bfd_error_bad_value); return false; } - howto = elf_hppa_howto_table + r_type; - r_symndx = ELF32_R_SYM (rel->r_info); + val = hppa_field_adjust (sym_value, (bfd_signed_vma) -8, e_fsel) >> 2; + insn = hppa_rebuild_insn ((int) BL_RP, val, 17); + bfd_put_32 (stub_bfd, insn, loc); - if (info->relocateable) - { - /* This is a relocateable link. We don't have to change - anything, unless the reloc is against a section symbol, - in which case we have to adjust according to where the - section symbol winds up in the output section. */ - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) - { - sym_sec = local_sections[r_symndx]; - rel->r_addend += sym_sec->output_offset; - } - } + bfd_put_32 (stub_bfd, (bfd_vma) NOP, loc + 4); + bfd_put_32 (stub_bfd, (bfd_vma) LDW_RP, loc + 8); + bfd_put_32 (stub_bfd, (bfd_vma) LDSID_RP_R1, loc + 12); + bfd_put_32 (stub_bfd, (bfd_vma) MTSP_R1, loc + 16); + bfd_put_32 (stub_bfd, (bfd_vma) BE_SR0_RP, loc + 20); - continue; - } + /* Point the function symbol at the stub. */ + stub_entry->h->elf.root.u.def.section = stub_sec; + stub_entry->h->elf.root.u.def.value = stub_sec->_raw_size; - /* This is a final link. */ - h = NULL; - sym = NULL; - sym_sec = NULL; - if (r_symndx < symtab_hdr->sh_info) - { - sym = local_syms + r_symndx; - sym_sec = local_sections[r_symndx]; - relocation = ((ELF_ST_TYPE (sym->st_info) == STT_SECTION - ? 0 : sym->st_value) - + sym_sec->output_offset - + sym_sec->output_section->vma); - } - else - { - long indx; + size = 24; + break; - indx = r_symndx - symtab_hdr->sh_info; - h = elf_sym_hashes (input_bfd)[indx]; - 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) - { - sym_sec = h->root.u.def.section; - relocation = (h->root.u.def.value - + sym_sec->output_offset - + sym_sec->output_section->vma); - } - else if (h->root.type == bfd_link_hash_undefweak) - relocation = 0; - else - { - if (!((*info->callbacks->undefined_symbol) - (info, h->root.root.string, input_bfd, - input_section, rel->r_offset, true))) - return false; - break; - } - } - - if (h != NULL) - sym_name = h->root.root.string; - else - { - sym_name = bfd_elf_string_from_elf_section (input_bfd, - symtab_hdr->sh_link, - sym->st_name); - if (sym_name == NULL) - return false; - if (*sym_name == '\0') - sym_name = bfd_section_name (input_bfd, sym_sec); - } - - r = elf32_hppa_bfd_final_link_relocate (howto, input_bfd, output_bfd, - input_section, contents, - rel->r_offset, relocation, - rel->r_addend, info, sym_sec, - sym_name, h == NULL); - - if (r != bfd_reloc_ok) - { - switch (r) - { - /* This can happen for DP relative relocs if $global$ is - undefined. This is a panic situation so we don't try - to continue. */ - case bfd_reloc_undefined: - case bfd_reloc_notsupported: - if (!((*info->callbacks->undefined_symbol) - (info, "$global$", input_bfd, - input_section, rel->r_offset, true))) - return false; - return false; - case bfd_reloc_dangerous: - { - /* We use this return value to indicate that we performed - a "dangerous" relocation. This doesn't mean we did - the wrong thing, it just means there may be some cleanup - that needs to be done here. - - In particular we had to swap the last call insn and its - delay slot. If the delay slot insn needed a relocation, - then we'll need to adjust the next relocation entry's - offset to account for the fact that the insn moved. - - This hair wouldn't be necessary if we inserted stubs - between procedures and used a "bl" to get to the stub. */ - if (rel != relend) - { - Elf_Internal_Rela *next_rel = rel + 1; - - if (rel->r_offset + 4 == next_rel->r_offset) - next_rel->r_offset -= 4; - } - break; - } - default: - case bfd_reloc_outofrange: - case bfd_reloc_overflow: - { - if (!((*info->callbacks->reloc_overflow) - (info, sym_name, howto->name, (bfd_vma) 0, - input_bfd, input_section, rel->r_offset))) - return false; - } - break; - } - } + default: + BFD_FAIL (); + return false; } + stub_sec->_raw_size += size; return true; } -/* Actually perform a relocation as part of a final link. This can get - rather hairy when linker stubs are needed. */ +#undef LDIL_R1 +#undef BE_SR4_R1 +#undef BL_R1 +#undef ADDIL_R1 +#undef DEPI_R1 +#undef ADDIL_DP +#undef LDW_R1_R21 +#undef LDW_R1_DLT +#undef LDW_R1_R19 +#undef ADDIL_R19 +#undef LDW_R1_DP +#undef LDSID_R21_R1 +#undef MTSP_R1 +#undef BE_SR0_R21 +#undef STW_RP +#undef BV_R0_R21 +#undef BL_RP +#undef NOP +#undef LDW_RP +#undef LDSID_RP_R1 +#undef BE_SR0_RP -static bfd_reloc_status_type -elf32_hppa_bfd_final_link_relocate (howto, input_bfd, output_bfd, - input_section, contents, offset, value, - addend, info, sym_sec, sym_name, is_local) - reloc_howto_type *howto; - bfd *input_bfd; - bfd *output_bfd ATTRIBUTE_UNUSED; - asection *input_section; - bfd_byte *contents; - bfd_vma offset; - bfd_vma value; - bfd_vma addend; - struct bfd_link_info *info; - asection *sym_sec; - const char *sym_name; - int is_local; +/* As above, but don't actually build the stub. Just bump offset so + we know stub section sizes. */ + +static boolean +hppa_size_one_stub (gen_entry, in_arg) + struct bfd_hash_entry *gen_entry; + PTR in_arg; { - unsigned long insn; - unsigned long r_type = howto->type; - unsigned long r_format = howto->bitsize; - unsigned long r_field = e_fsel; - bfd_byte *hit_data = contents + offset; - boolean r_pcrel = howto->pc_relative; + struct elf32_hppa_stub_hash_entry *stub_entry; + struct elf32_hppa_link_hash_table *hplink; + int size; - insn = bfd_get_32 (input_bfd, hit_data); + /* Massage our args to the form they really have. */ + stub_entry = (struct elf32_hppa_stub_hash_entry *) gen_entry; + hplink = (struct elf32_hppa_link_hash_table *) in_arg; - /* Make sure we have a value for $global$. FIXME isn't this effectively - just like the gp pointer on MIPS? Can we use those routines for this - purpose? */ - if (!elf32_hppa_hash_table (info)->global_sym_defined) + if (stub_entry->stub_type == hppa_stub_long_branch) { - struct elf_link_hash_entry *h; - asection *sec; - - h = elf_link_hash_lookup (elf_hash_table (info), "$global$", false, - false, false); - - /* If there isn't a $global$, then we're in deep trouble. */ - if (h == NULL) - return bfd_reloc_notsupported; - - /* If $global$ isn't a defined symbol, then we're still in deep - trouble. */ - if (h->root.type != bfd_link_hash_defined) - return bfd_reloc_undefined; - - sec = h->root.u.def.section; - elf32_hppa_hash_table (info)->global_value = (h->root.u.def.value - + sec->output_section->vma - + sec->output_offset); - elf32_hppa_hash_table (info)->global_sym_defined = 1; +#if ! LONG_BRANCH_PIC_IN_SHLIB + if (stub_entry->reloc_sec != NULL) + stub_entry->reloc_sec->_raw_size += sizeof (Elf32_External_Rela); +#endif + size = 8; } - - switch (r_type) + else if (stub_entry->stub_type == hppa_stub_long_branch_shared) + size = 12; + else if (stub_entry->stub_type == hppa_stub_export) + size = 24; + else /* hppa_stub_import or hppa_stub_import_shared. */ { - case R_PARISC_NONE: - break; - - case R_PARISC_DIR32: - case R_PARISC_DIR17F: - case R_PARISC_PCREL17C: - r_field = e_fsel; - goto do_basic_type_1; - case R_PARISC_DIR21L: - case R_PARISC_PCREL21L: - r_field = e_lrsel; - goto do_basic_type_1; - case R_PARISC_DIR17R: - case R_PARISC_PCREL17R: - case R_PARISC_DIR14R: - case R_PARISC_PCREL14R: - r_field = e_rrsel; - goto do_basic_type_1; - - /* For all the DP relative relocations, we need to examine the symbol's - section. If it's a code section, then "data pointer relative" makes - no sense. In that case we don't adjust the "value", and for 21 bit - addil instructions, we change the source addend register from %dp to - %r0. */ - case R_PARISC_DPREL21L: - r_field = e_lrsel; - if (sym_sec->flags & SEC_CODE) - { - if ((insn & 0xfc000000) >> 26 == 0xa - && (insn & 0x03e00000) >> 21 == 0x1b) - insn &= ~0x03e00000; - } + if (hplink->multi_subspace) + size = 28; else - value -= elf32_hppa_hash_table (info)->global_value; - goto do_basic_type_1; - case R_PARISC_DPREL14R: - r_field = e_rrsel; - if ((sym_sec->flags & SEC_CODE) == 0) - value -= elf32_hppa_hash_table (info)->global_value; - goto do_basic_type_1; - case R_PARISC_DPREL14F: - r_field = e_fsel; - if ((sym_sec->flags & SEC_CODE) == 0) - value -= elf32_hppa_hash_table (info)->global_value; - goto do_basic_type_1; - - /* These cases are separate as they may involve a lot more work - to deal with linker stubs. */ - case R_PARISC_PLABEL32: - case R_PARISC_PLABEL21L: - case R_PARISC_PLABEL14R: - case R_PARISC_PCREL17F: - { - bfd_vma location; - unsigned int len; - char *new_name, *stub_name; - - /* Get the field selector right. We'll need it in a minute. */ - if (r_type == R_PARISC_PCREL17F - || r_type == R_PARISC_PLABEL32) - r_field = e_fsel; - else if (r_type == R_PARISC_PLABEL21L) - r_field = e_lrsel; - else if (r_type == R_PARISC_PLABEL14R) - r_field = e_rrsel; - - /* Find out where we are and where we're going. */ - location = (offset + - input_section->output_offset + - input_section->output_section->vma); - - len = strlen (sym_name) + 1; - if (is_local) - len += 9; - new_name = bfd_malloc (len); - if (!new_name) - return bfd_reloc_notsupported; - strcpy (new_name, sym_name); - - /* Local symbols have unique IDs. */ - if (is_local) - sprintf (new_name + len - 10, "_%08x", (int)sym_sec); - - /* Any kind of linker stub needed? */ - if (((int)(value - location) > 0x3ffff) - || ((int)(value - location) < (int)0xfffc0000)) - { - struct elf32_hppa_stub_hash_table *stub_hash_table; - struct elf32_hppa_stub_hash_entry *stub_hash; - asection *stub_section; - - /* Build a name for the stub. */ - - len = strlen (new_name); - len += 23; - stub_name = bfd_malloc (len); - if (!stub_name) - return bfd_reloc_notsupported; - elf32_hppa_name_of_stub (location, value, stub_name); - strcat (stub_name, new_name); - free (new_name); - - stub_hash_table = elf32_hppa_hash_table (info)->stub_hash_table; - - stub_hash - = elf32_hppa_stub_hash_lookup (stub_hash_table, stub_name, - false, false); - - /* We're done with that name. */ - free (stub_name); - - /* The stub BFD only has one section. */ - stub_section = stub_hash_table->stub_bfd->sections; - - if (stub_hash != NULL) - { - if (r_type == R_PARISC_PCREL17F) - { - unsigned long delay_insn; - unsigned int opcode, rtn_reg, ldo_target_reg, ldo_src_reg; - - /* We'll need to peek at the next insn. */ - delay_insn = bfd_get_32 (input_bfd, hit_data + 4); - opcode = get_opcode (delay_insn); - - /* We also need to know the return register for this - call. */ - rtn_reg = (insn & 0x03e00000) >> 21; - - ldo_src_reg = (delay_insn & 0x03e00000) >> 21; - ldo_target_reg = (delay_insn & 0x001f0000) >> 16; - - /* Munge up the value and other parameters for - hppa_elf_relocate_insn. */ - - value = (stub_hash->offset - + stub_section->output_offset - + stub_section->output_section->vma); - - r_format = 17; - r_field = e_fsel; - r_pcrel = 0; - addend = 0; - - /* We need to peek at the delay insn and determine if - we'll need to swap the branch and its delay insn. */ - if ((insn & 2) - || (opcode == LDO - && ldo_target_reg == rtn_reg) - || (delay_insn == 0x08000240)) - { - /* No need to swap the branch and its delay slot, but - we do need to make sure to jump past the return - pointer update in the stub. */ - value += 4; - - /* If the delay insn does a return pointer adjustment, - then we have to make sure it stays valid. */ - if (opcode == LDO - && ldo_target_reg == rtn_reg) - { - delay_insn &= 0xfc00ffff; - delay_insn |= ((31 << 21) | (31 << 16)); - bfd_put_32 (input_bfd, delay_insn, hit_data + 4); - } - /* Use a BLE to reach the stub. */ - insn = BLE_SR4_R0; - } - else - { - /* Wonderful, we have to swap the call insn and its - delay slot. */ - bfd_put_32 (input_bfd, delay_insn, hit_data); - /* Use a BLE,n to reach the stub. */ - insn = (BLE_SR4_R0 | 0x2); - bfd_put_32 (input_bfd, insn, hit_data + 4); - insn = hppa_elf_relocate_insn (input_bfd, - input_section, - insn, offset + 4, - value, addend, - r_format, r_field, - r_pcrel); - /* Update the instruction word. */ - bfd_put_32 (input_bfd, insn, hit_data + 4); - return bfd_reloc_dangerous; - } - } - else - return bfd_reloc_notsupported; - } - } - goto do_basic_type_1; - } - -do_basic_type_1: - insn = hppa_elf_relocate_insn (input_bfd, input_section, insn, - offset, value, addend, r_format, - r_field, r_pcrel); - break; - - /* Something we don't know how to handle. */ - default: - return bfd_reloc_notsupported; + size = 16; } - /* Update the instruction word. */ - bfd_put_32 (input_bfd, insn, hit_data); - return (bfd_reloc_ok); + stub_entry->stub_sec->_raw_size += size; + return true; +} + +/* Return nonzero if ABFD represents an HPPA ELF32 file. + Additionally we set the default architecture and machine. */ + +static boolean +elf32_hppa_object_p (abfd) + bfd *abfd; +{ + unsigned int flags = elf_elfheader (abfd)->e_flags; + + switch (flags & (EF_PARISC_ARCH | EF_PARISC_WIDE)) + { + case EFA_PARISC_1_0: + return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 10); + case EFA_PARISC_1_1: + return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 11); + case EFA_PARISC_2_0: + return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 20); + case EFA_PARISC_2_0 | EF_PARISC_WIDE: + return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 25); + } + return true; } /* Undo the generic ELF code's subtraction of section->vma from the @@ -807,518 +1169,3160 @@ elf32_hppa_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) return true; } -/* Determine the name of the stub needed to perform a call assuming the - argument relocation bits for caller and callee are in CALLER and CALLEE - for a call from LOCATION to DESTINATION. Copy the name into STUB_NAME. */ - -static void -elf32_hppa_name_of_stub (location, destination, stub_name) - bfd_vma location ATTRIBUTE_UNUSED; - bfd_vma destination ATTRIBUTE_UNUSED; - char *stub_name; -{ - strcpy (stub_name, "_____long_branch_stub_"); -} - -/* Compute the size of the stub needed to call from LOCATION to DESTINATION - (a function named SYM_NAME), with argument relocation bits CALLER and - CALLEE. Return zero if no stub is needed to perform such a call. */ - -static unsigned int -elf32_hppa_size_of_stub (location, destination, sym_name) - bfd_vma location, destination; - const char *sym_name; -{ - /* Determine if a long branch stub is needed. */ - if (!(((int)(location - destination) > 0x3ffff) - || ((int)(location - destination) < (int)0xfffc0000))) - return 0; - - if (!strncmp ("$$", sym_name, 2) - && strcmp ("$$dyncall", sym_name)) - return 12; - else - return 16; -} - -/* Build one linker stub as defined by the stub hash table entry GEN_ENTRY. - IN_ARGS contains the stub BFD and link info pointers. */ +/* Create the .plt and .got sections, and set up our hash table + short-cuts to various dynamic sections. */ static boolean -elf32_hppa_build_one_stub (gen_entry, in_args) - struct bfd_hash_entry *gen_entry; - PTR in_args; +elf32_hppa_create_dynamic_sections (abfd, info) + bfd *abfd; + struct bfd_link_info *info; { - void **args = (void **)in_args; - bfd *stub_bfd = (bfd *)args[0]; - struct bfd_link_info *info = (struct bfd_link_info *)args[1]; - struct elf32_hppa_stub_hash_entry *entry; - struct elf32_hppa_stub_hash_table *stub_hash_table; - bfd_byte *loc; - symvalue sym_value; - const char *sym_name; + struct elf32_hppa_link_hash_table *hplink; - /* Initialize pointers to the stub hash table, the particular entry we - are building a stub for, and where (in memory) we should place the stub - instructions. */ - entry = (struct elf32_hppa_stub_hash_entry *)gen_entry; - stub_hash_table = elf32_hppa_hash_table(info)->stub_hash_table; - loc = stub_hash_table->location; + /* Don't try to create the .plt and .got twice. */ + hplink = hppa_link_hash_table (info); + if (hplink->splt != NULL) + return true; - /* Make a note of the offset within the stubs for this entry. */ - entry->offset = stub_hash_table->offset; + /* Call the generic code to do most of the work. */ + if (! _bfd_elf_create_dynamic_sections (abfd, info)) + return false; - /* The symbol's name starts at offset 22. */ - sym_name = entry->root.string + 22; + hplink->splt = bfd_get_section_by_name (abfd, ".plt"); + hplink->srelplt = bfd_get_section_by_name (abfd, ".rela.plt"); - sym_value = (entry->target_value - + entry->target_section->output_offset - + entry->target_section->output_section->vma); + hplink->sgot = bfd_get_section_by_name (abfd, ".got"); + hplink->srelgot = bfd_make_section (abfd, ".rela.got"); + if (hplink->srelgot == NULL + || ! bfd_set_section_flags (abfd, hplink->srelgot, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)) + || ! bfd_set_section_alignment (abfd, hplink->srelgot, 2)) + return false; - if (1) + hplink->sdynbss = bfd_get_section_by_name (abfd, ".dynbss"); + hplink->srelbss = bfd_get_section_by_name (abfd, ".rela.bss"); + + return true; +} + +/* Look through the relocs for a section during the first phase, and + allocate space in the global offset table or procedure linkage + table. At this point we haven't necessarily read all the input + files. */ + +static boolean +elf32_hppa_check_relocs (abfd, info, sec, relocs) + bfd *abfd; + struct bfd_link_info *info; + asection *sec; + const Elf_Internal_Rela *relocs; +{ + bfd *dynobj; + 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; + struct elf32_hppa_link_hash_table *hplink; + asection *sreloc; + asection *stubreloc; + + if (info->relocateable) + return true; + + hplink = hppa_link_hash_table (info); + dynobj = hplink->root.dynobj; + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + local_got_refcounts = elf_local_got_refcounts (abfd); + sreloc = NULL; + stubreloc = NULL; + + rel_end = relocs + sec->reloc_count; + for (rel = relocs; rel < rel_end; rel++) { - /* Create one of two variant long branch stubs. One for $$dyncall and - normal calls, the other for calls to millicode. */ - unsigned long insn; - int millicode_call = 0; + enum { + NEED_GOT = 1, + NEED_PLT = 2, + NEED_DYNREL = 4, +#if LONG_BRANCH_PIC_IN_SHLIB + NEED_STUBREL = 0, /* We won't be needing them in this case. */ +#else + NEED_STUBREL = 8, +#endif + PLT_PLABEL = 16 + }; - if (!strncmp ("$$", sym_name, 2) && strcmp ("$$dyncall", sym_name)) - millicode_call = 1; + unsigned int r_symndx, r_type; + struct elf32_hppa_link_hash_entry *h; + int need_entry; - /* First the return pointer adjustment. Depending on exact calling - sequence this instruction may be skipped. */ - bfd_put_32 (stub_bfd, LDO_M4_R31_R31, loc); + r_symndx = ELF32_R_SYM (rel->r_info); - /* The next two instructions are the long branch itself. A long branch - is formed with "ldil" loading the upper bits of the target address - into a register, then branching with "be" which adds in the lower bits. - Long branches to millicode nullify the delay slot of the "be". */ - insn = hppa_rebuild_insn (stub_bfd, LDIL_R1, - hppa_field_adjust (sym_value, 0, e_lrsel), 21); - bfd_put_32 (stub_bfd, insn, loc + 4); - insn = hppa_rebuild_insn (stub_bfd, BE_SR4_R1 | (millicode_call ? 2 : 0), - hppa_field_adjust (sym_value, 0, e_rrsel) >> 2, - 17); - bfd_put_32 (stub_bfd, insn, loc + 8); + if (r_symndx < symtab_hdr->sh_info) + h = NULL; + else + h = ((struct elf32_hppa_link_hash_entry *) + sym_hashes[r_symndx - symtab_hdr->sh_info]); - if (!millicode_call) + r_type = ELF32_R_TYPE (rel->r_info); + + switch (r_type) { - /* The sequence to call this stub places the return pointer into %r31, - the final target expects the return pointer in %r2, so copy the - return pointer into the proper register. */ - bfd_put_32 (stub_bfd, COPY_R31_R2, loc + 12); + case R_PARISC_DLTIND14F: + case R_PARISC_DLTIND14R: + case R_PARISC_DLTIND21L: + /* This symbol requires a global offset table entry. */ + need_entry = NEED_GOT; - /* Update the location and offsets. */ - stub_hash_table->location += 16; - stub_hash_table->offset += 16; + /* Mark this section as containing PIC code. */ + sec->flags |= SEC_HAS_GOT_REF; + break; + + case R_PARISC_PLABEL14R: /* "Official" procedure labels. */ + case R_PARISC_PLABEL21L: + case R_PARISC_PLABEL32: + /* If the addend is non-zero, we break badly. */ + BFD_ASSERT (rel->r_addend == 0); + + /* If we are creating a shared library, then we need to + create a PLT entry for all PLABELs, because PLABELs with + local symbols may be passed via a pointer to another + object. Additionally, output a dynamic relocation + pointing to the PLT entry. */ + need_entry = PLT_PLABEL | NEED_PLT | NEED_DYNREL; + break; + + case R_PARISC_PCREL12F: + hplink->has_12bit_branch = 1; + /* Fall thru. */ + case R_PARISC_PCREL17C: + case R_PARISC_PCREL17F: + hplink->has_17bit_branch = 1; + /* Fall thru. */ + case R_PARISC_PCREL22F: + /* Function calls might need to go through the .plt, and + might require long branch stubs. */ + if (h == NULL) + { + /* We know local syms won't need a .plt entry, and if + they need a long branch stub we can't guarantee that + we can reach the stub. So just flag an error later + if we're doing a shared link and find we need a long + branch stub. */ + continue; + } + else + { + /* Global symbols will need a .plt entry if they remain + global, and in most cases won't need a long branch + stub. Unfortunately, we have to cater for the case + where a symbol is forced local by versioning, or due + to symbolic linking, and we lose the .plt entry. */ + need_entry = NEED_PLT | NEED_STUBREL; + } + break; + + case R_PARISC_SEGBASE: /* Used to set segment base. */ + case R_PARISC_SEGREL32: /* Relative reloc, used for unwind. */ + case R_PARISC_PCREL14F: /* PC relative load/store. */ + case R_PARISC_PCREL14R: + case R_PARISC_PCREL17R: /* External branches. */ + case R_PARISC_PCREL21L: /* As above, and for load/store too. */ + /* We don't need to propagate the relocation if linking a + shared object since these are section relative. */ + continue; + + case R_PARISC_DPREL14F: /* Used for gp rel data load/store. */ + case R_PARISC_DPREL14R: + case R_PARISC_DPREL21L: + if (info->shared) + { + (*_bfd_error_handler) + (_("%s: relocation %s can not be used when making a shared object; recompile with -fPIC"), + bfd_get_filename (abfd), + elf_hppa_howto_table[r_type].name); + bfd_set_error (bfd_error_bad_value); + return false; + } + /* Fall through. */ + + case R_PARISC_DIR17F: /* Used for external branches. */ + case R_PARISC_DIR17R: + case R_PARISC_DIR14F: /* Used for load/store from absolute locn. */ + case R_PARISC_DIR14R: + case R_PARISC_DIR21L: /* As above, and for ext branches too. */ +#if 1 + /* Help debug shared library creation. Any of the above + relocs can be used in shared libs, but they may cause + pages to become unshared. */ + if (info->shared) + { + (*_bfd_error_handler) + (_("%s: relocation %s should not be used when making a shared object; recompile with -fPIC"), + bfd_get_filename (abfd), + elf_hppa_howto_table[r_type].name); + } + /* Fall through. */ +#endif + + case R_PARISC_DIR32: /* .word relocs. */ + /* We may want to output a dynamic relocation later. */ + need_entry = NEED_DYNREL; + break; + + /* This relocation describes the C++ object vtable hierarchy. + Reconstruct it for later use during GC. */ + case R_PARISC_GNU_VTINHERIT: + if (!_bfd_elf32_gc_record_vtinherit (abfd, sec, + &h->elf, rel->r_offset)) + return false; + continue; + + /* This relocation describes which C++ vtable entries are actually + used. Record for later use during GC. */ + case R_PARISC_GNU_VTENTRY: + if (!_bfd_elf32_gc_record_vtentry (abfd, sec, + &h->elf, rel->r_addend)) + return false; + continue; + + default: + continue; + } + + /* Now carry out our orders. */ + if (need_entry & NEED_GOT) + { + /* Allocate space for a GOT entry, as well as a dynamic + relocation for this entry. */ + if (dynobj == NULL) + hplink->root.dynobj = dynobj = abfd; + + if (hplink->sgot == NULL) + { + if (! elf32_hppa_create_dynamic_sections (dynobj, info)) + return false; + } + + if (h != NULL) + { + if (h->elf.got.refcount == -1) + { + h->elf.got.refcount = 1; + + /* Make sure this symbol is output as a dynamic symbol. */ + if (h->elf.dynindx == -1) + { + if (! bfd_elf32_link_record_dynamic_symbol (info, + &h->elf)) + return false; + } + + hplink->sgot->_raw_size += GOT_ENTRY_SIZE; + hplink->srelgot->_raw_size += sizeof (Elf32_External_Rela); + } + else + h->elf.got.refcount += 1; + } + else + { + /* This is a global offset table entry for a local symbol. */ + if (local_got_refcounts == NULL) + { + size_t size; + + /* Allocate space for local got offsets and local + plt offsets. Done this way to save polluting + elf_obj_tdata with another target specific + pointer. */ + size = symtab_hdr->sh_info * 2 * sizeof (bfd_signed_vma); + local_got_refcounts = ((bfd_signed_vma *) + bfd_alloc (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; + + hplink->sgot->_raw_size += GOT_ENTRY_SIZE; + if (info->shared) + { + /* If we are generating a shared object, we need to + output a reloc so that the dynamic linker can + adjust this GOT entry (because the address + the shared library is loaded at is not fixed). */ + hplink->srelgot->_raw_size += + sizeof (Elf32_External_Rela); + } + } + else + local_got_refcounts[r_symndx] += 1; + } + } + + if (need_entry & NEED_PLT) + { + /* If we are creating a shared library, and this is a reloc + against a weak symbol or a global symbol in a dynamic + object, then we will be creating an import stub and a + .plt entry for the symbol. Similarly, on a normal link + to symbols defined in a dynamic object we'll need the + import stub and a .plt entry. We don't know yet whether + the symbol is defined or not, so make an entry anyway and + clean up later in adjust_dynamic_symbol. */ + if ((sec->flags & SEC_ALLOC) != 0) + { + if (h != NULL) + { + if (h->elf.plt.refcount == -1) + { + h->elf.plt.refcount = 1; + h->elf.elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + } + else + h->elf.plt.refcount += 1; + + /* If this .plt entry is for a plabel, mark it so + that adjust_dynamic_symbol will keep the entry + even if it appears to be local. */ + if (need_entry & PLT_PLABEL) + h->plabel = 1; + } + else if (need_entry & PLT_PLABEL) + { + int indx; + + if (local_got_refcounts == NULL) + { + size_t size; + + /* Allocate space for local got offsets and local + plt offsets. */ + size = symtab_hdr->sh_info * 2 * sizeof (bfd_signed_vma); + local_got_refcounts = ((bfd_signed_vma *) + bfd_alloc (abfd, size)); + if (local_got_refcounts == NULL) + return false; + elf_local_got_refcounts (abfd) = local_got_refcounts; + memset (local_got_refcounts, -1, size); + } + indx = r_symndx + symtab_hdr->sh_info; + if (local_got_refcounts[indx] == -1) + local_got_refcounts[indx] = 1; + else + local_got_refcounts[indx] += 1; + } + } + } + + if (need_entry & (NEED_DYNREL | NEED_STUBREL)) + { + /* Flag this symbol as having a non-got, non-plt reference + so that we generate copy relocs if it turns out to be + dynamic. */ + if (h != NULL) + h->elf.elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; + + /* If we are creating a shared library then we need to copy + the reloc into the shared library. However, if we are + linking with -Bsymbolic, we need only copy absolute + relocs or relocs against symbols that are not defined in + an object we are including in the link. PC- or DP- or + DLT-relative relocs against any local sym or global sym + with DEF_REGULAR set, can be discarded. 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). We account for that possibility below by + storing information in the reloc_entries field of the + hash table entry. + + A similar situation to the -Bsymbolic case occurs when + creating shared libraries and symbol visibility changes + render the symbol local. + + As it turns out, all the relocs we will be creating here + are absolute, so we cannot remove them on -Bsymbolic + links or visibility changes anyway. A STUB_REL reloc + is absolute too, as in that case it is the reloc in the + stub we will be creating, rather than copying the PCREL + reloc in the branch. */ + if ((sec->flags & SEC_ALLOC) != 0 + && info->shared +#if RELATIVE_DYNAMIC_RELOCS + && (!info->symbolic + || is_absolute_reloc (r_type) + || (h != NULL + && ((h->elf.elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0))) +#endif + ) + { + boolean doit; + asection *srel; + + srel = sreloc; + if ((need_entry & NEED_STUBREL)) + srel = stubreloc; + + /* Create a reloc section in dynobj and make room for + this reloc. */ + if (srel == NULL) + { + char *name; + + if (dynobj == NULL) + hplink->root.dynobj = dynobj = abfd; + + name = bfd_elf_string_from_elf_section + (abfd, + elf_elfheader (abfd)->e_shstrndx, + elf_section_data (sec)->rel_hdr.sh_name); + if (name == NULL) + { + (*_bfd_error_handler) + (_("Could not find relocation section for %s"), + sec->name); + bfd_set_error (bfd_error_bad_value); + return false; + } + + if ((need_entry & NEED_STUBREL)) + { + size_t len = strlen (name) + sizeof (STUB_SUFFIX); + char *newname = bfd_malloc (len); + + if (newname == NULL) + return false; + strcpy (newname, name); + strcpy (newname + len - sizeof (STUB_SUFFIX), + STUB_SUFFIX); + name = newname; + } + + srel = bfd_get_section_by_name (dynobj, name); + if (srel == NULL) + { + flagword flags; + + srel = 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 (srel == NULL + || !bfd_set_section_flags (dynobj, srel, flags) + || !bfd_set_section_alignment (dynobj, srel, 2)) + return false; + } + else if ((need_entry & NEED_STUBREL)) + free (name); + + if ((need_entry & NEED_STUBREL)) + stubreloc = srel; + else + sreloc = srel; + } + +#if ! LONG_BRANCH_PIC_IN_SHLIB + /* If this is a function call, we only need one dynamic + reloc for the stub as all calls to a particular + function will go through the same stub. Actually, a + long branch stub needs two relocations, but we count + on some intelligence on the part of the dynamic + linker. */ + if ((need_entry & NEED_STUBREL)) + { + doit = h->stub_reloc_sec != stubreloc; + h->stub_reloc_sec = stubreloc; + } + else +#endif + doit = 1; + + if (doit) + { + srel->_raw_size += sizeof (Elf32_External_Rela); + +#if ! LONG_BRANCH_PIC_IN_SHLIB || RELATIVE_DYNAMIC_RELOCS + /* Keep track of relocations we have entered for + this global symbol, so that we can discard them + later if necessary. */ + if (h != NULL + && (0 +#if RELATIVE_DYNAMIC_RELOCS + || ! is_absolute_reloc (rtype) +#endif + || (need_entry & NEED_STUBREL))) + { + struct elf32_hppa_dyn_reloc_entry *p; + + for (p = h->reloc_entries; p != NULL; p = p->next) + if (p->section == srel) + break; + + if (p == NULL) + { + p = ((struct elf32_hppa_dyn_reloc_entry *) + bfd_alloc (dynobj, sizeof *p)); + if (p == NULL) + return false; + p->next = h->reloc_entries; + h->reloc_entries = p; + p->section = srel; + p->count = 0; + } + + /* NEED_STUBREL and NEED_DYNREL are never both + set. Leave the count at zero for the + NEED_STUBREL case as we only ever have one + stub reloc per section per symbol, and this + simplifies code in hppa_discard_copies. */ + if (! (need_entry & NEED_STUBREL)) + ++p->count; + } +#endif + } + } + } + } + + return true; +} + +/* Return the section that should be marked against garbage collection + for a given relocation. */ + +static asection * +elf32_hppa_gc_mark_hook (abfd, info, rel, h, sym) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + Elf_Internal_Rela *rel; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; +{ + if (h != NULL) + { + switch ((unsigned int) ELF32_R_TYPE (rel->r_info)) + { + case R_PARISC_GNU_VTINHERIT: + case R_PARISC_GNU_VTENTRY: + break; + + default: + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } + } + } + else + { + if (!(elf_bad_symtab (abfd) + && ELF_ST_BIND (sym->st_info) != STB_LOCAL) + && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) + && sym->st_shndx != SHN_COMMON)) + { + return bfd_section_from_elf_index (abfd, sym->st_shndx); + } + } + + return NULL; +} + +/* Update the got and plt entry reference counts for the section being + removed. */ + +static boolean +elf32_hppa_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; + bfd_signed_vma *local_plt_refcounts; + const Elf_Internal_Rela *rel, *relend; + unsigned long r_symndx; + struct elf_link_hash_entry *h; + struct elf32_hppa_link_hash_table *hplink; + bfd *dynobj; + asection *sgot; + asection *srelgot; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + local_got_refcounts = elf_local_got_refcounts (abfd); + local_plt_refcounts = local_got_refcounts; + if (local_plt_refcounts != NULL) + local_plt_refcounts += symtab_hdr->sh_info; + hplink = hppa_link_hash_table (info); + dynobj = hplink->root.dynobj; + if (dynobj == NULL) + return true; + + sgot = hplink->sgot; + srelgot = hplink->srelgot; + + relend = relocs + sec->reloc_count; + for (rel = relocs; rel < relend; rel++) + switch ((unsigned int) ELF32_R_TYPE (rel->r_info)) + { + case R_PARISC_DLTIND14F: + case R_PARISC_DLTIND14R: + case R_PARISC_DLTIND21L: + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + 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 -= GOT_ENTRY_SIZE; + srelgot->_raw_size -= sizeof (Elf32_External_Rela); + } + } + } + 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 -= GOT_ENTRY_SIZE; + if (info->shared) + srelgot->_raw_size -= sizeof (Elf32_External_Rela); + } + } + } + break; + + case R_PARISC_PCREL12F: + case R_PARISC_PCREL17C: + case R_PARISC_PCREL17F: + case R_PARISC_PCREL22F: + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + break; + + case R_PARISC_PLABEL14R: + case R_PARISC_PLABEL21L: + case R_PARISC_PLABEL32: + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + else if (local_plt_refcounts != NULL) + { + if (local_plt_refcounts[r_symndx] > 0) + local_plt_refcounts[r_symndx] -= 1; + } + break; + + default: + break; + } + + return true; +} + +/* Our own version of hide_symbol, so that we can keep plt entries for + plabels. */ + +static void +elf32_hppa_hide_symbol (info, h) + struct bfd_link_info *info ATTRIBUTE_UNUSED; + struct elf_link_hash_entry *h; +{ + h->dynindx = -1; + if (! ((struct elf32_hppa_link_hash_entry *) h)->plabel) + { + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + h->plt.offset = (bfd_vma) -1; + } +} + +/* 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 +elf32_hppa_adjust_dynamic_symbol (info, h) + struct bfd_link_info *info; + struct elf_link_hash_entry *h; +{ + bfd *dynobj; + struct elf32_hppa_link_hash_table *hplink; + asection *s; + + hplink = hppa_link_hash_table (info); + dynobj = hplink->root.dynobj; + + /* 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->plt.refcount > 0 + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 + && (h->root.u.def.section->flags & SEC_HAS_GOT_REF) != 0) + { + ((struct elf32_hppa_link_hash_entry *) h)->maybe_pic_call = 1; + } + + if (h->plt.refcount <= 0 + || ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 + && h->root.type != bfd_link_hash_defweak + && ! ((struct elf32_hppa_link_hash_entry *) h)->plabel + && (!info->shared || info->symbolic))) + { + /* The .plt entry is not needed when: + a) Garbage collection has removed all references to the + symbol, or + b) We know for certain the symbol is defined in this + object, and it's not a weak definition, nor is the symbol + used by a plabel relocation. Either this object is the + application or we are doing a shared symbolic link. */ + + /* As a special sop to the hppa ABI, we keep a .plt entry + for functions in sections containing PIC code. */ + if (((struct elf32_hppa_link_hash_entry *) h)->maybe_pic_call) + ((struct elf32_hppa_link_hash_entry *) h)->pic_call = 1; + else + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + return true; + } + } + + /* Make an entry in the .plt section. */ + s = hplink->splt; + h->plt.offset = s->_raw_size; + if (PLABEL_PLT_ENTRY_SIZE != PLT_ENTRY_SIZE + && ((struct elf32_hppa_link_hash_entry *) h)->plabel + && (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) + { + /* Add some extra space for the dynamic linker to use. */ + s->_raw_size += PLABEL_PLT_ENTRY_SIZE; } else + s->_raw_size += PLT_ENTRY_SIZE; + + if (! ((struct elf32_hppa_link_hash_entry *) h)->pic_call) { - /* Update the location and offsets. */ - stub_hash_table->location += 12; - stub_hash_table->offset += 12; + /* Make sure this symbol is output as a dynamic symbol. */ + 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; + } + + /* We also need to make an entry in the .rela.plt section. */ + s = hplink->srelplt; + s->_raw_size += sizeof (Elf32_External_Rela); + + hplink->need_plt_stub = 1; + } + return true; + } + + /* 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; + + /* 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. */ + + s = hplink->sdynbss; + + /* We must generate a COPY reloc to tell the dynamic linker to + copy the initial value out of the dynamic object and into the + runtime process image. 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) + { + asection *srel; + + srel = hplink->srelbss; + srel->_raw_size += sizeof (Elf32_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 other ELF linkers handle this. */ + unsigned int power_of_two; + + power_of_two = bfd_log2 (h->size); + if (power_of_two > 3) + 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)) + { + if (! bfd_set_section_alignment (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; +} + +/* Called via elf_link_hash_traverse to create .plt entries for an + application that uses statically linked PIC functions. Similar to + the first part of elf32_hppa_adjust_dynamic_symbol. */ + +static boolean +hppa_handle_PIC_calls (h, inf) + struct elf_link_hash_entry *h; + PTR inf; +{ + struct bfd_link_info *info; + bfd *dynobj; + struct elf32_hppa_link_hash_table *hplink; + asection *s; + + if (! (h->plt.refcount > 0 + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && (h->root.u.def.section->flags & SEC_HAS_GOT_REF) != 0)) + { + h->plt.offset = (bfd_vma) -1; + h->elf_link_hash_flags &= ~ELF_LINK_HASH_NEEDS_PLT; + return true; + } + + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + ((struct elf32_hppa_link_hash_entry *) h)->maybe_pic_call = 1; + ((struct elf32_hppa_link_hash_entry *) h)->pic_call = 1; + + info = (struct bfd_link_info *) inf; + hplink = hppa_link_hash_table (info); + dynobj = hplink->root.dynobj; + + /* Make an entry in the .plt section. */ + s = hplink->splt; + h->plt.offset = s->_raw_size; + s->_raw_size += PLT_ENTRY_SIZE; + + return true; +} + +#if ((! LONG_BRANCH_PIC_IN_SHLIB && LONG_BRANCH_VIA_PLT) \ + || RELATIVE_DYNAMIC_RELOCS) +/* This function is called via elf_link_hash_traverse to discard space + we allocated for relocs that it turned out we didn't need. */ + +static boolean +hppa_discard_copies (h, inf) + struct elf_link_hash_entry *h; + PTR inf; +{ + struct elf32_hppa_dyn_reloc_entry *s; + struct elf32_hppa_link_hash_entry *eh; + struct bfd_link_info *info; + + eh = (struct elf32_hppa_link_hash_entry *) h; + info = (struct bfd_link_info *) inf; + +#if ! LONG_BRANCH_PIC_IN_SHLIB && LONG_BRANCH_VIA_PLT + /* Handle the stub reloc case. If we have a plt entry for the + function, we won't be needing long branch stubs. s->count will + only be zero for stub relocs, which provides a handy way of + flagging these relocs, and means we need do nothing special for + the forced local and symbolic link case. */ + if (eh->stub_reloc_sec != NULL + && eh->elf.plt.offset != (bfd_vma) -1) + { + for (s = eh->reloc_entries; s != NULL; s = s->next) + if (s->count == 0) + s->section->_raw_size -= sizeof (Elf32_External_Rela); + } +#endif + +#if RELATIVE_DYNAMIC_RELOCS + /* 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 (eh->elf.dynindx == -1 + || ((eh->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0 + && !is_absolute_reloc (r_type) + && info->symbolic)) + { + for (s = eh->reloc_entries; s != NULL; s = s->next) + s->section->_raw_size -= s->count * sizeof (Elf32_External_Rela); + } +#endif + + return true; +} +#endif + +/* This function is called via elf_link_hash_traverse to force + millicode symbols local so they do not end up as globals in the + dynamic symbol table. We ought to be able to do this in + adjust_dynamic_symbol, but our adjust_dynamic_symbol is not called + for all dynamic symbols. Arguably, this is a bug in + elf_adjust_dynamic_symbol. */ + +static boolean +clobber_millicode_symbols (h, info) + struct elf_link_hash_entry *h; + struct bfd_link_info *info; +{ + /* Note! We only want to remove these from the dynamic symbol + table. Therefore we do not set ELF_LINK_FORCED_LOCAL. */ + if (h->type == STT_PARISC_MILLI) + elf32_hppa_hide_symbol (info, h); + return true; +} + +/* Set the sizes of the dynamic sections. */ + +static boolean +elf32_hppa_size_dynamic_sections (output_bfd, info) + bfd *output_bfd; + struct bfd_link_info *info; +{ + struct elf32_hppa_link_hash_table *hplink; + bfd *dynobj; + asection *s; + boolean relocs; + boolean reltext; + + hplink = hppa_link_hash_table (info); + dynobj = hplink->root.dynobj; + BFD_ASSERT (dynobj != NULL); + + if (hplink->root.dynamic_sections_created) + { + bfd *i; + + /* Set the contents of the .interp section to the interpreter. */ + if (! info->shared) + { + 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; } + /* Force millicode symbols local. */ + elf_link_hash_traverse (&hplink->root, + clobber_millicode_symbols, + info); + + /* Set up .plt offsets for local plabels. */ + for (i = info->input_bfds; i; i = i->link_next) + { + bfd_signed_vma *local_plt; + bfd_signed_vma *end_local_plt; + bfd_size_type locsymcount; + Elf_Internal_Shdr *symtab_hdr; + + local_plt = elf_local_got_refcounts (i); + if (!local_plt) + continue; + + symtab_hdr = &elf_tdata (i)->symtab_hdr; + locsymcount = symtab_hdr->sh_info; + local_plt += locsymcount; + end_local_plt = local_plt + locsymcount; + + for (; local_plt < end_local_plt; ++local_plt) + { + if (*local_plt > 0) + { + s = hplink->splt; + *local_plt = s->_raw_size; + s->_raw_size += PLT_ENTRY_SIZE; + if (info->shared) + hplink->srelplt->_raw_size += sizeof (Elf32_External_Rela); + } + else + *local_plt = (bfd_vma) -1; + } + } } + else + { + /* Run through the function symbols, looking for any that are + PIC, and allocate space for the necessary .plt entries so + that %r19 will be set up. */ + if (! info->shared) + elf_link_hash_traverse (&hplink->root, + hppa_handle_PIC_calls, + info); + + /* We may have created entries in the .rela.got section. + However, if we are not creating the dynamic sections, we will + not actually use these entries. Reset the size of .rela.got, + which will cause it to get stripped from the output file + below. */ + hplink->srelgot->_raw_size = 0; + } + +#if ((! LONG_BRANCH_PIC_IN_SHLIB && LONG_BRANCH_VIA_PLT) \ + || RELATIVE_DYNAMIC_RELOCS) + /* If this is a -Bsymbolic shared link, then we need to discard all + relocs against symbols defined in a regular object. We also need + to lose relocs we've allocated for long branch stubs if we know + we won't be generating a stub. */ + if (info->shared) + elf_link_hash_traverse (&hplink->root, + hppa_discard_copies, + info); +#endif + + /* The check_relocs and adjust_dynamic_symbol entry points have + determined the sizes of the various dynamic sections. Allocate + memory for them. */ + relocs = false; + reltext = false; + for (s = dynobj->sections; s != NULL; s = s->next) + { + const char *name; + + if ((s->flags & SEC_LINKER_CREATED) == 0) + continue; + + /* It's OK to base decisions on the section name, because none + of the dynobj section names depend upon the input files. */ + name = bfd_get_section_name (dynobj, s); + + if (strncmp (name, ".rela", 5) == 0) + { + if (s->_raw_size != 0) + { + asection *target; + const char *outname; + + /* Remember whether there are any reloc sections other + than .rela.plt. */ + if (strcmp (name+5, ".plt") != 0) + 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; + } + } + else if (strcmp (name, ".plt") == 0) + { + if (hplink->need_plt_stub) + { + /* Make space for the plt stub at the end of the .plt + section. We want this stub right at the end, up + against the .got section. */ + int gotalign = bfd_section_alignment (dynobj, hplink->sgot); + int pltalign = bfd_section_alignment (dynobj, s); + bfd_size_type mask; + + if (gotalign > pltalign) + bfd_set_section_alignment (dynobj, s, gotalign); + mask = ((bfd_size_type) 1 << gotalign) - 1; + s->_raw_size = (s->_raw_size + sizeof (plt_stub) + mask) & ~mask; + } + } + else if (strcmp (name, ".got") == 0) + ; + else + { + /* It's not one of our sections, so don't allocate space. */ + continue; + } + + 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. */ + _bfd_strip_section_from_output (info, s); + continue; + } + + /* Allocate memory for the section contents. Zero it, because + we may not fill in all the reloc sections. */ + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); + if (s->contents == NULL && s->_raw_size != 0) + return false; + } + + if (hplink->root.dynamic_sections_created) + { + /* Like IA-64 and HPPA64, always create a DT_PLTGOT. It + actually has nothing to do with the PLT, it is how we + communicate the LTP value of a load module to the dynamic + linker. */ + if (! bfd_elf32_add_dynamic_entry (info, DT_PLTGOT, 0)) + return false; + + /* Add some entries to the .dynamic section. We fill in the + values later, in elf32_hppa_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. */ + if (! info->shared) + { + if (! bfd_elf32_add_dynamic_entry (info, DT_DEBUG, 0)) + return false; + } + + if (hplink->srelplt->_raw_size != 0) + { + if (! 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)) + 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))) + return false; + } + + if (reltext) + { + if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) + return false; + info->flags |= DF_TEXTREL; + } + } + return true; } /* External entry points for sizing and building linker stubs. */ -/* Build all the stubs associated with the current output file. The - stubs are kept in a hash table attached to the main linker hash - table. This is called via hppaelf_finish in the linker. */ - -boolean -elf32_hppa_build_stubs (stub_bfd, info) - bfd *stub_bfd; - struct bfd_link_info *info; -{ - /* The stub BFD only has one section. */ - asection *stub_sec = stub_bfd->sections; - struct elf32_hppa_stub_hash_table *table; - unsigned int size; - void *args[2]; - - /* So we can pass both the BFD for the stubs and the link info - structure to the routine which actually builds stubs. */ - args[0] = stub_bfd; - args[1] = info; - - /* Allocate memory to hold the linker stubs. */ - size = bfd_section_size (stub_bfd, stub_sec); - stub_sec->contents = (unsigned char *) bfd_zalloc (stub_bfd, size); - if (stub_sec->contents == NULL) - return false; - table = elf32_hppa_hash_table(info)->stub_hash_table; - table->location = stub_sec->contents; - - /* Build the stubs as directed by the stub hash table. */ - elf32_hppa_stub_hash_traverse (table, elf32_hppa_build_one_stub, args); - - return true; -} - /* Determine and set the size of the stub section for a final link. The basic idea here is to examine all the relocations looking for PC-relative calls to a target that is unreachable with a "bl" - instruction or calls where the caller and callee disagree on the - location of their arguments or return value. */ + instruction. */ boolean -elf32_hppa_size_stubs (stub_bfd, output_bfd, link_info) +elf32_hppa_size_stubs (output_bfd, stub_bfd, info, multi_subspace, group_size, + add_stub_section, layout_sections_again) + bfd *output_bfd; bfd *stub_bfd; - bfd *output_bfd ATTRIBUTE_UNUSED; - struct bfd_link_info *link_info; + struct bfd_link_info *info; + boolean multi_subspace; + bfd_signed_vma group_size; + asection * (*add_stub_section) PARAMS ((const char *, asection *)); + void (*layout_sections_again) PARAMS ((void)); { bfd *input_bfd; - asection *section, *stub_sec = 0; - Elf_Internal_Shdr *symtab_hdr; + asection *section; + asection **input_list, **list; Elf_Internal_Sym *local_syms, **all_local_syms; - unsigned int i, index, bfd_count = 0; - struct elf32_hppa_stub_hash_table *stub_hash_table = 0; + unsigned int bfd_indx, bfd_count; + int top_id, top_index; + struct elf32_hppa_link_hash_table *hplink; + bfd_size_type stub_group_size; + boolean stubs_always_before_branch; + boolean stub_changed = 0; + boolean ret = 0; - /* Create and initialize the stub hash table. */ - stub_hash_table = ((struct elf32_hppa_stub_hash_table *) - bfd_malloc (sizeof (struct elf32_hppa_stub_hash_table))); - if (!stub_hash_table) - goto error_return; + hplink = hppa_link_hash_table (info); - if (!elf32_hppa_stub_hash_table_init (stub_hash_table, stub_bfd, - elf32_hppa_stub_hash_newfunc)) - goto error_return; - - /* Attach the hash tables to the main hash table. */ - elf32_hppa_hash_table(link_info)->stub_hash_table = stub_hash_table; - - /* Count the number of input BFDs. */ - for (input_bfd = link_info->input_bfds; - input_bfd != NULL; - input_bfd = input_bfd->link_next) - bfd_count++; - - /* Magic as we know the stub bfd only has one section. */ - stub_sec = stub_bfd->sections; - - /* If generating a relocateable output file, then we don't - have to examine the relocs. */ - if (link_info->relocateable) + /* Stash our params away. */ + hplink->stub_bfd = stub_bfd; + hplink->multi_subspace = multi_subspace; + hplink->add_stub_section = add_stub_section; + hplink->layout_sections_again = layout_sections_again; + stubs_always_before_branch = group_size < 0; + if (group_size < 0) + stub_group_size = -group_size; + else + stub_group_size = group_size; + if (stub_group_size == 1) { - for (i = 0; i < bfd_count; i++) - if (all_local_syms[i]) - free (all_local_syms[i]); - free (all_local_syms); - return true; + /* Default values. */ + stub_group_size = 8000000; + if (hplink->has_17bit_branch || hplink->multi_subspace) + stub_group_size = 250000; + if (hplink->has_12bit_branch) + stub_group_size = 7812; } - /* Now that we have argument location information for all the global - functions we can start looking for stubs. */ - for (input_bfd = link_info->input_bfds, index = 0; + /* Count the number of input BFDs and find the top input section id. */ + for (input_bfd = info->input_bfds, bfd_count = 0, top_id = 0; input_bfd != NULL; - input_bfd = input_bfd->link_next, index++) + input_bfd = input_bfd->link_next) { + bfd_count += 1; + for (section = input_bfd->sections; + section != NULL; + section = section->next) + { + if (top_id < section->id) + top_id = section->id; + } + } + + hplink->stub_group + = (struct map_stub *) bfd_zmalloc (sizeof (struct map_stub) * (top_id + 1)); + if (hplink->stub_group == NULL) + return false; + + /* Make a list of input sections for each output section included in + the link. + + We can't use output_bfd->section_count here to find the top output + section index as some sections may have been removed, and + _bfd_strip_section_from_output doesn't renumber the indices. */ + for (section = output_bfd->sections, top_index = 0; + section != NULL; + section = section->next) + { + if (top_index < section->index) + top_index = section->index; + } + + input_list + = (asection **) bfd_malloc (sizeof (asection *) * (top_index + 1)); + if (input_list == NULL) + return false; + + /* For sections we aren't interested in, mark their entries with a + value we can check later. */ + list = input_list + top_index; + do + *list = bfd_abs_section_ptr; + while (list-- != input_list); + + for (section = output_bfd->sections; + section != NULL; + section = section->next) + { + if ((section->flags & SEC_CODE) != 0) + input_list[section->index] = NULL; + } + + /* Now actually build the lists. */ + for (input_bfd = info->input_bfds; + input_bfd != NULL; + input_bfd = input_bfd->link_next) + { + for (section = input_bfd->sections; + section != NULL; + section = section->next) + { + if (section->output_section != NULL + && section->output_section->owner == output_bfd + && section->output_section->index <= top_index) + { + list = input_list + section->output_section->index; + if (*list != bfd_abs_section_ptr) + { + /* Steal the link_sec pointer for our list. */ +#define PREV_SEC(sec) (hplink->stub_group[(sec)->id].link_sec) + /* This happens to make the list in reverse order, + which is what we want. */ + PREV_SEC (section) = *list; + *list = section; + } + } + } + } + + /* See whether we can group stub sections together. Grouping stub + sections may result in fewer stubs. More importantly, we need to + put all .init* and .fini* stubs at the beginning of the .init or + .fini output sections respectively, because glibc splits the + _init and _fini functions into multiple parts. Putting a stub in + the middle of a function is not a good idea. */ + list = input_list + top_index; + do + { + asection *tail = *list; + if (tail == bfd_abs_section_ptr) + continue; + while (tail != NULL) + { + asection *curr; + asection *prev; + bfd_size_type total; + + curr = tail; + if (tail->_cooked_size) + total = tail->_cooked_size; + else + total = tail->_raw_size; + while ((prev = PREV_SEC (curr)) != NULL + && ((total += curr->output_offset - prev->output_offset) + < stub_group_size)) + curr = prev; + + /* OK, the size from the start of CURR to the end is less + than 250000 bytes and thus can be handled by one stub + section. (or the tail section is itself larger than + 250000 bytes, in which case we may be toast.) + We should really be keeping track of the total size of + stubs added here, as stubs contribute to the final output + section size. That's a little tricky, and this way will + only break if stubs added total more than 12144 bytes, or + 1518 long branch stubs. It seems unlikely for more than + 1518 different functions to be called, especially from + code only 250000 bytes long. */ + do + { + prev = PREV_SEC (tail); + /* Set up this stub group. */ + hplink->stub_group[tail->id].link_sec = curr; + } + while (tail != curr && (tail = prev) != NULL); + + /* But wait, there's more! Input sections up to 250000 + bytes before the stub section can be handled by it too. */ + if (!stubs_always_before_branch) + { + total = 0; + while (prev != NULL + && ((total += tail->output_offset - prev->output_offset) + < stub_group_size)) + { + tail = prev; + prev = PREV_SEC (tail); + hplink->stub_group[tail->id].link_sec = curr; + } + } + tail = prev; + } + } + while (list-- != input_list); + free (input_list); +#undef PREV_SEC + + /* We want to read in symbol extension records only once. To do this + we need to read in the local symbols in parallel and save them for + later use; so hold pointers to the local symbols in an array. */ + all_local_syms + = (Elf_Internal_Sym **) bfd_zmalloc (sizeof (Elf_Internal_Sym *) + * bfd_count); + if (all_local_syms == NULL) + return false; + + /* Walk over all the input BFDs, swapping in local symbols. + If we are creating a shared library, create hash entries for the + export stubs. */ + for (input_bfd = info->input_bfds, bfd_indx = 0; + input_bfd != NULL; + input_bfd = input_bfd->link_next, bfd_indx++) + { + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Sym *isym; + Elf32_External_Sym *ext_syms, *esym, *end_sy; + /* We'll need the symbol table in a second. */ symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; if (symtab_hdr->sh_info == 0) continue; - local_syms = all_local_syms[index]; - - /* Walk over each section attached to the input bfd. */ - for (section = input_bfd->sections; - section != NULL; - section = section->next) + /* We need an array of the local symbols attached to the input bfd. + Unfortunately, we're going to have to read & swap them in. */ + local_syms = (Elf_Internal_Sym *) + bfd_malloc (symtab_hdr->sh_info * sizeof (Elf_Internal_Sym)); + if (local_syms == NULL) { - Elf_Internal_Shdr *input_rel_hdr; - Elf32_External_Rela *external_relocs, *erelaend, *erela; - Elf_Internal_Rela *internal_relocs, *irelaend, *irela; + goto error_ret_free_local; + } + all_local_syms[bfd_indx] = local_syms; + ext_syms = (Elf32_External_Sym *) + bfd_malloc (symtab_hdr->sh_info * sizeof (Elf32_External_Sym)); + if (ext_syms == NULL) + { + goto error_ret_free_local; + } - /* If there aren't any relocs, then there's nothing to do. */ - if ((section->flags & SEC_RELOC) == 0 - || section->reloc_count == 0) + if (bfd_seek (input_bfd, symtab_hdr->sh_offset, SEEK_SET) != 0 + || (bfd_read (ext_syms, 1, + (symtab_hdr->sh_info * sizeof (Elf32_External_Sym)), + input_bfd) + != (symtab_hdr->sh_info * sizeof (Elf32_External_Sym)))) + { + free (ext_syms); + goto error_ret_free_local; + } + + /* Swap the local symbols in. */ + isym = local_syms; + esym = ext_syms; + for (end_sy = esym + symtab_hdr->sh_info; esym < end_sy; esym++, isym++) + bfd_elf32_swap_symbol_in (input_bfd, esym, isym); + + /* Now we can free the external symbols. */ + free (ext_syms); + +#if ! LONG_BRANCH_PIC_IN_SHLIB + /* If this is a shared link, find all the stub reloc sections. */ + if (info->shared) + for (section = input_bfd->sections; + section != NULL; + section = section->next) + { + char *name; + asection *reloc_sec; + + name = bfd_malloc (strlen (section->name) + + sizeof STUB_SUFFIX + + 5); + if (name == NULL) + return false; + sprintf (name, ".rela%s%s", section->name, STUB_SUFFIX); + reloc_sec = bfd_get_section_by_name (hplink->root.dynobj, name); + hplink->stub_group[section->id].reloc_sec = reloc_sec; + free (name); + } +#endif + + if (info->shared && hplink->multi_subspace) + { + struct elf_link_hash_entry **sym_hashes; + struct elf_link_hash_entry **end_hashes; + unsigned int symcount; + + symcount = (symtab_hdr->sh_size / sizeof (Elf32_External_Sym) + - symtab_hdr->sh_info); + sym_hashes = elf_sym_hashes (input_bfd); + end_hashes = sym_hashes + symcount; + + /* Look through the global syms for functions; We need to + build export stubs for all globally visible functions. */ + for (; sym_hashes < end_hashes; sym_hashes++) + { + struct elf32_hppa_link_hash_entry *hash; + + hash = (struct elf32_hppa_link_hash_entry *) *sym_hashes; + + while (hash->elf.root.type == bfd_link_hash_indirect + || hash->elf.root.type == bfd_link_hash_warning) + hash = ((struct elf32_hppa_link_hash_entry *) + hash->elf.root.u.i.link); + + /* At this point in the link, undefined syms have been + resolved, so we need to check that the symbol was + defined in this BFD. */ + if ((hash->elf.root.type == bfd_link_hash_defined + || hash->elf.root.type == bfd_link_hash_defweak) + && hash->elf.type == STT_FUNC + && hash->elf.root.u.def.section->output_section != NULL + && (hash->elf.root.u.def.section->output_section->owner + == output_bfd) + && hash->elf.root.u.def.section->owner == input_bfd + && (hash->elf.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) + && !(hash->elf.elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) + && ELF_ST_VISIBILITY (hash->elf.other) == STV_DEFAULT) + { + asection *sec; + const char *stub_name; + struct elf32_hppa_stub_hash_entry *stub_entry; + + sec = hash->elf.root.u.def.section; + stub_name = hash->elf.root.root.string; + stub_entry = hppa_stub_hash_lookup (&hplink->stub_hash_table, + stub_name, + false, false); + if (stub_entry == NULL) + { + stub_entry = hppa_add_stub (stub_name, sec, hplink); + if (!stub_entry) + goto error_ret_free_local; + + stub_entry->target_value = hash->elf.root.u.def.value; + stub_entry->target_section = hash->elf.root.u.def.section; + stub_entry->stub_type = hppa_stub_export; + stub_entry->h = hash; + stub_changed = 1; + } + else + { + (*_bfd_error_handler) (_("%s: duplicate export stub %s"), + bfd_get_filename (input_bfd), + stub_name); + } + } + } + } + } + + while (1) + { + asection *stub_sec; + + for (input_bfd = info->input_bfds, bfd_indx = 0; + input_bfd != NULL; + input_bfd = input_bfd->link_next, bfd_indx++) + { + Elf_Internal_Shdr *symtab_hdr; + + /* We'll need the symbol table in a second. */ + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + if (symtab_hdr->sh_info == 0) continue; - /* Allocate space for the external relocations. */ - external_relocs - = ((Elf32_External_Rela *) - bfd_malloc (section->reloc_count - * sizeof (Elf32_External_Rela))); - if (external_relocs == NULL) + local_syms = all_local_syms[bfd_indx]; + + /* Walk over each section attached to the input bfd. */ + for (section = input_bfd->sections; + section != NULL; + section = section->next) { - for (i = 0; i < bfd_count; i++) - if (all_local_syms[i]) - free (all_local_syms[i]); - free (all_local_syms); - goto error_return; - } + Elf_Internal_Shdr *input_rel_hdr; + Elf32_External_Rela *external_relocs, *erelaend, *erela; + Elf_Internal_Rela *internal_relocs, *irelaend, *irela; - /* Likewise for the internal relocations. */ - internal_relocs - = ((Elf_Internal_Rela *) - bfd_malloc (section->reloc_count * sizeof (Elf_Internal_Rela))); - if (internal_relocs == NULL) - { - free (external_relocs); - for (i = 0; i < bfd_count; i++) - if (all_local_syms[i]) - free (all_local_syms[i]); - free (all_local_syms); - goto error_return; - } - - /* Read in the external relocs. */ - input_rel_hdr = &elf_section_data (section)->rel_hdr; - if (bfd_seek (input_bfd, input_rel_hdr->sh_offset, SEEK_SET) != 0 - || bfd_read (external_relocs, 1, input_rel_hdr->sh_size, - input_bfd) != input_rel_hdr->sh_size) - { - free (external_relocs); - free (internal_relocs); - for (i = 0; i < bfd_count; i++) - if (all_local_syms[i]) - free (all_local_syms[i]); - free (all_local_syms); - goto error_return; - } - - /* Swap in the relocs. */ - erela = external_relocs; - erelaend = erela + section->reloc_count; - irela = internal_relocs; - for (; erela < erelaend; erela++, irela++) - bfd_elf32_swap_reloca_in (input_bfd, erela, irela); - - /* We're done with the external relocs, free them. */ - free (external_relocs); - - /* Now examine each relocation. */ - irela = internal_relocs; - irelaend = irela + section->reloc_count; - for (; irela < irelaend; irela++) - { - long r_type, size_of_stub; - unsigned long r_index; - struct elf_link_hash_entry *hash; - struct elf32_hppa_stub_hash_entry *stub_hash; - Elf_Internal_Sym *sym; - asection *sym_sec; - const char *sym_name; - symvalue sym_value; - bfd_vma location, destination; - char *new_name = NULL; - - r_type = ELF32_R_TYPE (irela->r_info); - r_index = ELF32_R_SYM (irela->r_info); - - if (r_type < 0 || r_type >= (int) R_PARISC_UNIMPLEMENTED) - { - bfd_set_error (bfd_error_bad_value); - free (internal_relocs); - for (i = 0; i < bfd_count; i++) - if (all_local_syms[i]) - free (all_local_syms[i]); - free (all_local_syms); - goto error_return; - } - - /* Only look for stubs on call instructions or plabel - references. */ - if (r_type != R_PARISC_PCREL17F - && r_type != R_PARISC_PLABEL32 - && r_type != R_PARISC_PLABEL21L - && r_type != R_PARISC_PLABEL14R) + /* If there aren't any relocs, then there's nothing more + to do. */ + if ((section->flags & SEC_RELOC) == 0 + || section->reloc_count == 0) continue; - /* Now determine the call target, its name, value, section - and argument relocation bits. */ - hash = NULL; - sym = NULL; - sym_sec = NULL; - if (r_index < symtab_hdr->sh_info) + /* If this section is a link-once section that will be + discarded, then don't create any stubs. */ + if (section->output_section == NULL + || section->output_section->owner != output_bfd) + continue; + + /* Allocate space for the external relocations. */ + external_relocs + = ((Elf32_External_Rela *) + bfd_malloc (section->reloc_count + * sizeof (Elf32_External_Rela))); + if (external_relocs == NULL) { - /* It's a local symbol. */ - Elf_Internal_Shdr *hdr; - - sym = local_syms + r_index; - hdr = elf_elfsections (input_bfd)[sym->st_shndx]; - sym_sec = hdr->bfd_section; - sym_name = bfd_elf_string_from_elf_section (input_bfd, - symtab_hdr->sh_link, - sym->st_name); - sym_value = (ELF_ST_TYPE (sym->st_info) == STT_SECTION - ? 0 : sym->st_value); - destination = (sym_value - + sym_sec->output_offset - + sym_sec->output_section->vma); - - /* Tack on an ID so we can uniquely identify this local - symbol in the stub or arg info hash tables. */ - new_name = bfd_malloc (strlen (sym_name) + 10); - if (new_name == 0) - { - free (internal_relocs); - for (i = 0; i < bfd_count; i++) - if (all_local_syms[i]) - free (all_local_syms[i]); - free (all_local_syms); - goto error_return; - } - sprintf (new_name, "%s_%08x", sym_name, (int)sym_sec); - sym_name = new_name; + goto error_ret_free_local; } - else - { - /* It's an external symbol. */ - long index; - index = r_index - symtab_hdr->sh_info; - hash = elf_sym_hashes (input_bfd)[index]; - if (hash->root.type == bfd_link_hash_defined - || hash->root.type == bfd_link_hash_defweak) + /* Likewise for the internal relocations. */ + internal_relocs = ((Elf_Internal_Rela *) + bfd_malloc (section->reloc_count + * sizeof (Elf_Internal_Rela))); + if (internal_relocs == NULL) + { + free (external_relocs); + goto error_ret_free_local; + } + + /* Read in the external relocs. */ + input_rel_hdr = &elf_section_data (section)->rel_hdr; + if (bfd_seek (input_bfd, input_rel_hdr->sh_offset, SEEK_SET) != 0 + || bfd_read (external_relocs, 1, + input_rel_hdr->sh_size, + input_bfd) != input_rel_hdr->sh_size) + { + free (external_relocs); + error_ret_free_internal: + free (internal_relocs); + goto error_ret_free_local; + } + + /* Swap in the relocs. */ + erela = external_relocs; + erelaend = erela + section->reloc_count; + irela = internal_relocs; + for (; erela < erelaend; erela++, irela++) + bfd_elf32_swap_reloca_in (input_bfd, erela, irela); + + /* We're done with the external relocs, free them. */ + free (external_relocs); + + /* Now examine each relocation. */ + irela = internal_relocs; + irelaend = irela + section->reloc_count; + for (; irela < irelaend; irela++) + { + unsigned int r_type, r_indx; + enum elf32_hppa_stub_type stub_type; + struct elf32_hppa_stub_hash_entry *stub_entry; + asection *sym_sec; + bfd_vma sym_value; + bfd_vma destination; + struct elf32_hppa_link_hash_entry *hash; + char *stub_name; + const asection *id_sec; + + r_type = ELF32_R_TYPE (irela->r_info); + r_indx = ELF32_R_SYM (irela->r_info); + + if (r_type >= (unsigned int) R_PARISC_UNIMPLEMENTED) { - sym_sec = hash->root.u.def.section; - sym_name = hash->root.root.string; - sym_value = hash->root.u.def.value; - destination = (sym_value + bfd_set_error (bfd_error_bad_value); + goto error_ret_free_internal; + } + + /* Only look for stubs on call instructions. */ + if (r_type != (unsigned int) R_PARISC_PCREL12F + && r_type != (unsigned int) R_PARISC_PCREL17F + && r_type != (unsigned int) R_PARISC_PCREL22F) + continue; + + /* Now determine the call target, its name, value, + section. */ + sym_sec = NULL; + sym_value = 0; + destination = 0; + hash = NULL; + if (r_indx < symtab_hdr->sh_info) + { + /* It's a local symbol. */ + Elf_Internal_Sym *sym; + Elf_Internal_Shdr *hdr; + + sym = local_syms + r_indx; + hdr = elf_elfsections (input_bfd)[sym->st_shndx]; + sym_sec = hdr->bfd_section; + if (ELF_ST_TYPE (sym->st_info) != STT_SECTION) + sym_value = sym->st_value; + destination = (sym_value + irela->r_addend + sym_sec->output_offset + sym_sec->output_section->vma); } else { - bfd_set_error (bfd_error_bad_value); - free (internal_relocs); - for (i = 0; i < bfd_count; i++) - if (all_local_syms[i]) - free (all_local_syms[i]); - free (all_local_syms); - goto error_return; + /* It's an external symbol. */ + int e_indx; + + e_indx = r_indx - symtab_hdr->sh_info; + hash = ((struct elf32_hppa_link_hash_entry *) + elf_sym_hashes (input_bfd)[e_indx]); + + while (hash->elf.root.type == bfd_link_hash_indirect + || hash->elf.root.type == bfd_link_hash_warning) + hash = ((struct elf32_hppa_link_hash_entry *) + hash->elf.root.u.i.link); + + if (hash->elf.root.type == bfd_link_hash_defined + || hash->elf.root.type == bfd_link_hash_defweak) + { + sym_sec = hash->elf.root.u.def.section; + sym_value = hash->elf.root.u.def.value; + if (sym_sec->output_section != NULL) + destination = (sym_value + irela->r_addend + + sym_sec->output_offset + + sym_sec->output_section->vma); + } + else if (hash->elf.root.type == bfd_link_hash_undefweak) + { + if (! info->shared) + continue; + } + else if (hash->elf.root.type == bfd_link_hash_undefined) + { + if (! (info->shared + && !info->no_undefined + && (ELF_ST_VISIBILITY (hash->elf.other) + == STV_DEFAULT))) + continue; + } + else + { + bfd_set_error (bfd_error_bad_value); + goto error_ret_free_internal; + } } - } - /* Now determine where the call point is. */ - location = (section->output_offset - + section->output_section->vma - + irela->r_offset); + /* Determine what (if any) linker stub is needed. */ + stub_type = hppa_type_of_stub (section, irela, hash, + destination); + if (stub_type == hppa_stub_none) + continue; - /* We only care about the destination for PCREL function - calls (eg. we don't care for PLABELS). */ - if (r_type != R_PARISC_PCREL17F) - location = destination; - - /* Determine what (if any) linker stub is needed and its - size (in bytes). */ - size_of_stub = elf32_hppa_size_of_stub (location, - destination, - sym_name); - if (size_of_stub != 0) - { - char *stub_name; - unsigned int len; + /* Support for grouping stub sections. */ + id_sec = hplink->stub_group[section->id].link_sec; /* Get the name of this stub. */ - len = strlen (sym_name); - len += 23; - - stub_name = bfd_malloc (len); + stub_name = hppa_stub_name (id_sec, sym_sec, hash, irela); if (!stub_name) + goto error_ret_free_internal; + + stub_entry = hppa_stub_hash_lookup (&hplink->stub_hash_table, + stub_name, + false, false); + if (stub_entry != NULL) { - /* Because sym_name was mallocd above for local - symbols. */ - if (r_index < symtab_hdr->sh_info) - free (new_name); - - free (internal_relocs); - for (i = 0; i < bfd_count; i++) - if (all_local_syms[i]) - free (all_local_syms[i]); - free (all_local_syms); - goto error_return; - } - elf32_hppa_name_of_stub (location, destination, stub_name); - strcat (stub_name + 22, sym_name); - - /* Because sym_name was malloced above for local symbols. */ - if (r_index < symtab_hdr->sh_info) - free (new_name); - - stub_hash - = elf32_hppa_stub_hash_lookup (stub_hash_table, stub_name, - false, false); - if (stub_hash != NULL) - { - /* The proper stub has already been created, nothing - else to do. */ + /* The proper stub has already been created. */ free (stub_name); + continue; } - else + + stub_entry = hppa_add_stub (stub_name, section, hplink); + if (stub_entry == NULL) { - bfd_set_section_size (stub_bfd, stub_sec, - (bfd_section_size (stub_bfd, - stub_sec) - + size_of_stub)); - - /* Enter this entry into the linker stub hash table. */ - stub_hash - = elf32_hppa_stub_hash_lookup (stub_hash_table, - stub_name, true, true); - if (stub_hash == NULL) - { - free (stub_name); - free (internal_relocs); - for (i = 0; i < bfd_count; i++) - if (all_local_syms[i]) - free (all_local_syms[i]); - free (all_local_syms); - goto error_return; - } - - /* We'll need these to determine the address that the - stub will branch to. */ - stub_hash->target_value = sym_value; - stub_hash->target_section = sym_sec; + free (stub_name); + goto error_ret_free_local; } - free (stub_name); + + stub_entry->target_value = sym_value; + stub_entry->target_section = sym_sec; + stub_entry->stub_type = stub_type; + if (info->shared) + { + if (stub_type == hppa_stub_import) + stub_entry->stub_type = hppa_stub_import_shared; + else if (stub_type == hppa_stub_long_branch + && (LONG_BRANCH_PIC_IN_SHLIB || hash == NULL)) + stub_entry->stub_type = hppa_stub_long_branch_shared; + } + stub_entry->h = hash; + stub_changed = 1; } + + /* We're done with the internal relocs, free them. */ + free (internal_relocs); } - /* We're done with the internal relocs, free them. */ - free (internal_relocs); + } + + if (!stub_changed) + break; + + /* OK, we've added some stubs. Find out the new size of the + stub sections. */ + for (stub_sec = hplink->stub_bfd->sections; + stub_sec != NULL; + stub_sec = stub_sec->next) + { + stub_sec->_raw_size = 0; + stub_sec->_cooked_size = 0; + } +#if ! LONG_BRANCH_PIC_IN_SHLIB + { + int i; + + for (i = top_id; i >= 0; --i) + { + /* This will probably hit the same section many times.. */ + stub_sec = hplink->stub_group[i].reloc_sec; + if (stub_sec != NULL) + { + stub_sec->_raw_size = 0; + stub_sec->_cooked_size = 0; + } + } + } +#endif + + bfd_hash_traverse (&hplink->stub_hash_table, + hppa_size_one_stub, + hplink); + + /* Ask the linker to do its stuff. */ + (*hplink->layout_sections_again) (); + stub_changed = 0; + } + + ret = 1; + + error_ret_free_local: + while (bfd_count-- > 0) + if (all_local_syms[bfd_count]) + free (all_local_syms[bfd_count]); + free (all_local_syms); + + return ret; +} + +/* For a final link, this function is called after we have sized the + stubs to provide a value for __gp. */ + +boolean +elf32_hppa_set_gp (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + struct elf32_hppa_link_hash_table *hplink; + struct elf_link_hash_entry *h; + asection *sec; + bfd_vma gp_val; + + hplink = hppa_link_hash_table (info); + h = elf_link_hash_lookup (&hplink->root, "$global$", + false, false, false); + + if (h != NULL + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak)) + { + gp_val = h->root.u.def.value; + sec = h->root.u.def.section; + } + else + { + /* Choose to point our LTP at, in this order, one of .plt, .got, + or .data, if these sections exist. In the case of choosing + .plt try to make the LTP ideal for addressing anywhere in the + .plt or .got with a 14 bit signed offset. Typically, the end + of the .plt is the start of the .got, so choose .plt + 0x2000 + if either the .plt or .got is larger than 0x2000. If both + the .plt and .got are smaller than 0x2000, choose the end of + the .plt section. */ + + sec = hplink->splt; + if (sec != NULL) + { + gp_val = sec->_raw_size; + if (gp_val > 0x2000 + || (hplink->sgot && hplink->sgot->_raw_size > 0x2000)) + { + gp_val = 0x2000; + } + } + else + { + gp_val = 0; + sec = hplink->sgot; + if (sec != NULL) + { + /* We know we don't have a .plt. If .got is large, + offset our LTP. */ + if (sec->_raw_size > 0x2000) + gp_val = 0x2000; + } + else + { + /* No .plt or .got. Who cares what the LTP is? */ + sec = bfd_get_section_by_name (abfd, ".data"); + } + } + + if (h != NULL) + { + h->root.type = bfd_link_hash_defined; + h->root.u.def.value = gp_val; + if (sec != NULL) + h->root.u.def.section = sec; + else + h->root.u.def.section = bfd_abs_section_ptr; } } - /* We're done with the local symbols, free them. */ - for (i = 0; i < bfd_count; i++) - if (all_local_syms[i]) - free (all_local_syms[i]); - free (all_local_syms); - return true; -error_return: - /* Return gracefully, avoiding dangling references to the hash tables. */ - if (stub_hash_table) + if (sec != NULL && sec->output_section != NULL) + gp_val += sec->output_section->vma + sec->output_offset; + + elf_gp (abfd) = gp_val; + return true; +} + +/* Build all the stubs associated with the current output file. The + stubs are kept in a hash table attached to the main linker hash + table. We also set up the .plt entries for statically linked PIC + functions here. This function is called via hppaelf_finish in the + linker. */ + +boolean +elf32_hppa_build_stubs (info) + struct bfd_link_info *info; +{ + asection *stub_sec; + struct bfd_hash_table *table; + struct elf32_hppa_link_hash_table *hplink; + + hplink = hppa_link_hash_table (info); + + for (stub_sec = hplink->stub_bfd->sections; + stub_sec != NULL; + stub_sec = stub_sec->next) { - elf32_hppa_hash_table(link_info)->stub_hash_table = NULL; - free (stub_hash_table); + size_t size; + + /* Allocate memory to hold the linker stubs. */ + size = stub_sec->_raw_size; + stub_sec->contents = (unsigned char *) bfd_zalloc (hplink->stub_bfd, + size); + if (stub_sec->contents == NULL && size != 0) + return false; + stub_sec->_raw_size = 0; } - /* Set the size of the stub section to zero since we're never going - to create them. Avoids losing when we try to get its contents - too. */ - bfd_set_section_size (stub_bfd, stub_sec, 0); - return false; + + /* Build the stubs as directed by the stub hash table. */ + table = &hplink->stub_hash_table; + bfd_hash_traverse (table, hppa_build_one_stub, info); + + return true; +} + +/* Perform a final link. */ + +static boolean +elf32_hppa_final_link (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + asection *s; + + /* Invoke the regular ELF garbage collecting linker to do all the + work. */ + if (!_bfd_elf32_gc_common_final_link (abfd, info)) + return false; + + /* If we're producing a final executable, sort the contents of the + unwind section. Magic section names, but this is much safer than + having elf32_hppa_relocate_section remember where SEGREL32 relocs + occurred. Consider what happens if someone inept creates a + linker script that puts unwind information in .text. */ + s = bfd_get_section_by_name (abfd, ".PARISC.unwind"); + if (s != NULL) + { + bfd_size_type size; + char *contents; + + size = s->_raw_size; + contents = bfd_malloc (size); + if (contents == NULL) + return false; + + if (! bfd_get_section_contents (abfd, s, contents, (file_ptr) 0, size)) + return false; + + qsort (contents, size / 16, 16, hppa_unwind_entry_compare); + + if (! bfd_set_section_contents (abfd, s, contents, (file_ptr) 0, size)) + return false; + } + return true; +} + +/* Record the lowest address for the data and text segments. */ + +static void +hppa_record_segment_addr (abfd, section, data) + bfd *abfd ATTRIBUTE_UNUSED; + asection *section; + PTR data; +{ + struct elf32_hppa_link_hash_table *hplink; + + hplink = (struct elf32_hppa_link_hash_table *) data; + + if ((section->flags & (SEC_ALLOC | SEC_LOAD)) == (SEC_ALLOC | SEC_LOAD)) + { + bfd_vma value = section->vma - section->filepos; + + if ((section->flags & SEC_READONLY) != 0) + { + if (value < hplink->text_segment_base) + hplink->text_segment_base = value; + } + else + { + if (value < hplink->data_segment_base) + hplink->data_segment_base = value; + } + } +} + +/* Perform a relocation as part of a final link. */ + +static bfd_reloc_status_type +final_link_relocate (input_section, contents, rel, value, hplink, sym_sec, h) + asection *input_section; + bfd_byte *contents; + const Elf_Internal_Rela *rel; + bfd_vma value; + struct elf32_hppa_link_hash_table *hplink; + asection *sym_sec; + struct elf32_hppa_link_hash_entry *h; +{ + int insn; + unsigned int r_type = ELF32_R_TYPE (rel->r_info); + reloc_howto_type *howto = elf_hppa_howto_table + r_type; + int r_format = howto->bitsize; + enum hppa_reloc_field_selector_type_alt r_field; + bfd *input_bfd = input_section->owner; + bfd_vma offset = rel->r_offset; + bfd_vma max_branch_offset = 0; + bfd_byte *hit_data = contents + offset; + bfd_signed_vma addend = rel->r_addend; + bfd_vma location; + struct elf32_hppa_stub_hash_entry *stub_entry = NULL; + int val; + + if (r_type == R_PARISC_NONE) + return bfd_reloc_ok; + + insn = bfd_get_32 (input_bfd, hit_data); + + /* Find out where we are and where we're going. */ + location = (offset + + input_section->output_offset + + input_section->output_section->vma); + + switch (r_type) + { + case R_PARISC_PCREL12F: + case R_PARISC_PCREL17F: + case R_PARISC_PCREL22F: + /* If this is a call to a function defined in another dynamic + library, or if it is a call to a PIC function in the same + object, or if this is a shared link and it is a call to a + weak symbol which may or may not be in the same object, then + find the import stub in the stub hash. */ + if (sym_sec == NULL + || sym_sec->output_section == NULL + || (h != NULL + && ((h->maybe_pic_call + && !(input_section->flags & SEC_HAS_GOT_REF)) + || (h->elf.root.type == bfd_link_hash_defweak + && h->elf.dynindx != -1 + && h->elf.plt.offset != (bfd_vma) -1)))) + { + stub_entry = hppa_get_stub_entry (input_section, sym_sec, + h, rel, hplink); + if (stub_entry != NULL) + { + value = (stub_entry->stub_offset + + stub_entry->stub_sec->output_offset + + stub_entry->stub_sec->output_section->vma); + addend = 0; + } + else if (sym_sec == NULL && h != NULL + && h->elf.root.type == bfd_link_hash_undefweak) + { + /* It's OK if undefined weak. Make undefined weak + branches go nowhere. */ + value = location; + addend = 0; + } + else + return bfd_reloc_notsupported; + } + /* Fall thru. */ + + case R_PARISC_PCREL21L: + case R_PARISC_PCREL17C: + case R_PARISC_PCREL17R: + case R_PARISC_PCREL14R: + case R_PARISC_PCREL14F: + /* Make it a pc relative offset. */ + value -= location; + addend -= 8; + break; + + case R_PARISC_DPREL21L: + case R_PARISC_DPREL14R: + case R_PARISC_DPREL14F: + /* For all the DP relative relocations, we need to examine the symbol's + section. If it's a code section, then "data pointer relative" makes + no sense. In that case we don't adjust the "value", and for 21 bit + addil instructions, we change the source addend register from %dp to + %r0. This situation commonly arises when a variable's "constness" + is declared differently from the way the variable is defined. For + instance: "extern int foo" with foo defined as "const int foo". */ + if (sym_sec == NULL) + break; + if ((sym_sec->flags & SEC_CODE) != 0) + { + if ((insn & ((0x3f << 26) | (0x1f << 21))) + == (((int) OP_ADDIL << 26) | (27 << 21))) + { + insn &= ~ (0x1f << 21); +#if 1 /* debug them. */ + (*_bfd_error_handler) + (_("%s(%s+0x%lx): fixing %s"), + bfd_get_filename (input_bfd), + input_section->name, + (long) rel->r_offset, + howto->name); +#endif + } + /* Now try to make things easy for the dynamic linker. */ + + break; + } + /* Fall thru. */ + + case R_PARISC_DLTIND21L: + case R_PARISC_DLTIND14R: + case R_PARISC_DLTIND14F: + value -= elf_gp (input_section->output_section->owner); + break; + + case R_PARISC_SEGREL32: + if ((sym_sec->flags & SEC_CODE) != 0) + value -= hplink->text_segment_base; + else + value -= hplink->data_segment_base; + break; + + default: + break; + } + + switch (r_type) + { + case R_PARISC_DIR32: + case R_PARISC_DIR14F: + case R_PARISC_DIR17F: + case R_PARISC_PCREL17C: + case R_PARISC_PCREL14F: + case R_PARISC_DPREL14F: + case R_PARISC_PLABEL32: + case R_PARISC_DLTIND14F: + case R_PARISC_SEGBASE: + case R_PARISC_SEGREL32: + r_field = e_fsel; + break; + + case R_PARISC_DIR21L: + case R_PARISC_PCREL21L: + case R_PARISC_DPREL21L: + case R_PARISC_PLABEL21L: + case R_PARISC_DLTIND21L: + r_field = e_lrsel; + break; + + case R_PARISC_DIR17R: + case R_PARISC_PCREL17R: + case R_PARISC_DIR14R: + case R_PARISC_PCREL14R: + case R_PARISC_DPREL14R: + case R_PARISC_PLABEL14R: + case R_PARISC_DLTIND14R: + r_field = e_rrsel; + break; + + case R_PARISC_PCREL12F: + case R_PARISC_PCREL17F: + case R_PARISC_PCREL22F: + r_field = e_fsel; + + if (r_type == (unsigned int) R_PARISC_PCREL17F) + { + max_branch_offset = (1 << (17-1)) << 2; + } + else if (r_type == (unsigned int) R_PARISC_PCREL12F) + { + max_branch_offset = (1 << (12-1)) << 2; + } + else + { + max_branch_offset = (1 << (22-1)) << 2; + } + + /* sym_sec is NULL on undefined weak syms or when shared on + undefined syms. We've already checked for a stub for the + shared undefined case. */ + if (sym_sec == NULL) + break; + + /* If the branch is out of reach, then redirect the + call to the local stub for this function. */ + if (value + addend + max_branch_offset >= 2*max_branch_offset) + { + stub_entry = hppa_get_stub_entry (input_section, sym_sec, + h, rel, hplink); + if (stub_entry == NULL) + return bfd_reloc_notsupported; + + /* Munge up the value and addend so that we call the stub + rather than the procedure directly. */ + value = (stub_entry->stub_offset + + stub_entry->stub_sec->output_offset + + stub_entry->stub_sec->output_section->vma + - location); + addend = -8; + } + break; + + /* Something we don't know how to handle. */ + default: + return bfd_reloc_notsupported; + } + + /* Make sure we can reach the stub. */ + if (max_branch_offset != 0 + && value + addend + max_branch_offset >= 2*max_branch_offset) + { + (*_bfd_error_handler) + (_("%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections"), + bfd_get_filename (input_bfd), + input_section->name, + (long) rel->r_offset, + stub_entry->root.string); + return bfd_reloc_notsupported; + } + + val = hppa_field_adjust (value, addend, r_field); + + switch (r_type) + { + case R_PARISC_PCREL12F: + case R_PARISC_PCREL17C: + case R_PARISC_PCREL17F: + case R_PARISC_PCREL17R: + case R_PARISC_PCREL22F: + case R_PARISC_DIR17F: + case R_PARISC_DIR17R: + /* This is a branch. Divide the offset by four. + Note that we need to decide whether it's a branch or + otherwise by inspecting the reloc. Inspecting insn won't + work as insn might be from a .word directive. */ + val >>= 2; + break; + + default: + break; + } + + insn = hppa_rebuild_insn (insn, val, r_format); + + /* Update the instruction word. */ + bfd_put_32 (input_bfd, (bfd_vma) insn, hit_data); + return bfd_reloc_ok; +} + +/* Relocate an HPPA ELF section. */ + +static boolean +elf32_hppa_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; +{ + bfd *dynobj; + bfd_vma *local_got_offsets; + struct elf32_hppa_link_hash_table *hplink; + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + asection *sreloc; + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + + hplink = hppa_link_hash_table (info); + dynobj = hplink->root.dynobj; + local_got_offsets = elf_local_got_offsets (input_bfd); + sreloc = NULL; + + rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; rel++) + { + unsigned int r_type; + reloc_howto_type *howto; + unsigned int r_symndx; + struct elf32_hppa_link_hash_entry *h; + Elf_Internal_Sym *sym; + asection *sym_sec; + bfd_vma relocation; + bfd_reloc_status_type r; + const char *sym_name; + boolean plabel; + + r_type = ELF32_R_TYPE (rel->r_info); + if (r_type >= (unsigned int) R_PARISC_UNIMPLEMENTED) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + if (r_type == (unsigned int) R_PARISC_GNU_VTENTRY + || r_type == (unsigned int) R_PARISC_GNU_VTINHERIT) + continue; + + r_symndx = ELF32_R_SYM (rel->r_info); + + if (info->relocateable) + { + /* This is a relocateable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + sym_sec = local_sections[r_symndx]; + rel->r_addend += sym_sec->output_offset; + } + } + continue; + } + + /* This is a final link. */ + h = NULL; + sym = NULL; + sym_sec = NULL; + if (r_symndx < symtab_hdr->sh_info) + { + /* This is a local symbol, h defaults to NULL. */ + sym = local_syms + r_symndx; + sym_sec = local_sections[r_symndx]; + relocation = ((ELF_ST_TYPE (sym->st_info) == STT_SECTION + ? 0 : sym->st_value) + + sym_sec->output_offset + + sym_sec->output_section->vma); + } + else + { + int indx; + + /* It's a global; Find its entry in the link hash. */ + indx = r_symndx - symtab_hdr->sh_info; + h = ((struct elf32_hppa_link_hash_entry *) + elf_sym_hashes (input_bfd)[indx]); + while (h->elf.root.type == bfd_link_hash_indirect + || h->elf.root.type == bfd_link_hash_warning) + h = (struct elf32_hppa_link_hash_entry *) h->elf.root.u.i.link; + + relocation = 0; + if (h->elf.root.type == bfd_link_hash_defined + || h->elf.root.type == bfd_link_hash_defweak) + { + sym_sec = h->elf.root.u.def.section; + /* If sym_sec->output_section is NULL, then it's a + symbol defined in a shared library. */ + if (sym_sec->output_section != NULL) + relocation = (h->elf.root.u.def.value + + sym_sec->output_offset + + sym_sec->output_section->vma); + } + else if (h->elf.root.type == bfd_link_hash_undefweak) + ; + else if (info->shared && !info->no_undefined + && ELF_ST_VISIBILITY (h->elf.other) == STV_DEFAULT) + { + if (info->symbolic) + if (!((*info->callbacks->undefined_symbol) + (info, h->elf.root.root.string, input_bfd, + input_section, rel->r_offset, false))) + return false; + } + else + { + if (!((*info->callbacks->undefined_symbol) + (info, h->elf.root.root.string, input_bfd, + input_section, rel->r_offset, true))) + return false; + } + } + + /* Do any required modifications to the relocation value, and + determine what types of dynamic info we need to output, if + any. */ + plabel = 0; + switch (r_type) + { + case R_PARISC_DLTIND14F: + case R_PARISC_DLTIND14R: + case R_PARISC_DLTIND21L: + /* Relocation is to the entry for this symbol in the global + offset table. */ + if (h != NULL) + { + bfd_vma off; + + off = h->elf.got.offset; + BFD_ASSERT (off != (bfd_vma) -1); + + if (! hplink->root.dynamic_sections_created + || (info->shared + && (info->symbolic || h->elf.dynindx == -1) + && (h->elf.elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) != 0)) + { + /* 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 4, we use the + least significant bit to record whether we have + initialized it already. + + When doing a dynamic link, we create a .rela.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_32 (output_bfd, relocation, + hplink->sgot->contents + off); + h->elf.got.offset |= 1; + } + } + + relocation = off; + } + else + { + /* Local symbol case. */ + bfd_vma off; + + BFD_ASSERT (local_got_offsets != NULL + && local_got_offsets[r_symndx] != (bfd_vma) -1); + + 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. */ + if ((off & 1) != 0) + off &= ~1; + else + { + bfd_put_32 (output_bfd, relocation, + hplink->sgot->contents + off); + + if (info->shared) + { + /* Output a dynamic *ABS* relocation for this + GOT entry. In this case it is relative to + the base of the object because the symbol + index is zero. */ + Elf_Internal_Rela outrel; + asection *srelgot = hplink->srelgot; + + outrel.r_offset = (off + + hplink->sgot->output_offset + + hplink->sgot->output_section->vma); + outrel.r_info = ELF32_R_INFO (0, R_PARISC_DIR32); + outrel.r_addend = relocation; + bfd_elf32_swap_reloca_out (output_bfd, &outrel, + ((Elf32_External_Rela *) + srelgot->contents + + srelgot->reloc_count)); + ++srelgot->reloc_count; + } + + local_got_offsets[r_symndx] |= 1; + } + + relocation = off; + } + + /* Add the base of the GOT to the relocation value. */ + relocation += (hplink->sgot->output_offset + + hplink->sgot->output_section->vma); + break; + + case R_PARISC_SEGREL32: + /* If this is the first SEGREL relocation, then initialize + the segment base values. */ + if (hplink->text_segment_base == (bfd_vma) -1) + bfd_map_over_sections (output_bfd, + hppa_record_segment_addr, + hplink); + break; + + case R_PARISC_PLABEL14R: + case R_PARISC_PLABEL21L: + case R_PARISC_PLABEL32: + if (hplink->root.dynamic_sections_created) + { + bfd_vma off; + + /* If we have a global symbol with a PLT slot, then + redirect this relocation to it. */ + if (h != NULL) + { + off = h->elf.plt.offset; + } + else + { + int indx; + + indx = r_symndx + symtab_hdr->sh_info; + off = local_got_offsets[indx]; + + /* As for the local .got entry case, we use the last + bit to record whether we've already initialised + this local .plt entry. */ + if ((off & 1) != 0) + off &= ~1; + else + { + bfd_put_32 (output_bfd, + relocation, + hplink->splt->contents + off); + bfd_put_32 (output_bfd, + elf_gp (hplink->splt->output_section->owner), + hplink->splt->contents + off + 4); + + if (info->shared) + { + /* Output a dynamic IPLT relocation for this + PLT entry. */ + Elf_Internal_Rela outrel; + asection *srelplt = hplink->srelplt; + + outrel.r_offset = (off + + hplink->splt->output_offset + + hplink->splt->output_section->vma); + outrel.r_info = ELF32_R_INFO (0, R_PARISC_IPLT); + outrel.r_addend = relocation; + bfd_elf32_swap_reloca_out (output_bfd, &outrel, + ((Elf32_External_Rela *) + srelplt->contents + + srelplt->reloc_count)); + ++srelplt->reloc_count; + } + + local_got_offsets[indx] |= 1; + } + } + + BFD_ASSERT (off < (bfd_vma) -2); + + /* PLABELs contain function pointers. Relocation is to + the entry for the function in the .plt. The magic +2 + offset signals to $$dyncall that the function pointer + is in the .plt and thus has a gp pointer too. + Exception: Undefined PLABELs should have a value of + zero. */ + if (h == NULL + || (h->elf.root.type != bfd_link_hash_undefweak + && h->elf.root.type != bfd_link_hash_undefined)) + { + relocation = (off + + hplink->splt->output_offset + + hplink->splt->output_section->vma + + 2); + } + plabel = 1; + } + /* Fall through and possibly emit a dynamic relocation. */ + + case R_PARISC_DIR17F: + case R_PARISC_DIR17R: + case R_PARISC_DIR14F: + case R_PARISC_DIR14R: + case R_PARISC_DIR21L: + case R_PARISC_DPREL14F: + case R_PARISC_DPREL14R: + case R_PARISC_DPREL21L: + case R_PARISC_DIR32: + /* The reloc types handled here and this conditional + expression must match the code in check_relocs and + hppa_discard_copies. ie. We need exactly the same + condition as in check_relocs, with some extra conditions + (dynindx test in this case) to cater for relocs removed + by hppa_discard_copies. */ + if ((input_section->flags & SEC_ALLOC) != 0 + && info->shared +#if RELATIVE_DYNAMIC_RELOCS + && (is_absolute_reloc (r_type) + || ((!info->symbolic + || (h != NULL + && ((h->elf.elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0 + || h->elf.root.type == bfd_link_hash_defweak))) + && (h == NULL || h->elf.dynindx != -1))) +#endif + ) + { + Elf_Internal_Rela outrel; + boolean skip; + + /* 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; + sreloc = bfd_get_section_by_name (dynobj, name); + BFD_ASSERT (sreloc != NULL); + } + + outrel.r_offset = rel->r_offset; + outrel.r_addend = rel->r_addend; + skip = false; + if (elf_section_data (input_section)->stab_info != NULL) + { + bfd_vma off; + + off = (_bfd_stab_section_offset + (output_bfd, &hplink->root.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 += (input_section->output_offset + + input_section->output_section->vma); + + if (skip) + { + memset (&outrel, 0, sizeof (outrel)); + } + else if (h != NULL + && h->elf.dynindx != -1 + && (plabel + || !info->symbolic + || (h->elf.elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)) + { + outrel.r_info = ELF32_R_INFO (h->elf.dynindx, r_type); + } + else /* It's a local symbol, or one marked to become local. */ + { + int indx = 0; + + /* Add the absolute offset of the symbol. */ + outrel.r_addend += relocation; + + /* Global plabels need to be processed by the + dynamic linker so that functions have at most one + fptr. For this reason, we need to differentiate + between global and local plabels, which we do by + providing the function symbol for a global plabel + reloc, and no symbol for local plabels. */ + if (! plabel + && sym_sec != NULL + && sym_sec->output_section != NULL + && ! bfd_is_abs_section (sym_sec)) + { + indx = elf_section_data (sym_sec->output_section)->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 -= sym_sec->output_section->vma; + } + + outrel.r_info = ELF32_R_INFO (indx, r_type); + } + + bfd_elf32_swap_reloca_out (output_bfd, &outrel, + ((Elf32_External_Rela *) + sreloc->contents + + sreloc->reloc_count)); + ++sreloc->reloc_count; + } + break; + + default: + break; + } + + r = final_link_relocate (input_section, contents, rel, relocation, + hplink, sym_sec, h); + + if (r == bfd_reloc_ok) + continue; + + if (h != NULL) + sym_name = h->elf.root.root.string; + else + { + sym_name = bfd_elf_string_from_elf_section (input_bfd, + symtab_hdr->sh_link, + sym->st_name); + if (sym_name == NULL) + return false; + if (*sym_name == '\0') + sym_name = bfd_section_name (input_bfd, sym_sec); + } + + howto = elf_hppa_howto_table + r_type; + + if (r == bfd_reloc_undefined || r == bfd_reloc_notsupported) + { + (*_bfd_error_handler) + (_("%s(%s+0x%lx): cannot handle %s for %s"), + bfd_get_filename (input_bfd), + input_section->name, + (long) rel->r_offset, + howto->name, + sym_name); + } + else + { + if (!((*info->callbacks->reloc_overflow) + (info, sym_name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset))) + return false; + } + } + + return true; +} + +/* Comparison function for qsort to sort unwind section during a + final link. */ + +static int +hppa_unwind_entry_compare (a, b) + const PTR a; + const PTR b; +{ + const bfd_byte *ap, *bp; + unsigned long av, bv; + + ap = (const bfd_byte *) a; + av = (unsigned long) ap[0] << 24; + av |= (unsigned long) ap[1] << 16; + av |= (unsigned long) ap[2] << 8; + av |= (unsigned long) ap[3]; + + bp = (const bfd_byte *) b; + bv = (unsigned long) bp[0] << 24; + bv |= (unsigned long) bp[1] << 16; + bv |= (unsigned long) bp[2] << 8; + bv |= (unsigned long) bp[3]; + + return av < bv ? -1 : av > bv ? 1 : 0; +} + +/* Finish up dynamic symbol handling. We set the contents of various + dynamic sections here. */ + +static boolean +elf32_hppa_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 elf32_hppa_link_hash_table *hplink; + bfd *dynobj; + + hplink = hppa_link_hash_table (info); + dynobj = hplink->root.dynobj; + + if (h->plt.offset != (bfd_vma) -1) + { + bfd_vma value; + + /* This symbol has an entry in the procedure linkage table. Set + it up. + + The format of a plt entry is + + <__gp> + */ + value = 0; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + value = h->root.u.def.value; + if (h->root.u.def.section->output_section != NULL) + value += (h->root.u.def.section->output_offset + + h->root.u.def.section->output_section->vma); + } + + if (! ((struct elf32_hppa_link_hash_entry *) h)->pic_call) + { + Elf_Internal_Rela rel; + + /* Create a dynamic IPLT relocation for this entry. */ + rel.r_offset = (h->plt.offset + + hplink->splt->output_offset + + hplink->splt->output_section->vma); + if (! ((struct elf32_hppa_link_hash_entry *) h)->plt_abs + && h->dynindx != -1) + { + /* To support lazy linking, the function pointer is + initialised to point to a special stub stored at the + end of the .plt. This is only done for plt entries + with a non-*ABS* dynamic relocation. */ + value = (hplink->splt->output_offset + + hplink->splt->output_section->vma + + hplink->splt->_raw_size + - sizeof (plt_stub) + + PLT_STUB_ENTRY); + rel.r_info = ELF32_R_INFO (h->dynindx, R_PARISC_IPLT); + rel.r_addend = 0; + } + else + { + /* This symbol has been marked to become local, and is + used by a plabel so must be kept in the .plt. */ + rel.r_info = ELF32_R_INFO (0, R_PARISC_IPLT); + rel.r_addend = value; + } + + bfd_elf32_swap_reloca_out (hplink->splt->output_section->owner, + &rel, + ((Elf32_External_Rela *) + hplink->srelplt->contents + + hplink->srelplt->reloc_count)); + hplink->srelplt->reloc_count++; + } + + bfd_put_32 (hplink->splt->owner, + value, + hplink->splt->contents + h->plt.offset); + bfd_put_32 (hplink->splt->owner, + elf_gp (hplink->splt->output_section->owner), + hplink->splt->contents + h->plt.offset + 4); + if (PLABEL_PLT_ENTRY_SIZE != PLT_ENTRY_SIZE + && ((struct elf32_hppa_link_hash_entry *) h)->plabel + && h->dynindx != -1) + { + memset (hplink->splt->contents + h->plt.offset + 8, + 0, PLABEL_PLT_ENTRY_SIZE - PLT_ENTRY_SIZE); + } + + 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. */ + sym->st_shndx = SHN_UNDEF; + } + } + + if (h->got.offset != (bfd_vma) -1) + { + Elf_Internal_Rela rel; + + /* This symbol has an entry in the global offset table. Set it + up. */ + + rel.r_offset = ((h->got.offset &~ (bfd_vma) 1) + + hplink->sgot->output_offset + + hplink->sgot->output_section->vma); + + /* 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 (! hplink->root.dynamic_sections_created + || (info->shared + && (info->symbolic || h->dynindx == -1) + && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR))) + { + rel.r_info = ELF32_R_INFO (0, R_PARISC_DIR32); + rel.r_addend = (h->root.u.def.value + + h->root.u.def.section->output_offset + + h->root.u.def.section->output_section->vma); + } + else + { + BFD_ASSERT((h->got.offset & 1) == 0); + bfd_put_32 (output_bfd, (bfd_vma) 0, + hplink->sgot->contents + h->got.offset); + rel.r_info = ELF32_R_INFO (h->dynindx, R_PARISC_DIR32); + rel.r_addend = 0; + } + + bfd_elf32_swap_reloca_out (output_bfd, &rel, + ((Elf32_External_Rela *) + hplink->srelgot->contents + + hplink->srelgot->reloc_count)); + ++hplink->srelgot->reloc_count; + } + + if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) + { + asection *s; + Elf_Internal_Rela rel; + + /* 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 = hplink->srelbss; + + rel.r_offset = (h->root.u.def.value + + h->root.u.def.section->output_offset + + h->root.u.def.section->output_section->vma); + rel.r_addend = 0; + rel.r_info = ELF32_R_INFO (h->dynindx, R_PARISC_COPY); + bfd_elf32_swap_reloca_out (output_bfd, &rel, + ((Elf32_External_Rela *) s->contents + + s->reloc_count)); + ++s->reloc_count; + } + + /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ + if (h->root.root.string[0] == '_' + && (strcmp (h->root.root.string, "_DYNAMIC") == 0 + || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)) + { + sym->st_shndx = SHN_ABS; + } + + return true; +} + +/* Finish up the dynamic sections. */ + +static boolean +elf32_hppa_finish_dynamic_sections (output_bfd, info) + bfd *output_bfd; + struct bfd_link_info *info; +{ + bfd *dynobj; + struct elf32_hppa_link_hash_table *hplink; + asection *sdyn; + + hplink = hppa_link_hash_table (info); + dynobj = hplink->root.dynobj; + + sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + + if (hplink->root.dynamic_sections_created) + { + Elf32_External_Dyn *dyncon, *dynconend; + + BFD_ASSERT (sdyn != NULL); + + dyncon = (Elf32_External_Dyn *) sdyn->contents; + dynconend = (Elf32_External_Dyn *) (sdyn->contents + sdyn->_raw_size); + for (; dyncon < dynconend; dyncon++) + { + Elf_Internal_Dyn dyn; + asection *s; + + bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn); + + switch (dyn.d_tag) + { + default: + break; + + case DT_PLTGOT: + /* Use PLTGOT to set the GOT register. */ + dyn.d_un.d_ptr = elf_gp (output_bfd); + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_JMPREL: + s = hplink->srelplt; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_PLTRELSZ: + s = hplink->srelplt; + 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; + } + } + } + + if (hplink->sgot->_raw_size != 0) + { + /* Fill in the first entry in the global offset table. + We use it to point to our dynamic section, if we have one. */ + bfd_put_32 (output_bfd, + (sdyn != NULL + ? sdyn->output_section->vma + sdyn->output_offset + : (bfd_vma) 0), + hplink->sgot->contents); + + /* The second entry is reserved for use by the dynamic linker. */ + memset (hplink->sgot->contents + GOT_ENTRY_SIZE, 0, GOT_ENTRY_SIZE); + + /* Set .got entry size. */ + elf_section_data (hplink->sgot->output_section) + ->this_hdr.sh_entsize = GOT_ENTRY_SIZE; + } + + if (hplink->splt->_raw_size != 0) + { + /* Set plt entry size. */ + elf_section_data (hplink->splt->output_section) + ->this_hdr.sh_entsize = PLT_ENTRY_SIZE; + + if (hplink->need_plt_stub) + { + /* Set up the .plt stub. */ + memcpy (hplink->splt->contents + + hplink->splt->_raw_size - sizeof (plt_stub), + plt_stub, sizeof (plt_stub)); + + if ((hplink->splt->output_offset + + hplink->splt->output_section->vma + + hplink->splt->_raw_size) + != (hplink->sgot->output_offset + + hplink->sgot->output_section->vma)) + { + (*_bfd_error_handler) + (_(".got section not immediately after .plt section")); + return false; + } + } + } + + return true; +} + +/* Tweak the OSABI field of the elf header. */ + +static void +elf32_hppa_post_process_headers (abfd, link_info) + bfd *abfd; + struct bfd_link_info *link_info ATTRIBUTE_UNUSED; +{ + Elf_Internal_Ehdr * i_ehdrp; + + i_ehdrp = elf_elfheader (abfd); + + if (strcmp (bfd_get_target (abfd), "elf32-hppa-linux") == 0) + { + i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX; + } + else + { + i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_HPUX; + } +} + +/* Called when writing out an object file to decide the type of a + symbol. */ +static int +elf32_hppa_elf_get_symbol_type (elf_sym, type) + Elf_Internal_Sym *elf_sym; + int type; +{ + if (ELF_ST_TYPE (elf_sym->st_info) == STT_PARISC_MILLI) + return STT_PARISC_MILLI; + else + return type; } /* Misc BFD support code. */ -#define bfd_elf32_bfd_reloc_type_lookup elf_hppa_reloc_type_lookup -#define bfd_elf32_bfd_is_local_label_name elf_hppa_is_local_label_name -#define elf_info_to_howto elf_hppa_info_to_howto -#define elf_info_to_howto_rel elf_hppa_info_to_howto_rel +#define bfd_elf32_bfd_is_local_label_name elf_hppa_is_local_label_name +#define bfd_elf32_bfd_reloc_type_lookup elf_hppa_reloc_type_lookup +#define elf_info_to_howto elf_hppa_info_to_howto +#define elf_info_to_howto_rel elf_hppa_info_to_howto_rel /* Stuff for the BFD linker. */ -#define elf_backend_relocate_section elf32_hppa_relocate_section -#define elf_backend_add_symbol_hook elf32_hppa_add_symbol_hook -#define bfd_elf32_bfd_link_hash_table_create \ - elf32_hppa_link_hash_table_create -#define elf_backend_fake_sections elf_hppa_fake_sections +#define bfd_elf32_bfd_final_link elf32_hppa_final_link +#define bfd_elf32_bfd_link_hash_table_create elf32_hppa_link_hash_table_create +#define elf_backend_add_symbol_hook elf32_hppa_add_symbol_hook +#define elf_backend_adjust_dynamic_symbol elf32_hppa_adjust_dynamic_symbol +#define elf_backend_check_relocs elf32_hppa_check_relocs +#define elf_backend_create_dynamic_sections elf32_hppa_create_dynamic_sections +#define elf_backend_fake_sections elf_hppa_fake_sections +#define elf_backend_relocate_section elf32_hppa_relocate_section +#define elf_backend_hide_symbol elf32_hppa_hide_symbol +#define elf_backend_finish_dynamic_symbol elf32_hppa_finish_dynamic_symbol +#define elf_backend_finish_dynamic_sections elf32_hppa_finish_dynamic_sections +#define elf_backend_size_dynamic_sections elf32_hppa_size_dynamic_sections +#define elf_backend_gc_mark_hook elf32_hppa_gc_mark_hook +#define elf_backend_gc_sweep_hook elf32_hppa_gc_sweep_hook +#define elf_backend_object_p elf32_hppa_object_p +#define elf_backend_final_write_processing elf_hppa_final_write_processing +#define elf_backend_post_process_headers elf32_hppa_post_process_headers +#define elf_backend_get_symbol_type elf32_hppa_elf_get_symbol_type +#define elf_backend_can_gc_sections 1 +#define elf_backend_plt_alignment 2 +#define elf_backend_want_got_plt 0 +#define elf_backend_plt_readonly 0 +#define elf_backend_want_plt_sym 0 +#define elf_backend_got_header_size 8 #define TARGET_BIG_SYM bfd_elf32_hppa_vec #define TARGET_BIG_NAME "elf32-hppa" @@ -1327,3 +4331,11 @@ error_return: #define ELF_MAXPAGESIZE 0x1000 #include "elf32-target.h" + +#undef TARGET_BIG_SYM +#define TARGET_BIG_SYM bfd_elf32_hppa_linux_vec +#undef TARGET_BIG_NAME +#define TARGET_BIG_NAME "elf32-hppa-linux" + +#define INCLUDED_TARGET_FILE 1 +#include "elf32-target.h" diff --git a/gnu/dist/toolchain/bfd/elf32-hppa.h b/gnu/dist/toolchain/bfd/elf32-hppa.h index 915fc13ae59c..b7b59e69c9e3 100644 --- a/gnu/dist/toolchain/bfd/elf32-hppa.h +++ b/gnu/dist/toolchain/bfd/elf32-hppa.h @@ -4,7 +4,8 @@ in the Stratus FTX/Golf Object File Format (SED-1762) dated February 1994. - Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc. + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 98, 99, 2000 + Free Software Foundation, Inc. Written by: @@ -36,13 +37,18 @@ #include "elf/hppa.h" boolean elf32_hppa_size_stubs - PARAMS ((bfd *, bfd *, struct bfd_link_info *)); + PARAMS ((bfd *, bfd *, struct bfd_link_info *, boolean, bfd_signed_vma, + asection * (*) PARAMS ((const char *, asection *)), + void (*) PARAMS ((void)))); -boolean elf32_hppa_build_stubs +boolean elf32_hppa_set_gp PARAMS ((bfd *, struct bfd_link_info *)); +boolean elf32_hppa_build_stubs + PARAMS ((struct bfd_link_info *)); + extern elf_hppa_reloc_type ** _bfd_elf32_hppa_gen_reloc_type - PARAMS ((bfd *, elf_hppa_reloc_type, int, int, int, asymbol *)); + PARAMS ((bfd *, elf_hppa_reloc_type, int, unsigned int, int, asymbol *)); /* Define groups of basic relocations. FIXME: These should be the only basic relocations created by GAS. The rest diff --git a/gnu/dist/toolchain/bfd/elf32-i370.c b/gnu/dist/toolchain/bfd/elf32-i370.c index c8bf94326cde..b8afdbac8070 100644 --- a/gnu/dist/toolchain/bfd/elf32-i370.c +++ b/gnu/dist/toolchain/bfd/elf32-i370.c @@ -19,8 +19,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. */ - - /* This file is based on a preliminary PowerPC ELF ABI. But its been hacked on for the IBM 360/370 architectures. Basically, the 31bit relocation works, and just about everything @@ -28,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ dynamic loading to work ... its never been tested ... */ - #include "bfd.h" #include "sysdep.h" #include "bfdlink.h" @@ -61,7 +58,6 @@ enum i370_reloc_type R_I370_max }; - static reloc_howto_type *i370_elf_howto_table[ (int)R_I370_max ]; @@ -254,13 +250,11 @@ static reloc_howto_type i370_elf_howto_raw[] = false), /* pcrel_offset */ }; - static void i370_elf_howto_init PARAMS ((void)); static void i370_elf_info_to_howto PARAMS ((bfd *abfd, arelent *cache_ptr, Elf32_Internal_Rela *dst)); static boolean i370_elf_set_private_flags PARAMS ((bfd *, flagword)); - /* Initialize the i370_elf_howto_table, so that linear accesses can be done. */ @@ -272,11 +266,10 @@ i370_elf_howto_init () for (i = 0; i < sizeof (i370_elf_howto_raw) / sizeof (i370_elf_howto_raw[0]); i++) { type = i370_elf_howto_raw[i].type; - BFD_ASSERT (type < sizeof(i370_elf_howto_table) / sizeof(i370_elf_howto_table[0])); + BFD_ASSERT (type < sizeof (i370_elf_howto_table) / sizeof (i370_elf_howto_table[0])); i370_elf_howto_table[type] = &i370_elf_howto_raw[i]; } } - static reloc_howto_type * i370_elf_reloc_type_lookup (abfd, code) @@ -350,7 +343,6 @@ static boolean i370_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_ #define ELF_DYNAMIC_INTERPRETER "/lib/ld.so" - /* Set the howto pointer for an i370 ELF reloc. */ static void @@ -369,7 +361,7 @@ i370_elf_info_to_howto (abfd, cache_ptr, dst) /* hack alert -- the following several routines look generic to me ... * why are we bothering with them ??? */ -/* Function to set whether a module needs the -mrelocatable bit set. */ +/* Function to set whether a module needs the -mrelocatable bit set. */ static boolean i370_elf_set_private_flags (abfd, flags) bfd *abfd; @@ -438,7 +430,6 @@ i370_elf_merge_private_bfd_data (ibfd, obfd) return true; } - /* Handle an i370 specific section when reading an object file. This is called when elfcode.h finds a section with an unknown type. */ @@ -470,8 +461,6 @@ i370_elf_section_from_shdr (abfd, hdr, name) bfd_set_section_flags (abfd, newsect, flags); return true; } - - /* Set up any other section flags and such that may be necessary. */ /* XXX hack alert bogus This routine is mostly all junk and almost @@ -479,7 +468,6 @@ i370_elf_section_from_shdr (abfd, hdr, name) * just enough to allow glibc-2.1 ld.so to compile & link. */ - static boolean i370_elf_fake_sections (abfd, shdr, asect) bfd *abfd ATTRIBUTE_UNUSED; @@ -494,7 +482,6 @@ i370_elf_fake_sections (abfd, shdr, asect) return true; } - #if 0 /* Create a special linker section */ @@ -610,7 +597,7 @@ i370_elf_create_dynamic_sections (abfd, info) return false; } - /* xxx beats me, seem to need a rela.text ... */ + /* xxx beats me, seem to need a rela.text ... */ s = bfd_make_section (abfd, ".rela.text"); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) @@ -654,7 +641,6 @@ i370_elf_adjust_dynamic_symbol (info, h) && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0))); - s = bfd_get_section_by_name (dynobj, ".rela.text"); BFD_ASSERT (s != NULL); s->_raw_size += sizeof (Elf32_External_Rela); @@ -742,7 +728,6 @@ i370_elf_adjust_dynamic_symbol (info, h) return true; } - /* Increment the index of a dynamic symbol by a given amount. Called via elf_link_hash_traverse. */ @@ -769,7 +754,6 @@ i370_elf_adjust_dynindx (h, cparg) return true; } - /* Set the sizes of the dynamic sections. */ /* XXX hack alert bogus This routine is mostly all junk and almost @@ -879,7 +863,7 @@ i370_elf_size_dynamic_sections (output_bfd, info) asection *target; const char *outname; - /* Remember whether there are any relocation sections. */ + /* Remember whether there are any relocation sections. */ relocs = true; /* If this relocation section applies to a read only @@ -959,6 +943,7 @@ i370_elf_size_dynamic_sections (output_bfd, info) { if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; + info->flags |= DF_TEXTREL; } } @@ -1001,7 +986,6 @@ i370_elf_size_dynamic_sections (output_bfd, info) return true; } - /* Look through the relocs for a section during the first phase, and allocate space in the global offset table or procedure linkage @@ -1106,7 +1090,6 @@ i370_elf_check_relocs (abfd, info, sec, relocs) return true; } - /* Finish up the dynamic sections. */ /* XXX hack alert bogus This routine is mostly all junk and almost @@ -1247,7 +1230,6 @@ i370_elf_finish_dynamic_sections (output_bfd, info) return true; } - /* The RELOCATE_SECTION function is called by the ELF backend linker to handle the relocations for a section. @@ -1413,16 +1395,17 @@ i370_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) + else if (info->shared + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { - (*info->callbacks->undefined_symbol)(info, - h->root.root.string, - input_bfd, - input_section, - rel->r_offset, - true); + (*info->callbacks->undefined_symbol) (info, + h->root.root.string, + input_bfd, + input_section, + rel->r_offset, + true); ret = false; continue; } @@ -1560,9 +1543,9 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section, #ifdef DEBUG if (indx <= 0) { - printf("indx=%d section=%s flags=%08x name=%s\n", - indx, osec->name, osec->flags, - h->root.root.string); + printf ("indx=%d section=%s flags=%08x name=%s\n", + indx, osec->name, osec->flags, + h->root.root.string); } #endif } @@ -1600,7 +1583,6 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section, continue; } - #ifdef DEBUG fprintf (stderr, "\ttype = %s (%d), name = %s, symbol index = %ld, offset = %ld, addend = %ld\n", howto->name, @@ -1645,13 +1627,13 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section, name = bfd_section_name (input_bfd, sec); } - (*info->callbacks->reloc_overflow)(info, - name, - howto->name, - (bfd_vma) 0, - input_bfd, - input_section, - offset); + (*info->callbacks->reloc_overflow) (info, + name, + howto->name, + (bfd_vma) 0, + input_bfd, + input_section, + offset); } break; @@ -1659,7 +1641,6 @@ i370_elf_relocate_section (output_bfd, info, input_bfd, input_section, } } - #ifdef DEBUG fprintf (stderr, "\n"); #endif @@ -1688,8 +1669,6 @@ i370_elf_post_process_headers (abfd, link_info) #define ELF_MAXPAGESIZE 0x1000 #define elf_info_to_howto i370_elf_info_to_howto - - #define elf_backend_plt_not_loaded 1 #define elf_backend_got_symbol_offset 4 diff --git a/gnu/dist/toolchain/bfd/elf32-i386.c b/gnu/dist/toolchain/bfd/elf32-i386.c index fc1b5a8ccb6e..4ad2c2be6aa4 100644 --- a/gnu/dist/toolchain/bfd/elf32-i386.c +++ b/gnu/dist/toolchain/bfd/elf32-i386.c @@ -1,5 +1,6 @@ /* Intel 80386/80486-specific support for 32-bit ELF - Copyright 1993, 94-98, 1999 Free Software Foundation, Inc. + Copyright 1993, 94, 95, 96, 97, 98, 99, 2000 + Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -56,35 +57,66 @@ static boolean elf_i386_finish_dynamic_sections static reloc_howto_type elf_howto_table[]= { - HOWTO(R_386_NONE, 0,0, 0,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_NONE", true,0x00000000,0x00000000,false), - HOWTO(R_386_32, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_32", true,0xffffffff,0xffffffff,false), - HOWTO(R_386_PC32, 0,2,32,true, 0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_PC32", true,0xffffffff,0xffffffff,true), - HOWTO(R_386_GOT32, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GOT32", true,0xffffffff,0xffffffff,false), - HOWTO(R_386_PLT32, 0,2,32,true,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_PLT32", true,0xffffffff,0xffffffff,true), - HOWTO(R_386_COPY, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_COPY", true,0xffffffff,0xffffffff,false), - HOWTO(R_386_GLOB_DAT, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GLOB_DAT", true,0xffffffff,0xffffffff,false), - HOWTO(R_386_JUMP_SLOT, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_JUMP_SLOT",true,0xffffffff,0xffffffff,false), - HOWTO(R_386_RELATIVE, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_RELATIVE", true,0xffffffff,0xffffffff,false), - HOWTO(R_386_GOTOFF, 0,2,32,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GOTOFF", true,0xffffffff,0xffffffff,false), - HOWTO(R_386_GOTPC, 0,2,32,true,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_GOTPC", true,0xffffffff,0xffffffff,true), - EMPTY_HOWTO (11), - EMPTY_HOWTO (12), - EMPTY_HOWTO (13), - EMPTY_HOWTO (14), - EMPTY_HOWTO (15), - EMPTY_HOWTO (16), - EMPTY_HOWTO (17), - EMPTY_HOWTO (18), - EMPTY_HOWTO (19), + HOWTO(R_386_NONE, 0, 0, 0, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_NONE", + true, 0x00000000, 0x00000000, false), + HOWTO(R_386_32, 0, 2, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_32", + true, 0xffffffff, 0xffffffff, false), + HOWTO(R_386_PC32, 0, 2, 32, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_PC32", + true, 0xffffffff, 0xffffffff, true), + HOWTO(R_386_GOT32, 0, 2, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_GOT32", + true, 0xffffffff, 0xffffffff, false), + HOWTO(R_386_PLT32, 0, 2, 32, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_PLT32", + true, 0xffffffff, 0xffffffff, true), + HOWTO(R_386_COPY, 0, 2, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_COPY", + true, 0xffffffff, 0xffffffff, false), + HOWTO(R_386_GLOB_DAT, 0, 2, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_GLOB_DAT", + true, 0xffffffff, 0xffffffff, false), + HOWTO(R_386_JUMP_SLOT, 0, 2, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_JUMP_SLOT", + true, 0xffffffff, 0xffffffff, false), + HOWTO(R_386_RELATIVE, 0, 2, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_RELATIVE", + true, 0xffffffff, 0xffffffff, false), + HOWTO(R_386_GOTOFF, 0, 2, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_GOTOFF", + true, 0xffffffff, 0xffffffff, false), + HOWTO(R_386_GOTPC, 0, 2, 32, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_GOTPC", + true, 0xffffffff, 0xffffffff, true), + + /* We have a gap in the reloc numbers here. + R_386_standard counts the number up to this point, and + R_386_ext_offset is the value to subtract from a reloc type of + R_386_16 thru R_386_PC8 to form an index into this table. */ +#define R_386_standard ((unsigned int) R_386_GOTPC + 1) +#define R_386_ext_offset ((unsigned int) R_386_16 - R_386_standard) + /* The remaining relocs are a GNU extension. */ - HOWTO(R_386_16, 0,1,16,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_16", true,0xffff,0xffff,false), - HOWTO(R_386_PC16, 0,1,16,true, 0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_PC16", true,0xffff,0xffff,true), - HOWTO(R_386_8, 0,0,8,false,0,complain_overflow_bitfield, bfd_elf_generic_reloc,"R_386_8", true,0xff,0xff,false), - HOWTO(R_386_PC8, 0,0,8,true, 0,complain_overflow_signed, bfd_elf_generic_reloc,"R_386_PC8", true,0xff,0xff,true), -}; + HOWTO(R_386_16, 0, 1, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_16", + true, 0xffff, 0xffff, false), + HOWTO(R_386_PC16, 0, 1, 16, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_PC16", + true, 0xffff, 0xffff, true), + HOWTO(R_386_8, 0, 0, 8, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_386_8", + true, 0xff, 0xff, false), + HOWTO(R_386_PC8, 0, 0, 8, true, 0, complain_overflow_signed, + bfd_elf_generic_reloc, "R_386_PC8", + true, 0xff, 0xff, true), + + /* Another gap. */ +#define R_386_ext ((unsigned int) R_386_PC8 + 1 - R_386_ext_offset) +#define R_386_vt_offset ((unsigned int) R_386_GNU_VTINHERIT - R_386_ext) /* GNU extension to record C++ vtable hierarchy. */ -static reloc_howto_type elf32_i386_vtinherit_howto = HOWTO (R_386_GNU_VTINHERIT, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -97,10 +129,9 @@ static reloc_howto_type elf32_i386_vtinherit_howto = false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false); + false), /* GNU extension to record C++ vtable member usage. */ -static reloc_howto_type elf32_i386_vtentry_howto = HOWTO (R_386_GNU_VTENTRY, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -113,7 +144,11 @@ static reloc_howto_type elf32_i386_vtentry_howto = false, /* partial_inplace */ 0, /* src_mask */ 0, /* dst_mask */ - false); + false) + +#define R_386_vt ((unsigned int) R_386_GNU_VTENTRY + 1 - R_386_vt_offset) + +}; #ifdef DEBUG_GEN_RELOC #define TRACE(str) fprintf (stderr, "i386 bfd reloc lookup %d (%s)\n", code, str) @@ -130,76 +165,78 @@ elf_i386_reloc_type_lookup (abfd, code) { case BFD_RELOC_NONE: TRACE ("BFD_RELOC_NONE"); - return &elf_howto_table[ (int)R_386_NONE ]; + return &elf_howto_table[(unsigned int) R_386_NONE ]; case BFD_RELOC_32: TRACE ("BFD_RELOC_32"); - return &elf_howto_table[ (int)R_386_32 ]; + return &elf_howto_table[(unsigned int) R_386_32 ]; case BFD_RELOC_CTOR: TRACE ("BFD_RELOC_CTOR"); - return &elf_howto_table[ (int)R_386_32 ]; + return &elf_howto_table[(unsigned int) R_386_32 ]; case BFD_RELOC_32_PCREL: TRACE ("BFD_RELOC_PC32"); - return &elf_howto_table[ (int)R_386_PC32 ]; + return &elf_howto_table[(unsigned int) R_386_PC32 ]; case BFD_RELOC_386_GOT32: TRACE ("BFD_RELOC_386_GOT32"); - return &elf_howto_table[ (int)R_386_GOT32 ]; + return &elf_howto_table[(unsigned int) R_386_GOT32 ]; case BFD_RELOC_386_PLT32: TRACE ("BFD_RELOC_386_PLT32"); - return &elf_howto_table[ (int)R_386_PLT32 ]; + return &elf_howto_table[(unsigned int) R_386_PLT32 ]; case BFD_RELOC_386_COPY: TRACE ("BFD_RELOC_386_COPY"); - return &elf_howto_table[ (int)R_386_COPY ]; + return &elf_howto_table[(unsigned int) R_386_COPY ]; case BFD_RELOC_386_GLOB_DAT: TRACE ("BFD_RELOC_386_GLOB_DAT"); - return &elf_howto_table[ (int)R_386_GLOB_DAT ]; + return &elf_howto_table[(unsigned int) R_386_GLOB_DAT ]; case BFD_RELOC_386_JUMP_SLOT: TRACE ("BFD_RELOC_386_JUMP_SLOT"); - return &elf_howto_table[ (int)R_386_JUMP_SLOT ]; + return &elf_howto_table[(unsigned int) R_386_JUMP_SLOT ]; case BFD_RELOC_386_RELATIVE: TRACE ("BFD_RELOC_386_RELATIVE"); - return &elf_howto_table[ (int)R_386_RELATIVE ]; + return &elf_howto_table[(unsigned int) R_386_RELATIVE ]; case BFD_RELOC_386_GOTOFF: TRACE ("BFD_RELOC_386_GOTOFF"); - return &elf_howto_table[ (int)R_386_GOTOFF ]; + return &elf_howto_table[(unsigned int) R_386_GOTOFF ]; case BFD_RELOC_386_GOTPC: TRACE ("BFD_RELOC_386_GOTPC"); - return &elf_howto_table[ (int)R_386_GOTPC ]; + return &elf_howto_table[(unsigned int) R_386_GOTPC ]; /* The remaining relocs are a GNU extension. */ case BFD_RELOC_16: TRACE ("BFD_RELOC_16"); - return &elf_howto_table[(int) R_386_16]; + return &elf_howto_table[(unsigned int) R_386_16 - R_386_ext_offset]; case BFD_RELOC_16_PCREL: TRACE ("BFD_RELOC_16_PCREL"); - return &elf_howto_table[(int) R_386_PC16]; + return &elf_howto_table[(unsigned int) R_386_PC16 - R_386_ext_offset]; case BFD_RELOC_8: TRACE ("BFD_RELOC_8"); - return &elf_howto_table[(int) R_386_8]; + return &elf_howto_table[(unsigned int) R_386_8 - R_386_ext_offset]; case BFD_RELOC_8_PCREL: TRACE ("BFD_RELOC_8_PCREL"); - return &elf_howto_table[(int) R_386_PC8]; + return &elf_howto_table[(unsigned int) R_386_PC8 - R_386_ext_offset]; case BFD_RELOC_VTABLE_INHERIT: TRACE ("BFD_RELOC_VTABLE_INHERIT"); - return &elf32_i386_vtinherit_howto; + return &elf_howto_table[(unsigned int) R_386_GNU_VTINHERIT + - R_386_vt_offset]; case BFD_RELOC_VTABLE_ENTRY: TRACE ("BFD_RELOC_VTABLE_ENTRY"); - return &elf32_i386_vtentry_howto; + return &elf_howto_table[(unsigned int) R_386_GNU_VTENTRY + - R_386_vt_offset]; default: break; @@ -224,22 +261,20 @@ elf_i386_info_to_howto_rel (abfd, cache_ptr, dst) arelent *cache_ptr; Elf32_Internal_Rel *dst; { - enum elf_i386_reloc_type type; + unsigned int r_type = ELF32_R_TYPE (dst->r_info); + unsigned int indx; - type = (enum elf_i386_reloc_type) ELF32_R_TYPE (dst->r_info); - if (type == R_386_GNU_VTINHERIT) - cache_ptr->howto = &elf32_i386_vtinherit_howto; - else if (type == R_386_GNU_VTENTRY) - cache_ptr->howto = &elf32_i386_vtentry_howto; - else if (type < R_386_max - && (type < FIRST_INVALID_RELOC || type > LAST_INVALID_RELOC)) - cache_ptr->howto = &elf_howto_table[(int) type]; - else + if ((indx = r_type) >= R_386_standard + && ((indx = r_type - R_386_ext_offset) - R_386_standard + >= R_386_ext - R_386_standard) + && ((indx = r_type - R_386_vt_offset) - R_386_ext + >= R_386_vt - R_386_ext)) { (*_bfd_error_handler) (_("%s: invalid relocation type %d"), - bfd_get_filename (abfd), (int) type); - cache_ptr->howto = &elf_howto_table[(int) R_386_NONE]; + bfd_get_filename (abfd), (int) r_type); + indx = (unsigned int) R_386_NONE; } + cache_ptr->howto = &elf_howto_table[indx]; } /* Return whether a symbol name implies a local label. The UnixWare @@ -439,7 +474,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs) bfd *dynobj; Elf_Internal_Shdr *symtab_hdr; struct elf_link_hash_entry **sym_hashes; - bfd_vma *local_got_offsets; + bfd_signed_vma *local_got_refcounts; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; asection *sgot; @@ -452,7 +487,7 @@ elf_i386_check_relocs (abfd, info, sec, relocs) dynobj = elf_hash_table (info)->dynobj; symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); - local_got_offsets = elf_local_got_offsets (abfd); + local_got_refcounts = elf_local_got_refcounts (abfd); sgot = NULL; srelgot = NULL; @@ -522,57 +557,54 @@ elf_i386_check_relocs (abfd, info, sec, relocs) if (h != NULL) { - if (h->got.offset != (bfd_vma) -1) + if (h->got.refcount == -1) { - /* We have already allocated space in the .got. */ - break; - } - h->got.offset = sgot->_raw_size; + 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; - } + /* 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; + } - srelgot->_raw_size += sizeof (Elf32_External_Rel); + sgot->_raw_size += 4; + srelgot->_raw_size += sizeof (Elf32_External_Rel); + } + else + h->got.refcount += 1; } else { - /* This is a global offset table entry for a local - symbol. */ - if (local_got_offsets == NULL) + /* This is a global offset table entry for a local symbol. */ + if (local_got_refcounts == NULL) { size_t size; - register unsigned int i; - size = symtab_hdr->sh_info * sizeof (bfd_vma); - local_got_offsets = (bfd_vma *) bfd_alloc (abfd, size); - if (local_got_offsets == NULL) + size = symtab_hdr->sh_info * sizeof (bfd_signed_vma); + local_got_refcounts = ((bfd_signed_vma *) + bfd_alloc (abfd, size)); + if (local_got_refcounts == NULL) return false; - elf_local_got_offsets (abfd) = local_got_offsets; - for (i = 0; i < symtab_hdr->sh_info; i++) - local_got_offsets[i] = (bfd_vma) -1; + elf_local_got_refcounts (abfd) = local_got_refcounts; + memset (local_got_refcounts, -1, size); } - if (local_got_offsets[r_symndx] != (bfd_vma) -1) + if (local_got_refcounts[r_symndx] == -1) { - /* We have already allocated space in the .got. */ - break; - } - local_got_offsets[r_symndx] = sgot->_raw_size; + local_got_refcounts[r_symndx] = 1; - 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); + 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; } - - sgot->_raw_size += 4; - break; case R_386_PLT32: @@ -588,8 +620,13 @@ elf_i386_check_relocs (abfd, info, sec, relocs) if (h == NULL) continue; - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - + if (h->plt.refcount == -1) + { + h->plt.refcount = 1; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + } + else + h->plt.refcount += 1; break; case R_386_32: @@ -598,28 +635,33 @@ elf_i386_check_relocs (abfd, info, sec, relocs) h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; /* 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). We account for that - possibility below by storing information in the - pcrel_relocs_copied field of the hash table entry. */ + 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 (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)))) { /* 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. */ + reloc types into the output file. We create a reloc + section in dynobj and make room for this reloc. */ if (sreloc == NULL) { const char *name; @@ -631,9 +673,20 @@ elf_i386_check_relocs (abfd, info, sec, relocs) if (name == NULL) return false; - BFD_ASSERT (strncmp (name, ".rel", 4) == 0 - && strcmp (bfd_get_section_name (abfd, sec), - name + 4) == 0); + if (strncmp (name, ".rel", 4) != 0 + || 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); + } sreloc = bfd_get_section_by_name (dynobj, name); if (sreloc == NULL) @@ -654,15 +707,13 @@ elf_i386_check_relocs (abfd, info, sec, relocs) sreloc->_raw_size += sizeof (Elf32_External_Rel); - /* If we are linking with -Bsymbolic, and 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 again if the symbol is later - defined by a regular object. 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 && info->symbolic + /* 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) { struct elf_i386_link_hash_entry *eh; @@ -766,14 +817,81 @@ elf_i386_gc_mark_hook (abfd, info, rel, h, sym) static boolean elf_i386_gc_sweep_hook (abfd, info, sec, relocs) - bfd *abfd ATTRIBUTE_UNUSED; + bfd *abfd; struct bfd_link_info *info ATTRIBUTE_UNUSED; - asection *sec ATTRIBUTE_UNUSED; - const Elf_Internal_Rela *relocs ATTRIBUTE_UNUSED; + asection *sec; + const Elf_Internal_Rela *relocs; { - /* ??? It would seem that the existing i386 code does no sort - of reference counting or whatnot on its GOT and PLT entries, - so it is not possible to garbage collect them at this time. */ + Elf_Internal_Shdr *symtab_hdr; + struct elf_link_hash_entry **sym_hashes; + bfd_signed_vma *local_got_refcounts; + const Elf_Internal_Rela *rel, *relend; + unsigned long r_symndx; + struct elf_link_hash_entry *h; + bfd *dynobj; + asection *sgot; + asection *srelgot; + + 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)) + { + case R_386_GOT32: + case R_386_GOTOFF: + case R_386_GOTPC: + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + 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); + } + } + } + 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); + } + } + } + break; + + case R_386_PLT32: + r_symndx = ELF32_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + break; + + default: + break; + } return true; } @@ -812,16 +930,18 @@ elf_i386_adjust_dynamic_symbol (info, h) 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) + 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)) { /* This case can occur if we saw a PLT32 reloc in an input - file, but the symbol was never referred to by a dynamic - object. In such a case, we don't actually need to build - a procedure linkage table, and we can just do a PC32 - reloc instead. */ - BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0); + file, but the symbol was never referred to by a dynamic + object, or if all references were garbage collected. In + such a case, we don't actually need to build a procedure + 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; } @@ -859,13 +979,11 @@ elf_i386_adjust_dynamic_symbol (info, h) /* 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); @@ -995,10 +1113,10 @@ elf_i386_size_dynamic_sections (output_bfd, info) 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 && info->symbolic) + if (info->shared) elf_i386_link_hash_traverse (elf_i386_hash_table (info), elf_i386_discard_copies, - (PTR) NULL); + (PTR) info); /* The check_relocs and adjust_dynamic_symbol entry points have determined the sizes of the various dynamic sections. Allocate @@ -1092,8 +1210,12 @@ elf_i386_size_dynamic_sections (output_bfd, info) continue; } - /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size); + /* 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_386_NONE reloc instead + of garbage. */ + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) return false; } @@ -1133,6 +1255,7 @@ elf_i386_size_dynamic_sections (output_bfd, info) { if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; + info->flags |= DF_TEXTREL; } } @@ -1140,26 +1263,32 @@ elf_i386_size_dynamic_sections (output_bfd, info) } /* This function is called via elf_i386_link_hash_traverse if we are - creating a shared object with -Bsymbolic. It discards the space - allocated to copy PC relative relocs against symbols which are - defined in regular objects. We allocated space for them in the + 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. */ -/*ARGSUSED*/ static boolean -elf_i386_discard_copies (h, ignore) +elf_i386_discard_copies (h, inf) struct elf_i386_link_hash_entry *h; - PTR ignore ATTRIBUTE_UNUSED; + PTR inf; { struct elf_i386_pcrel_relocs_copied *s; + struct bfd_link_info *info = (struct bfd_link_info *) inf; - /* We only discard relocs for symbols defined in a regular object. */ - if ((h->root.elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - return true; - - for (s = h->pcrel_relocs_copied; s != NULL; s = s->next) - s->section->_raw_size -= s->count * sizeof (Elf32_External_Rel); + /* 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); + } return true; } @@ -1193,9 +1322,14 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, sym_hashes = elf_sym_hashes (input_bfd); local_got_offsets = elf_local_got_offsets (input_bfd); - sgot = NULL; - splt = NULL; 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; @@ -1209,20 +1343,21 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, asection *sec; bfd_vma relocation; bfd_reloc_status_type r; + unsigned int indx; r_type = ELF32_R_TYPE (rel->r_info); - if (r_type == R_386_GNU_VTINHERIT - || r_type == R_386_GNU_VTENTRY) + if (r_type == (int) R_386_GNU_VTINHERIT + || r_type == (int) R_386_GNU_VTENTRY) continue; - if (r_type < 0 - || r_type >= (int) R_386_max - || (r_type >= (int) FIRST_INVALID_RELOC - && r_type <= (int) LAST_INVALID_RELOC)) + + if ((indx = (unsigned) r_type) >= R_386_standard + && ((indx = (unsigned) r_type - R_386_ext_offset) - R_386_standard + >= R_386_ext - R_386_standard)) { bfd_set_error (bfd_error_bad_value); return false; } - howto = elf_howto_table + r_type; + howto = elf_howto_table + indx; r_symndx = ELF32_R_SYM (rel->r_info); @@ -1273,6 +1408,7 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, 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 @@ -1336,11 +1472,7 @@ 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. */ - if (sgot == NULL) - { - sgot = bfd_get_section_by_name (dynobj, ".got"); - BFD_ASSERT (sgot != NULL); - } + BFD_ASSERT (sgot != NULL); if (h != NULL) { @@ -1459,12 +1591,13 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, /* Relocation is to the entry for this symbol in the procedure linkage table. */ - /* Resolve a PLT32 reloc again a local symbol directly, + /* Resolve a PLT32 reloc against a local symbol directly, without using the procedure linkage table. */ if (h == NULL) break; - if (h->plt.offset == (bfd_vma) -1) + if (h->plt.offset == (bfd_vma) -1 + || splt == NULL) { /* We didn't make a PLT entry for this symbol. This happens when statically linking PIC code, or when @@ -1472,12 +1605,6 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, break; } - if (splt == NULL) - { - splt = bfd_get_section_by_name (dynobj, ".plt"); - BFD_ASSERT (splt != NULL); - } - relocation = (splt->output_section->vma + splt->output_offset + h->plt.offset); @@ -1513,10 +1640,22 @@ elf_i386_relocate_section (output_bfd, info, input_bfd, input_section, if (name == NULL) return false; - BFD_ASSERT (strncmp (name, ".rel", 4) == 0 - && strcmp (bfd_get_section_name (input_bfd, - input_section), - name + 4) == 0); + 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); @@ -1744,17 +1883,21 @@ elf_i386_finish_dynamic_symbol (output_bfd, info, h, sym) + sgot->output_offset + (h->got.offset &~ 1)); - /* If this is a -Bsymbolic link, and the symbol is defined - locally, we just want to emit a RELATIVE reloc. Likewise if - the symbol was forced to be local because of a version file. + /* 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_HASH_DEF_REGULAR)) - rel.r_info = ELF32_R_INFO (0, R_386_RELATIVE); + 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))) + { + 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); rel.r_info = ELF32_R_INFO (h->dynindx, R_386_GLOB_DAT); } @@ -1928,27 +2071,6 @@ elf_i386_finish_dynamic_sections (output_bfd, info) #define ELF_ARCH bfd_arch_i386 #define ELF_MACHINE_CODE EM_386 #define ELF_MAXPAGESIZE 0x1000 -#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_reloc_type_lookup elf_i386_reloc_type_lookup -#define bfd_elf32_bfd_is_local_label_name \ - elf_i386_is_local_label_name -#define elf_backend_create_dynamic_sections \ - _bfd_elf_create_dynamic_sections -#define bfd_elf32_bfd_link_hash_table_create \ - elf_i386_link_hash_table_create -#define elf_backend_check_relocs elf_i386_check_relocs -#define elf_backend_adjust_dynamic_symbol \ - elf_i386_adjust_dynamic_symbol -#define elf_backend_size_dynamic_sections \ - elf_i386_size_dynamic_sections -#define elf_backend_relocate_section elf_i386_relocate_section -#define elf_backend_finish_dynamic_symbol \ - elf_i386_finish_dynamic_symbol -#define elf_backend_finish_dynamic_sections \ - elf_i386_finish_dynamic_sections -#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_can_gc_sections 1 #define elf_backend_want_got_plt 1 @@ -1957,4 +2079,22 @@ elf_i386_finish_dynamic_sections (output_bfd, info) #define elf_backend_got_header_size 12 #define elf_backend_plt_header_size PLT_ENTRY_SIZE +#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_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_relocate_section elf_i386_relocate_section +#define elf_backend_size_dynamic_sections elf_i386_size_dynamic_sections + #include "elf32-target.h" diff --git a/gnu/dist/toolchain/bfd/elf32-i860.c b/gnu/dist/toolchain/bfd/elf32-i860.c index 6a2d2d975635..a2e3e5d1e666 100644 --- a/gnu/dist/toolchain/bfd/elf32-i860.c +++ b/gnu/dist/toolchain/bfd/elf32-i860.c @@ -1,5 +1,7 @@ -/* Intel 860 specific support for 32-bit ELF - Copyright 1993 Free Software Foundation, Inc. +/* Intel i860 specific support for 32-bit ELF. + Copyright 1993, 2000 Free Software Foundation, Inc. + + Full i860 support contributed by Jason Eckhardt . This file is part of BFD, the Binary File Descriptor library. @@ -21,14 +23,1085 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" #include "elf-bfd.h" +#include "elf/i860.h" -#define bfd_elf32_bfd_reloc_type_lookup bfd_default_reloc_type_lookup -#define elf_info_to_howto _bfd_elf_no_info_to_howto +/* Prototypes. */ +static reloc_howto_type *lookup_howto + PARAMS ((unsigned int)); -#define TARGET_BIG_SYM bfd_elf32_i860_vec -#define TARGET_BIG_NAME "elf32-i860" -#define ELF_ARCH bfd_arch_i860 -#define ELF_MACHINE_CODE EM_860 -#define ELF_MAXPAGESIZE 1 /* FIXME: This number is wrong, It should be the page size in bytes. */ +static reloc_howto_type *elf32_i860_reloc_type_lookup + PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); + +static void elf32_i860_info_to_howto_rela + PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *)); + +static bfd_reloc_status_type elf32_i860_relocate_splitn + PARAMS ((bfd *, Elf_Internal_Rela *, bfd_byte *, bfd_vma)); + +static bfd_reloc_status_type elf32_i860_relocate_pc16 + PARAMS ((bfd *, asection *, Elf_Internal_Rela *, bfd_byte *, bfd_vma)); + +static bfd_reloc_status_type elf32_i860_relocate_pc26 + PARAMS ((bfd *, asection *, Elf_Internal_Rela *, bfd_byte *, bfd_vma)); + +static bfd_reloc_status_type elf32_i860_relocate_highadj + PARAMS ((bfd *, Elf_Internal_Rela *, bfd_byte *, bfd_vma)); + +static boolean elf32_i860_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); + +static bfd_reloc_status_type i860_final_link_relocate + PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, bfd_vma)); + +static boolean elf32_i860_is_local_label_name + PARAMS ((bfd *, const char *)); + +/* This howto table is preliminary. */ +static reloc_howto_type elf32_i860_howto_table [] = +{ + /* This relocation does nothing. */ + HOWTO (R_860_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_860_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 32-bit absolute relocation. */ + HOWTO (R_860_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_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_860_COPY", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_GLOB_DAT, /* 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_860_GLOB_DAT", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_JUMP_SLOT, /* 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_860_JUMP_SLOT", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_RELATIVE, /* 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_860_RELATIVE", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 26-bit PC-relative relocation. */ + HOWTO (R_860_PC26, /* 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_860_PC26", /* name */ + false, /* partial_inplace */ + 0x3ffffff, /* src_mask */ + 0x3ffffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_860_PLT26, /* type */ + 0, /* 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_860_PLT26", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + true), /* pcrel_offset */ + + /* A 16-bit PC-relative relocation. */ + HOWTO (R_860_PC16, /* type */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_PC16", /* name */ + false, /* partial_inplace */ + 0x1f07ff, /* src_mask */ + 0x1f07ff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_860_LOW0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_LOW0", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_SPLIT0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_SPLIT0", /* name */ + false, /* partial_inplace */ + 0x1f07ff, /* src_mask */ + 0x1f07ff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_LOW1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_LOW1", /* name */ + false, /* partial_inplace */ + 0xfffe, /* src_mask */ + 0xfffe, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_SPLIT1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_SPLIT1", /* name */ + false, /* partial_inplace */ + 0x1f07fe, /* src_mask */ + 0x1f07fe, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_LOW2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_LOW2", /* name */ + false, /* partial_inplace */ + 0xfffc, /* src_mask */ + 0xfffc, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_SPLIT2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_SPLIT2", /* name */ + false, /* partial_inplace */ + 0x1f07fc, /* src_mask */ + 0x1f07fc, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_LOW3, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_LOW3", /* name */ + false, /* partial_inplace */ + 0xfff8, /* src_mask */ + 0xfff8, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_LOGOT0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_LOGOT0", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_860_SPGOT0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_SPGOT0", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_860_LOGOT1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_LOGOT1", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_860_SPGOT1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_SPGOT1", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_860_LOGOTOFF0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_LOGOTOFF0", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_SPGOTOFF0, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_SPGOTOFF0", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_LOGOTOFF1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_LOGOTOFF1", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_SPGOTOFF1, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_SPGOTOFF1", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_LOGOTOFF2, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_LOGOTOFF2", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_LOGOTOFF3, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_LOGOTOFF3", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_LOPC, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_LOPC", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_860_HIGHADJ, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_HIGHADJ", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_HAGOT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_HAGOT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_860_HAGOTOFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_HAGOTOFF", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_HAPC, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_HAPC", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_860_HIGH, /* type */ + 16, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_HIGH", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + HOWTO (R_860_HIGOT, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_HIGOT", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0xffff, /* dst_mask */ + true), /* pcrel_offset */ + + HOWTO (R_860_HIGOTOFF, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_860_HIGOTOFF", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ +}; + +static unsigned char elf_code_to_howto_index[R_860_max + 1]; + +static reloc_howto_type * +lookup_howto (rtype) + unsigned int rtype; +{ + static int initialized = 0; + int i; + int howto_tbl_size = (int) (sizeof (elf32_i860_howto_table) + / sizeof (elf32_i860_howto_table[0])); + + if (! initialized) + { + initialized = 1; + memset (elf_code_to_howto_index, 0xff, + sizeof (elf_code_to_howto_index)); + for (i = 0; i < howto_tbl_size; i++) + elf_code_to_howto_index[elf32_i860_howto_table[i].type] = i; + } + + BFD_ASSERT (rtype <= R_860_max); + i = elf_code_to_howto_index[rtype]; + if (i >= howto_tbl_size) + return 0; + return elf32_i860_howto_table + i; +} + +/* Given a BFD reloc, return the matching HOWTO structure. */ +static reloc_howto_type * +elf32_i860_reloc_type_lookup (abfd, code) + bfd * abfd ATTRIBUTE_UNUSED; + bfd_reloc_code_real_type code; +{ + unsigned int rtype; + + switch (code) + { + case BFD_RELOC_NONE: + rtype = R_860_NONE; + break; + case BFD_RELOC_32: + rtype = R_860_32; + break; + case BFD_RELOC_860_COPY: + rtype = R_860_COPY; + break; + case BFD_RELOC_860_GLOB_DAT: + rtype = R_860_GLOB_DAT; + break; + case BFD_RELOC_860_JUMP_SLOT: + rtype = R_860_JUMP_SLOT; + break; + case BFD_RELOC_860_RELATIVE: + rtype = R_860_RELATIVE; + break; + case BFD_RELOC_860_PC26: + rtype = R_860_PC26; + break; + case BFD_RELOC_860_PLT26: + rtype = R_860_PLT26; + break; + case BFD_RELOC_860_PC16: + rtype = R_860_PC16; + break; + case BFD_RELOC_860_LOW0: + rtype = R_860_LOW0; + break; + case BFD_RELOC_860_SPLIT0: + rtype = R_860_SPLIT0; + break; + case BFD_RELOC_860_LOW1: + rtype = R_860_LOW1; + break; + case BFD_RELOC_860_SPLIT1: + rtype = R_860_SPLIT1; + break; + case BFD_RELOC_860_LOW2: + rtype = R_860_LOW2; + break; + case BFD_RELOC_860_SPLIT2: + rtype = R_860_SPLIT2; + break; + case BFD_RELOC_860_LOW3: + rtype = R_860_LOW3; + break; + case BFD_RELOC_860_LOGOT0: + rtype = R_860_LOGOT0; + break; + case BFD_RELOC_860_SPGOT0: + rtype = R_860_SPGOT0; + break; + case BFD_RELOC_860_LOGOT1: + rtype = R_860_LOGOT1; + break; + case BFD_RELOC_860_SPGOT1: + rtype = R_860_SPGOT1; + break; + case BFD_RELOC_860_LOGOTOFF0: + rtype = R_860_LOGOTOFF0; + break; + case BFD_RELOC_860_SPGOTOFF0: + rtype = R_860_SPGOTOFF0; + break; + case BFD_RELOC_860_LOGOTOFF1: + rtype = R_860_LOGOTOFF1; + break; + case BFD_RELOC_860_SPGOTOFF1: + rtype = R_860_SPGOTOFF1; + break; + case BFD_RELOC_860_LOGOTOFF2: + rtype = R_860_LOGOTOFF2; + break; + case BFD_RELOC_860_LOGOTOFF3: + rtype = R_860_LOGOTOFF3; + break; + case BFD_RELOC_860_LOPC: + rtype = R_860_LOPC; + break; + case BFD_RELOC_860_HIGHADJ: + rtype = R_860_HIGHADJ; + break; + case BFD_RELOC_860_HAGOT: + rtype = R_860_HAGOT; + break; + case BFD_RELOC_860_HAGOTOFF: + rtype = R_860_HAGOTOFF; + break; + case BFD_RELOC_860_HAPC: + rtype = R_860_HAPC; + break; + case BFD_RELOC_860_HIGH: + rtype = R_860_HIGH; + break; + case BFD_RELOC_860_HIGOT: + rtype = R_860_HIGOT; + break; + case BFD_RELOC_860_HIGOTOFF: + rtype = R_860_HIGOTOFF; + break; + default: + rtype = 0; + break; + } + return lookup_howto (rtype); +} + +/* Given a ELF reloc, return the matching HOWTO structure. */ +static void +elf32_i860_info_to_howto_rela (abfd, bfd_reloc, elf_reloc) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *bfd_reloc; + Elf64_Internal_Rela *elf_reloc; +{ + bfd_reloc->howto = lookup_howto (ELF32_R_TYPE (elf_reloc->r_info)); +} + +/* Specialized relocation handler for R_860_SPLITn. These relocations + involves a 16-bit field that is split into two contiguous parts. */ +static bfd_reloc_status_type +elf32_i860_relocate_splitn (input_bfd, rello, contents, value) + bfd *input_bfd; + Elf_Internal_Rela *rello; + bfd_byte *contents; + bfd_vma value; +{ + bfd_vma insn; + reloc_howto_type *howto; + howto = lookup_howto (ELF32_R_TYPE (rello->r_info)); + insn = bfd_get_32 (input_bfd, contents + rello->r_offset); + + /* Relocate. */ + value += rello->r_addend; + + /* Separate the fields and insert. */ + value = (((value & 0xf8) << 5) | (value & 0x7ff)) & howto->dst_mask; + insn = (insn & ~howto->dst_mask) | value; + + bfd_put_32 (input_bfd, insn, contents + rello->r_offset); + return bfd_reloc_ok; +} + +/* Specialized relocation handler for R_860_PC16. This relocation + involves a 16-bit, PC-relative field that is split into two contiguous + parts. */ +static bfd_reloc_status_type +elf32_i860_relocate_pc16 (input_bfd, input_section, rello, contents, value) + bfd *input_bfd; + asection *input_section; + Elf_Internal_Rela *rello; + bfd_byte *contents; + bfd_vma value; +{ + bfd_vma insn; + reloc_howto_type *howto; + howto = lookup_howto (ELF32_R_TYPE (rello->r_info)); + insn = bfd_get_32 (input_bfd, contents + rello->r_offset); + + /* Adjust for PC-relative relocation. */ + value -= (input_section->output_section->vma + + input_section->output_offset); + value -= rello->r_offset; + + /* Relocate. */ + value += rello->r_addend; + + /* Separate the fields and insert. */ + value = (((value & 0xf8) << 5) | (value & 0x7ff)) & howto->dst_mask; + insn = (insn & ~howto->dst_mask) | value; + + bfd_put_32 (input_bfd, insn, contents + rello->r_offset); + return bfd_reloc_ok; + +} + +/* Specialized relocation handler for R_860_PC26. This relocation + involves a 26-bit, PC-relative field which must be adjusted by 4. */ +static bfd_reloc_status_type +elf32_i860_relocate_pc26 (input_bfd, input_section, rello, contents, value) + bfd *input_bfd; + asection *input_section; + Elf_Internal_Rela *rello; + bfd_byte *contents; + bfd_vma value; +{ + bfd_vma insn; + reloc_howto_type *howto; + howto = lookup_howto (ELF32_R_TYPE (rello->r_info)); + insn = bfd_get_32 (input_bfd, contents + rello->r_offset); + + /* Adjust for PC-relative relocation. */ + value -= (input_section->output_section->vma + + input_section->output_offset); + value -= rello->r_offset; + + /* Relocate. */ + value += rello->r_addend; + + /* Adjust value by 4 and insert the field. */ + value = ((value - 4) >> howto->rightshift) & howto->dst_mask; + insn = (insn & ~howto->dst_mask) | value; + + bfd_put_32 (input_bfd, insn, contents + rello->r_offset); + return bfd_reloc_ok; + +} + +/* Specialized relocation handler for R_860_HIGHADJ. */ +static bfd_reloc_status_type +elf32_i860_relocate_highadj (input_bfd, rel, contents, value) + bfd *input_bfd; + Elf_Internal_Rela *rel; + bfd_byte *contents; + bfd_vma value; +{ + bfd_vma insn; + + insn = bfd_get_32 (input_bfd, contents + rel->r_offset); + + value += ((rel->r_addend & 0x8000) << 1); + value += rel->r_addend; + value = ((value >> 16) & 0xffff); + + insn = (insn & 0xffff0000) | value; + + bfd_put_32 (input_bfd, insn, contents + rel->r_offset); + return bfd_reloc_ok; +} + +/* Perform a single relocation. By default we use the standard BFD + routines. However, we handle some specially. */ +static bfd_reloc_status_type +i860_final_link_relocate (howto, input_bfd, input_section, contents, rel, relocation) + reloc_howto_type * howto; + bfd * input_bfd; + asection * input_section; + bfd_byte * contents; + Elf_Internal_Rela * rel; + bfd_vma relocation; +{ + return _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, rel->r_offset, relocation, + rel->r_addend); +} + +/* Relocate an i860 ELF section. + + This is boiler-plate code copied from fr30. + There is some attempt to make this function usable for many architectures, + both USE_REL and USE_RELA ['twould be nice if such a critter existed], + if only to serve as a learning tool. + + The RELOCATE_SECTION function is called by the new ELF backend linker + to handle the relocations for a section. + + The relocs are always passed as Rela structures; if the section + actually uses Rel structures, the r_addend field will always be + zero. + + This function is responsible for adjusting the section contents as + necessary, and (if using Rela relocs and generating a 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 +elf32_i860_relocate_section (output_bfd, info, input_bfd, input_section, + contents, relocs, local_syms, local_sections) + bfd * output_bfd ATTRIBUTE_UNUSED; + struct bfd_link_info * info; + bfd * input_bfd; + asection * input_section; + bfd_byte * contents; + Elf_Internal_Rela * relocs; + Elf_Internal_Sym * local_syms; + asection ** local_sections; +{ + Elf_Internal_Shdr * symtab_hdr; + struct elf_link_hash_entry ** sym_hashes; + Elf_Internal_Rela * rel; + Elf_Internal_Rela * relend; + + symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (input_bfd); + relend = relocs + input_section->reloc_count; + + for (rel = relocs; rel < relend; rel ++) + { + reloc_howto_type * howto; + unsigned long r_symndx; + Elf_Internal_Sym * sym; + asection * sec; + struct elf_link_hash_entry * h; + bfd_vma relocation; + bfd_reloc_status_type r; + const char * name = NULL; + int r_type; + + r_type = ELF32_R_TYPE (rel->r_info); + +#if 0 + if ( r_type == R_860_GNU_VTINHERIT + || r_type == R_860_GNU_VTENTRY) + continue; +#endif + + r_symndx = ELF32_R_SYM (rel->r_info); + + if (info->relocateable) + { + /* This is a relocateable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + + if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + sec = local_sections [r_symndx]; + rel->r_addend += sec->output_offset + sym->st_value; + } + } + + continue; + } + + /* This is a final link. */ + howto = lookup_howto (ELF32_R_TYPE (rel->r_info)); + h = NULL; + sym = NULL; + sec = NULL; + + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections [r_symndx]; + relocation = (sec->output_section->vma + + sec->output_offset + + sym->st_value); + + name = bfd_elf_string_from_elf_section + (input_bfd, symtab_hdr->sh_link, sym->st_name); + name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name; + } + else + { + h = sym_hashes [r_symndx - symtab_hdr->sh_info]; + + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + + name = h->root.root.string; + + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sec = h->root.u.def.section; + relocation = (h->root.u.def.value + + sec->output_section->vma + + sec->output_offset); + } + else if (h->root.type == bfd_link_hash_undefweak) + { + relocation = 0; + } + else + { + if (! ((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, + input_section, rel->r_offset, true))) + return false; + relocation = 0; + } + } + + switch (r_type) + { + default: + r = i860_final_link_relocate (howto, input_bfd, input_section, + contents, rel, relocation); + break; + + case R_860_HIGHADJ: + r = elf32_i860_relocate_highadj (input_bfd, rel, contents, + relocation); + break; + + case R_860_PC16: + r = elf32_i860_relocate_pc16 (input_bfd, input_section, rel, + contents, relocation); + break; + + case R_860_PC26: + r = elf32_i860_relocate_pc26 (input_bfd, input_section, rel, + contents, relocation); + break; + + case R_860_SPLIT0: + case R_860_SPLIT1: + case R_860_SPLIT2: + r = elf32_i860_relocate_splitn (input_bfd, rel, contents, + relocation); + break; + + /* We do not yet handle GOT/PLT/Dynamic relocations. */ + case R_860_COPY: + case R_860_GLOB_DAT: + case R_860_JUMP_SLOT: + case R_860_RELATIVE: + case R_860_PLT26: + case R_860_LOGOT0: + case R_860_SPGOT0: + case R_860_LOGOT1: + case R_860_SPGOT1: + case R_860_LOGOTOFF0: + case R_860_SPGOTOFF0: + case R_860_LOGOTOFF1: + case R_860_SPGOTOFF1: + case R_860_LOGOTOFF2: + case R_860_LOGOTOFF3: + case R_860_LOPC: + case R_860_HAGOT: + case R_860_HAGOTOFF: + case R_860_HAPC: + case R_860_HIGOT: + case R_860_HIGOTOFF: + r = bfd_reloc_notsupported; + break; + } + + if (r != bfd_reloc_ok) + { + const char * msg = (const char *) NULL; + + switch (r) + { + case bfd_reloc_overflow: + r = info->callbacks->reloc_overflow + (info, name, howto->name, (bfd_vma) 0, + input_bfd, input_section, rel->r_offset); + break; + + case bfd_reloc_undefined: + r = info->callbacks->undefined_symbol + (info, name, input_bfd, input_section, rel->r_offset, true); + break; + + case bfd_reloc_outofrange: + msg = _("internal error: out of range error"); + break; + + case bfd_reloc_notsupported: + msg = _("internal error: unsupported relocation error"); + break; + + case bfd_reloc_dangerous: + msg = _("internal error: dangerous relocation"); + break; + + default: + msg = _("internal error: unknown error"); + break; + } + + if (msg) + r = info->callbacks->warning + (info, msg, name, input_bfd, input_section, rel->r_offset); + + if (! r) + return false; + } + } + + return true; +} + +/* Return whether a symbol name implies a local label. SVR4/860 compilers + generate labels of the form ".ep.function_name" to denote the end of a + function prolog. These should be local. + ??? Do any other SVR4 compilers have this convention? If so, this should + be added to the generic routine. */ +static boolean +elf32_i860_is_local_label_name (abfd, name) + bfd *abfd; + const char *name; +{ + if (name[0] == '.' && name[1] == 'e' && name[2] == 'p' && name[3] == '.') + return true; + + return _bfd_elf_is_local_label_name (abfd, name); +} + +#define TARGET_BIG_SYM bfd_elf32_i860_vec +#define TARGET_BIG_NAME "elf32-i860" +#define TARGET_LITTLE_SYM bfd_elf32_i860_little_vec +#define TARGET_LITTLE_NAME "elf32-i860-little" +#define ELF_ARCH bfd_arch_i860 +#define ELF_MACHINE_CODE EM_860 +#define ELF_MAXPAGESIZE 4096 + +#define elf_info_to_howto_rel NULL +#define elf_info_to_howto elf32_i860_info_to_howto_rela +#define elf_backend_relocate_section elf32_i860_relocate_section +#define bfd_elf32_bfd_reloc_type_lookup elf32_i860_reloc_type_lookup +#define bfd_elf32_bfd_is_local_label_name elf32_i860_is_local_label_name #include "elf32-target.h" diff --git a/gnu/dist/toolchain/bfd/elf32-i960.c b/gnu/dist/toolchain/bfd/elf32-i960.c index 839fc3d892af..0d03d570f639 100644 --- a/gnu/dist/toolchain/bfd/elf32-i960.c +++ b/gnu/dist/toolchain/bfd/elf32-i960.c @@ -102,7 +102,6 @@ elf32_i960_info_to_howto_rel (abfd, cache_ptr, dst) function. It just short circuits the reloc if producing relocateable output against an external symbol. */ -/*ARGSUSED*/ bfd_reloc_status_type elf32_i960_relocate (abfd, reloc_entry, @@ -129,7 +128,7 @@ elf32_i960_relocate (abfd, { reloc_entry->addend -= symbol->value; } - /* This is more dubious. */ + /* This is more dubious. */ else if (output_bfd != (bfd *) NULL && (symbol->flags & BSF_SECTION_SYM) != 0) { diff --git a/gnu/dist/toolchain/bfd/elf32-m32r.c b/gnu/dist/toolchain/bfd/elf32-m32r.c index efb655526716..cfdb1c3b2ce7 100644 --- a/gnu/dist/toolchain/bfd/elf32-m32r.c +++ b/gnu/dist/toolchain/bfd/elf32-m32r.c @@ -566,8 +566,8 @@ m32r_elf_lo16_reloc (input_bfd, reloc_entry, symbol, data, input_section, output_bfd, error_message); } -/* Do generic partial_inplace relocation. - This is a local replacement for bfd_elf_generic_reloc. */ +/* Do generic partial_inplace relocation. + This is a local replacement for bfd_elf_generic_reloc. */ bfd_reloc_status_type m32r_elf_generic_reloc (input_bfd, reloc_entry, symbol, data, @@ -578,7 +578,7 @@ m32r_elf_generic_reloc (input_bfd, reloc_entry, symbol, data, PTR data; asection *input_section; bfd *output_bfd; - char **error_message; + char **error_message ATTRIBUTE_UNUSED; { bfd_reloc_status_type ret; bfd_vma relocation; @@ -624,7 +624,7 @@ m32r_elf_generic_reloc (input_bfd, reloc_entry, symbol, data, } relocation += reloc_entry->addend; - inplace_address = data + reloc_entry->address; + inplace_address = (bfd_byte *) data + reloc_entry->address; #define DOIT(x) \ x = ( (x & ~reloc_entry->howto->dst_mask) | \ @@ -1313,7 +1313,7 @@ m32r_elf_relocate_section (output_bfd, info, input_bfd, input_section, When the chip supports parallel 16 bit insns, things may change. */ -static boolean +static boolean m32r_elf_relax_section (abfd, sec, link_info, again) bfd *abfd; asection *sec; @@ -1925,7 +1925,7 @@ m32r_elf_final_write_processing (abfd, linker) elf_elfheader (abfd)->e_flags |= val; } -/* Function to keep M32R specific file flags. */ +/* Function to keep M32R specific file flags. */ static boolean m32r_elf_set_private_flags (abfd, flags) bfd * abfd; @@ -1986,7 +1986,7 @@ m32r_elf_merge_private_bfd_data (ibfd, obfd) to the default values. */ if (bfd_get_arch_info (ibfd)->the_default) return true; - + elf_flags_init (obfd) = true; elf_elfheader (obfd)->e_flags = in_flags; @@ -2025,22 +2025,22 @@ m32r_elf_print_private_bfd_data (abfd, ptr) PTR ptr; { FILE * file = (FILE *) ptr; - + BFD_ASSERT (abfd != NULL && ptr != NULL) - + _bfd_elf_print_private_bfd_data (abfd, ptr); - + fprintf (file, _("private flags = %lx"), elf_elfheader (abfd)->e_flags); - + switch (elf_elfheader (abfd)->e_flags & EF_M32R_ARCH) { default: case E_M32R_ARCH: fprintf (file, _(": m32r instructions")); break; case E_M32RX_ARCH: fprintf (file, _(": m32rx instructions")); break; } - + fputc ('\n', file); - + return true; } @@ -2059,14 +2059,14 @@ m32r_elf_gc_mark_hook (abfd, info, rel, h, sym) case R_M32R_GNU_VTINHERIT: case R_M32R_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; @@ -2099,11 +2099,10 @@ m32r_elf_gc_sweep_hook (abfd, info, sec, relocs) return true; } - /* Look through the relocs for a section during the first phase. Since we don't do .gots or .plts, we just need to consider the virtual table relocs for gc. */ - + static boolean m32r_elf_check_relocs (abfd, info, sec, relocs) bfd *abfd; @@ -2115,28 +2114,28 @@ m32r_elf_check_relocs (abfd, info, sec, relocs) struct elf_link_hash_entry **sym_hashes, **sym_hashes_end; const Elf_Internal_Rela *rel; const Elf_Internal_Rela *rel_end; - + if (info->relocateable) return true; - + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); - sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym); + sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof (Elf32_External_Sym); if (!elf_bad_symtab (abfd)) sym_hashes_end -= symtab_hdr->sh_info; - + rel_end = relocs + sec->reloc_count; for (rel = relocs; rel < rel_end; rel++) { struct elf_link_hash_entry *h; unsigned long r_symndx; - + r_symndx = ELF32_R_SYM (rel->r_info); if (r_symndx < symtab_hdr->sh_info) h = NULL; else h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - + switch (ELF32_R_TYPE (rel->r_info)) { /* This relocation describes the C++ object vtable hierarchy. @@ -2145,7 +2144,7 @@ m32r_elf_check_relocs (abfd, info, sec, relocs) if (!_bfd_elf32_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_M32R_GNU_VTENTRY: @@ -2154,13 +2153,10 @@ m32r_elf_check_relocs (abfd, info, sec, relocs) break; } } - + return true; } - - - #define ELF_ARCH bfd_arch_m32r #define ELF_MACHINE_CODE EM_CYGNUS_M32R #define ELF_MAXPAGESIZE 0x1 /* Explicitly requested by Mitsubishi. */ @@ -2192,5 +2188,5 @@ m32r_elf_check_relocs (abfd, info, sec, relocs) #define bfd_elf32_bfd_merge_private_bfd_data m32r_elf_merge_private_bfd_data #define bfd_elf32_bfd_set_private_flags m32r_elf_set_private_flags #define bfd_elf32_bfd_print_private_bfd_data m32r_elf_print_private_bfd_data - + #include "elf32-target.h" diff --git a/gnu/dist/toolchain/bfd/elf32-m68hc11.c b/gnu/dist/toolchain/bfd/elf32-m68hc11.c new file mode 100644 index 000000000000..177db3e2ee73 --- /dev/null +++ b/gnu/dist/toolchain/bfd/elf32-m68hc11.c @@ -0,0 +1,280 @@ +/* Motorola 68HC11-specific support for 32-bit ELF + Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Contributed by Stephane Carrez (stcarrez@worldnet.fr) + (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com)) + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "elf-bfd.h" +#include "elf/m68hc11.h" + +static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup +PARAMS ((bfd * abfd, bfd_reloc_code_real_type code)); +static void m68hc11_info_to_howto_rel +PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); + +/* Use REL instead of RELA to save space */ +#define USE_REL + +/* The Motorola 68HC11 microcontroler only addresses 64Kb. + We must handle 8 and 16-bit relocations. The 32-bit relocation + is defined but not used except by gas when -gstabs is used (which + is wrong). + The 3-bit and 16-bit PC rel relocation is only used by 68HC12. */ +static reloc_howto_type elf_m68hc11_howto_table[] = { + /* This reloc does nothing. */ + HOWTO (R_M68HC11_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_M68HC11_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 8 bit absolute relocation */ + HOWTO (R_M68HC11_8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_8", /* name */ + false, /* partial_inplace */ + 0x00ff, /* src_mask */ + 0x00ff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 8 bit absolute relocation (upper address) */ + HOWTO (R_M68HC11_HI8, /* type */ + 8, /* 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_M68HC11_HI8", /* name */ + false, /* partial_inplace */ + 0x00ff, /* src_mask */ + 0x00ff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 8 bit absolute relocation (upper address) */ + HOWTO (R_M68HC11_LO8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_LO8", /* name */ + false, /* partial_inplace */ + 0x00ff, /* src_mask */ + 0x00ff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 8 bit PC-rel relocation */ + HOWTO (R_M68HC11_PCREL_8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_PCREL_8", /* name */ + false, /* partial_inplace */ + 0x0, /* src_mask */ + 0x00ff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 16 bit absolute relocation */ + HOWTO (R_M68HC11_16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont /*bitfield */ , /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_16", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 32 bit absolute relocation. This one is never used for the + code relocation. It's used by gas for -gstabs generation. */ + HOWTO (R_M68HC11_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 3 bit absolute relocation */ + HOWTO (R_M68HC11_3B, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 3, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_4B", /* name */ + false, /* partial_inplace */ + 0x003, /* src_mask */ + 0x003, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 16 bit PC-rel relocation */ + HOWTO (R_M68HC11_PCREL_16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_PCREL_16", /* name */ + false, /* partial_inplace */ + 0x0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy */ + HOWTO (R_M68HC11_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_M68HC11_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_M68HC11_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 1, /* 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_M68HC11_GNU_VTENTRY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ +}; + +/* Map BFD reloc types to M68HC11 ELF reloc types. */ + +struct m68hc11_reloc_map +{ + bfd_reloc_code_real_type bfd_reloc_val; + unsigned char elf_reloc_val; +}; + +static const struct m68hc11_reloc_map m68hc11_reloc_map[] = { + {BFD_RELOC_NONE, R_M68HC11_NONE,}, + {BFD_RELOC_8, R_M68HC11_8}, + {BFD_RELOC_M68HC11_HI8, R_M68HC11_HI8}, + {BFD_RELOC_M68HC11_LO8, R_M68HC11_LO8}, + {BFD_RELOC_8_PCREL, R_M68HC11_PCREL_8}, + {BFD_RELOC_16_PCREL, R_M68HC11_PCREL_16}, + {BFD_RELOC_16, R_M68HC11_16}, + {BFD_RELOC_32, R_M68HC11_32}, + {BFD_RELOC_M68HC11_3B, R_M68HC11_3B}, + + /* The following relocs are defined but they probably don't work yet. */ + {BFD_RELOC_VTABLE_INHERIT, R_M68HC11_GNU_VTINHERIT}, + {BFD_RELOC_VTABLE_ENTRY, R_M68HC11_GNU_VTENTRY}, +}; + +static reloc_howto_type * +bfd_elf32_bfd_reloc_type_lookup (abfd, code) + bfd *abfd ATTRIBUTE_UNUSED; + bfd_reloc_code_real_type code; +{ + unsigned int i; + + for (i = 0; + i < sizeof (m68hc11_reloc_map) / sizeof (struct m68hc11_reloc_map); + i++) + { + if (m68hc11_reloc_map[i].bfd_reloc_val == code) + return &elf_m68hc11_howto_table[m68hc11_reloc_map[i].elf_reloc_val]; + } + + return NULL; +} + +/* Set the howto pointer for an M68HC11 ELF reloc. */ + +static void +m68hc11_info_to_howto_rel (abfd, cache_ptr, dst) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *cache_ptr; + Elf32_Internal_Rel *dst; +{ + unsigned int r_type; + + r_type = ELF32_R_TYPE (dst->r_info); + BFD_ASSERT (r_type < (unsigned int) R_M68HC11_max); + cache_ptr->howto = &elf_m68hc11_howto_table[r_type]; +} + +/* Below is the only difference between elf32-m68hc12.c and elf32-m68hc11.c. + The Motorola spec says to use a different Elf machine code. */ +#define ELF_ARCH bfd_arch_m68hc11 +#define ELF_MACHINE_CODE EM_68HC11 +#define ELF_MAXPAGESIZE 0x1000 + +#define TARGET_BIG_SYM bfd_elf32_m68hc11_vec +#define TARGET_BIG_NAME "elf32-m68hc11" + +#define elf_info_to_howto 0 +#define elf_info_to_howto_rel m68hc11_info_to_howto_rel +#define elf_backend_object_p 0 +#define elf_backend_final_write_processing 0 + +#include "elf32-target.h" diff --git a/gnu/dist/toolchain/bfd/elf32-m68hc12.c b/gnu/dist/toolchain/bfd/elf32-m68hc12.c new file mode 100644 index 000000000000..d4baece0fa8e --- /dev/null +++ b/gnu/dist/toolchain/bfd/elf32-m68hc12.c @@ -0,0 +1,280 @@ +/* Motorola 68HC12-specific support for 32-bit ELF + Copyright (C) 1999, 2000 Free Software Foundation, Inc. + Contributed by Stephane Carrez (stcarrez@worldnet.fr) + (Heavily copied from the D10V port by Martin Hunt (hunt@cygnus.com)) + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "elf-bfd.h" +#include "elf/m68hc11.h" + +static reloc_howto_type *bfd_elf32_bfd_reloc_type_lookup +PARAMS ((bfd * abfd, bfd_reloc_code_real_type code)); +static void m68hc11_info_to_howto_rel +PARAMS ((bfd *, arelent *, Elf32_Internal_Rel *)); + +/* Use REL instead of RELA to save space */ +#define USE_REL + +/* The Motorola 68HC11 microcontroler only addresses 64Kb. + We must handle 8 and 16-bit relocations. The 32-bit relocation + is defined but not used except by gas when -gstabs is used (which + is wrong). + The 3-bit and 16-bit PC rel relocation is only used by 68HC12. */ +static reloc_howto_type elf_m68hc11_howto_table[] = { + /* This reloc does nothing. */ + HOWTO (R_M68HC11_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_M68HC11_NONE", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 8 bit absolute relocation */ + HOWTO (R_M68HC11_8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_8", /* name */ + false, /* partial_inplace */ + 0x00ff, /* src_mask */ + 0x00ff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 8 bit absolute relocation (upper address) */ + HOWTO (R_M68HC11_HI8, /* type */ + 8, /* 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_M68HC11_HI8", /* name */ + false, /* partial_inplace */ + 0x00ff, /* src_mask */ + 0x00ff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 8 bit absolute relocation (upper address) */ + HOWTO (R_M68HC11_LO8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_LO8", /* name */ + false, /* partial_inplace */ + 0x00ff, /* src_mask */ + 0x00ff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 8 bit PC-rel relocation */ + HOWTO (R_M68HC11_PCREL_8, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 8, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_PCREL_8", /* name */ + false, /* partial_inplace */ + 0x0, /* src_mask */ + 0x00ff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 16 bit absolute relocation */ + HOWTO (R_M68HC11_16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont /*bitfield */ , /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_16", /* name */ + false, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 32 bit absolute relocation. This one is never used for the + code relocation. It's used by gas for -gstabs generation. */ + HOWTO (R_M68HC11_32, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_32", /* name */ + false, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 3 bit absolute relocation */ + HOWTO (R_M68HC11_3B, /* type */ + 0, /* rightshift */ + 0, /* size (0 = byte, 1 = short, 2 = long) */ + 3, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_bitfield, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_4B", /* name */ + false, /* partial_inplace */ + 0x003, /* src_mask */ + 0x003, /* dst_mask */ + false), /* pcrel_offset */ + + /* A 16 bit PC-rel relocation */ + HOWTO (R_M68HC11_PCREL_16, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + bfd_elf_generic_reloc, /* special_function */ + "R_M68HC11_PCREL_16", /* name */ + false, /* partial_inplace */ + 0x0, /* src_mask */ + 0xffff, /* dst_mask */ + false), /* pcrel_offset */ + + /* GNU extension to record C++ vtable hierarchy */ + HOWTO (R_M68HC11_GNU_VTINHERIT, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 0, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ + complain_overflow_dont, /* complain_on_overflow */ + NULL, /* special_function */ + "R_M68HC11_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_M68HC11_GNU_VTENTRY, /* type */ + 0, /* rightshift */ + 1, /* 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_M68HC11_GNU_VTENTRY", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ + false), /* pcrel_offset */ +}; + +/* Map BFD reloc types to M68HC11 ELF reloc types. */ + +struct m68hc11_reloc_map +{ + bfd_reloc_code_real_type bfd_reloc_val; + unsigned char elf_reloc_val; +}; + +static const struct m68hc11_reloc_map m68hc11_reloc_map[] = { + {BFD_RELOC_NONE, R_M68HC11_NONE,}, + {BFD_RELOC_8, R_M68HC11_8}, + {BFD_RELOC_M68HC11_HI8, R_M68HC11_HI8}, + {BFD_RELOC_M68HC11_LO8, R_M68HC11_LO8}, + {BFD_RELOC_8_PCREL, R_M68HC11_PCREL_8}, + {BFD_RELOC_16_PCREL, R_M68HC11_PCREL_16}, + {BFD_RELOC_16, R_M68HC11_16}, + {BFD_RELOC_32, R_M68HC11_32}, + {BFD_RELOC_M68HC11_3B, R_M68HC11_3B}, + + /* The following relocs are defined but they probably don't work yet. */ + {BFD_RELOC_VTABLE_INHERIT, R_M68HC11_GNU_VTINHERIT}, + {BFD_RELOC_VTABLE_ENTRY, R_M68HC11_GNU_VTENTRY}, +}; + +static reloc_howto_type * +bfd_elf32_bfd_reloc_type_lookup (abfd, code) + bfd *abfd ATTRIBUTE_UNUSED; + bfd_reloc_code_real_type code; +{ + unsigned int i; + + for (i = 0; + i < sizeof (m68hc11_reloc_map) / sizeof (struct m68hc11_reloc_map); + i++) + { + if (m68hc11_reloc_map[i].bfd_reloc_val == code) + return &elf_m68hc11_howto_table[m68hc11_reloc_map[i].elf_reloc_val]; + } + + return NULL; +} + +/* Set the howto pointer for an M68HC11 ELF reloc. */ + +static void +m68hc11_info_to_howto_rel (abfd, cache_ptr, dst) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *cache_ptr; + Elf32_Internal_Rel *dst; +{ + unsigned int r_type; + + r_type = ELF32_R_TYPE (dst->r_info); + BFD_ASSERT (r_type < (unsigned int) R_M68HC11_max); + cache_ptr->howto = &elf_m68hc11_howto_table[r_type]; +} + +/* Below is the only difference between elf32-m68hc12.c and elf32-m68hc11.c. + The Motorola spec says to use a different Elf machine code. */ +#define ELF_ARCH bfd_arch_m68hc12 +#define ELF_MACHINE_CODE EM_68HC12 +#define ELF_MAXPAGESIZE 0x1000 + +#define TARGET_BIG_SYM bfd_elf32_m68hc12_vec +#define TARGET_BIG_NAME "elf32-m68hc12" + +#define elf_info_to_howto 0 +#define elf_info_to_howto_rel m68hc11_info_to_howto_rel +#define elf_backend_object_p 0 +#define elf_backend_final_write_processing 0 + +#include "elf32-target.h" diff --git a/gnu/dist/toolchain/bfd/elf32-m68k.c b/gnu/dist/toolchain/bfd/elf32-m68k.c index 3df26d2c7f96..78a0814eddfe 100644 --- a/gnu/dist/toolchain/bfd/elf32-m68k.c +++ b/gnu/dist/toolchain/bfd/elf32-m68k.c @@ -181,7 +181,6 @@ reloc_type_lookup (abfd, code) /* end code generated by elf.el */ #define USE_RELA - /* Functions for the m68k ELF linker. */ @@ -224,11 +223,11 @@ static const bfd_byte elf_m68k_plt_entry[PLT_ENTRY_SIZE] = /* Procedure linkage table entries for the cpu32 */ static const bfd_byte elf_cpu32_plt0_entry[PLT_CPU32_ENTRY_SIZE] = { - 0x22, 0x7b, 0x01, 0x70, /* moveal %pc@(0xc), %a1 */ + 0x2f, 0x3b, 0x01, 0x70, /* move.l (%pc,addr),-(%sp) */ 0, 0, 0, 0, /* replaced with offset to .got + 4. */ + 0x22, 0x7b, 0x01, 0x70, /* moveal %pc@(0xc), %a1 */ + 0, 0, 0, 0, /* replace with offset to .got +8. */ 0x4e, 0xd1, /* jmp %a1@ */ - 0, 0, 0, 0, /* replace with offset to .got +8. */ - 0, 0, 0, 0, /* pad out to 24 bytes. */ 0, 0, 0, 0, /* pad out to 24 bytes. */ 0, 0 }; @@ -376,12 +375,12 @@ elf32_m68k_copy_private_bfd_data (ibfd, obfd) if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) return true; - + in_flags = elf_elfheader (ibfd)->e_flags; - + elf_elfheader (obfd)->e_flags = in_flags; elf_flags_init (obfd) = true; - + return true; } @@ -847,19 +846,19 @@ elf_m68k_gc_sweep_hook (abfd, info, sec, relocs) unsigned long r_symndx; struct elf_link_hash_entry *h; bfd *dynobj; - asection *sgot = NULL; - asection *srelgot = NULL; + asection *sgot; + asection *srelgot; 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) - { - sgot = bfd_get_section_by_name (dynobj, ".got"); - srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); - } + if (dynobj == NULL) + return true; + + sgot = bfd_get_section_by_name (dynobj, ".got"); + srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); relend = relocs + sec->reloc_count; for (rel = relocs; rel < relend; rel++) @@ -887,7 +886,7 @@ elf_m68k_gc_sweep_hook (abfd, info, sec, relocs) } } } - else + else if (local_got_refcounts != NULL) { if (local_got_refcounts[r_symndx] > 0) { @@ -932,7 +931,6 @@ elf_m68k_gc_sweep_hook (abfd, info, sec, relocs) 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 @@ -1267,7 +1265,12 @@ elf_m68k_size_dynamic_sections (output_bfd, info) } /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size); + /* FIXME: This should be a call to bfd_alloc not bfd_zalloc. + Unused entries should be reclaimed before the section's contents + are written out, but at the moment this does not happen. Thus in + order to prevent writing out garbage, we initialise the section's + contents to zero. */ + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) return false; } @@ -1307,6 +1310,7 @@ elf_m68k_size_dynamic_sections (output_bfd, info) { if (!bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; + info->flags |= DF_TEXTREL; } } @@ -1319,7 +1323,6 @@ elf_m68k_size_dynamic_sections (output_bfd, info) in regular objects. We allocated space for them in the check_relocs routine, but we won't fill them in in the relocate_section routine. */ -/*ARGSUSED*/ static boolean elf_m68k_discard_copies (h, ignore) struct elf_m68k_link_hash_entry *h; @@ -1459,7 +1462,14 @@ elf_m68k_relocate_section (output_bfd, info, input_bfd, input_section, && ((! info->symbolic && h->dynindx != -1) || (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) - && (input_section->flags & SEC_ALLOC) != 0 + && ((input_section->flags & SEC_ALLOC) != 0 + /* DWARF will emit R_68K_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)) && (r_type == R_68K_8 || r_type == R_68K_16 || r_type == R_68K_32 @@ -2133,7 +2143,7 @@ elf_m68k_finish_dynamic_sections (output_bfd, info) + sgot->output_offset + 8 - (splt->output_section->vma + 10)), splt->contents + 12); - elf_section_data (splt->output_section)->this_hdr.sh_entsize + elf_section_data (splt->output_section)->this_hdr.sh_entsize = PLT_ENTRY_SIZE; } else /* cpu32 */ @@ -2148,8 +2158,8 @@ elf_m68k_finish_dynamic_sections (output_bfd, info) (sgot->output_section->vma + sgot->output_offset + 8 - (splt->output_section->vma + 10)), - splt->contents + 10); - elf_section_data (splt->output_section)->this_hdr.sh_entsize + splt->contents + 12); + elf_section_data (splt->output_section)->this_hdr.sh_entsize = PLT_CPU32_ENTRY_SIZE; } } @@ -2173,6 +2183,144 @@ elf_m68k_finish_dynamic_sections (output_bfd, info) return true; } +/* Given a .data section and a .emreloc in-memory section, store + relocation information into the .emreloc section which can be + used at runtime to relocate the section. This is called by the + linker when the --embedded-relocs switch is used. This is called + after the add_symbols entry point has been called for all the + objects, and before the final_link entry point is called. */ + +boolean +bfd_m68k_elf32_create_embedded_relocs (abfd, info, datasec, relsec, errmsg) + bfd *abfd; + struct bfd_link_info *info; + asection *datasec; + asection *relsec; + char **errmsg; +{ + Elf_Internal_Shdr *symtab_hdr; + Elf32_External_Sym *extsyms; + Elf32_External_Sym *free_extsyms = NULL; + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *free_relocs = NULL; + Elf_Internal_Rela *irel, *irelend; + bfd_byte *p; + + BFD_ASSERT (! info->relocateable); + + *errmsg = NULL; + + if (datasec->reloc_count == 0) + return true; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + /* Read this BFD's symbols if we haven't done so already, or get the cached + copy if it exists. */ + if (symtab_hdr->contents != NULL) + extsyms = (Elf32_External_Sym *) symtab_hdr->contents; + else + { + /* Go get them off disk. */ + if (info->keep_memory) + extsyms = ((Elf32_External_Sym *) + bfd_alloc (abfd, symtab_hdr->sh_size)); + else + extsyms = ((Elf32_External_Sym *) + bfd_malloc (symtab_hdr->sh_size)); + if (extsyms == NULL) + goto error_return; + if (! info->keep_memory) + 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)) + goto error_return; + if (info->keep_memory) + symtab_hdr->contents = extsyms; + } + + /* Get a copy of the native relocations. */ + internal_relocs = (_bfd_elf32_link_read_relocs + (abfd, datasec, (PTR) NULL, (Elf_Internal_Rela *) NULL, + info->keep_memory)); + if (internal_relocs == NULL) + goto error_return; + if (! info->keep_memory) + free_relocs = internal_relocs; + + relsec->contents = (bfd_byte *) bfd_alloc (abfd, datasec->reloc_count * 12); + if (relsec->contents == NULL) + goto error_return; + + p = relsec->contents; + + irelend = internal_relocs + datasec->reloc_count; + for (irel = internal_relocs; irel < irelend; irel++, p += 12) + { + asection *targetsec; + + /* We are going to write a four byte longword into the runtime + reloc section. The longword will be the address in the data + section which must be relocated. It is followed by the name + of the target section NUL-padded or truncated to 8 + characters. */ + + /* We can only relocate absolute longword relocs at run time. */ + if (ELF32_R_TYPE (irel->r_info) != (int) R_68K_32) + { + *errmsg = _("unsupported reloc type"); + bfd_set_error (bfd_error_bad_value); + goto error_return; + } + + /* Get the target section referred to by the reloc. */ + if (ELF32_R_SYM (irel->r_info) < symtab_hdr->sh_info) + { + Elf_Internal_Sym isym; + + /* A local symbol. */ + bfd_elf32_swap_symbol_in (abfd, + extsyms + ELF32_R_SYM (irel->r_info), + &isym); + + targetsec = bfd_section_from_elf_index (abfd, isym.st_shndx); + } + else + { + unsigned long indx; + struct elf_link_hash_entry *h; + + /* An external symbol. */ + indx = ELF32_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + targetsec = h->root.u.def.section; + else + targetsec = NULL; + } + + bfd_put_32 (abfd, irel->r_offset + datasec->output_offset, p); + memset (p + 4, 0, 8); + if (targetsec != NULL) + strncpy (p + 4, targetsec->output_section->name, 8); + } + + if (free_extsyms != NULL) + free (free_extsyms); + if (free_relocs != NULL) + free (free_relocs); + return true; + +error_return: + if (free_extsyms != NULL) + free (free_extsyms); + if (free_relocs != NULL) + free (free_relocs); + return false; +} + #define TARGET_BIG_SYM bfd_elf32_m68k_vec #define TARGET_BIG_NAME "elf32-m68k" #define ELF_MACHINE_CODE EM_68K diff --git a/gnu/dist/toolchain/bfd/elf32-mcore.c b/gnu/dist/toolchain/bfd/elf32-mcore.c index edc6f678c226..051bd0d2074c 100644 --- a/gnu/dist/toolchain/bfd/elf32-mcore.c +++ b/gnu/dist/toolchain/bfd/elf32-mcore.c @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #define USE_RELA /* Only USE_REL is actually significant, but this is - here are a reminder... */ + here are a reminder... */ static void mcore_elf_howto_init PARAMS ((void)); @@ -84,7 +84,7 @@ static reloc_howto_type mcore_elf_howto_raw[] = false), /* pcrel_offset */ /* 8 bits + 2 zero bits; jmpi/jsri/lrw instructions. - Should not appear in object files. */ + Should not appear in object files. */ HOWTO (R_MCORE_PCRELIMM8BY4, /* type */ 2, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -99,7 +99,7 @@ static reloc_howto_type mcore_elf_howto_raw[] = 0, /* dst_mask */ true), /* pcrel_offset */ - /* bsr/bt/bf/br instructions; 11 bits + 1 zero bit + /* bsr/bt/bf/br instructions; 11 bits + 1 zero bit Span 2k instructions == 4k bytes. Only useful pieces at the relocated address are the opcode (5 bits) */ HOWTO (R_MCORE_PCRELIMM11BY2,/* type */ @@ -116,7 +116,7 @@ static reloc_howto_type mcore_elf_howto_raw[] = 0x7ff, /* dst_mask */ true), /* pcrel_offset */ - /* 4 bits + 1 zero bit; 'loopt' instruction only; unsupported. */ + /* 4 bits + 1 zero bit; 'loopt' instruction only; unsupported. */ HOWTO (R_MCORE_PCRELIMM4BY2, /* type */ 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -131,7 +131,7 @@ static reloc_howto_type mcore_elf_howto_raw[] = 0, /* dst_mask */ true), /* pcrel_offset */ - /* 32-bit pc-relative. Eventually this will help support PIC code. */ + /* 32-bit pc-relative. Eventually this will help support PIC code. */ HOWTO (R_MCORE_PCREL32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -148,11 +148,11 @@ static reloc_howto_type mcore_elf_howto_raw[] = /* Like PCRELIMM11BY2, this relocation indicates that there is a 'jsri' at the specified address. There is a separate relocation - entry for the literal pool entry that it references, but we + entry for the literal pool entry that it references, but we might be able to change the jsri to a bsr if the target turns out to be close enough [even though we won't reclaim the literal pool entry, we'll get some runtime efficiency back]. Note that this - is a relocation that we are allowed to safely ignore. */ + is a relocation that we are allowed to safely ignore. */ HOWTO (R_MCORE_PCRELJSR_IMM11BY2,/* type */ 1, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -166,7 +166,7 @@ static reloc_howto_type mcore_elf_howto_raw[] = 0x0, /* src_mask */ 0x7ff, /* dst_mask */ true), /* pcrel_offset */ - + /* GNU extension to record C++ vtable hierarchy */ HOWTO (R_MCORE_GNU_VTINHERIT, /* type */ 0, /* rightshift */ @@ -196,7 +196,7 @@ static reloc_howto_type mcore_elf_howto_raw[] = 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (R_MCORE_RELATIVE, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -225,15 +225,14 @@ mcore_elf_howto_init () for (i = NUM_ELEM (mcore_elf_howto_raw); i--;) { unsigned int type; - + type = mcore_elf_howto_raw[i].type; - + BFD_ASSERT (type < NUM_ELEM (mcore_elf_howto_table)); - + mcore_elf_howto_table [type] = & mcore_elf_howto_raw [i]; } } - static reloc_howto_type * mcore_elf_reloc_type_lookup (abfd, code) @@ -275,11 +274,11 @@ mcore_elf_info_to_howto (abfd, cache_ptr, dst) mcore_elf_howto_init (); BFD_ASSERT (ELF32_R_TYPE (dst->r_info) < (unsigned int) R_MCORE_max); - + cache_ptr->howto = mcore_elf_howto_table [ELF32_R_TYPE (dst->r_info)]; } -/* Function to set whether a module needs the -mrelocatable bit set. */ +/* Function to set whether a module needs the -mrelocatable bit set. */ static boolean mcore_elf_set_private_flags (abfd, flags) bfd * abfd; @@ -322,18 +321,8 @@ mcore_elf_merge_private_bfd_data (ibfd, obfd) flagword new_flags; /* Check if we have the same endianess */ - if ( ibfd->xvec->byteorder != obfd->xvec->byteorder - && obfd->xvec->byteorder != BFD_ENDIAN_UNKNOWN) - { - (*_bfd_error_handler) - (_("%s: compiled for a %s endian system and target is %s endian.\n"), - bfd_get_filename (ibfd), - bfd_big_endian (ibfd) ? "big" : "little", - bfd_big_endian (obfd) ? "big" : "little"); - - bfd_set_error (bfd_error_wrong_format); - return false; - } + if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + return false; if ( bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) @@ -341,7 +330,7 @@ mcore_elf_merge_private_bfd_data (ibfd, obfd) 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; @@ -356,11 +345,9 @@ mcore_elf_merge_private_bfd_data (ibfd, obfd) return true; } - /* Don't pretend we can deal with unsupported relocs. */ -/*ARGSUSED*/ static bfd_reloc_status_type mcore_elf_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) @@ -373,7 +360,7 @@ mcore_elf_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section, char ** error_message ATTRIBUTE_UNUSED; { BFD_ASSERT (reloc_entry->howto != (reloc_howto_type *)0); - + _bfd_error_handler (_("%s: Relocation %s (%d) is not currently supported.\n"), bfd_get_filename (abfd), reloc_entry->howto->name, @@ -381,7 +368,6 @@ mcore_elf_unsupported_reloc (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_notsupported; } - /* The RELOCATE_SECTION function is called by the ELF backend linker to handle the relocations for a section. @@ -455,7 +441,7 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section, unsigned long r_symndx; struct elf_link_hash_entry * h = (struct elf_link_hash_entry *) 0; unsigned short oldinst = 0; - + /* Unknown relocation handling */ if ((unsigned) r_type >= (unsigned) R_MCORE_max || ! mcore_elf_howto_table [(int)r_type]) @@ -468,10 +454,10 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section, ret = false; continue; } - + howto = mcore_elf_howto_table [(int) r_type]; r_symndx = ELF32_R_SYM (rel->r_info); - + if (info->relocateable) { /* This is a relocateable link. We don't have to change @@ -481,7 +467,7 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_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]; @@ -498,7 +484,7 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* This is a final link. */ - /* Complain about known relocation that are not yet supported */ + /* Complain about known relocation that are not yet supported. */ if (howto->special_function == mcore_elf_unsupported_reloc) { _bfd_error_handler (_("%s: Relocation %s (%d) is not currently supported.\n"), @@ -559,7 +545,6 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; } - #ifdef DEBUG fprintf (stderr, "\ttype = %s (%d), symbol index = %ld, offset = %ld, addend = %ld\n", howto->name, r_type, r_symndx, (long) offset, (long) addend); @@ -574,11 +559,11 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_put_16 (input_bfd, oldinst, contents + offset); r = bfd_reloc_ok; } - + if (r != bfd_reloc_ok) { ret = false; - + switch (r) { default: @@ -594,7 +579,7 @@ mcore_elf_relocate_section (output_bfd, info, input_bfd, input_section, { name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name); - + if (name == NULL) break; @@ -643,7 +628,7 @@ mcore_elf_gc_mark_hook (abfd, info, rel, h, sym) 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; @@ -681,7 +666,7 @@ mcore_elf_gc_sweep_hook (abfd, info, sec, relocs) /* Look through the relocs for a section during the first phase. Since we don't do .gots or .plts, we just need to consider the virtual table relocs for gc. */ - + static boolean mcore_elf_check_relocs (abfd, info, sec, relocs) bfd * abfd; @@ -694,30 +679,30 @@ mcore_elf_check_relocs (abfd, info, sec, relocs) struct elf_link_hash_entry ** sym_hashes_end; const Elf_Internal_Rela * rel; const Elf_Internal_Rela * rel_end; - + if (info->relocateable) return true; - + symtab_hdr = & elf_tdata (abfd)->symtab_hdr; sym_hashes = elf_sym_hashes (abfd); sym_hashes_end = sym_hashes + symtab_hdr->sh_size / sizeof (Elf32_External_Sym); if (!elf_bad_symtab (abfd)) sym_hashes_end -= symtab_hdr->sh_info; - + rel_end = relocs + sec->reloc_count; - + for (rel = relocs; rel < rel_end; rel++) { struct elf_link_hash_entry * h; unsigned long r_symndx; - + r_symndx = ELF32_R_SYM (rel->r_info); - + if (r_symndx < symtab_hdr->sh_info) h = NULL; else h = sym_hashes [r_symndx - symtab_hdr->sh_info]; - + switch (ELF32_R_TYPE (rel->r_info)) { /* This relocation describes the C++ object vtable hierarchy. @@ -726,7 +711,7 @@ mcore_elf_check_relocs (abfd, info, sec, relocs) if (!_bfd_elf32_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_MCORE_GNU_VTENTRY: @@ -735,7 +720,7 @@ mcore_elf_check_relocs (abfd, info, sec, relocs) break; } } - + return true; } @@ -750,7 +735,6 @@ mcore_elf_check_relocs (abfd, info, sec, relocs) #define elf_info_to_howto mcore_elf_info_to_howto #define elf_info_to_howto_rel NULL - #define bfd_elf32_bfd_copy_private_bfd_data mcore_elf_copy_private_bfd_data #define bfd_elf32_bfd_merge_private_bfd_data mcore_elf_merge_private_bfd_data #define bfd_elf32_bfd_set_private_flags mcore_elf_set_private_flags diff --git a/gnu/dist/toolchain/bfd/elf32-pj.c b/gnu/dist/toolchain/bfd/elf32-pj.c index 3b96949f479f..81759ff4698d 100644 --- a/gnu/dist/toolchain/bfd/elf32-pj.c +++ b/gnu/dist/toolchain/bfd/elf32-pj.c @@ -131,7 +131,6 @@ static reloc_howto_type pj_elf_howto_table[] = 0xffff, /* dst_mask */ true), /* pcrel_offset */ - HOWTO (R_PJ_CODE_HI16, /* type */ 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -176,7 +175,6 @@ static reloc_howto_type pj_elf_howto_table[] = 0, /* dst_mask */ false), /* pcrel_offset */ - }; /* This function is used for normal relocs. This is like the COFF @@ -213,8 +211,8 @@ pj_elf_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, return bfd_reloc_undefined; if (bfd_is_com_section (symbol_in->section)) - sym_value = 0; - else + sym_value = 0; + else sym_value = (symbol_in->value + symbol_in->section->output_section->vma + symbol_in->section->output_offset); @@ -228,7 +226,7 @@ pj_elf_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, break; /* Relocations in code are always bigendian, no matter what the - data endianness is. */ + data endianness is. */ case R_PJ_CODE_DIR32: insn = bfd_getb32 (hit_data); @@ -254,7 +252,7 @@ pj_elf_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, insn += (sym_value + reloc_entry->addend) >> 16; bfd_putb16 (insn, hit_data); break; - + default: abort (); break; @@ -296,7 +294,7 @@ pj_elf_reloc_type_lookup (abfd, code) bfd_reloc_code_real_type code; { unsigned int i; - + for (i = 0; i < sizeof (pj_reloc_map) / sizeof (struct elf_reloc_map); i++) { if (pj_reloc_map[i].bfd_reloc_val == code) @@ -324,7 +322,7 @@ pj_elf_info_to_howto (abfd, cache_ptr, dst) } /* Take this moment to fill in the special picoJava bits in the - e_flags field. */ + e_flags field. */ static void pj_elf_final_write_processing (abfd, linker) diff --git a/gnu/dist/toolchain/bfd/elf32-ppc.c b/gnu/dist/toolchain/bfd/elf32-ppc.c index b405feaa1f53..d3152ce24c3d 100644 --- a/gnu/dist/toolchain/bfd/elf32-ppc.c +++ b/gnu/dist/toolchain/bfd/elf32-ppc.c @@ -32,7 +32,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define USE_RELA /* we want RELA relocations, not REL */ - static reloc_howto_type *ppc_elf_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); static void ppc_elf_info_to_howto @@ -124,11 +123,27 @@ static boolean ppc_elf_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_i /* The number of single-slot PLT entries (the rest use two slots). */ #define PLT_NUM_SINGLE_ENTRIES 8192 - -static reloc_howto_type *ppc_elf_howto_table[ (int)R_PPC_max ]; +/* Will references to this symbol always reference the symbol + in this object? */ +#define SYMBOL_REFERENCES_LOCAL(INFO, H) \ + ((! INFO->shared \ + || INFO->symbolic \ + || H->dynindx == -1 \ + || 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) -static reloc_howto_type ppc_elf_howto_raw[] = -{ +/* Will _calls_ to this symbol always call the version in this object? */ +#define SYMBOL_CALLS_LOCAL(INFO, H) \ + ((! INFO->shared \ + || INFO->symbolic \ + || H->dynindx == -1 \ + || ELF_ST_VISIBILITY (H->other) != STV_DEFAULT) \ + && (H->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) != 0) + +static reloc_howto_type *ppc_elf_howto_table[(int) R_PPC_max]; + +static reloc_howto_type ppc_elf_howto_raw[] = { /* This reloc does nothing. */ HOWTO (R_PPC_NONE, /* type */ 0, /* rightshift */ @@ -221,7 +236,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = false), /* pcrel_offset */ /* The high order 16 bits of an address, plus 1 if the contents of - the low 16 bits, treated as a signed number, is negative. */ + the low 16 bits, treated as a signed number, is negative. */ HOWTO (R_PPC_ADDR16_HA, /* type */ 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -254,7 +269,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = /* 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. */ + bits must be zero. */ HOWTO (R_PPC_ADDR14_BRTAKEN, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -286,7 +301,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0xfffc, /* dst_mask */ false), /* pcrel_offset */ - /* A relative 26 bit branch; the lower two bits must be zero. */ + /* A relative 26 bit branch; the lower two bits must be zero. */ HOWTO (R_PPC_REL24, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -301,7 +316,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0x3fffffc, /* dst_mask */ true), /* pcrel_offset */ - /* A relative 16 bit branch; the lower two bits must be zero. */ + /* A relative 16 bit branch; the lower two bits must be zero. */ HOWTO (R_PPC_REL14, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -316,7 +331,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0xfffc, /* dst_mask */ true), /* pcrel_offset */ - /* A relative 16 bit branch. Bit 10 should be set to indicate that + /* 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_PPC_REL14_BRTAKEN, /* type */ @@ -333,7 +348,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0xfffc, /* dst_mask */ true), /* pcrel_offset */ - /* A relative 16 bit branch. Bit 10 should be set to indicate that + /* 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_PPC_REL14_BRNTAKEN, /* type */ @@ -560,7 +575,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = true), /* pcrel_offset */ /* 32-bit relocation to the symbol's procedure linkage table. - FIXME: not supported. */ + FIXME: not supported. */ HOWTO (R_PPC_PLT32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -576,7 +591,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = false), /* pcrel_offset */ /* 32-bit PC relative relocation to the symbol's procedure linkage table. - FIXME: not supported. */ + FIXME: not supported. */ HOWTO (R_PPC_PLTREL32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -655,7 +670,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0xffff, /* dst_mask */ false), /* pcrel_offset */ - /* 32-bit section relative relocation. */ + /* 32-bit section relative relocation. */ HOWTO (R_PPC_SECTOFF, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -670,7 +685,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0, /* dst_mask */ true), /* pcrel_offset */ - /* 16-bit lower half section relative relocation. */ + /* 16-bit lower half section relative relocation. */ HOWTO (R_PPC_SECTOFF_LO, /* type */ 0, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -685,7 +700,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0xffff, /* dst_mask */ false), /* pcrel_offset */ - /* 16-bit upper half section relative relocation. */ + /* 16-bit upper half section relative relocation. */ HOWTO (R_PPC_SECTOFF_HI, /* type */ 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -700,7 +715,7 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0xffff, /* dst_mask */ false), /* pcrel_offset */ - /* 16-bit upper half adjusted section relative relocation. */ + /* 16-bit upper half adjusted section relative relocation. */ HOWTO (R_PPC_SECTOFF_HA, /* type */ 16, /* rightshift */ 1, /* size (0 = byte, 1 = short, 2 = long) */ @@ -931,7 +946,6 @@ static reloc_howto_type ppc_elf_howto_raw[] = 0xffff, /* dst_mask */ false), /* pcrel_offset */ }; - /* Initialize the ppc_elf_howto_table, so that linear accesses can be done. */ @@ -943,11 +957,10 @@ ppc_elf_howto_init () for (i = 0; i < sizeof (ppc_elf_howto_raw) / sizeof (ppc_elf_howto_raw[0]); i++) { type = ppc_elf_howto_raw[i].type; - BFD_ASSERT (type < sizeof(ppc_elf_howto_table) / sizeof(ppc_elf_howto_table[0])); + BFD_ASSERT (type < sizeof (ppc_elf_howto_table) / sizeof (ppc_elf_howto_table[0])); ppc_elf_howto_table[type] = &ppc_elf_howto_raw[i]; } } - /* This function handles relaxing for the PPC with option --mpc860c0[=]. @@ -959,7 +972,7 @@ ppc_elf_howto_init () 3/ The branch is taken. 4/ The branch is located in the last 5 words of a page. (The EOP limit is 5 by default but may be specified as any value from 1-10.) - + Our software solution is to detect these problematic branches in a linker pass and modify them as follows: 1/ Unconditional branches - Since these are always predicted taken, @@ -975,22 +988,22 @@ ppc_elf_howto_init () static int ppc_elf_sort_rela (arg1, arg2) - const void *arg1; - const void *arg2; + const void *arg1; + const void *arg2; { const Elf_Internal_Rela **rela1 = (const Elf_Internal_Rela**) arg1; const Elf_Internal_Rela **rela2 = (const Elf_Internal_Rela**) arg2; - /* Sort by offset. */ + /* Sort by offset. */ return ((*rela1)->r_offset - (*rela2)->r_offset); } static boolean ppc_elf_relax_section (abfd, isec, link_info, again) - bfd *abfd; - asection *isec; - struct bfd_link_info *link_info; - boolean *again; + bfd *abfd; + asection *isec; + struct bfd_link_info *link_info; + boolean *again; { #define PAGESIZE 0x1000 @@ -1001,7 +1014,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again) Elf_Internal_Rela **rela_comb = NULL; int comb_curr, comb_count; - /* We never have to do this more than once per input section. */ + /* We never have to do this more than once per input section. */ *again = false; /* If needed, initialize this section's cooked size. */ @@ -1009,13 +1022,13 @@ ppc_elf_relax_section (abfd, isec, link_info, again) isec->_cooked_size = isec->_raw_size; /* We're only interested in text sections which overlap the - troublesome area at the end of a page. */ + troublesome area at the end of a page. */ if (link_info->mpc860c0 && (isec->flags & SEC_CODE) && isec->_cooked_size) { bfd_vma dot, end_page, end_section; boolean section_modified; - /* Get the section contents. */ + /* Get the section contents. */ /* Get cached copy if it exists. */ if (elf_section_data (isec)->this_hdr.contents != NULL) contents = elf_section_data (isec)->this_hdr.contents; @@ -1024,42 +1037,42 @@ ppc_elf_relax_section (abfd, isec, link_info, again) /* Go get them off disk. */ contents = (bfd_byte *) bfd_malloc (isec->_raw_size); if (contents == NULL) - goto error_return; + goto error_return; free_contents = contents; if (! bfd_get_section_contents (abfd, isec, contents, (file_ptr) 0, isec->_raw_size)) - goto error_return; + goto error_return; } comb_curr = 0; comb_count = 0; if (isec->reloc_count) - { + { unsigned n; /* Get a copy of the native relocations. */ internal_relocs = _bfd_elf32_link_read_relocs ( - abfd, isec, (PTR) NULL, (Elf_Internal_Rela *) NULL, + abfd, isec, (PTR) NULL, (Elf_Internal_Rela *) NULL, link_info->keep_memory); if (internal_relocs == NULL) goto error_return; if (! link_info->keep_memory) free_relocs = internal_relocs; - - /* Setup a faster access method for the reloc info we need. */ + + /* 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*)); + bfd_malloc (isec->reloc_count*sizeof (Elf_Internal_Rela*)); if (rela_comb == NULL) goto error_return; - for (n=0; nreloc_count; ++n) + for (n = 0; n < isec->reloc_count; ++n) { long r_type; - + r_type = ELF32_R_TYPE (internal_relocs[n].r_info); - if (r_type < 0 || r_type >= (int)R_PPC_max) + if (r_type < 0 || r_type >= (int) R_PPC_max) goto error_return; - + /* Prologue constants are sometimes present in the ".text" sections and they can be identified by their associated relocation. We don't want to process those words and some others which @@ -1067,37 +1080,37 @@ ppc_elf_relax_section (abfd, isec, link_info, again) conditional branches will have a relocation so we will only ignore words that 1) have a reloc, and 2) the reloc is not applicable to a conditional branch. - The array rela_comb is built here for use in the EOP scan loop. */ + The array rela_comb is built here for use in the EOP scan loop. */ switch (r_type) { case R_PPC_ADDR14_BRNTAKEN: /* absolute, predicted not taken */ - case R_PPC_REL14: /* relative cond. br. */ + case R_PPC_REL14: /* relative cond. br. */ case R_PPC_REL14_BRNTAKEN: /* rel. cond. br., predicted not taken */ - /* We should check the instruction. */ + /* We should check the instruction. */ break; default: - /* The word is not a conditional branch - ignore it. */ + /* The word is not a conditional branch - ignore it. */ rela_comb[comb_count++] = &internal_relocs[n]; break; } } if (comb_count > 1) - qsort (rela_comb, (size_t) comb_count, sizeof (int), ppc_elf_sort_rela); - } + qsort (rela_comb, (size_t) comb_count, sizeof (int), ppc_elf_sort_rela); + } - /* Enumerate each EOP region that overlaps this section. */ + /* Enumerate each EOP region that overlaps this section. */ end_section = isec->vma + isec->_cooked_size; dot = end_page = (isec->vma | (PAGESIZE - 1)) + 1; dot -= link_info->mpc860c0; section_modified = false; if (dot < isec->vma) /* Increment the start position if this section */ - dot = isec->vma; /* begins in the middle of its first EOP region. */ + dot = isec->vma; /* begins in the middle of its first EOP region. */ for (; dot < end_section; dot += PAGESIZE, end_page += PAGESIZE) { - /* Check each word in this EOP region. */ + /* Check each word in this EOP region. */ for (; dot < end_page; dot += 4) { bfd_vma isec_offset; @@ -1105,7 +1118,7 @@ ppc_elf_relax_section (abfd, isec, link_info, again) boolean skip, modified; /* Don't process this word if there is a relocation for it and - the relocation indicates the word is not a conditional branch. */ + the relocation indicates the word is not a conditional branch. */ skip = false; isec_offset = dot - isec->vma; for (; comb_currr_info) < (unsigned int) R_PPC_max); @@ -1354,7 +1367,7 @@ ppc_elf_addr16_ha_reloc (abfd, reloc_entry, symbol, data, input_section, return bfd_reloc_continue; } -/* Function to set whether a module needs the -mrelocatable bit set. */ +/* Function to set whether a module needs the -mrelocatable bit set. */ static boolean ppc_elf_set_private_flags (abfd, flags) @@ -1399,21 +1412,8 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) 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_get_filename (ibfd)); - - bfd_set_error (bfd_error_wrong_format); - return false; - } + if (_bfd_generic_verify_endian_match (ibfd, obfd) == false) + return false; if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour || bfd_get_flavour (obfd) != bfd_target_elf_flavour) @@ -1475,7 +1475,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_get_filename (ibfd), (long) new_flags, (long) old_flags); } if (error) @@ -1487,7 +1487,6 @@ ppc_elf_merge_private_bfd_data (ibfd, obfd) 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. */ @@ -1515,7 +1514,6 @@ ppc_elf_section_from_shdr (abfd, hdr, name) bfd_set_section_flags (abfd, newsect, flags); return true; } - /* Set up any other section flags and such that may be necessary. */ @@ -1533,7 +1531,6 @@ ppc_elf_fake_sections (abfd, shdr, asect) return true; } - /* Create a special linker section */ static elf_linker_section_t * @@ -1577,10 +1574,10 @@ ppc_elf_create_linker_section (abfd, info, which) default: (*_bfd_error_handler) (_("%s: Unknown special linker type %d"), bfd_get_filename (abfd), - (int)which); + (int) which); bfd_set_error (bfd_error_bad_value); - return (elf_linker_section_t *)0; + return (elf_linker_section_t *) 0; case LINKER_SECTION_SDATA: /* .sdata/.sbss section */ defaults.name = ".sdata"; @@ -1605,10 +1602,9 @@ ppc_elf_create_linker_section (abfd, info, which) return lsect; } - -/* If we have a non-zero sized .sbss2 or .PPC.EMB.sbss0 sections, we need to bump up - the number of section headers. */ +/* If we have a non-zero sized .sbss2 or .PPC.EMB.sbss0 sections, we + need to bump up the number of section headers. */ static int ppc_elf_additional_program_headers (abfd) @@ -1634,7 +1630,7 @@ ppc_elf_additional_program_headers (abfd) return ret; } -/* Modify the segment map if needed */ +/* Modify the segment map if needed. */ static boolean ppc_elf_modify_segment_map (abfd) @@ -1655,7 +1651,7 @@ ppc_elf_create_dynamic_sections (abfd, info) register asection *s; flagword flags; - if (!_bfd_elf_create_dynamic_sections(abfd, info)) + if (!_bfd_elf_create_dynamic_sections (abfd, info)) return false; flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY @@ -1708,7 +1704,6 @@ ppc_elf_adjust_dynamic_symbol (info, h) && (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. */ @@ -1716,9 +1711,7 @@ ppc_elf_adjust_dynamic_symbol (info, h) || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) != 0) { 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) != 0) + || SYMBOL_CALLS_LOCAL (info, h) || (info->shared && h->plt.refcount <= 0)) { /* A PLT entry is not required/allowed when: @@ -1726,9 +1719,8 @@ ppc_elf_adjust_dynamic_symbol (info, h) 1. We are not using ld.so; because then the PLT entry can't be set up, so we can't use one. - 2. We know for certain that a symbol is defined in - this object, because this object is the application, - is linked with -Bsymbolic, or because the symbol is local. + 2. We know for certain that a call to this symbol + will go to this object. 3. GC has rendered the entry unused. Note, however, that in an executable all references to the @@ -1877,7 +1869,6 @@ ppc_elf_adjust_dynamic_symbol (info, h) return true; } - /* Set the sizes of the dynamic sections. */ @@ -1919,10 +1910,10 @@ ppc_elf_size_dynamic_sections (output_bfd, info) stripped from the output file below. */ static char *rela_sections[] = { ".rela.got", ".rela.sdata", ".rela.sdata2", ".rela.sbss", - (char *)0 }; + (char *) 0 }; char **p; - for (p = rela_sections; *p != (char *)0; p++) + for (p = rela_sections; *p != (char *) 0; p++) { s = bfd_get_section_by_name (dynobj, *p); if (s != NULL) @@ -1984,7 +1975,7 @@ ppc_elf_size_dynamic_sections (output_bfd, info) asection *target; const char *outname; - /* Remember whether there are any relocation sections. */ + /* Remember whether there are any relocation sections. */ relocs = true; /* If this relocation section applies to a read only @@ -2057,12 +2048,12 @@ ppc_elf_size_dynamic_sections (output_bfd, info) { if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; + info->flags |= DF_TEXTREL; } } return true; } - /* Look through the relocs for a section during the first phase, and allocate space in the global offset table or procedure linkage @@ -2106,7 +2097,6 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) return false; } - if ((sdata2 = elf_linker_section (abfd, LINKER_SECTION_SDATA2)) == NULL) { sdata2 = ppc_elf_create_linker_section (abfd, info, LINKER_SECTION_SDATA2); @@ -2119,7 +2109,7 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) local_got_refcounts = elf_local_got_refcounts (abfd); sym_hashes = elf_sym_hashes (abfd); - sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof(Elf32_External_Sym); + sym_hashes_end = sym_hashes + symtab_hdr->sh_size/sizeof (Elf32_External_Sym); if (!elf_bad_symtab (abfd)) sym_hashes_end -= symtab_hdr->sh_info; @@ -2250,7 +2240,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")); - return false; + return false; } if (srelgot == NULL && (h != NULL || info->shared)) @@ -2319,7 +2309,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), - ppc_elf_howto_table[(int)ELF32_R_TYPE (rel->r_info)]->name)); + ppc_elf_howto_table[(int) ELF32_R_TYPE (rel->r_info)]->name)); return false; } break; @@ -2397,7 +2387,8 @@ ppc_elf_check_relocs (abfd, info, sec, relocs) case R_PPC_REL14_BRNTAKEN: case R_PPC_REL32: if (h == NULL - || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) + || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0 + || SYMBOL_REFERENCES_LOCAL (info, h)) break; /* fall through */ @@ -2540,7 +2531,7 @@ ppc_elf_gc_sweep_hook (abfd, info, sec, relocs) if (h->got.refcount > 0) h->got.refcount--; } - else + else if (local_got_refcounts != NULL) { if (local_got_refcounts[r_symndx] > 0) local_got_refcounts[r_symndx]--; @@ -2571,7 +2562,6 @@ ppc_elf_gc_sweep_hook (abfd, info, sec, relocs) /* Hook called by the linker routine which adds symbols from an object file. We use it to put .comm items in .sbss, and not .bss. */ -/*ARGSUSED*/ static boolean ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd *abfd; @@ -2623,7 +2613,6 @@ ppc_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) return true; } - /* Finish up dynamic symbol handling. We set the contents of various dynamic sections here. */ @@ -2691,7 +2680,7 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) Otherwise, the PLT entry would provide a definition for the symbol even if the symbol wasn't defined anywhere, and so the symbol would never be NULL. */ - if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK) + if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK) == 0) sym->st_value = 0; } @@ -2719,8 +2708,7 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) 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_HASH_DEF_REGULAR)) + && SYMBOL_REFERENCES_LOCAL (info, h)) { rela.r_info = ELF32_R_INFO (0, R_PPC_RELATIVE); rela.r_addend = (h->root.u.def.value @@ -2729,7 +2717,7 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) } else { - BFD_ASSERT((h->got.offset & 1) == 0); + BFD_ASSERT ((h->got.offset & 1) == 0); bfd_put_32 (output_bfd, (bfd_vma) 0, sgot->contents + h->got.offset); rela.r_info = ELF32_R_INFO (h->dynindx, R_PPC_GLOB_DAT); rela.r_addend = 0; @@ -2785,7 +2773,6 @@ ppc_elf_finish_dynamic_symbol (output_bfd, info, h, sym) return true; } - /* Finish up the dynamic sections. */ @@ -2873,7 +2860,6 @@ ppc_elf_finish_dynamic_sections (output_bfd, info) return true; } - /* The RELOCATE_SECTION function is called by the ELF backend linker to handle the relocations for a section. @@ -2934,11 +2920,12 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, fprintf (stderr, "ppc_elf_relocate_section called for %s section %s, %ld relocations%s\n", bfd_get_filename (input_bfd), bfd_section_name(input_bfd, input_section), - (long)input_section->reloc_count, + (long) input_section->reloc_count, (info->relocateable) ? " (relocatable)" : ""); #endif - if (!ppc_elf_howto_table[ R_PPC_ADDR32 ]) /* Initialize howto table if needed */ + if (!ppc_elf_howto_table[R_PPC_ADDR32]) + /* Initialize howto table if needed. */ ppc_elf_howto_init (); local_got_offsets = elf_local_got_offsets (input_bfd); @@ -2956,27 +2943,29 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, bfd_vma offset = rel->r_offset; bfd_vma addend = rel->r_addend; bfd_reloc_status_type r = bfd_reloc_other; - Elf_Internal_Sym *sym = (Elf_Internal_Sym *)0; - asection *sec = (asection *)0; - struct elf_link_hash_entry *h = (struct elf_link_hash_entry *)0; - const char *sym_name = (const char *)0; + Elf_Internal_Sym *sym = (Elf_Internal_Sym *) 0; + asection *sec = (asection *) 0; + struct elf_link_hash_entry *h = (struct elf_link_hash_entry *) 0; + const char *sym_name = (const char *) 0; reloc_howto_type *howto; unsigned long r_symndx; bfd_vma relocation; + int will_become_local; /* Unknown relocation handling */ - if ((unsigned)r_type >= (unsigned)R_PPC_max || !ppc_elf_howto_table[(int)r_type]) + if ((unsigned) r_type >= (unsigned) R_PPC_max + || !ppc_elf_howto_table[(int) r_type]) { (*_bfd_error_handler) (_("%s: unknown relocation type %d"), bfd_get_filename (input_bfd), - (int)r_type); + (int) r_type); bfd_set_error (bfd_error_bad_value); ret = false; continue; } - howto = ppc_elf_howto_table[(int)r_type]; + howto = ppc_elf_howto_table[(int) r_type]; r_symndx = ELF32_R_SYM (rel->r_info); if (info->relocateable) @@ -2988,7 +2977,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, if (r_symndx < symtab_hdr->sh_info) { sym = local_syms + r_symndx; - if ((unsigned)ELF_ST_TYPE (sym->st_info) == STT_SECTION) + if ((unsigned) ELF_ST_TYPE (sym->st_info) == STT_SECTION) { sec = local_sections[r_symndx]; addend = rel->r_addend += sec->output_offset + sym->st_value; @@ -2998,10 +2987,10 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, #ifdef DEBUG fprintf (stderr, "\ttype = %s (%d), symbol index = %ld, offset = %ld, addend = %ld\n", howto->name, - (int)r_type, + (int) r_type, r_symndx, - (long)offset, - (long)addend); + (long) offset, + (long) addend); #endif continue; } @@ -3016,6 +3005,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (sec->output_section->vma + sec->output_offset + sym->st_value); + /* Relocs to local symbols are always resolved. */ + will_become_local = 1; } else { @@ -3024,11 +3015,17 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; sym_name = h->root.root.string; + + /* Can this relocation be resolved immediately? */ + will_become_local = SYMBOL_REFERENCES_LOCAL (info, h); + 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_PPC_PLT32 + if (((r_type == R_PPC_PLT32 + || r_type == R_PPC_PLTREL24) + && splt != NULL && h->plt.offset != (bfd_vma) -1) || (r_type == R_PPC_LOCAL24PC && sec->output_section == NULL) @@ -3037,20 +3034,17 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_PPC_GOT16_HI || r_type == R_PPC_GOT16_HA) && 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 || ! will_become_local)) || (info->shared - && ((! info->symbolic && h->dynindx != -1) - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0) + && ! will_become_local && ((input_section->flags & SEC_ALLOC) != 0 /* Testing SEC_DEBUGGING here may be wrong. It's here to avoid a crash when generating a shared library with DWARF debugging information. */ - || (input_section->flags & SEC_DEBUGGING) != 0) + || ((input_section->flags & SEC_DEBUGGING) != 0 + && (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_DYNAMIC) != 0)) && (r_type == R_PPC_ADDR32 || r_type == R_PPC_ADDR24 || r_type == R_PPC_ADDR16 @@ -3060,7 +3054,6 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, || r_type == R_PPC_ADDR14 || r_type == R_PPC_ADDR14_BRTAKEN || r_type == R_PPC_ADDR14_BRNTAKEN - || r_type == R_PPC_PLTREL24 || r_type == R_PPC_COPY || r_type == R_PPC_GLOB_DAT || r_type == R_PPC_JMP_SLOT @@ -3094,13 +3087,13 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, 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; - } + } else relocation = (h->root.u.def.value + sec->output_section->vma @@ -3108,13 +3101,12 @@ 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->no_undefined && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) relocation = 0; else { - if (! (*info->callbacks->undefined_symbol)(info, + if (! (*info->callbacks->undefined_symbol) (info, h->root.root.string, input_bfd, input_section, @@ -3127,19 +3119,19 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } } - switch ((int)r_type) + switch ((int) r_type) { default: (*_bfd_error_handler) (_("%s: unknown relocation type %d for symbol %s"), bfd_get_filename (input_bfd), - (int)r_type, sym_name); + (int) r_type, sym_name); bfd_set_error (bfd_error_bad_value); ret = false; continue; /* Relocations that need no special processing. */ - case (int)R_PPC_LOCAL24PC: + case (int) R_PPC_LOCAL24PC: /* It makes no sense to point a local relocation at a symbol not in this object. */ if (h != NULL @@ -3160,28 +3152,29 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, /* Relocations that may need to be propagated if this is a shared object. */ - case (int)R_PPC_REL24: - case (int)R_PPC_REL32: - case (int)R_PPC_REL14: + case (int) R_PPC_REL24: + case (int) R_PPC_REL32: + case (int) R_PPC_REL14: /* If these relocations are not to a named symbol, they can be handled right here, no need to bother the dynamic linker. */ if (h == NULL - || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) + || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0 + || SYMBOL_REFERENCES_LOCAL (info, h)) break; /* fall through */ /* 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: - case (int)R_PPC_ADDR16_LO: - case (int)R_PPC_ADDR16_HI: - case (int)R_PPC_ADDR16_HA: - case (int)R_PPC_ADDR14: - case (int)R_PPC_UADDR32: - case (int)R_PPC_UADDR16: + case (int) R_PPC_NONE: + case (int) R_PPC_ADDR32: + case (int) R_PPC_ADDR24: + case (int) R_PPC_ADDR16: + case (int) R_PPC_ADDR16_LO: + case (int) R_PPC_ADDR16_HI: + case (int) R_PPC_ADDR16_HA: + case (int) R_PPC_ADDR14: + case (int) R_PPC_UADDR32: + case (int) R_PPC_UADDR16: if (info->shared) { Elf_Internal_Rela outrel; @@ -3241,12 +3234,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, memset (&outrel, 0, sizeof outrel); /* h->dynindx may be -1 if this symbol was marked to become local. */ - else if (h != NULL - && ((! info->symbolic && h->dynindx != -1) - || (h->elf_link_hash_flags - & ELF_LINK_HASH_DEF_REGULAR) == 0)) + else if (! will_become_local) { - BFD_ASSERT (h->dynindx != -1); outrel.r_info = ELF32_R_INFO (h->dynindx, r_type); outrel.r_addend = rel->r_addend; } @@ -3283,11 +3272,11 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, osec = sec->output_section; indx = elf_section_data (osec)->dynindx; - BFD_ASSERT(indx > 0); + BFD_ASSERT (indx > 0); #ifdef DEBUG if (indx <= 0) { - printf("indx=%d section=%s flags=%08x name=%s\n", + printf ("indx=%d section=%s flags=%08x name=%s\n", indx, osec->name, osec->flags, h->root.root.string); } @@ -3328,8 +3317,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; /* branch taken prediction relocations */ - case (int)R_PPC_ADDR14_BRTAKEN: - case (int)R_PPC_REL14_BRTAKEN: + case (int) R_PPC_ADDR14_BRTAKEN: + case (int) R_PPC_REL14_BRTAKEN: insn = bfd_get_32 (output_bfd, contents + offset); if ((relocation - offset) & 0x8000) insn &= ~BRANCH_PREDICT_BIT; @@ -3339,8 +3328,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; /* branch not taken predicition relocations */ - case (int)R_PPC_ADDR14_BRNTAKEN: - case (int)R_PPC_REL14_BRNTAKEN: + case (int) R_PPC_ADDR14_BRNTAKEN: + case (int) R_PPC_REL14_BRNTAKEN: insn = bfd_get_32 (output_bfd, contents + offset); if ((relocation - offset) & 0x8000) insn |= BRANCH_PREDICT_BIT; @@ -3350,10 +3339,10 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; /* GOT16 relocations */ - case (int)R_PPC_GOT16: - case (int)R_PPC_GOT16_LO: - case (int)R_PPC_GOT16_HI: - case (int)R_PPC_GOT16_HA: + case (int) R_PPC_GOT16: + case (int) R_PPC_GOT16_LO: + case (int) R_PPC_GOT16_HI: + case (int) R_PPC_GOT16_HA: /* Relocation is to the entry for this symbol in the global offset table. */ BFD_ASSERT (sgot != NULL); @@ -3367,8 +3356,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, 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))) + && SYMBOL_REFERENCES_LOCAL (info, h))) { /* This is actually a static link, or it is a -Bsymbolic link and the symbol is defined @@ -3441,7 +3429,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; /* Indirect .sdata relocation */ - case (int)R_PPC_EMB_SDAI16: + case (int) R_PPC_EMB_SDAI16: BFD_ASSERT (sdata != NULL); relocation = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd, info, sdata, h, relocation, rel, @@ -3449,7 +3437,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; /* Indirect .sdata2 relocation */ - case (int)R_PPC_EMB_SDA2I16: + case (int) R_PPC_EMB_SDA2I16: BFD_ASSERT (sdata2 != NULL); relocation = bfd_elf32_finish_pointer_linker_section (output_bfd, input_bfd, info, sdata2, h, relocation, rel, @@ -3460,8 +3448,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, section, not the actual VMA. This is appropriate when generating an embedded ELF object, for which the .got section acts like the AIX .toc section. */ - case (int)R_PPC_TOC16: /* phony GOT16 relocations */ - BFD_ASSERT (sec != (asection *)0); + case (int) R_PPC_TOC16: /* phony GOT16 relocations */ + BFD_ASSERT (sec != (asection *) 0); BFD_ASSERT (bfd_is_und_section (sec) || strcmp (bfd_get_section_name (abfd, sec), ".got") == 0 || strcmp (bfd_get_section_name (abfd, sec), ".cgot") == 0) @@ -3469,7 +3457,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, addend -= sec->output_section->vma + sec->output_offset + 0x8000; break; - case (int)R_PPC_PLTREL24: + case (int) R_PPC_PLTREL24: /* Relocation is to the entry for this symbol in the procedure linkage table. */ BFD_ASSERT (h != NULL); @@ -3486,14 +3474,14 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (splt->output_section->vma + splt->output_offset + h->plt.offset); - break; + break; /* relocate against _SDA_BASE_ */ - case (int)R_PPC_SDAREL16: + case (int) R_PPC_SDAREL16: { const char *name; - BFD_ASSERT (sec != (asection *)0); + BFD_ASSERT (sec != (asection *) 0); name = bfd_get_section_name (abfd, sec->output_section); if (strcmp (name, ".sdata") != 0 && strcmp (name, ".sbss") != 0) @@ -3501,7 +3489,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"), bfd_get_filename (input_bfd), sym_name, - ppc_elf_howto_table[ (int)r_type ]->name, + ppc_elf_howto_table[(int) r_type]->name, name); } addend -= (sdata->sym_hash->root.u.def.value @@ -3510,22 +3498,21 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } break; - /* relocate against _SDA2_BASE_ */ - case (int)R_PPC_EMB_SDA2REL: + case (int) R_PPC_EMB_SDA2REL: { const char *name; - BFD_ASSERT (sec != (asection *)0); + BFD_ASSERT (sec != (asection *) 0); name = bfd_get_section_name (abfd, sec->output_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), sym_name, - ppc_elf_howto_table[ (int)r_type ]->name, + ppc_elf_howto_table[(int) r_type]->name, name); - + bfd_set_error (bfd_error_bad_value); ret = false; continue; @@ -3536,15 +3523,14 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, } break; - /* relocate against either _SDA_BASE_, _SDA2_BASE_, or 0 */ - case (int)R_PPC_EMB_SDA21: - case (int)R_PPC_EMB_RELSDA: + case (int) R_PPC_EMB_SDA21: + case (int) R_PPC_EMB_RELSDA: { const char *name; int reg; - BFD_ASSERT (sec != (asection *)0); + BFD_ASSERT (sec != (asection *) 0); name = bfd_get_section_name (abfd, sec->output_section); if (strcmp (name, ".sdata") == 0 || strcmp (name, ".sbss") == 0) { @@ -3554,7 +3540,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, + sdata->sym_hash->root.u.def.section->output_offset); } - else if (strcmp (name, ".sdata2") == 0 || strcmp (name, ".sbss2") == 0) + else if (strcmp (name, ".sdata2") == 0 + || strcmp (name, ".sbss2") == 0) { reg = 2; addend -= (sdata2->sym_hash->root.u.def.value @@ -3562,7 +3549,8 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, + sdata2->sym_hash->root.u.def.section->output_offset); } - else if (strcmp (name, ".PPC.EMB.sdata0") == 0 || strcmp (name, ".PPC.EMB.sbss0") == 0) + else if (strcmp (name, ".PPC.EMB.sdata0") == 0 + || strcmp (name, ".PPC.EMB.sbss0") == 0) { reg = 0; } @@ -3572,7 +3560,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, (*_bfd_error_handler) (_("%s: The target (%s) of a %s relocation is in the wrong output section (%s)"), bfd_get_filename (input_bfd), sym_name, - ppc_elf_howto_table[ (int)r_type ]->name, + ppc_elf_howto_table[(int) r_type]->name, name); bfd_set_error (bfd_error_bad_value); @@ -3590,75 +3578,74 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, break; /* Relocate against the beginning of the section */ - case (int)R_PPC_SECTOFF: - case (int)R_PPC_SECTOFF_LO: - case (int)R_PPC_SECTOFF_HI: - BFD_ASSERT (sec != (asection *)0); + case (int) R_PPC_SECTOFF: + case (int) R_PPC_SECTOFF_LO: + case (int) R_PPC_SECTOFF_HI: + BFD_ASSERT (sec != (asection *) 0); addend -= sec->output_section->vma; break; - case (int)R_PPC_SECTOFF_HA: - BFD_ASSERT (sec != (asection *)0); + case (int) R_PPC_SECTOFF_HA: + BFD_ASSERT (sec != (asection *) 0); addend -= sec->output_section->vma; addend += ((relocation + addend) & 0x8000) << 1; break; /* Negative relocations */ - case (int)R_PPC_EMB_NADDR32: - case (int)R_PPC_EMB_NADDR16: - case (int)R_PPC_EMB_NADDR16_LO: - case (int)R_PPC_EMB_NADDR16_HI: - addend -= 2*relocation; + case (int) R_PPC_EMB_NADDR32: + case (int) R_PPC_EMB_NADDR16: + case (int) R_PPC_EMB_NADDR16_LO: + case (int) R_PPC_EMB_NADDR16_HI: + addend -= 2 * relocation; break; - case (int)R_PPC_EMB_NADDR16_HA: - addend -= 2*relocation; + case (int) R_PPC_EMB_NADDR16_HA: + addend -= 2 * relocation; addend += ((relocation + addend) & 0x8000) << 1; break; /* NOP relocation that prevents garbage collecting linkers from omitting a reference. */ - case (int)R_PPC_EMB_MRKREF: + case (int) R_PPC_EMB_MRKREF: continue; - case (int)R_PPC_COPY: - case (int)R_PPC_GLOB_DAT: - case (int)R_PPC_JMP_SLOT: - case (int)R_PPC_RELATIVE: - case (int)R_PPC_PLT32: - case (int)R_PPC_PLTREL32: - case (int)R_PPC_PLT16_LO: - case (int)R_PPC_PLT16_HI: - case (int)R_PPC_PLT16_HA: - case (int)R_PPC_EMB_RELSEC16: - case (int)R_PPC_EMB_RELST_LO: - case (int)R_PPC_EMB_RELST_HI: - case (int)R_PPC_EMB_RELST_HA: - case (int)R_PPC_EMB_BIT_FLD: + case (int) R_PPC_COPY: + case (int) R_PPC_GLOB_DAT: + case (int) R_PPC_JMP_SLOT: + case (int) R_PPC_RELATIVE: + case (int) R_PPC_PLT32: + case (int) R_PPC_PLTREL32: + case (int) R_PPC_PLT16_LO: + case (int) R_PPC_PLT16_HI: + case (int) R_PPC_PLT16_HA: + case (int) R_PPC_EMB_RELSEC16: + case (int) R_PPC_EMB_RELST_LO: + case (int) R_PPC_EMB_RELST_HI: + 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), - ppc_elf_howto_table[ (int)r_type ]->name, + ppc_elf_howto_table[(int) r_type]->name, sym_name); bfd_set_error (bfd_error_invalid_operation); ret = false; continue; - case (int)R_PPC_GNU_VTINHERIT: - case (int)R_PPC_GNU_VTENTRY: + case (int) R_PPC_GNU_VTINHERIT: + case (int) R_PPC_GNU_VTENTRY: /* These are no-ops in the end. */ continue; } - #ifdef DEBUG fprintf (stderr, "\ttype = %s (%d), name = %s, symbol index = %ld, offset = %ld, addend = %ld\n", howto->name, - (int)r_type, + (int) r_type, sym_name, r_symndx, - (long)offset, - (long)addend); + (long) offset, + (long) addend); #endif r = _bfd_final_link_relocate (howto, @@ -3702,7 +3689,7 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, name = bfd_section_name (input_bfd, sec); } - if (! (*info->callbacks->reloc_overflow)(info, + if (! (*info->callbacks->reloc_overflow) (info, name, howto->name, (bfd_vma) 0, @@ -3721,7 +3708,6 @@ ppc_elf_relocate_section (output_bfd, info, input_bfd, input_section, return ret; } - #define TARGET_LITTLE_SYM bfd_elf32_powerpcle_vec #define TARGET_LITTLE_NAME "elf32-powerpcle" diff --git a/gnu/dist/toolchain/bfd/elf32-sh-lin.c b/gnu/dist/toolchain/bfd/elf32-sh-lin.c new file mode 100644 index 000000000000..1ee0a87cab86 --- /dev/null +++ b/gnu/dist/toolchain/bfd/elf32-sh-lin.c @@ -0,0 +1,29 @@ +/* Hitachi SH specific support for 32-bit Linux + Copyright 2000 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. */ + +#define TARGET_BIG_SYM bfd_elf32_shblin_vec +#define TARGET_BIG_NAME "elf32-shbig-linux" +#define TARGET_LITTLE_SYM bfd_elf32_shlin_vec +#define TARGET_LITTLE_NAME "elf32-sh-linux" +#define ELF_ARCH bfd_arch_sh +#define ELF_MACHINE_CODE EM_SH +#define ELF_MAXPAGESIZE 0x10000 +#define elf_symbol_leading_char 0 + +#include "elf32-sh.c" diff --git a/gnu/dist/toolchain/bfd/elf32-sparc.c b/gnu/dist/toolchain/bfd/elf32-sparc.c index 1c8d0ba275ae..4e9c6c282335 100644 --- a/gnu/dist/toolchain/bfd/elf32-sparc.c +++ b/gnu/dist/toolchain/bfd/elf32-sparc.c @@ -24,6 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libbfd.h" #include "elf-bfd.h" #include "elf/sparc.h" +#include "opcode/sparc.h" static reloc_howto_type *elf32_sparc_reloc_type_lookup PARAMS ((bfd *, bfd_reloc_code_real_type)); @@ -36,6 +37,8 @@ static boolean elf32_sparc_adjust_dynamic_symbol PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); static boolean elf32_sparc_size_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); +static boolean elf32_sparc_relax_section + PARAMS ((bfd *, asection *, struct bfd_link_info *, boolean *)); static boolean elf32_sparc_relocate_section PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); @@ -126,7 +129,6 @@ static reloc_howto_type elf32_sparc_vtinherit_howto = static reloc_howto_type elf32_sparc_vtentry_howto = HOWTO (R_SPARC_GNU_VTENTRY, 0,2,0,false,0,complain_overflow_dont, _bfd_elf_rel_vtable_reloc_fn,"R_SPARC_GNU_VTENTRY", false,0,0, false); - struct elf_reloc_map { bfd_reloc_code_real_type bfd_reloc_val; unsigned char elf_reloc_val; @@ -185,7 +187,7 @@ elf32_sparc_reloc_type_lookup (abfd, code) bfd_reloc_code_real_type code; { unsigned int i; - + switch (code) { case BFD_RELOC_VTABLE_INHERIT: @@ -1016,7 +1018,12 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) } /* Allocate memory for the section contents. */ - s->contents = (bfd_byte *) bfd_alloc (dynobj, s->_raw_size); + /* FIXME: This should be a call to bfd_alloc not bfd_zalloc. + Unused entries should be reclaimed before the section's contents + are written out, but at the moment this does not happen. Thus in + order to prevent writing out garbage, we initialise the section's + contents to zero. */ + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); if (s->contents == NULL && s->_raw_size != 0) return false; } @@ -1053,12 +1060,28 @@ elf32_sparc_size_dynamic_sections (output_bfd, info) { if (! bfd_elf32_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; + info->flags |= DF_TEXTREL; } } return true; } +#define SET_SEC_DO_RELAX(section) do { elf_section_data(section)->tdata = (void *)1; } while (0) +#define SEC_DO_RELAX(section) (elf_section_data(section)->tdata == (void *)1) + +static boolean +elf32_sparc_relax_section (abfd, section, link_info, again) + bfd *abfd ATTRIBUTE_UNUSED; + asection *section ATTRIBUTE_UNUSED; + struct bfd_link_info *link_info ATTRIBUTE_UNUSED; + boolean *again; +{ + *again = false; + SET_SEC_DO_RELAX (section); + return true; +} + /* Relocate a SPARC ELF section. */ static boolean @@ -1113,7 +1136,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, r_type = ELF32_R_TYPE (rel->r_info); - if (r_type == R_SPARC_GNU_VTINHERIT + if (r_type == R_SPARC_GNU_VTINHERIT || r_type == R_SPARC_GNU_VTENTRY) continue; @@ -1518,6 +1541,7 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, break; } + r = bfd_reloc_continue; if (r_type == R_SPARC_WDISP16) { bfd_vma x; @@ -1549,12 +1573,101 @@ elf32_sparc_relocate_section (output_bfd, info, input_bfd, input_section, bfd_putl32 (/*input_bfd,*/ x, contents + rel->r_offset); r = bfd_reloc_ok; } - else + else if ((r_type == R_SPARC_WDISP30 || r_type == R_SPARC_WPLT30) + && SEC_DO_RELAX (input_section) + && rel->r_offset + 4 < input_section->_raw_size) + { +#define G0 0 +#define O7 15 +#define XCC (2 << 20) +#define COND(x) (((x)&0xf)<<25) +#define CONDA COND(0x8) +#define INSN_BPA (F2(0,1) | CONDA | BPRED | XCC) +#define INSN_BA (F2(0,2) | CONDA) +#define INSN_OR F3(2, 0x2, 0) +#define INSN_NOP F2(0,4) + + bfd_vma x, y; + + /* If the instruction is a call with either: + restore + arithmetic instruction with rd == %o7 + where rs1 != %o7 and rs2 if it is register != %o7 + then we can optimize if the call destination is near + by changing the call into a branch always. */ + x = bfd_get_32 (input_bfd, contents + rel->r_offset); + y = bfd_get_32 (input_bfd, contents + rel->r_offset + 4); + if ((x & OP(~0)) == OP(1) && (y & OP(~0)) == OP(2)) + { + if (((y & OP3(~0)) == OP3(0x3d) /* restore */ + || ((y & OP3(0x28)) == 0 /* arithmetic */ + && (y & RD(~0)) == RD(O7))) + && (y & RS1(~0)) != RS1(O7) + && ((y & F3I(~0)) + || (y & RS2(~0)) != RS2(O7))) + { + bfd_vma reloc; + + reloc = relocation + rel->r_addend - rel->r_offset; + reloc -= (input_section->output_section->vma + + input_section->output_offset); + + /* Ensure the reloc fits into simm22. */ + if ((reloc & 3) == 0 + && ((reloc & ~(bfd_vma)0x7fffff) == 0 + || ((reloc | 0x7fffff) == ~(bfd_vma)0))) + { + reloc >>= 2; + + /* Check whether it fits into simm19 on v9. */ + if (((reloc & 0x3c0000) == 0 + || (reloc & 0x3c0000) == 0x3c0000) + && (elf_elfheader (output_bfd)->e_flags & EF_SPARC_32PLUS)) + x = INSN_BPA | (reloc & 0x7ffff); /* ba,pt %xcc */ + else + x = INSN_BA | (reloc & 0x3fffff); /* ba */ + bfd_put_32 (input_bfd, x, contents + rel->r_offset); + r = bfd_reloc_ok; + if (rel->r_offset >= 4 + && (y & (0xffffffff ^ RS1(~0))) + == (INSN_OR | RD(O7) | RS2(G0))) + { + bfd_vma z; + unsigned int reg; + + z = bfd_get_32 (input_bfd, + contents + rel->r_offset - 4); + if ((z & (0xffffffff ^ RD(~0))) + != (INSN_OR | RS1(O7) | RS2(G0))) + break; + + /* The sequence was + or %o7, %g0, %rN + call foo + or %rN, %g0, %o7 + + If call foo was replaced with ba, replace + or %rN, %g0, %o7 with nop. */ + + reg = (y & RS1(~0)) >> 14; + if (reg != ((z & RD(~0)) >> 25) + || reg == G0 || reg == O7) + break; + + bfd_put_32 (input_bfd, INSN_NOP, + contents + rel->r_offset + 4); + } + + } + } + } + } + + if (r == bfd_reloc_continue) r = _bfd_final_link_relocate (howto, input_bfd, input_section, contents, rel->r_offset, relocation, rel->r_addend); - if (r != bfd_reloc_ok) { switch (r) @@ -1842,33 +1955,6 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd) error = false; -#if 0 - /* ??? The native linker doesn't do this so we can't (otherwise gcc would - have to know which linker is being used). Instead, the native linker - bumps up the architecture level when it has to. However, I still think - warnings like these are good, so it would be nice to have them turned on - by some option. */ - - /* If the output machine is normal sparc, we can't allow v9 input files. */ - if (bfd_get_mach (obfd) == bfd_mach_sparc - && (bfd_get_mach (ibfd) == bfd_mach_sparc_v8plus - || bfd_get_mach (ibfd) == bfd_mach_sparc_v8plusa)) - { - error = true; - (*_bfd_error_handler) - (_("%s: compiled for a v8plus system and target is v8"), - bfd_get_filename (ibfd)); - } - /* If the output machine is v9, we can't allow v9+vis input files. */ - if (bfd_get_mach (obfd) == bfd_mach_sparc_v8plus - && bfd_get_mach (ibfd) == bfd_mach_sparc_v8plusa) - { - error = true; - (*_bfd_error_handler) - (_("%s: compiled for a v8plusa system and target is v8plus"), - bfd_get_filename (ibfd)); - } -#else if (bfd_get_mach (ibfd) >= bfd_mach_sparc_v9) { error = true; @@ -1881,7 +1967,6 @@ elf32_sparc_merge_private_bfd_data (ibfd, obfd) if (bfd_get_mach (obfd) < bfd_get_mach (ibfd)) bfd_set_arch_mach (obfd, bfd_arch_sparc, bfd_get_mach (ibfd)); } -#endif if (((elf_elfheader (ibfd)->e_flags & EF_SPARC_LEDATA) != previous_ibfd_e_flags) @@ -1911,7 +1996,10 @@ elf32_sparc_object_p (abfd) { if (elf_elfheader (abfd)->e_machine == EM_SPARC32PLUS) { - if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US1) + if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US3) + return bfd_default_set_arch_mach (abfd, bfd_arch_sparc, + bfd_mach_sparc_v8plusb); + else if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US1) return bfd_default_set_arch_mach (abfd, bfd_arch_sparc, bfd_mach_sparc_v8plusa); else if (elf_elfheader (abfd)->e_flags & EF_SPARC_32PLUS) @@ -1949,6 +2037,12 @@ elf32_sparc_final_write_processing (abfd, linker) elf_elfheader (abfd)->e_flags &=~ EF_SPARC_32PLUS_MASK; elf_elfheader (abfd)->e_flags |= EF_SPARC_32PLUS | EF_SPARC_SUN_US1; break; + case bfd_mach_sparc_v8plusb : + elf_elfheader (abfd)->e_machine = EM_SPARC32PLUS; + elf_elfheader (abfd)->e_flags &=~ EF_SPARC_32PLUS_MASK; + elf_elfheader (abfd)->e_flags |= EF_SPARC_32PLUS | EF_SPARC_SUN_US1 + | EF_SPARC_SUN_US3; + break; case bfd_mach_sparc_sparclite_le : elf_elfheader (abfd)->e_machine = EM_SPARC; elf_elfheader (abfd)->e_flags |= EF_SPARC_LEDATA; @@ -1967,6 +2061,7 @@ elf32_sparc_final_write_processing (abfd, linker) #define ELF_MAXPAGESIZE 0x10000 #define bfd_elf32_bfd_reloc_type_lookup elf32_sparc_reloc_type_lookup +#define bfd_elf32_bfd_relax_section elf32_sparc_relax_section #define elf_info_to_howto elf32_sparc_info_to_howto #define elf_backend_create_dynamic_sections \ _bfd_elf_create_dynamic_sections diff --git a/gnu/dist/toolchain/bfd/elf32-v850.c b/gnu/dist/toolchain/bfd/elf32-v850.c index 4fe28fc92b91..e71866c3aa39 100644 --- a/gnu/dist/toolchain/bfd/elf32-v850.c +++ b/gnu/dist/toolchain/bfd/elf32-v850.c @@ -17,12 +17,9 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - - /* XXX FIXME: This code is littered with 32bit int, 16bit short, 8bit char dependencies. As is the gas & simulator code or the v850. */ - #include "bfd.h" #include "sysdep.h" #include "bfdlink.h" @@ -32,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* sign-extend a 24-bit number */ #define SEXT24(x) ((((x) & 0xffffff) ^ (~ 0x7fffff)) + 0x800000) - + static reloc_howto_type *v850_elf_reloc_type_lookup PARAMS ((bfd *abfd, bfd_reloc_code_real_type code)); static void v850_elf_info_to_howto_rel @@ -103,7 +100,7 @@ static reloc_howto_type v850_elf_howto_table[] = 0, /* dst_mask */ false), /* pcrel_offset */ - /* A PC relative 9 bit branch. */ + /* A PC relative 9 bit branch. */ HOWTO (R_V850_9_PCREL, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -118,7 +115,7 @@ static reloc_howto_type v850_elf_howto_table[] = 0x00ffffff, /* dst_mask */ true), /* pcrel_offset */ - /* A PC relative 22 bit branch. */ + /* A PC relative 22 bit branch. */ HOWTO (R_V850_22_PCREL, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -312,7 +309,7 @@ static reloc_howto_type v850_elf_howto_table[] = 0x7f, /* src_mask */ 0x7f, /* dst_mask */ false), /* pcrel_offset */ - + /* 7 bit offset from the tiny data area pointer. */ HOWTO (R_V850_TDA_7_7_OFFSET, /* type */ 0, /* rightshift */ @@ -462,7 +459,7 @@ static reloc_howto_type v850_elf_howto_table[] = 0, /* src_mask */ 0, /* dst_mask */ false), /* pcrel_offset */ - + }; /* Map BFD reloc types to V850 ELF reloc types. */ @@ -504,7 +501,6 @@ static const struct v850_elf_reloc_map v850_elf_reloc_map[] = { BFD_RELOC_VTABLE_ENTRY, R_V850_GNU_VTENTRY }, }; - /* Map a bfd relocation into the appropriate howto structure */ static reloc_howto_type * @@ -521,14 +517,13 @@ v850_elf_reloc_type_lookup (abfd, code) if (v850_elf_reloc_map[i].bfd_reloc_val == code) { BFD_ASSERT (v850_elf_howto_table[v850_elf_reloc_map[i].elf_reloc_val].type == v850_elf_reloc_map[i].elf_reloc_val); - + return & v850_elf_howto_table[v850_elf_reloc_map[i].elf_reloc_val]; } } return NULL; } - /* Set the howto pointer for an V850 ELF reloc. */ static void @@ -544,7 +539,7 @@ v850_elf_info_to_howto_rel (abfd, cache_ptr, dst) cache_ptr->howto = &v850_elf_howto_table[r_type]; } -/* Set the howto pointer for a V850 ELF reloc (type RELA). */ +/* Set the howto pointer for a V850 ELF reloc (type RELA). */ static void v850_elf_info_to_howto_rela (abfd, cache_ptr, dst) bfd * abfd ATTRIBUTE_UNUSED; @@ -557,7 +552,6 @@ v850_elf_info_to_howto_rela (abfd, cache_ptr, dst) BFD_ASSERT (r_type < (unsigned int) R_V850_max); cache_ptr->howto = &v850_elf_howto_table[r_type]; } - /* Look through the relocs for a section during the first phase, and allocate space in the global offset table or procedure linkage @@ -644,14 +638,14 @@ v850_elf_check_relocs (abfd, info, sec, relocs) other = V850_OTHER_SDA; common = ".scommon"; goto small_data_common; - + case R_V850_ZDA_16_16_SPLIT_OFFSET: case R_V850_ZDA_16_16_OFFSET: case R_V850_ZDA_15_16_OFFSET: other = V850_OTHER_ZDA; common = ".zcommon"; goto small_data_common; - + case R_V850_TDA_4_5_OFFSET: case R_V850_TDA_4_4_OFFSET: case R_V850_TDA_6_8_OFFSET: @@ -760,21 +754,21 @@ remember_hi16s_reloc (abfd, addend, address) bfd_byte * address; { hi16s_location * entry = NULL; - + /* Find a free structure. */ if (free_hi16s == NULL) free_hi16s = (hi16s_location *) bfd_zalloc (abfd, sizeof (* free_hi16s)); entry = free_hi16s; free_hi16s = free_hi16s->next; - + entry->addend = addend; entry->address = address; entry->counter = hi16s_counter ++; entry->found = false; entry->next = previous_hi16s; previous_hi16s = entry; - + /* Cope with wrap around of our counter. */ if (hi16s_counter == 0) { @@ -784,7 +778,7 @@ remember_hi16s_reloc (abfd, addend, address) hi16s_counter = 0x10000; } - + return; } @@ -798,7 +792,7 @@ find_remembered_hi16s_reloc (addend, already_found) hi16s_location * previous = NULL; hi16s_location * prev; bfd_byte * addr; - + /* Search the table. Record the most recent entry that matches. */ for (entry = previous_hi16s; entry; entry = entry->next) { @@ -808,7 +802,7 @@ find_remembered_hi16s_reloc (addend, already_found) previous = prev; match = entry; } - + prev = entry; } @@ -824,9 +818,9 @@ find_remembered_hi16s_reloc (addend, already_found) /* Note that this entry has now been used. */ match->found = true; - + return addr; -} +} /* FIXME: The code here probably ought to be removed and the code in reloc.c allowed to do its stuff instead. At least for most of the relocs, anwyay. */ @@ -839,62 +833,62 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) { unsigned long insn; bfd_signed_vma saddend = (bfd_signed_vma) addend; - + switch (r_type) { default: /* fprintf (stderr, "reloc type %d not SUPPORTED\n", r_type ); */ return bfd_reloc_notsupported; - + case R_V850_32: bfd_put_32 (abfd, addend, address); return bfd_reloc_ok; - + case R_V850_22_PCREL: if (saddend > 0x1fffff || saddend < -0x200000) return bfd_reloc_overflow; - + if ((addend % 2) != 0) return bfd_reloc_dangerous; - + insn = bfd_get_32 (abfd, address); insn &= ~0xfffe003f; insn |= (((addend & 0xfffe) << 16) | ((addend & 0x3f0000) >> 16)); bfd_put_32 (abfd, insn, address); return bfd_reloc_ok; - + case R_V850_9_PCREL: if (saddend > 0xff || saddend < -0x100) return bfd_reloc_overflow; - + if ((addend % 2) != 0) return bfd_reloc_dangerous; - + insn = bfd_get_16 (abfd, address); insn &= ~ 0xf870; insn |= ((addend & 0x1f0) << 7) | ((addend & 0x0e) << 3); break; - + case R_V850_HI16: addend += (bfd_get_16 (abfd, address) << 16); addend = (addend >> 16); insn = addend; break; - + case R_V850_HI16_S: /* Remember where this relocation took place. */ remember_hi16s_reloc (abfd, addend, address); addend += (bfd_get_16 (abfd, address) << 16); addend = (addend >> 16) + ((addend & 0x8000) != 0); - - /* This relocation cannot overflow. */ + + /* This relocation cannot overflow. */ if (addend > 0x7fff) addend = 0; - + insn = addend; break; - + case R_V850_LO16: /* Calculate the sum of the value stored in the instruction and the addend and check for overflow from the low 16 bits into the high @@ -972,7 +966,6 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) ------------ 0x00116fff = fred + 0x10ffff = 0x7000 + 0x10ffff - Overflow can also occur if the computation carries into the 16th bit and it also results in the 15th bit having the same value as the 15th bit of the original value. What happens is that the HI16S reloc @@ -1007,7 +1000,7 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) + 0x00006fff ------------ 0x00006fff but 'fred + 0x7000' = 0x00016fff - + Note - there is no need to change anything if a carry occurs, and the 15th bit changes its value from being set to being clear, as the HI16S reloc will have already added in 1 to the high part for us: @@ -1046,7 +1039,7 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) #define BIT15_SET(x) ((x) & 0x8000) #define OVERFLOWS(a,i) ((((a) & 0xffff) + (i)) > 0xffff) - + if ((BIT15_SET (result) && ! BIT15_SET (addend)) || (OVERFLOWS (addend, insn) && ((! BIT15_SET (insn)) || (BIT15_SET (addend))))) @@ -1054,7 +1047,7 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) boolean already_updated; bfd_byte * hi16s_address = find_remembered_hi16s_reloc (addend, & already_updated); - + /* Amend the matching HI16_S relocation. */ if (hi16s_address != NULL) { @@ -1071,7 +1064,7 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) return bfd_reloc_overflow; } } - + /* Do not complain if value has top bit set, as this has been anticipated. */ insn = result & 0xffff; break; @@ -1081,7 +1074,7 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) addend += (char) bfd_get_8 (abfd, address); saddend = (bfd_signed_vma) addend; - + if (saddend > 0x7f || saddend < -0x80) return bfd_reloc_overflow; @@ -1090,150 +1083,150 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) case R_V850_CALLT_16_16_OFFSET: addend += bfd_get_16 (abfd, address); - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0xffff || saddend < 0) return bfd_reloc_overflow; insn = addend; break; - + case R_V850_16: - /* drop through */ + /* drop through */ case R_V850_SDA_16_16_OFFSET: case R_V850_ZDA_16_16_OFFSET: case R_V850_TDA_16_16_OFFSET: addend += bfd_get_16 (abfd, address); - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0x7fff || saddend < -0x8000) return bfd_reloc_overflow; insn = addend; break; - + case R_V850_SDA_15_16_OFFSET: case R_V850_ZDA_15_16_OFFSET: insn = bfd_get_16 (abfd, address); addend += (insn & 0xfffe); - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0x7ffe || saddend < -0x8000) return bfd_reloc_overflow; - + if (addend & 1) return bfd_reloc_dangerous; - + insn = (addend & ~1) | (insn & 1); break; - + case R_V850_TDA_6_8_OFFSET: insn = bfd_get_16 (abfd, address); addend += ((insn & 0x7e) << 1); - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0xfc || saddend < 0) return bfd_reloc_overflow; - + if (addend & 3) return bfd_reloc_dangerous; - + insn &= 0xff81; insn |= (addend >> 1); break; - + case R_V850_TDA_7_8_OFFSET: insn = bfd_get_16 (abfd, address); addend += ((insn & 0x7f) << 1); - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0xfe || saddend < 0) return bfd_reloc_overflow; - + if (addend & 1) return bfd_reloc_dangerous; - + insn &= 0xff80; insn |= (addend >> 1); break; - + case R_V850_TDA_7_7_OFFSET: insn = bfd_get_16 (abfd, address); addend += insn & 0x7f; - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0x7f || saddend < 0) return bfd_reloc_overflow; - + insn &= 0xff80; insn |= addend; break; - + case R_V850_TDA_4_5_OFFSET: insn = bfd_get_16 (abfd, address); addend += ((insn & 0xf) << 1); - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0x1e || saddend < 0) return bfd_reloc_overflow; - + if (addend & 1) return bfd_reloc_dangerous; - + insn &= 0xfff0; insn |= (addend >> 1); break; - + case R_V850_TDA_4_4_OFFSET: insn = bfd_get_16 (abfd, address); addend += insn & 0xf; - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0xf || saddend < 0) return bfd_reloc_overflow; - + insn &= 0xfff0; insn |= addend; break; - + case R_V850_ZDA_16_16_SPLIT_OFFSET: case R_V850_SDA_16_16_SPLIT_OFFSET: insn = bfd_get_32 (abfd, address); addend += ((insn & 0xfffe0000) >> 16) + ((insn & 0x20) >> 5); - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0x7fff || saddend < -0x8000) return bfd_reloc_overflow; - + insn &= 0x0001ffdf; insn |= (addend & 1) << 5; insn |= (addend & ~1) << 16; - + bfd_put_32 (abfd, insn, address); return bfd_reloc_ok; - + case R_V850_CALLT_6_7_OFFSET: insn = bfd_get_16 (abfd, address); addend += ((insn & 0x3f) << 1); - + saddend = (bfd_signed_vma) addend; - + if (saddend > 0x7e || saddend < 0) return bfd_reloc_overflow; - + if (addend & 1) return bfd_reloc_dangerous; - + insn &= 0xff80; insn |= (addend >> 1); break; @@ -1247,7 +1240,6 @@ v850_elf_perform_relocation (abfd, r_type, addend, address) bfd_put_16 (abfd, insn, address); return bfd_reloc_ok; } - /* Insert the addend into the instruction. */ static bfd_reloc_status_type @@ -1261,7 +1253,7 @@ v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err) char ** err ATTRIBUTE_UNUSED; { long relocation; - + /* If there is an output BFD, and the symbol is not a section name (which is only defined at final link time), and either we are not putting the addend into the instruction @@ -1275,13 +1267,13 @@ v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err) reloc->address += isection->output_offset; return bfd_reloc_ok; } -#if 0 +#if 0 else if (obfd != NULL) { return bfd_reloc_continue; } #endif - + /* Catch relocs involving undefined symbols. */ if (bfd_is_und_section (symbol->section) && (symbol->flags & BSF_WEAK) == 0 @@ -1293,37 +1285,51 @@ v850_elf_reloc (abfd, reloc, symbol, data, isection, obfd, err) /* Is the address of the relocation really within the section? */ if (reloc->address > isection->_cooked_size) return bfd_reloc_outofrange; - + /* Work out which section the relocation is targetted at and the initial relocation command value. */ - + /* Get symbol value. (Common symbols are special.) */ if (bfd_is_com_section (symbol->section)) relocation = 0; else relocation = symbol->value; - + /* Convert input-section-relative symbol value to absolute + addend. */ relocation += symbol->section->output_section->vma; relocation += symbol->section->output_offset; relocation += reloc->addend; - + +#if 0 /* Since this reloc is going to be processed later on, we should + not make it pc-relative here. To test this, try assembling and + linking this program: + + .text + .globl _start + nop + _start: + jr foo + + .section ".foo","ax" + nop + foo: + nop + */ if (reloc->howto->pc_relative == true) { /* Here the variable relocation holds the final address of the symbol we are relocating against, plus any addend. */ relocation -= isection->output_section->vma + isection->output_offset; - + /* Deal with pcrel_offset */ relocation -= reloc->address; } +#endif - reloc->addend = relocation; + reloc->addend = relocation; return bfd_reloc_ok; } - -/*ARGSUSED*/ static boolean v850_elf_is_local_label_name (abfd, name) bfd * abfd ATTRIBUTE_UNUSED; @@ -1332,7 +1338,6 @@ v850_elf_is_local_label_name (abfd, name) return ( (name[0] == '.' && (name[1] == 'L' || name[1] == '.')) || (name[0] == '_' && name[1] == '.' && name[2] == 'L' && name[3] == '_')); } - /* Perform a relocation as part of a final link. */ static bfd_reloc_status_type @@ -1362,7 +1367,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, + input_section->output_offset); value -= offset; break; - + case R_V850_22_PCREL: value -= (input_section->output_section->vma + input_section->output_offset @@ -1371,10 +1376,10 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, /* If the sign extension will corrupt the value then we have overflowed. */ if (((value & 0xff000000) != 0x0) && ((value & 0xff000000) != 0xff000000)) return bfd_reloc_overflow; - + value = SEXT24 (value); /* Only the bottom 24 bits of the PC are valid */ break; - + case R_V850_HI16_S: case R_V850_HI16: case R_V850_LO16: @@ -1383,12 +1388,12 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, case R_V850_8: break; - case R_V850_ZDA_15_16_OFFSET: + case R_V850_ZDA_15_16_OFFSET: case R_V850_ZDA_16_16_OFFSET: case R_V850_ZDA_16_16_SPLIT_OFFSET: if (sym_sec == NULL) return bfd_reloc_undefined; - + value -= sym_sec->output_section->vma; break; @@ -1401,7 +1406,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, if (sym_sec == NULL) return bfd_reloc_undefined; - + /* Get the value of __gp. */ h = bfd_link_hash_lookup (info->hash, "__gp", false, false, true); if (h == (struct bfd_link_hash_entry *) NULL @@ -1426,12 +1431,12 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, { unsigned long ep; struct bfd_link_hash_entry * h; - + /* Get the value of __ep. */ h = bfd_link_hash_lookup (info->hash, "__ep", false, false, true); if (h == (struct bfd_link_hash_entry *) NULL || h->type != bfd_link_hash_defined) - return bfd_reloc_continue; /* Actually this indicates that __ep could not be found. */ + return bfd_reloc_continue; /* Actually this indicates that __ep could not be found. */ ep = (h->u.def.value + h->u.def.section->output_section->vma @@ -1440,17 +1445,17 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, value -= ep; } break; - + case R_V850_CALLT_6_7_OFFSET: { unsigned long ctbp; struct bfd_link_hash_entry * h; - + /* Get the value of __ctbp. */ h = bfd_link_hash_lookup (info->hash, "__ctbp", false, false, true); if (h == (struct bfd_link_hash_entry *) NULL || h->type != bfd_link_hash_defined) - return (bfd_reloc_dangerous + 1); /* Actually this indicates that __ctbp could not be found. */ + return (bfd_reloc_dangerous + 1); /* Actually this indicates that __ctbp could not be found. */ ctbp = (h->u.def.value + h->u.def.section->output_section->vma @@ -1458,7 +1463,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, value -= ctbp; } break; - + case R_V850_CALLT_16_16_OFFSET: { unsigned long ctbp; @@ -1466,7 +1471,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, if (sym_sec == NULL) return bfd_reloc_undefined; - + /* Get the value of __ctbp. */ h = bfd_link_hash_lookup (info->hash, "__ctbp", false, false, true); if (h == (struct bfd_link_hash_entry *) NULL @@ -1481,7 +1486,7 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, value -= (ctbp - sym_sec->output_section->vma); } break; - + case R_V850_NONE: case R_V850_GNU_VTINHERIT: case R_V850_GNU_VTENTRY: @@ -1492,9 +1497,8 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd, } /* Perform the relocation. */ - return v850_elf_perform_relocation (input_bfd, r_type, value + addend, hit_data); + return v850_elf_perform_relocation (input_bfd, r_type, value + addend, hit_data); } - /* Relocate an V850 ELF section. */ static boolean @@ -1524,12 +1528,12 @@ v850_elf_relocate_section (output_bfd, info, input_bfd, input_section, return false; } - + /* Reset the list of remembered HI16S relocs to empty. */ free_hi16s = previous_hi16s; previous_hi16s = NULL; hi16s_counter = 0; - + rel = relocs; relend = relocs + input_section->reloc_count; for (; rel < relend; rel++) @@ -1596,11 +1600,11 @@ fprintf (stderr, "local: sec: %s, sym: %s (%d), value: %x + %x + %x addend %x\n" else { h = sym_hashes[r_symndx - symtab_hdr->sh_info]; - + while (h->root.type == bfd_link_hash_indirect || h->root.type == bfd_link_hash_warning) h = (struct elf_link_hash_entry *) h->root.u.i.link; - + if (h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) { @@ -1696,7 +1700,7 @@ fprintf (stderr, "unknown: name: %s\n", h->root.root.string); case (bfd_reloc_dangerous + 1): msg = _("could not locate special linker symbol __ctbp"); goto common_error; - + default: msg = _("internal error: unknown error"); /* fall through */ @@ -1803,7 +1807,7 @@ v850_elf_final_write_processing (abfd, linker) elf_elfheader (abfd)->e_flags |= val; } -/* Function to keep V850 specific file flags. */ +/* Function to keep V850 specific file flags. */ static boolean v850_elf_set_private_flags (abfd, flags) bfd * abfd; @@ -1864,7 +1868,7 @@ v850_elf_merge_private_bfd_data (ibfd, obfd) to the default values. */ if (bfd_get_arch_info (ibfd)->the_default) return true; - + elf_flags_init (obfd) = true; elf_elfheader (obfd)->e_flags = in_flags; @@ -1896,14 +1900,14 @@ v850_elf_print_private_bfd_data (abfd, ptr) PTR ptr; { FILE * file = (FILE *) ptr; - + BFD_ASSERT (abfd != NULL && ptr != NULL); - + _bfd_elf_print_private_bfd_data (abfd, ptr); - + /* xgettext:c-format */ fprintf (file, _("private flags = %lx: "), elf_elfheader (abfd)->e_flags); - + switch (elf_elfheader (abfd)->e_flags & EF_V850_ARCH) { default: @@ -1911,9 +1915,9 @@ v850_elf_print_private_bfd_data (abfd, ptr) case E_V850E_ARCH: fprintf (file, _("v850e architecture")); break; case E_V850EA_ARCH: fprintf (file, _("v850ea architecture")); break; } - + fputc ('\n', file); - + return true; } @@ -1934,7 +1938,6 @@ static asection v850_elf_zcom_section; static asymbol v850_elf_zcom_symbol; static asymbol * v850_elf_zcom_symbol_ptr; - /* Given a BFD section, try to locate the corresponding ELF section index. */ @@ -1953,7 +1956,7 @@ v850_elf_section_from_bfd_section (abfd, hdr, sec, retval) *retval = SHN_V850_ZCOMMON; else return false; - + return true; } @@ -1966,34 +1969,34 @@ v850_elf_symbol_processing (abfd, asym) { elf_symbol_type * elfsym = (elf_symbol_type *) asym; unsigned short index; - + index = elfsym->internal_elf_sym.st_shndx; /* If the section index is an "ordinary" index, then it may refer to a v850 specific section created by the assembler. Check the section's type and change the index it matches. - + FIXME: Should we alter the st_shndx field as well ? */ - + if (index < elf_elfheader(abfd)[0].e_shnum) switch (elf_elfsections(abfd)[index]->sh_type) { case SHT_V850_SCOMMON: index = SHN_V850_SCOMMON; break; - + case SHT_V850_TCOMMON: index = SHN_V850_TCOMMON; break; - + case SHT_V850_ZCOMMON: index = SHN_V850_ZCOMMON; break; - + default: break; } - + switch (index) { case SHN_V850_SCOMMON: @@ -2013,7 +2016,7 @@ v850_elf_symbol_processing (abfd, asym) asym->section = & v850_elf_scom_section; asym->value = elfsym->internal_elf_sym.st_size; break; - + case SHN_V850_TCOMMON: if (v850_elf_tcom_section.name == NULL) { @@ -2055,7 +2058,6 @@ v850_elf_symbol_processing (abfd, asym) /* Hook called by the linker routine which adds symbols from an object file. We must handle the special v850 section numbers here. */ -/*ARGSUSED*/ static boolean v850_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd * abfd; @@ -2067,32 +2069,32 @@ v850_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) bfd_vma * valp; { int index = sym->st_shndx; - + /* If the section index is an "ordinary" index, then it may refer to a v850 specific section created by the assembler. Check the section's type and change the index it matches. - + FIXME: Should we alter the st_shndx field as well ? */ - + if (index < elf_elfheader(abfd)[0].e_shnum) switch (elf_elfsections(abfd)[index]->sh_type) { case SHT_V850_SCOMMON: index = SHN_V850_SCOMMON; break; - + case SHT_V850_TCOMMON: index = SHN_V850_TCOMMON; break; - + case SHT_V850_ZCOMMON: index = SHN_V850_ZCOMMON; break; - + default: break; } - + switch (index) { case SHN_V850_SCOMMON: @@ -2100,13 +2102,13 @@ v850_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) (*secp)->flags |= SEC_IS_COMMON; *valp = sym->st_size; break; - + case SHN_V850_TCOMMON: *secp = bfd_make_section_old_way (abfd, ".tcommon"); (*secp)->flags |= SEC_IS_COMMON; *valp = sym->st_size; break; - + case SHN_V850_ZCOMMON: *secp = bfd_make_section_old_way (abfd, ".zcommon"); (*secp)->flags |= SEC_IS_COMMON; @@ -2129,7 +2131,7 @@ v850_elf_link_output_symbol_hook (abfd, info, name, sym, input_sec) /* If we see a common symbol, which implies a relocatable link, then if a symbol was in a special common section in an input file, mark it as a special common in the output file. */ - + if (sym->st_shndx == SHN_COMMON) { if (strcmp (input_sec->name, ".scommon") == 0) @@ -2193,18 +2195,16 @@ v850_elf_fake_sections (abfd, hdr, sec) } else if (strcmp (name, ".zcommon") == 0) hdr->sh_type = SHT_V850_ZCOMMON; - + return true; } - - #define TARGET_LITTLE_SYM bfd_elf32_v850_vec #define TARGET_LITTLE_NAME "elf32-v850" #define ELF_ARCH bfd_arch_v850 #define ELF_MACHINE_CODE EM_CYGNUS_V850 #define ELF_MAXPAGESIZE 0x1000 - + #define elf_info_to_howto v850_elf_info_to_howto_rela #define elf_info_to_howto_rel v850_elf_info_to_howto_rel @@ -2223,7 +2223,6 @@ v850_elf_fake_sections (abfd, hdr, sec) #define elf_backend_can_gc_sections 1 - #define bfd_elf32_bfd_is_local_label_name v850_elf_is_local_label_name #define bfd_elf32_bfd_reloc_type_lookup v850_elf_reloc_type_lookup #define bfd_elf32_bfd_copy_private_bfd_data v850_elf_copy_private_bfd_data diff --git a/gnu/dist/toolchain/bfd/elf32.c b/gnu/dist/toolchain/bfd/elf32.c index f2229694406d..2d3bebf4ffd6 100644 --- a/gnu/dist/toolchain/bfd/elf32.c +++ b/gnu/dist/toolchain/bfd/elf32.c @@ -19,5 +19,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define ARCH_SIZE 32 - #include "elfcode.h" diff --git a/gnu/dist/toolchain/bfd/elf64-gen.c b/gnu/dist/toolchain/bfd/elf64-gen.c index 78dc09d39788..c071934991d9 100644 --- a/gnu/dist/toolchain/bfd/elf64-gen.c +++ b/gnu/dist/toolchain/bfd/elf64-gen.c @@ -58,6 +58,37 @@ elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) bfd_reloc->howto = &dummy; } +static boolean +elf64_generic_link_add_symbols (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + asection *o; + + /* Check if there are any relocations. */ + for (o = abfd->sections; o != NULL; o = o->next) + if ((o->flags & SEC_RELOC) != 0) + { + 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_set_error (bfd_error_wrong_format); + return false; + } + + return bfd_elf64_bfd_link_add_symbols (abfd, info); +} + #define TARGET_LITTLE_SYM bfd_elf64_little_generic_vec #define TARGET_LITTLE_NAME "elf64-little" #define TARGET_BIG_SYM bfd_elf64_big_generic_vec @@ -66,6 +97,7 @@ elf_generic_info_to_howto_rel (abfd, bfd_reloc, elf_reloc) #define ELF_MACHINE_CODE EM_NONE #define ELF_MAXPAGESIZE 0x1 #define bfd_elf64_bfd_reloc_type_lookup bfd_default_reloc_type_lookup +#define bfd_elf64_bfd_link_add_symbols elf64_generic_link_add_symbols #define elf_info_to_howto elf_generic_info_to_howto #define elf_info_to_howto_rel elf_generic_info_to_howto_rel diff --git a/gnu/dist/toolchain/bfd/elf64-hppa.c b/gnu/dist/toolchain/bfd/elf64-hppa.c new file mode 100644 index 000000000000..1b3a548b72c0 --- /dev/null +++ b/gnu/dist/toolchain/bfd/elf64-hppa.c @@ -0,0 +1,2704 @@ +/* Support for HPPA 64-bit ELF + Copyright 1999, 2000, 2001 Free Software Foundation, Inc. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#include "alloca-conf.h" +#include "bfd.h" +#include "sysdep.h" +#include "libbfd.h" +#include "elf-bfd.h" +#include "elf/hppa.h" +#include "libhppa.h" +#include "elf64-hppa.h" +#define ARCH_SIZE 64 + +#define PLT_ENTRY_SIZE 0x10 +#define DLT_ENTRY_SIZE 0x8 +#define OPD_ENTRY_SIZE 0x20 + +#define ELF_DYNAMIC_INTERPRETER "/usr/lib/pa20_64/dld.sl" + +/* The stub is supposed to load the target address and target's DP + value out of the PLT, then do an external branch to the target + address. + + LDD PLTOFF(%r27),%r1 + BVE (%r1) + LDD PLTOFF+8(%r27),%r27 + + Note that we must use the LDD with a 14 bit displacement, not the one + with a 5 bit displacement. */ +static char plt_stub[] = {0x53, 0x61, 0x00, 0x00, 0xe8, 0x20, 0xd0, 0x00, + 0x53, 0x7b, 0x00, 0x00 }; + +struct elf64_hppa_dyn_hash_entry +{ + struct bfd_hash_entry root; + + /* Offsets for this symbol in various linker sections. */ + bfd_vma dlt_offset; + bfd_vma plt_offset; + bfd_vma opd_offset; + bfd_vma stub_offset; + + /* The symbol table entry, if any, that this was derived from. */ + struct elf_link_hash_entry *h; + + /* The index of the (possibly local) symbol in the input bfd and its + associated BFD. Needed so that we can have relocs against local + symbols in shared libraries. */ + unsigned long sym_indx; + bfd *owner; + + /* Dynamic symbols may need to have two different values. One for + the dynamic symbol table, one for the normal symbol table. + + In such cases we store the symbol's real value and section + index here so we can restore the real value before we write + the normal symbol table. */ + bfd_vma st_value; + int st_shndx; + + /* Used to count non-got, non-plt relocations for delayed sizing + of relocation sections. */ + struct elf64_hppa_dyn_reloc_entry + { + /* Next relocation in the chain. */ + struct elf64_hppa_dyn_reloc_entry *next; + + /* The type of the relocation. */ + int type; + + /* The input section of the relocation. */ + asection *sec; + + /* The index of the section symbol for the input section of + the relocation. Only needed when building shared libraries. */ + int sec_symndx; + + /* The offset within the input section of the relocation. */ + bfd_vma offset; + + /* The addend for the relocation. */ + bfd_vma addend; + + } *reloc_entries; + + /* Nonzero if this symbol needs an entry in one of the linker + sections. */ + unsigned want_dlt; + unsigned want_plt; + unsigned want_opd; + unsigned want_stub; +}; + +struct elf64_hppa_dyn_hash_table +{ + struct bfd_hash_table root; +}; + +struct elf64_hppa_link_hash_table +{ + struct elf_link_hash_table root; + + /* Shortcuts to get to the various linker defined sections. */ + asection *dlt_sec; + asection *dlt_rel_sec; + asection *plt_sec; + asection *plt_rel_sec; + asection *opd_sec; + asection *opd_rel_sec; + asection *other_rel_sec; + + /* Offset of __gp within .plt section. When the PLT gets large we want + to slide __gp into the PLT section so that we can continue to use + single DP relative instructions to load values out of the PLT. */ + bfd_vma gp_offset; + + /* Note this is not strictly correct. We should create a stub section for + each input section with calls. The stub section should be placed before + the section with the call. */ + asection *stub_sec; + + bfd_vma text_segment_base; + bfd_vma data_segment_base; + + struct elf64_hppa_dyn_hash_table dyn_hash_table; + + /* We build tables to map from an input section back to its + symbol index. This is the BFD for which we currently have + a map. */ + bfd *section_syms_bfd; + + /* Array of symbol numbers for each input section attached to the + current BFD. */ + int *section_syms; +}; + +#define elf64_hppa_hash_table(p) \ + ((struct elf64_hppa_link_hash_table *) ((p)->hash)) + +typedef struct bfd_hash_entry *(*new_hash_entry_func) + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); + +static boolean elf64_hppa_dyn_hash_table_init + PARAMS ((struct elf64_hppa_dyn_hash_table *ht, bfd *abfd, + new_hash_entry_func new)); +static struct bfd_hash_entry *elf64_hppa_new_dyn_hash_entry + PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table, + const char *string)); +static struct bfd_link_hash_table *elf64_hppa_hash_table_create + PARAMS ((bfd *abfd)); +static struct elf64_hppa_dyn_hash_entry *elf64_hppa_dyn_hash_lookup + PARAMS ((struct elf64_hppa_dyn_hash_table *table, const char *string, + boolean create, boolean copy)); +static void elf64_hppa_dyn_hash_traverse + PARAMS ((struct elf64_hppa_dyn_hash_table *table, + boolean (*func) (struct elf64_hppa_dyn_hash_entry *, PTR), + PTR info)); + +static const char *get_dyn_name + PARAMS ((asection *, struct elf_link_hash_entry *, + const Elf_Internal_Rela *, char **, size_t *)); + +/* This must follow the definitions of the various derived linker + hash tables and shared functions. */ +#include "elf-hppa.h" + +static boolean elf64_hppa_object_p + PARAMS ((bfd *)); + +static boolean elf64_hppa_section_from_shdr + PARAMS ((bfd *, Elf64_Internal_Shdr *, char *)); + +static void elf64_hppa_post_process_headers + PARAMS ((bfd *, struct bfd_link_info *)); + +static boolean elf64_hppa_create_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); + +static boolean elf64_hppa_adjust_dynamic_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); + +static boolean elf64_hppa_size_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); + +static boolean elf64_hppa_finish_dynamic_symbol + PARAMS ((bfd *, struct bfd_link_info *, + struct elf_link_hash_entry *, Elf_Internal_Sym *)); + +static boolean elf64_hppa_finish_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); + +static boolean elf64_hppa_check_relocs + PARAMS ((bfd *, struct bfd_link_info *, + asection *, const Elf_Internal_Rela *)); + +static boolean elf64_hppa_dynamic_symbol_p + PARAMS ((struct elf_link_hash_entry *, struct bfd_link_info *)); + +static boolean elf64_hppa_mark_exported_functions + PARAMS ((struct elf_link_hash_entry *, PTR)); + +static boolean elf64_hppa_finalize_opd + PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + +static boolean elf64_hppa_finalize_dlt + PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + +static boolean allocate_global_data_dlt + PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + +static boolean allocate_global_data_plt + PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + +static boolean allocate_global_data_stub + PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + +static boolean allocate_global_data_opd + PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + +static boolean get_reloc_section + PARAMS ((bfd *, struct elf64_hppa_link_hash_table *, asection *)); + +static boolean count_dyn_reloc + PARAMS ((bfd *, struct elf64_hppa_dyn_hash_entry *, + int, asection *, int, bfd_vma, bfd_vma)); + +static boolean allocate_dynrel_entries + PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + +static boolean elf64_hppa_finalize_dynreloc + PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + +static boolean get_opd + PARAMS ((bfd *, struct bfd_link_info *, struct elf64_hppa_link_hash_table *)); + +static boolean get_plt + PARAMS ((bfd *, struct bfd_link_info *, struct elf64_hppa_link_hash_table *)); + +static boolean get_dlt + PARAMS ((bfd *, struct bfd_link_info *, struct elf64_hppa_link_hash_table *)); + +static boolean get_stub + PARAMS ((bfd *, struct bfd_link_info *, struct elf64_hppa_link_hash_table *)); + +static int elf64_hppa_elf_get_symbol_type + PARAMS ((Elf_Internal_Sym *, int)); + +static boolean +elf64_hppa_dyn_hash_table_init (ht, abfd, new) + struct elf64_hppa_dyn_hash_table *ht; + bfd *abfd ATTRIBUTE_UNUSED; + new_hash_entry_func new; +{ + memset (ht, 0, sizeof (*ht)); + return bfd_hash_table_init (&ht->root, new); +} + +static struct bfd_hash_entry* +elf64_hppa_new_dyn_hash_entry (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + struct elf64_hppa_dyn_hash_entry *ret; + ret = (struct elf64_hppa_dyn_hash_entry *) entry; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (!ret) + ret = bfd_hash_allocate (table, sizeof (*ret)); + + if (!ret) + return 0; + + /* Initialize our local data. All zeros, and definitely easier + than setting 8 bit fields. */ + memset (ret, 0, sizeof (*ret)); + + /* Call the allocation method of the superclass. */ + ret = ((struct elf64_hppa_dyn_hash_entry *) + bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string)); + + return &ret->root; +} + +/* Create the derived linker hash table. The PA64 ELF port uses this + derived hash table to keep information specific to the PA ElF + linker (without using static variables). */ + +static struct bfd_link_hash_table* +elf64_hppa_hash_table_create (abfd) + bfd *abfd; +{ + struct elf64_hppa_link_hash_table *ret; + + ret = bfd_zalloc (abfd, sizeof (*ret)); + if (!ret) + return 0; + if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, + _bfd_elf_link_hash_newfunc)) + { + bfd_release (abfd, ret); + return 0; + } + + if (!elf64_hppa_dyn_hash_table_init (&ret->dyn_hash_table, abfd, + elf64_hppa_new_dyn_hash_entry)) + return 0; + return &ret->root.root; +} + +/* Look up an entry in a PA64 ELF linker hash table. */ + +static struct elf64_hppa_dyn_hash_entry * +elf64_hppa_dyn_hash_lookup(table, string, create, copy) + struct elf64_hppa_dyn_hash_table *table; + const char *string; + boolean create, copy; +{ + return ((struct elf64_hppa_dyn_hash_entry *) + bfd_hash_lookup (&table->root, string, create, copy)); +} + +/* Traverse a PA64 ELF linker hash table. */ + +static void +elf64_hppa_dyn_hash_traverse (table, func, info) + struct elf64_hppa_dyn_hash_table *table; + boolean (*func) PARAMS ((struct elf64_hppa_dyn_hash_entry *, PTR)); + PTR info; +{ + (bfd_hash_traverse + (&table->root, + (boolean (*) PARAMS ((struct bfd_hash_entry *, PTR))) func, + info)); +} + +/* Return nonzero if ABFD represents a PA2.0 ELF64 file. + + Additionally we set the default architecture and machine. */ +static boolean +elf64_hppa_object_p (abfd) + bfd *abfd; +{ + unsigned int flags = elf_elfheader (abfd)->e_flags; + + switch (flags & (EF_PARISC_ARCH | EF_PARISC_WIDE)) + { + case EFA_PARISC_1_0: + return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 10); + case EFA_PARISC_1_1: + return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 11); + case EFA_PARISC_2_0: + return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 20); + case EFA_PARISC_2_0 | EF_PARISC_WIDE: + return bfd_default_set_arch_mach (abfd, bfd_arch_hppa, 25); + } + /* Don't be fussy. */ + return true; +} + +/* Given section type (hdr->sh_type), return a boolean indicating + whether or not the section is an elf64-hppa specific section. */ +static boolean +elf64_hppa_section_from_shdr (abfd, hdr, name) + bfd *abfd; + Elf64_Internal_Shdr *hdr; + char *name; +{ + asection *newsect; + + switch (hdr->sh_type) + { + case SHT_PARISC_EXT: + if (strcmp (name, ".PARISC.archext") != 0) + return false; + break; + case SHT_PARISC_UNWIND: + if (strcmp (name, ".PARISC.unwind") != 0) + return false; + break; + case SHT_PARISC_DOC: + case SHT_PARISC_ANNOT: + default: + return false; + } + + if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) + return false; + newsect = hdr->bfd_section; + + return true; +} + +/* Construct a string for use in the elf64_hppa_dyn_hash_table. The + name describes what was once potentially anonymous memory. We + allocate memory as necessary, possibly reusing PBUF/PLEN. */ + +static const char * +get_dyn_name (sec, h, rel, pbuf, plen) + asection *sec; + struct elf_link_hash_entry *h; + const Elf_Internal_Rela *rel; + char **pbuf; + size_t *plen; +{ + size_t nlen, tlen; + char *buf; + size_t len; + + if (h && rel->r_addend == 0) + return h->root.root.string; + + if (h) + nlen = strlen (h->root.root.string); + else + nlen = 8 + 1 + sizeof (rel->r_info) * 2 - 8; + tlen = nlen + 1 + sizeof (rel->r_addend) * 2 + 1; + + len = *plen; + buf = *pbuf; + if (len < tlen) + { + if (buf) + free (buf); + *pbuf = buf = malloc (tlen); + *plen = len = tlen; + if (!buf) + return NULL; + } + + if (h) + { + memcpy (buf, h->root.root.string, nlen); + buf[nlen++] = '+'; + sprintf_vma (buf + nlen, rel->r_addend); + } + else + { + nlen = sprintf (buf, "%x:%lx", + sec->id & 0xffffffff, + (long) ELF64_R_SYM (rel->r_info)); + if (rel->r_addend) + { + buf[nlen++] = '+'; + sprintf_vma (buf + nlen, rel->r_addend); + } + } + + return buf; +} + +/* SEC is a section containing relocs for an input BFD when linking; return + a suitable section for holding relocs in the output BFD for a link. */ + +static boolean +get_reloc_section (abfd, hppa_info, sec) + bfd *abfd; + struct elf64_hppa_link_hash_table *hppa_info; + asection *sec; +{ + const char *srel_name; + asection *srel; + bfd *dynobj; + + srel_name = (bfd_elf_string_from_elf_section + (abfd, elf_elfheader(abfd)->e_shstrndx, + elf_section_data(sec)->rel_hdr.sh_name)); + if (srel_name == NULL) + return false; + + BFD_ASSERT ((strncmp (srel_name, ".rela", 5) == 0 + && strcmp (bfd_get_section_name (abfd, sec), + srel_name+5) == 0) + || (strncmp (srel_name, ".rel", 4) == 0 + && strcmp (bfd_get_section_name (abfd, sec), + srel_name+4) == 0)); + + dynobj = hppa_info->root.dynobj; + if (!dynobj) + hppa_info->root.dynobj = dynobj = abfd; + + srel = bfd_get_section_by_name (dynobj, srel_name); + if (srel == NULL) + { + srel = bfd_make_section (dynobj, srel_name); + if (srel == NULL + || !bfd_set_section_flags (dynobj, srel, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)) + || !bfd_set_section_alignment (dynobj, srel, 3)) + return false; + } + + hppa_info->other_rel_sec = srel; + return true; +} + +/* Add a new entry to the list of dynamic relocations against DYN_H. + + We use this to keep a record of all the FPTR relocations against a + particular symbol so that we can create FPTR relocations in the + output file. */ + +static boolean +count_dyn_reloc (abfd, dyn_h, type, sec, sec_symndx, offset, addend) + bfd *abfd; + struct elf64_hppa_dyn_hash_entry *dyn_h; + int type; + asection *sec; + int sec_symndx; + bfd_vma offset; + bfd_vma addend; +{ + struct elf64_hppa_dyn_reloc_entry *rent; + + rent = (struct elf64_hppa_dyn_reloc_entry *) + bfd_alloc (abfd, sizeof (*rent)); + if (!rent) + return false; + + rent->next = dyn_h->reloc_entries; + rent->type = type; + rent->sec = sec; + rent->sec_symndx = sec_symndx; + rent->offset = offset; + rent->addend = addend; + dyn_h->reloc_entries = rent; + + return true; +} + +/* Scan the RELOCS and record the type of dynamic entries that each + referenced symbol needs. */ + +static boolean +elf64_hppa_check_relocs (abfd, info, sec, relocs) + bfd *abfd; + struct bfd_link_info *info; + asection *sec; + const Elf_Internal_Rela *relocs; +{ + struct elf64_hppa_link_hash_table *hppa_info; + const Elf_Internal_Rela *relend; + Elf_Internal_Shdr *symtab_hdr; + const Elf_Internal_Rela *rel; + asection *dlt, *plt, *stubs; + char *buf; + size_t buf_len; + int sec_symndx; + + if (info->relocateable) + return true; + + /* 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 (! bfd_elf64_link_create_dynamic_sections (abfd, info)) + return false; + } + + hppa_info = elf64_hppa_hash_table (info); + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + + /* If necessary, build a new table holding section symbols indices + for this BFD. This is disgusting. */ + + if (info->shared && hppa_info->section_syms_bfd != abfd) + { + unsigned long i; + int highest_shndx; + Elf_Internal_Sym *local_syms, *isym; + Elf64_External_Sym *ext_syms, *esym; + + /* We're done with the old cache of section index to section symbol + index information. Free it. + + ?!? Note we leak the last section_syms array. Presumably we + could free it in one of the later routines in this file. */ + if (hppa_info->section_syms) + free (hppa_info->section_syms); + + /* Allocate memory for the internal and external symbols. */ + local_syms + = (Elf_Internal_Sym *) bfd_malloc (symtab_hdr->sh_info + * sizeof (Elf_Internal_Sym)); + if (local_syms == NULL) + return false; + + ext_syms + = (Elf64_External_Sym *) bfd_malloc (symtab_hdr->sh_info + * sizeof (Elf64_External_Sym)); + if (ext_syms == NULL) + { + free (local_syms); + return false; + } + + /* Read in the local symbols. */ + if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 + || bfd_read (ext_syms, 1, + (symtab_hdr->sh_info + * sizeof (Elf64_External_Sym)), abfd) + != (symtab_hdr->sh_info * sizeof (Elf64_External_Sym))) + { + free (local_syms); + free (ext_syms); + return false; + } + + /* Swap in the local symbols, also record the highest section index + referenced by the local symbols. */ + isym = local_syms; + esym = ext_syms; + highest_shndx = 0; + for (i = 0; i < symtab_hdr->sh_info; i++, esym++, isym++) + { + bfd_elf64_swap_symbol_in (abfd, esym, isym); + if (isym->st_shndx > highest_shndx) + highest_shndx = isym->st_shndx; + } + + /* Now we can free the external symbols. */ + free (ext_syms); + + /* Allocate an array to hold the section index to section symbol index + mapping. Bump by one since we start counting at zero. */ + highest_shndx++; + hppa_info->section_syms = (int *) bfd_malloc (highest_shndx + * sizeof (int)); + + /* Now walk the local symbols again. If we find a section symbol, + record the index of the symbol into the section_syms array. */ + for (isym = local_syms, i = 0; i < symtab_hdr->sh_info; i++, isym++) + { + if (ELF_ST_TYPE (isym->st_info) == STT_SECTION) + hppa_info->section_syms[isym->st_shndx] = i; + } + + /* We are finished with the local symbols. Get rid of them. */ + free (local_syms); + + /* Record which BFD we built the section_syms mapping for. */ + hppa_info->section_syms_bfd = abfd; + } + + /* Record the symbol index for this input section. We may need it for + relocations when building shared libraries. When not building shared + libraries this value is never really used, but assign it to zero to + prevent out of bounds memory accesses in other routines. */ + if (info->shared) + { + sec_symndx = _bfd_elf_section_from_bfd_section (abfd, sec); + + /* If we did not find a section symbol for this section, then + something went terribly wrong above. */ + if (sec_symndx == -1) + return false; + + sec_symndx = hppa_info->section_syms[sec_symndx]; + } + else + sec_symndx = 0; + + dlt = plt = stubs = NULL; + buf = NULL; + buf_len = 0; + + relend = relocs + sec->reloc_count; + for (rel = relocs; rel < relend; ++rel) + { + enum { + NEED_DLT = 1, + NEED_PLT = 2, + NEED_STUB = 4, + NEED_OPD = 8, + NEED_DYNREL = 16, + }; + + struct elf_link_hash_entry *h = NULL; + unsigned long r_symndx = ELF64_R_SYM (rel->r_info); + struct elf64_hppa_dyn_hash_entry *dyn_h; + int need_entry; + const char *addr_name; + boolean maybe_dynamic; + int dynrel_type = R_PARISC_NONE; + static reloc_howto_type *howto; + + if (r_symndx >= symtab_hdr->sh_info) + { + /* We're dealing with a global symbol -- find its hash entry + and mark it as being referenced. */ + long indx = r_symndx - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + 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; + + h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR; + } + + /* We can only get preliminary data on whether a symbol is + locally or externally defined, as not all of the input files + have yet been processed. Do something with what we know, as + this may help reduce memory usage and processing time later. */ + maybe_dynamic = false; + if (h && ((info->shared && ! info->symbolic) + || ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) + || h->root.type == bfd_link_hash_defweak)) + maybe_dynamic = true; + + howto = elf_hppa_howto_table + ELF64_R_TYPE (rel->r_info); + need_entry = 0; + switch (howto->type) + { + /* These are simple indirect references to symbols through the + DLT. We need to create a DLT entry for any symbols which + appears in a DLTIND relocation. */ + case R_PARISC_DLTIND21L: + case R_PARISC_DLTIND14R: + case R_PARISC_DLTIND14F: + case R_PARISC_DLTIND14WR: + case R_PARISC_DLTIND14DR: + need_entry = NEED_DLT; + break; + + /* ?!? These need a DLT entry. But I have no idea what to do with + the "link time TP value. */ + case R_PARISC_LTOFF_TP21L: + case R_PARISC_LTOFF_TP14R: + case R_PARISC_LTOFF_TP14F: + case R_PARISC_LTOFF_TP64: + case R_PARISC_LTOFF_TP14WR: + case R_PARISC_LTOFF_TP14DR: + case R_PARISC_LTOFF_TP16F: + case R_PARISC_LTOFF_TP16WF: + case R_PARISC_LTOFF_TP16DF: + need_entry = NEED_DLT; + break; + + /* These are function calls. Depending on their precise target we + may need to make a stub for them. The stub uses the PLT, so we + need to create PLT entries for these symbols too. */ + case R_PARISC_PCREL12F: + case R_PARISC_PCREL17F: + case R_PARISC_PCREL22F: + case R_PARISC_PCREL32: + case R_PARISC_PCREL64: + case R_PARISC_PCREL21L: + case R_PARISC_PCREL17R: + case R_PARISC_PCREL17C: + case R_PARISC_PCREL14R: + case R_PARISC_PCREL14F: + case R_PARISC_PCREL22C: + case R_PARISC_PCREL14WR: + case R_PARISC_PCREL14DR: + case R_PARISC_PCREL16F: + case R_PARISC_PCREL16WF: + case R_PARISC_PCREL16DF: + need_entry = (NEED_PLT | NEED_STUB); + break; + + case R_PARISC_PLTOFF21L: + case R_PARISC_PLTOFF14R: + case R_PARISC_PLTOFF14F: + case R_PARISC_PLTOFF14WR: + case R_PARISC_PLTOFF14DR: + case R_PARISC_PLTOFF16F: + case R_PARISC_PLTOFF16WF: + case R_PARISC_PLTOFF16DF: + need_entry = (NEED_PLT); + break; + + case R_PARISC_DIR64: + if (info->shared || maybe_dynamic) + need_entry = (NEED_DYNREL); + dynrel_type = R_PARISC_DIR64; + break; + + /* This is an indirect reference through the DLT to get the address + of a OPD descriptor. Thus we need to make a DLT entry that points + to an OPD entry. */ + case R_PARISC_LTOFF_FPTR21L: + case R_PARISC_LTOFF_FPTR14R: + case R_PARISC_LTOFF_FPTR14WR: + case R_PARISC_LTOFF_FPTR14DR: + case R_PARISC_LTOFF_FPTR32: + case R_PARISC_LTOFF_FPTR64: + case R_PARISC_LTOFF_FPTR16F: + case R_PARISC_LTOFF_FPTR16WF: + case R_PARISC_LTOFF_FPTR16DF: + if (info->shared || maybe_dynamic) + need_entry = (NEED_DLT | NEED_OPD); + else + need_entry = (NEED_DLT | NEED_OPD); + dynrel_type = R_PARISC_FPTR64; + break; + + /* This is a simple OPD entry. */ + case R_PARISC_FPTR64: + if (info->shared || maybe_dynamic) + need_entry = (NEED_OPD | NEED_DYNREL); + else + need_entry = (NEED_OPD); + dynrel_type = R_PARISC_FPTR64; + break; + + /* Add more cases as needed. */ + } + + if (!need_entry) + continue; + + /* Collect a canonical name for this address. */ + addr_name = get_dyn_name (sec, h, rel, &buf, &buf_len); + + /* Collect the canonical entry data for this address. */ + dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, + addr_name, true, true); + BFD_ASSERT (dyn_h); + + /* Stash away enough information to be able to find this symbol + regardless of whether or not it is local or global. */ + dyn_h->h = h; + dyn_h->owner = abfd; + dyn_h->sym_indx = r_symndx; + + /* ?!? We may need to do some error checking in here. */ + /* Create what's needed. */ + if (need_entry & NEED_DLT) + { + if (! hppa_info->dlt_sec + && ! get_dlt (abfd, info, hppa_info)) + goto err_out; + dyn_h->want_dlt = 1; + } + + if (need_entry & NEED_PLT) + { + if (! hppa_info->plt_sec + && ! get_plt (abfd, info, hppa_info)) + goto err_out; + dyn_h->want_plt = 1; + } + + if (need_entry & NEED_STUB) + { + if (! hppa_info->stub_sec + && ! get_stub (abfd, info, hppa_info)) + goto err_out; + dyn_h->want_stub = 1; + } + + if (need_entry & NEED_OPD) + { + if (! hppa_info->opd_sec + && ! get_opd (abfd, info, hppa_info)) + goto err_out; + + dyn_h->want_opd = 1; + + /* FPTRs are not allocated by the dynamic linker for PA64, though + it is possible that will change in the future. */ + + /* This could be a local function that had its address taken, in + which case H will be NULL. */ + if (h) + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + } + + /* Add a new dynamic relocation to the chain of dynamic + relocations for this symbol. */ + if ((need_entry & NEED_DYNREL) && (sec->flags & SEC_ALLOC)) + { + if (! hppa_info->other_rel_sec + && ! get_reloc_section (abfd, hppa_info, sec)) + goto err_out; + + if (!count_dyn_reloc (abfd, dyn_h, dynrel_type, sec, + sec_symndx, rel->r_offset, rel->r_addend)) + goto err_out; + + /* If we are building a shared library and we just recorded + a dynamic R_PARISC_FPTR64 relocation, then make sure the + section symbol for this section ends up in the dynamic + symbol table. */ + if (info->shared && dynrel_type == R_PARISC_FPTR64 + && ! (_bfd_elf64_link_record_local_dynamic_symbol + (info, abfd, sec_symndx))) + return false; + } + } + + if (buf) + free (buf); + return true; + + err_out: + if (buf) + free (buf); + return false; +} + +struct elf64_hppa_allocate_data +{ + struct bfd_link_info *info; + bfd_size_type ofs; +}; + +/* Should we do dynamic things to this symbol? */ + +static boolean +elf64_hppa_dynamic_symbol_p (h, info) + struct elf_link_hash_entry *h; + struct bfd_link_info *info; +{ + if (h == NULL) + return false; + + 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->dynindx == -1) + return false; + + if (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_defweak) + return true; + + if (h->root.root.string[0] == '$' && h->root.root.string[1] == '$') + return false; + + if ((info->shared && !info->symbolic) + || ((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))) + return true; + + return false; +} + +/* Mark all funtions exported by this file so that we can later allocate + entries in .opd for them. */ + +static boolean +elf64_hppa_mark_exported_functions (h, data) + struct elf_link_hash_entry *h; + PTR data; +{ + struct bfd_link_info *info = (struct bfd_link_info *)data; + struct elf64_hppa_link_hash_table *hppa_info; + + hppa_info = elf64_hppa_hash_table (info); + + if (h + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->root.u.def.section->output_section != NULL + && h->type == STT_FUNC) + { + struct elf64_hppa_dyn_hash_entry *dyn_h; + + /* Add this symbol to the PA64 linker hash table. */ + dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, + h->root.root.string, true, true); + BFD_ASSERT (dyn_h); + dyn_h->h = h; + + if (! hppa_info->opd_sec + && ! get_opd (hppa_info->root.dynobj, info, hppa_info)) + return false; + + dyn_h->want_opd = 1; + /* Put a flag here for output_symbol_hook. */ + dyn_h->st_shndx = -1; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + } + + return true; +} + +/* Allocate space for a DLT entry. */ + +static boolean +allocate_global_data_dlt (dyn_h, data) + struct elf64_hppa_dyn_hash_entry *dyn_h; + PTR data; +{ + struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data; + + if (dyn_h->want_dlt) + { + struct elf_link_hash_entry *h = dyn_h->h; + + if (x->info->shared) + { + /* Possibly add the symbol to the local dynamic symbol + table since we might need to create a dynamic relocation + against it. */ + if (! h + || (h && h->dynindx == -1)) + { + bfd *owner; + owner = (h ? h->root.u.def.section->owner : dyn_h->owner); + + if (!_bfd_elf64_link_record_local_dynamic_symbol + (x->info, owner, dyn_h->sym_indx)) + return false; + } + } + + dyn_h->dlt_offset = x->ofs; + x->ofs += DLT_ENTRY_SIZE; + } + return true; +} + +/* Allocate space for a DLT.PLT entry. */ + +static boolean +allocate_global_data_plt (dyn_h, data) + struct elf64_hppa_dyn_hash_entry *dyn_h; + PTR data; +{ + struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data; + + if (dyn_h->want_plt + && elf64_hppa_dynamic_symbol_p (dyn_h->h, x->info) + && !((dyn_h->h->root.type == bfd_link_hash_defined + || dyn_h->h->root.type == bfd_link_hash_defweak) + && dyn_h->h->root.u.def.section->output_section != NULL)) + { + dyn_h->plt_offset = x->ofs; + x->ofs += PLT_ENTRY_SIZE; + if (dyn_h->plt_offset < 0x2000) + elf64_hppa_hash_table (x->info)->gp_offset = dyn_h->plt_offset; + } + else + dyn_h->want_plt = 0; + + return true; +} + +/* Allocate space for a STUB entry. */ + +static boolean +allocate_global_data_stub (dyn_h, data) + struct elf64_hppa_dyn_hash_entry *dyn_h; + PTR data; +{ + struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data; + + if (dyn_h->want_stub + && elf64_hppa_dynamic_symbol_p (dyn_h->h, x->info) + && !((dyn_h->h->root.type == bfd_link_hash_defined + || dyn_h->h->root.type == bfd_link_hash_defweak) + && dyn_h->h->root.u.def.section->output_section != NULL)) + { + dyn_h->stub_offset = x->ofs; + x->ofs += sizeof (plt_stub); + } + else + dyn_h->want_stub = 0; + return true; +} + +/* Allocate space for a FPTR entry. */ + +static boolean +allocate_global_data_opd (dyn_h, data) + struct elf64_hppa_dyn_hash_entry *dyn_h; + PTR data; +{ + struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data; + + if (dyn_h->want_opd) + { + struct elf_link_hash_entry *h = dyn_h->h; + + if (h) + 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; + + /* We never need an opd entry for a symbol which is not + defined by this output file. */ + if (h && h->root.type == bfd_link_hash_undefined) + dyn_h->want_opd = 0; + + /* If we are creating a shared library, took the address of a local + function or might export this function from this object file, then + we have to create an opd descriptor. */ + else if (x->info->shared + || h == NULL + || h->dynindx == -1 + || ((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && h->root.u.def.section->output_section != NULL)) + { + /* If we are creating a shared library, then we will have to + create a runtime relocation for the symbol to properly + initialize the .opd entry. Make sure the symbol gets + added to the dynamic symbol table. */ + if (x->info->shared + && (h == NULL || (h->dynindx == -1))) + { + bfd *owner; + owner = (h ? h->root.u.def.section->owner : dyn_h->owner); + + if (!_bfd_elf64_link_record_local_dynamic_symbol + (x->info, owner, dyn_h->sym_indx)) + return false; + } + + /* This may not be necessary or desirable anymore now that + we have some support for dealing with section symbols + in dynamic relocs. But name munging does make the result + much easier to debug. ie, the EPLT reloc will reference + a symbol like .foobar, instead of .text + offset. */ + if (x->info->shared && h) + { + char *new_name; + struct elf_link_hash_entry *nh; + + new_name = alloca (strlen (h->root.root.string) + 2); + new_name[0] = '.'; + strcpy (new_name + 1, h->root.root.string); + + nh = elf_link_hash_lookup (elf_hash_table (x->info), + new_name, true, true, true); + + nh->root.type = h->root.type; + nh->root.u.def.value = h->root.u.def.value; + nh->root.u.def.section = h->root.u.def.section; + + if (! bfd_elf64_link_record_dynamic_symbol (x->info, nh)) + return false; + + } + dyn_h->opd_offset = x->ofs; + x->ofs += OPD_ENTRY_SIZE; + } + + /* Otherwise we do not need an opd entry. */ + else + dyn_h->want_opd = 0; + } + return true; +} + +/* HP requires the EI_OSABI field to be filled in. The assignment to + EI_ABIVERSION may not be strictly necessary. */ + +static void +elf64_hppa_post_process_headers (abfd, link_info) + bfd * abfd; + struct bfd_link_info * link_info ATTRIBUTE_UNUSED; +{ + Elf_Internal_Ehdr * i_ehdrp; + + i_ehdrp = elf_elfheader (abfd); + + if (strcmp (bfd_get_target (abfd), "elf64-hppa-linux") == 0) + { + i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_LINUX; + } + else + { + i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_HPUX; + i_ehdrp->e_ident[EI_ABIVERSION] = 1; + } +} + +/* Create function descriptor section (.opd). This section is called .opd + because it contains "official prodecure descriptors". The "official" + refers to the fact that these descriptors are used when taking the address + of a procedure, thus ensuring a unique address for each procedure. */ + +static boolean +get_opd (abfd, info, hppa_info) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + struct elf64_hppa_link_hash_table *hppa_info; +{ + asection *opd; + bfd *dynobj; + + opd = hppa_info->opd_sec; + if (!opd) + { + dynobj = hppa_info->root.dynobj; + if (!dynobj) + hppa_info->root.dynobj = dynobj = abfd; + + opd = bfd_make_section (dynobj, ".opd"); + if (!opd + || !bfd_set_section_flags (dynobj, opd, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, opd, 3)) + { + BFD_ASSERT (0); + return false; + } + + hppa_info->opd_sec = opd; + } + + return true; +} + +/* Create the PLT section. */ + +static boolean +get_plt (abfd, info, hppa_info) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + struct elf64_hppa_link_hash_table *hppa_info; +{ + asection *plt; + bfd *dynobj; + + plt = hppa_info->plt_sec; + if (!plt) + { + dynobj = hppa_info->root.dynobj; + if (!dynobj) + hppa_info->root.dynobj = dynobj = abfd; + + plt = bfd_make_section (dynobj, ".plt"); + if (!plt + || !bfd_set_section_flags (dynobj, plt, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, plt, 3)) + { + BFD_ASSERT (0); + return false; + } + + hppa_info->plt_sec = plt; + } + + return true; +} + +/* Create the DLT section. */ + +static boolean +get_dlt (abfd, info, hppa_info) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + struct elf64_hppa_link_hash_table *hppa_info; +{ + asection *dlt; + bfd *dynobj; + + dlt = hppa_info->dlt_sec; + if (!dlt) + { + dynobj = hppa_info->root.dynobj; + if (!dynobj) + hppa_info->root.dynobj = dynobj = abfd; + + dlt = bfd_make_section (dynobj, ".dlt"); + if (!dlt + || !bfd_set_section_flags (dynobj, dlt, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, dlt, 3)) + { + BFD_ASSERT (0); + return false; + } + + hppa_info->dlt_sec = dlt; + } + + return true; +} + +/* Create the stubs section. */ + +static boolean +get_stub (abfd, info, hppa_info) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + struct elf64_hppa_link_hash_table *hppa_info; +{ + asection *stub; + bfd *dynobj; + + stub = hppa_info->stub_sec; + if (!stub) + { + dynobj = hppa_info->root.dynobj; + if (!dynobj) + hppa_info->root.dynobj = dynobj = abfd; + + stub = bfd_make_section (dynobj, ".stub"); + if (!stub + || !bfd_set_section_flags (dynobj, stub, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_READONLY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, stub, 3)) + { + BFD_ASSERT (0); + return false; + } + + hppa_info->stub_sec = stub; + } + + return true; +} + +/* Create sections necessary for dynamic linking. This is only a rough + cut and will likely change as we learn more about the somewhat + unusual dynamic linking scheme HP uses. + + .stub: + Contains code to implement cross-space calls. The first time one + of the stubs is used it will call into the dynamic linker, later + calls will go straight to the target. + + The only stub we support right now looks like + + ldd OFFSET(%dp),%r1 + bve %r0(%r1) + ldd OFFSET+8(%dp),%dp + + Other stubs may be needed in the future. We may want the remove + the break/nop instruction. It is only used right now to keep the + offset of a .plt entry and a .stub entry in sync. + + .dlt: + This is what most people call the .got. HP used a different name. + Losers. + + .rela.dlt: + Relocations for the DLT. + + .plt: + Function pointers as address,gp pairs. + + .rela.plt: + Should contain dynamic IPLT (and EPLT?) relocations. + + .opd: + FPTRS + + .rela.opd: + EPLT relocations for symbols exported from shared libraries. */ + +static boolean +elf64_hppa_create_dynamic_sections (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + asection *s; + + if (! get_stub (abfd, info, elf64_hppa_hash_table (info))) + return false; + + if (! get_dlt (abfd, info, elf64_hppa_hash_table (info))) + return false; + + if (! get_plt (abfd, info, elf64_hppa_hash_table (info))) + return false; + + if (! get_opd (abfd, info, elf64_hppa_hash_table (info))) + return false; + + s = bfd_make_section(abfd, ".rela.dlt"); + if (s == NULL + || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_READONLY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, s, 3)) + return false; + elf64_hppa_hash_table (info)->dlt_rel_sec = s; + + s = bfd_make_section(abfd, ".rela.plt"); + if (s == NULL + || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_READONLY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, s, 3)) + return false; + elf64_hppa_hash_table (info)->plt_rel_sec = s; + + s = bfd_make_section(abfd, ".rela.data"); + if (s == NULL + || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_READONLY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, s, 3)) + return false; + elf64_hppa_hash_table (info)->other_rel_sec = s; + + s = bfd_make_section(abfd, ".rela.opd"); + if (s == NULL + || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_READONLY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, s, 3)) + return false; + elf64_hppa_hash_table (info)->opd_rel_sec = s; + + return true; +} + +/* Allocate dynamic relocations for those symbols that turned out + to be dynamic. */ + +static boolean +allocate_dynrel_entries (dyn_h, data) + struct elf64_hppa_dyn_hash_entry *dyn_h; + PTR data; +{ + struct elf64_hppa_allocate_data *x = (struct elf64_hppa_allocate_data *)data; + struct elf64_hppa_link_hash_table *hppa_info; + struct elf64_hppa_dyn_reloc_entry *rent; + boolean dynamic_symbol, shared; + + hppa_info = elf64_hppa_hash_table (x->info); + dynamic_symbol = elf64_hppa_dynamic_symbol_p (dyn_h->h, x->info); + shared = x->info->shared; + + /* We may need to allocate relocations for a non-dynamic symbol + when creating a shared library. */ + if (!dynamic_symbol && !shared) + return true; + + /* Take care of the normal data relocations. */ + + for (rent = dyn_h->reloc_entries; rent; rent = rent->next) + { + switch (rent->type) + { + case R_PARISC_FPTR64: + /* Allocate one iff we are not building a shared library and + !want_opd, which by this point will be true only if we're + actually allocating one statically in the main executable. */ + if (!x->info->shared && dyn_h->want_opd) + continue; + break; + } + hppa_info->other_rel_sec->_raw_size += sizeof (Elf64_External_Rela); + + /* Make sure this symbol gets into the dynamic symbol table if it is + not already recorded. ?!? This should not be in the loop since + the symbol need only be added once. */ + if (dyn_h->h == 0 || dyn_h->h->dynindx == -1) + if (!_bfd_elf64_link_record_local_dynamic_symbol + (x->info, rent->sec->owner, dyn_h->sym_indx)) + return false; + } + + /* Take care of the GOT and PLT relocations. */ + + if ((dynamic_symbol || shared) && dyn_h->want_dlt) + hppa_info->dlt_rel_sec->_raw_size += sizeof (Elf64_External_Rela); + + /* If we are building a shared library, then every symbol that has an + opd entry will need an EPLT relocation to relocate the symbol's address + and __gp value based on the runtime load address. */ + if (shared && dyn_h->want_opd) + hppa_info->opd_rel_sec->_raw_size += sizeof (Elf64_External_Rela); + + if (dyn_h->want_plt && dynamic_symbol) + { + bfd_size_type t = 0; + + /* Dynamic symbols get one IPLT relocation. Local symbols in + shared libraries get two REL relocations. Local symbols in + main applications get nothing. */ + if (dynamic_symbol) + t = sizeof (Elf64_External_Rela); + else if (shared) + t = 2 * sizeof (Elf64_External_Rela); + + hppa_info->plt_rel_sec->_raw_size += t; + } + + return true; +} + +/* Adjust a symbol defined by a dynamic object and referenced by a + regular object. */ + +static boolean +elf64_hppa_adjust_dynamic_symbol (info, h) + struct bfd_link_info *info ATTRIBUTE_UNUSED; + struct elf_link_hash_entry *h; +{ + /* ??? Undefined symbols with PLT entries should be re-defined + to be the PLT entry. */ + + /* 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; + } + + /* If this is a reference to a symbol defined by a dynamic object which + is not a function, we might allocate the symbol in our .dynbss section + and allocate a COPY dynamic relocation. + + But PA64 code is canonically PIC, so as a rule we can avoid this sort + of hackery. */ + + return true; +} + +/* Set the final sizes of the dynamic sections and allocate memory for + the contents of our special sections. */ + +static boolean +elf64_hppa_size_dynamic_sections (output_bfd, info) + bfd *output_bfd; + struct bfd_link_info *info; +{ + bfd *dynobj; + asection *s; + boolean plt; + boolean relocs; + boolean reltext; + struct elf64_hppa_allocate_data data; + struct elf64_hppa_link_hash_table *hppa_info; + + hppa_info = elf64_hppa_hash_table (info); + + dynobj = elf_hash_table (info)->dynobj; + BFD_ASSERT (dynobj != NULL); + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Set the contents of the .interp section to the interpreter. */ + if (! info->shared) + { + 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; + } + } + else + { + /* We may have created entries in the .rela.got section. + However, if we are not creating the dynamic sections, we will + not actually use these entries. Reset the size of .rela.dlt, + which will cause it to get stripped from the output file + below. */ + s = bfd_get_section_by_name (dynobj, ".rela.dlt"); + if (s != NULL) + s->_raw_size = 0; + } + + /* Allocate the GOT entries. */ + + data.info = info; + if (elf64_hppa_hash_table (info)->dlt_sec) + { + data.ofs = 0x0; + elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table, + allocate_global_data_dlt, &data); + hppa_info->dlt_sec->_raw_size = data.ofs; + + data.ofs = 0x0; + elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table, + allocate_global_data_plt, &data); + hppa_info->plt_sec->_raw_size = data.ofs; + + data.ofs = 0x0; + elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table, + allocate_global_data_stub, &data); + hppa_info->stub_sec->_raw_size = data.ofs; + } + + /* Mark each function this program exports so that we will allocate + space in the .opd section for each function's FPTR. + + We have to traverse the main linker hash table since we have to + find functions which may not have been mentioned in any relocs. */ + elf_link_hash_traverse (elf_hash_table (info), + elf64_hppa_mark_exported_functions, + info); + + /* Allocate space for entries in the .opd section. */ + if (elf64_hppa_hash_table (info)->opd_sec) + { + data.ofs = 0; + elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table, + allocate_global_data_opd, &data); + hppa_info->opd_sec->_raw_size = data.ofs; + } + + /* Now allocate space for dynamic relocations, if necessary. */ + if (hppa_info->root.dynamic_sections_created) + elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table, + allocate_dynrel_entries, &data); + + /* The sizes of all the sections are set. 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; + + /* 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); + + strip = 0; + + if (strcmp (name, ".plt") == 0) + { + if (s->_raw_size == 0) + { + /* Strip this section if we don't need it; see the + comment below. */ + strip = true; + } + else + { + /* Remember whether there is a PLT. */ + plt = true; + } + } + else if (strcmp (name, ".dlt") == 0) + { + if (s->_raw_size == 0) + { + /* Strip this section if we don't need it; see the + comment below. */ + strip = true; + } + } + else if (strcmp (name, ".opd") == 0) + { + if (s->_raw_size == 0) + { + /* Strip this section if we don't need it; see the + comment below. */ + strip = true; + } + } + else if (strncmp (name, ".rela", 4) == 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. */ + strip = true; + } + 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 + 4); + 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; + } + } + else if (strncmp (name, ".dlt", 4) != 0 + && strcmp (name, ".stub") != 0 + && strcmp (name, ".got") != 0) + { + /* It's not one of our sections, so don't allocate space. */ + continue; + } + + if (strip) + { + _bfd_strip_section_from_output (info, s); + continue; + } + + /* Allocate memory for the section contents if it has not + been allocated already. 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_PARISC_NONE reloc instead of + garbage. */ + if (s->contents == NULL) + { + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); + if (s->contents == NULL && s->_raw_size != 0) + return false; + } + } + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Always create a DT_PLTGOT. It actually has nothing to do with + the PLT, it is how we communicate the __gp value of a load + module to the dynamic linker. */ + if (! bfd_elf64_add_dynamic_entry (info, DT_HP_DLD_FLAGS, 0) + || ! bfd_elf64_add_dynamic_entry (info, DT_PLTGOT, 0)) + return false; + + /* Add some entries to the .dynamic section. We fill in the + values later, in elf64_hppa_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. */ + if (! info->shared) + { + if (! bfd_elf64_add_dynamic_entry (info, DT_DEBUG, 0) + || ! bfd_elf64_add_dynamic_entry (info, DT_HP_DLD_HOOK, 0) + || ! bfd_elf64_add_dynamic_entry (info, DT_HP_LOAD_MAP, 0)) + return false; + } + + if (plt) + { + 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)) + 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))) + return false; + } + + if (reltext) + { + if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0)) + return false; + info->flags |= DF_TEXTREL; + } + } + + return true; +} + +/* Called after we have output the symbol into the dynamic symbol + table, but before we output the symbol into the normal symbol + table. + + For some symbols we had to change their address when outputting + the dynamic symbol table. We undo that change here so that + the symbols have their expected value in the normal symbol + table. Ick. */ + +static boolean +elf64_hppa_link_output_symbol_hook (abfd, info, name, sym, input_sec) + bfd *abfd ATTRIBUTE_UNUSED; + struct bfd_link_info *info; + const char *name; + Elf_Internal_Sym *sym; + asection *input_sec ATTRIBUTE_UNUSED; +{ + struct elf64_hppa_link_hash_table *hppa_info; + struct elf64_hppa_dyn_hash_entry *dyn_h; + + /* We may be called with the file symbol or section symbols. + They never need munging, so it is safe to ignore them. */ + if (!name) + return true; + + /* Get the PA dyn_symbol (if any) associated with NAME. */ + hppa_info = elf64_hppa_hash_table (info); + dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, + name, false, false); + + /* Function symbols for which we created .opd entries *may* have been + munged by finish_dynamic_symbol and have to be un-munged here. + + Note that finish_dynamic_symbol sometimes turns dynamic symbols + into non-dynamic ones, so we initialize st_shndx to -1 in + mark_exported_functions and check to see if it was overwritten + here instead of just checking dyn_h->h->dynindx. */ + if (dyn_h && dyn_h->want_opd && dyn_h->st_shndx != -1) + { + /* Restore the saved value and section index. */ + sym->st_value = dyn_h->st_value; + sym->st_shndx = dyn_h->st_shndx; + } + + return true; +} + +/* Finish up dynamic symbol handling. We set the contents of various + dynamic sections here. */ + +static boolean +elf64_hppa_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; +{ + asection *stub, *splt, *sdlt, *sopd, *spltrel, *sdltrel; + struct elf64_hppa_link_hash_table *hppa_info; + struct elf64_hppa_dyn_hash_entry *dyn_h; + + hppa_info = elf64_hppa_hash_table (info); + dyn_h = elf64_hppa_dyn_hash_lookup (&hppa_info->dyn_hash_table, + h->root.root.string, false, false); + + stub = hppa_info->stub_sec; + splt = hppa_info->plt_sec; + sdlt = hppa_info->dlt_sec; + sopd = hppa_info->opd_sec; + spltrel = hppa_info->plt_rel_sec; + sdltrel = hppa_info->dlt_rel_sec; + + BFD_ASSERT (stub != NULL && splt != NULL + && sopd != NULL && sdlt != NULL) + + /* Incredible. It is actually necessary to NOT use the symbol's real + value when building the dynamic symbol table for a shared library. + At least for symbols that refer to functions. + + We will store a new value and section index into the symbol long + enough to output it into the dynamic symbol table, then we restore + the original values (in elf64_hppa_link_output_symbol_hook). */ + if (dyn_h && dyn_h->want_opd) + { + /* Save away the original value and section index so that we + can restore them later. */ + dyn_h->st_value = sym->st_value; + dyn_h->st_shndx = sym->st_shndx; + + /* For the dynamic symbol table entry, we want the value to be + address of this symbol's entry within the .opd section. */ + sym->st_value = (dyn_h->opd_offset + + sopd->output_offset + + sopd->output_section->vma); + sym->st_shndx = _bfd_elf_section_from_bfd_section (output_bfd, + sopd->output_section); + } + + /* Initialize a .plt entry if requested. */ + if (dyn_h && dyn_h->want_plt + && elf64_hppa_dynamic_symbol_p (dyn_h->h, info)) + { + bfd_vma value; + Elf_Internal_Rela rel; + + /* We do not actually care about the value in the PLT entry + if we are creating a shared library and the symbol is + still undefined, we create a dynamic relocation to fill + in the correct value. */ + if (info->shared && h->root.type == bfd_link_hash_undefined) + value = 0; + else + value = (h->root.u.def.value + h->root.u.def.section->vma); + + /* Fill in the entry in the procedure linkage table. + + The format of a plt entry is + <__gp>. + + plt_offset is the offset within the PLT section at which to + install the PLT entry. + + We are modifying the in-memory PLT contents here, so we do not add + in the output_offset of the PLT section. */ + + bfd_put_64 (splt->owner, value, splt->contents + dyn_h->plt_offset); + value = _bfd_get_gp_value (splt->output_section->owner); + bfd_put_64 (splt->owner, value, splt->contents + dyn_h->plt_offset + 0x8); + + /* Create a dynamic IPLT relocation for this entry. + + We are creating a relocation in the output file's PLT section, + which is included within the DLT secton. So we do need to include + the PLT's output_offset in the computation of the relocation's + address. */ + rel.r_offset = (dyn_h->plt_offset + splt->output_offset + + splt->output_section->vma); + rel.r_info = ELF64_R_INFO (h->dynindx, R_PARISC_IPLT); + rel.r_addend = 0; + + bfd_elf64_swap_reloca_out (splt->output_section->owner, &rel, + (((Elf64_External_Rela *) + spltrel->contents) + + spltrel->reloc_count)); + spltrel->reloc_count++; + } + + /* Initialize an external call stub entry if requested. */ + if (dyn_h && dyn_h->want_stub + && elf64_hppa_dynamic_symbol_p (dyn_h->h, info)) + { + bfd_vma value; + int insn; + unsigned int max_offset; + + /* Install the generic stub template. + + We are modifying the contents of the stub section, so we do not + need to include the stub section's output_offset here. */ + memcpy (stub->contents + dyn_h->stub_offset, plt_stub, sizeof (plt_stub)); + + /* Fix up the first ldd instruction. + + We are modifying the contents of the STUB section in memory, + so we do not need to include its output offset in this computation. + + Note the plt_offset value is the value of the PLT entry relative to + the start of the PLT section. These instructions will reference + data relative to the value of __gp, which may not necessarily have + the same address as the start of the PLT section. + + gp_offset contains the offset of __gp within the PLT section. */ + value = dyn_h->plt_offset - hppa_info->gp_offset; + + insn = bfd_get_32 (stub->owner, stub->contents + dyn_h->stub_offset); + if (output_bfd->arch_info->mach >= 25) + { + /* Wide mode allows 16 bit offsets. */ + max_offset = 32768; + insn &= ~ 0xfff1; + insn |= re_assemble_16 (value); + } + else + { + max_offset = 8192; + insn &= ~ 0x3ff1; + insn |= re_assemble_14 (value); + } + + if ((value & 7) || value + max_offset >= 2*max_offset - 8) + { + (*_bfd_error_handler) (_("stub entry for %s cannot load .plt, dp offset = %ld"), + dyn_h->root.string, + (long) value); + return false; + } + + bfd_put_32 (stub->owner, insn, + stub->contents + dyn_h->stub_offset); + + /* Fix up the second ldd instruction. */ + value += 8; + insn = bfd_get_32 (stub->owner, stub->contents + dyn_h->stub_offset + 8); + if (output_bfd->arch_info->mach >= 25) + { + insn &= ~ 0xfff1; + insn |= re_assemble_16 (value); + } + else + { + insn &= ~ 0x3ff1; + insn |= re_assemble_14 (value); + } + bfd_put_32 (stub->owner, insn, + stub->contents + dyn_h->stub_offset + 8); + } + + /* Millicode symbols should not be put in the dynamic + symbol table under any circumstances. */ + if (ELF_ST_TYPE (sym->st_info) == STT_PARISC_MILLI) + h->dynindx = -1; + + return true; +} + +/* The .opd section contains FPTRs for each function this file + exports. Initialize the FPTR entries. */ + +static boolean +elf64_hppa_finalize_opd (dyn_h, data) + struct elf64_hppa_dyn_hash_entry *dyn_h; + PTR data; +{ + struct bfd_link_info *info = (struct bfd_link_info *)data; + struct elf64_hppa_link_hash_table *hppa_info; + struct elf_link_hash_entry *h = dyn_h->h; + asection *sopd; + asection *sopdrel; + + hppa_info = elf64_hppa_hash_table (info); + sopd = hppa_info->opd_sec; + sopdrel = hppa_info->opd_rel_sec; + + if (h && dyn_h && dyn_h->want_opd) + { + bfd_vma value; + + /* The first two words of an .opd entry are zero. + + We are modifying the contents of the OPD section in memory, so we + do not need to include its output offset in this computation. */ + memset (sopd->contents + dyn_h->opd_offset, 0, 16); + + value = (h->root.u.def.value + + h->root.u.def.section->output_section->vma + + h->root.u.def.section->output_offset); + + /* The next word is the address of the function. */ + bfd_put_64 (sopd->owner, value, sopd->contents + dyn_h->opd_offset + 16); + + /* The last word is our local __gp value. */ + value = _bfd_get_gp_value (sopd->output_section->owner); + bfd_put_64 (sopd->owner, value, sopd->contents + dyn_h->opd_offset + 24); + } + + /* If we are generating a shared library, we must generate EPLT relocations + for each entry in the .opd, even for static functions (they may have + had their address taken). */ + if (info->shared && dyn_h && dyn_h->want_opd) + { + Elf64_Internal_Rela rel; + int dynindx; + + /* We may need to do a relocation against a local symbol, in + which case we have to look up it's dynamic symbol index off + the local symbol hash table. */ + if (h && h->dynindx != -1) + dynindx = h->dynindx; + else + dynindx + = _bfd_elf_link_lookup_local_dynindx (info, dyn_h->owner, + dyn_h->sym_indx); + + /* The offset of this relocation is the absolute address of the + .opd entry for this symbol. */ + rel.r_offset = (dyn_h->opd_offset + sopd->output_offset + + sopd->output_section->vma); + + /* If H is non-null, then we have an external symbol. + + It is imperative that we use a different dynamic symbol for the + EPLT relocation if the symbol has global scope. + + In the dynamic symbol table, the function symbol will have a value + which is address of the function's .opd entry. + + Thus, we can not use that dynamic symbol for the EPLT relocation + (if we did, the data in the .opd would reference itself rather + than the actual address of the function). Instead we have to use + a new dynamic symbol which has the same value as the original global + function symbol. + + We prefix the original symbol with a "." and use the new symbol in + the EPLT relocation. This new symbol has already been recorded in + the symbol table, we just have to look it up and use it. + + We do not have such problems with static functions because we do + not make their addresses in the dynamic symbol table point to + the .opd entry. Ultimately this should be safe since a static + function can not be directly referenced outside of its shared + library. + + We do have to play similar games for FPTR relocations in shared + libraries, including those for static symbols. See the FPTR + handling in elf64_hppa_finalize_dynreloc. */ + if (h) + { + char *new_name; + struct elf_link_hash_entry *nh; + + new_name = alloca (strlen (h->root.root.string) + 2); + new_name[0] = '.'; + strcpy (new_name + 1, h->root.root.string); + + nh = elf_link_hash_lookup (elf_hash_table (info), + new_name, false, false, false); + + /* All we really want from the new symbol is its dynamic + symbol index. */ + dynindx = nh->dynindx; + } + + rel.r_addend = 0; + rel.r_info = ELF64_R_INFO (dynindx, R_PARISC_EPLT); + + bfd_elf64_swap_reloca_out (sopd->output_section->owner, &rel, + (((Elf64_External_Rela *) + sopdrel->contents) + + sopdrel->reloc_count)); + sopdrel->reloc_count++; + } + return true; +} + +/* The .dlt section contains addresses for items referenced through the + dlt. Note that we can have a DLTIND relocation for a local symbol, thus + we can not depend on finish_dynamic_symbol to initialize the .dlt. */ + +static boolean +elf64_hppa_finalize_dlt (dyn_h, data) + struct elf64_hppa_dyn_hash_entry *dyn_h; + PTR data; +{ + struct bfd_link_info *info = (struct bfd_link_info *)data; + struct elf64_hppa_link_hash_table *hppa_info; + asection *sdlt, *sdltrel; + struct elf_link_hash_entry *h = dyn_h->h; + + hppa_info = elf64_hppa_hash_table (info); + + sdlt = hppa_info->dlt_sec; + sdltrel = hppa_info->dlt_rel_sec; + + /* H/DYN_H may refer to a local variable and we know it's + address, so there is no need to create a relocation. Just install + the proper value into the DLT, note this shortcut can not be + skipped when building a shared library. */ + if (! info->shared && h && dyn_h && dyn_h->want_dlt) + { + bfd_vma value; + + /* If we had an LTOFF_FPTR style relocation we want the DLT entry + to point to the FPTR entry in the .opd section. + + We include the OPD's output offset in this computation as + we are referring to an absolute address in the resulting + object file. */ + if (dyn_h->want_opd) + { + value = (dyn_h->opd_offset + + hppa_info->opd_sec->output_offset + + hppa_info->opd_sec->output_section->vma); + } + else + { + value = (h->root.u.def.value + + h->root.u.def.section->output_offset); + + if (h->root.u.def.section->output_section) + value += h->root.u.def.section->output_section->vma; + else + value += h->root.u.def.section->vma; + } + + /* We do not need to include the output offset of the DLT section + here because we are modifying the in-memory contents. */ + bfd_put_64 (sdlt->owner, value, sdlt->contents + dyn_h->dlt_offset); + } + + /* Create a relocation for the DLT entry assocated with this symbol. + When building a shared library the symbol does not have to be dynamic. */ + if (dyn_h->want_dlt + && (elf64_hppa_dynamic_symbol_p (dyn_h->h, info) || info->shared)) + { + Elf64_Internal_Rela rel; + int dynindx; + + /* We may need to do a relocation against a local symbol, in + which case we have to look up it's dynamic symbol index off + the local symbol hash table. */ + if (h && h->dynindx != -1) + dynindx = h->dynindx; + else + dynindx + = _bfd_elf_link_lookup_local_dynindx (info, dyn_h->owner, + dyn_h->sym_indx); + + /* Create a dynamic relocation for this entry. Do include the output + offset of the DLT entry since we need an absolute address in the + resulting object file. */ + rel.r_offset = (dyn_h->dlt_offset + sdlt->output_offset + + sdlt->output_section->vma); + if (h && h->type == STT_FUNC) + rel.r_info = ELF64_R_INFO (dynindx, R_PARISC_FPTR64); + else + rel.r_info = ELF64_R_INFO (dynindx, R_PARISC_DIR64); + rel.r_addend = 0; + + bfd_elf64_swap_reloca_out (sdlt->output_section->owner, &rel, + (((Elf64_External_Rela *) + sdltrel->contents) + + sdltrel->reloc_count)); + sdltrel->reloc_count++; + } + return true; +} + +/* Finalize the dynamic relocations. Specifically the FPTR relocations + for dynamic functions used to initialize static data. */ + +static boolean +elf64_hppa_finalize_dynreloc (dyn_h, data) + struct elf64_hppa_dyn_hash_entry *dyn_h; + PTR data; +{ + struct bfd_link_info *info = (struct bfd_link_info *)data; + struct elf64_hppa_link_hash_table *hppa_info; + struct elf_link_hash_entry *h; + int dynamic_symbol; + + dynamic_symbol = elf64_hppa_dynamic_symbol_p (dyn_h->h, info); + + if (!dynamic_symbol && !info->shared) + return true; + + if (dyn_h->reloc_entries) + { + struct elf64_hppa_dyn_reloc_entry *rent; + int dynindx; + + hppa_info = elf64_hppa_hash_table (info); + h = dyn_h->h; + + /* We may need to do a relocation against a local symbol, in + which case we have to look up it's dynamic symbol index off + the local symbol hash table. */ + if (h && h->dynindx != -1) + dynindx = h->dynindx; + else + dynindx + = _bfd_elf_link_lookup_local_dynindx (info, dyn_h->owner, + dyn_h->sym_indx); + + for (rent = dyn_h->reloc_entries; rent; rent = rent->next) + { + Elf64_Internal_Rela rel; + + switch (rent->type) + { + case R_PARISC_FPTR64: + /* Allocate one iff we are not building a shared library and + !want_opd, which by this point will be true only if we're + actually allocating one statically in the main executable. */ + if (!info->shared && dyn_h->want_opd) + continue; + break; + } + + /* Create a dynamic relocation for this entry. + + We need the output offset for the reloc's section because + we are creating an absolute address in the resulting object + file. */ + rel.r_offset = (rent->offset + rent->sec->output_offset + + rent->sec->output_section->vma); + + /* An FPTR64 relocation implies that we took the address of + a function and that the function has an entry in the .opd + section. We want the FPTR64 relocation to reference the + entry in .opd. + + We could munge the symbol value in the dynamic symbol table + (in fact we already do for functions with global scope) to point + to the .opd entry. Then we could use that dynamic symbol in + this relocation. + + Or we could do something sensible, not munge the symbol's + address and instead just use a different symbol to reference + the .opd entry. At least that seems sensible until you + realize there's no local dynamic symbols we can use for that + purpose. Thus the hair in the check_relocs routine. + + We use a section symbol recorded by check_relocs as the + base symbol for the relocation. The addend is the difference + between the section symbol and the address of the .opd entry. */ + if (info->shared && rent->type == R_PARISC_FPTR64) + { + bfd_vma value, value2; + + /* First compute the address of the opd entry for this symbol. */ + value = (dyn_h->opd_offset + + hppa_info->opd_sec->output_section->vma + + hppa_info->opd_sec->output_offset); + + /* Compute the value of the start of the section with + the relocation. */ + value2 = (rent->sec->output_section->vma + + rent->sec->output_offset); + + /* Compute the difference between the start of the section + with the relocation and the opd entry. */ + value -= value2; + + /* The result becomes the addend of the relocation. */ + rel.r_addend = value; + + /* The section symbol becomes the symbol for the dynamic + relocation. */ + dynindx + = _bfd_elf_link_lookup_local_dynindx (info, + rent->sec->owner, + rent->sec_symndx); + } + else + rel.r_addend = rent->addend; + + rel.r_info = ELF64_R_INFO (dynindx, rent->type); + + bfd_elf64_swap_reloca_out (hppa_info->other_rel_sec->output_section->owner, + &rel, + (((Elf64_External_Rela *) + hppa_info->other_rel_sec->contents) + + hppa_info->other_rel_sec->reloc_count)); + hppa_info->other_rel_sec->reloc_count++; + } + } + + return true; +} + +/* Finish up the dynamic sections. */ + +static boolean +elf64_hppa_finish_dynamic_sections (output_bfd, info) + bfd *output_bfd; + struct bfd_link_info *info; +{ + bfd *dynobj; + asection *sdyn; + struct elf64_hppa_link_hash_table *hppa_info; + + hppa_info = elf64_hppa_hash_table (info); + + /* Finalize the contents of the .opd section. */ + elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table, + elf64_hppa_finalize_opd, + info); + + elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table, + elf64_hppa_finalize_dynreloc, + info); + + /* Finalize the contents of the .dlt section. */ + dynobj = elf_hash_table (info)->dynobj; + /* Finalize the contents of the .dlt section. */ + elf64_hppa_dyn_hash_traverse (&hppa_info->dyn_hash_table, + elf64_hppa_finalize_dlt, + info); + + sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + + if (elf_hash_table (info)->dynamic_sections_created) + { + Elf64_External_Dyn *dyncon, *dynconend; + + BFD_ASSERT (sdyn != NULL); + + dyncon = (Elf64_External_Dyn *) sdyn->contents; + dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->_raw_size); + for (; dyncon < dynconend; dyncon++) + { + Elf_Internal_Dyn dyn; + asection *s; + + bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn); + + switch (dyn.d_tag) + { + default: + break; + + case DT_HP_LOAD_MAP: + /* Compute the absolute address of 16byte scratchpad area + for the dynamic linker. + + By convention the linker script will allocate the scratchpad + area at the start of the .data section. So all we have to + to is find the start of the .data section. */ + s = bfd_get_section_by_name (output_bfd, ".data"); + dyn.d_un.d_ptr = s->vma; + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_PLTGOT: + /* HP's use PLTGOT to set the GOT register. */ + dyn.d_un.d_ptr = _bfd_get_gp_value (output_bfd); + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_JMPREL: + s = hppa_info->plt_rel_sec; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_PLTRELSZ: + s = hppa_info->plt_rel_sec; + dyn.d_un.d_val = s->_raw_size; + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_RELA: + s = hppa_info->other_rel_sec; + if (! s) + s = hppa_info->dlt_rel_sec; + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + case DT_RELASZ: + s = hppa_info->other_rel_sec; + dyn.d_un.d_val = s->_raw_size; + s = hppa_info->dlt_rel_sec; + dyn.d_un.d_val += s->_raw_size; + s = hppa_info->opd_rel_sec; + dyn.d_un.d_val += s->_raw_size; + /* There is some question about whether or not the size of + the PLT relocs should be included here. HP's tools do + it, so we'll emulate them. */ + s = hppa_info->plt_rel_sec; + dyn.d_un.d_val += s->_raw_size; + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + break; + + } + } + } + + return true; +} + +/* Return the number of additional phdrs we will need. + + The generic ELF code only creates PT_PHDRs for executables. The HP + dynamic linker requires PT_PHDRs for dynamic libraries too. + + This routine indicates that the backend needs one additional program + header for that case. + + Note we do not have access to the link info structure here, so we have + to guess whether or not we are building a shared library based on the + existence of a .interp section. */ + +static int +elf64_hppa_additional_program_headers (abfd) + bfd *abfd; +{ + asection *s; + + /* If we are creating a shared library, then we have to create a + PT_PHDR segment. HP's dynamic linker chokes without it. */ + s = bfd_get_section_by_name (abfd, ".interp"); + if (! s) + return 1; + return 0; +} + +/* Allocate and initialize any program headers required by this + specific backend. + + The generic ELF code only creates PT_PHDRs for executables. The HP + dynamic linker requires PT_PHDRs for dynamic libraries too. + + This allocates the PT_PHDR and initializes it in a manner suitable + for the HP linker. + + Note we do not have access to the link info structure here, so we have + to guess whether or not we are building a shared library based on the + existence of a .interp section. */ + +static boolean +elf64_hppa_modify_segment_map (abfd) + bfd *abfd; +{ + struct elf_segment_map *m; + asection *s; + + s = bfd_get_section_by_name (abfd, ".interp"); + if (! s) + { + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_PHDR) + break; + if (m == NULL) + { + m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m); + if (m == NULL) + return false; + + m->p_type = PT_PHDR; + m->p_flags = PF_R | PF_X; + m->p_flags_valid = 1; + m->p_paddr_valid = 1; + m->includes_phdrs = 1; + + m->next = elf_tdata (abfd)->segment_map; + elf_tdata (abfd)->segment_map = m; + } + } + + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_LOAD) + { + unsigned int i; + + for (i = 0; i < m->count; i++) + { + /* The code "hint" is not really a hint. It is a requirement + for certain versions of the HP dynamic linker. Worse yet, + it must be set even if the shared library does not have + any code in its "text" segment (thus the check for .hash + to catch this situation). */ + if (m->sections[i]->flags & SEC_CODE + || (strcmp (m->sections[i]->name, ".hash") == 0)) + m->p_flags |= (PF_X | PF_HP_CODE); + } + } + + return true; +} + +/* Called when writing out an object file to decide the type of a + symbol. */ +static int +elf64_hppa_elf_get_symbol_type (elf_sym, type) + Elf_Internal_Sym *elf_sym; + int type; +{ + if (ELF_ST_TYPE (elf_sym->st_info) == STT_PARISC_MILLI) + return STT_PARISC_MILLI; + else + return type; +} + +/* The hash bucket size is the standard one, namely 4. */ + +const struct elf_size_info hppa64_elf_size_info = +{ + sizeof (Elf64_External_Ehdr), + sizeof (Elf64_External_Phdr), + sizeof (Elf64_External_Shdr), + sizeof (Elf64_External_Rel), + sizeof (Elf64_External_Rela), + sizeof (Elf64_External_Sym), + sizeof (Elf64_External_Dyn), + sizeof (Elf_External_Note), + 4, + 1, + 64, 8, + ELFCLASS64, EV_CURRENT, + bfd_elf64_write_out_phdrs, + bfd_elf64_write_shdrs_and_ehdr, + bfd_elf64_write_relocs, + bfd_elf64_swap_symbol_out, + bfd_elf64_slurp_reloc_table, + bfd_elf64_slurp_symbol_table, + bfd_elf64_swap_dyn_in, + bfd_elf64_swap_dyn_out, + NULL, + NULL, + NULL, + NULL +}; + +#define TARGET_BIG_SYM bfd_elf64_hppa_vec +#define TARGET_BIG_NAME "elf64-hppa" +#define ELF_ARCH bfd_arch_hppa +#define ELF_MACHINE_CODE EM_PARISC +/* This is not strictly correct. The maximum page size for PA2.0 is + 64M. But everything still uses 4k. */ +#define ELF_MAXPAGESIZE 0x1000 +#define bfd_elf64_bfd_reloc_type_lookup elf_hppa_reloc_type_lookup +#define bfd_elf64_bfd_is_local_label_name elf_hppa_is_local_label_name +#define elf_info_to_howto elf_hppa_info_to_howto +#define elf_info_to_howto_rel elf_hppa_info_to_howto_rel + +#define elf_backend_section_from_shdr elf64_hppa_section_from_shdr +#define elf_backend_object_p elf64_hppa_object_p +#define elf_backend_final_write_processing \ + elf_hppa_final_write_processing +#define elf_backend_fake_sections elf_hppa_fake_sections +#define elf_backend_add_symbol_hook elf_hppa_add_symbol_hook + +#define elf_backend_relocate_section elf_hppa_relocate_section + +#define bfd_elf64_bfd_final_link elf_hppa_final_link + +#define elf_backend_create_dynamic_sections \ + elf64_hppa_create_dynamic_sections +#define elf_backend_post_process_headers elf64_hppa_post_process_headers + +#define elf_backend_adjust_dynamic_symbol \ + elf64_hppa_adjust_dynamic_symbol + +#define elf_backend_size_dynamic_sections \ + elf64_hppa_size_dynamic_sections + +#define elf_backend_finish_dynamic_symbol \ + elf64_hppa_finish_dynamic_symbol +#define elf_backend_finish_dynamic_sections \ + elf64_hppa_finish_dynamic_sections + +/* Stuff for the BFD linker: */ +#define bfd_elf64_bfd_link_hash_table_create \ + elf64_hppa_hash_table_create + +#define elf_backend_check_relocs \ + elf64_hppa_check_relocs + +#define elf_backend_size_info \ + hppa64_elf_size_info + +#define elf_backend_additional_program_headers \ + elf64_hppa_additional_program_headers + +#define elf_backend_modify_segment_map \ + elf64_hppa_modify_segment_map + +#define elf_backend_link_output_symbol_hook \ + elf64_hppa_link_output_symbol_hook + +#define elf_backend_want_got_plt 0 +#define elf_backend_plt_readonly 0 +#define elf_backend_want_plt_sym 0 +#define elf_backend_got_header_size 0 +#define elf_backend_plt_header_size 0 +#define elf_backend_type_change_ok true +#define elf_backend_get_symbol_type elf64_hppa_elf_get_symbol_type + +#include "elf64-target.h" + +#undef TARGET_BIG_SYM +#define TARGET_BIG_SYM bfd_elf64_hppa_linux_vec +#undef TARGET_BIG_NAME +#define TARGET_BIG_NAME "elf64-hppa-linux" + +#define INCLUDED_TARGET_FILE 1 +#include "elf64-target.h" diff --git a/gnu/dist/toolchain/bfd/elf64-hppa.h b/gnu/dist/toolchain/bfd/elf64-hppa.h new file mode 100644 index 000000000000..9c15e6a4400d --- /dev/null +++ b/gnu/dist/toolchain/bfd/elf64-hppa.h @@ -0,0 +1,47 @@ +/* ELF64/HPPA support + + Copyright (C) 1999, 2000 Free Software Foundation, Inc. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifndef _ELF64_HPPA_H +#define _ELF64_HPPA_H + +#include "elf-bfd.h" +#include "libhppa.h" +#include "elf/hppa.h" + +extern elf_hppa_reloc_type ** _bfd_elf64_hppa_gen_reloc_type + PARAMS ((bfd *, elf_hppa_reloc_type, int, unsigned int, int, asymbol *)); + +/* Define groups of basic relocations. FIXME: These should + be the only basic relocations created by GAS. The rest + should be internal to the BFD backend. + + The idea is both SOM and ELF define these basic relocation + types so they map into a SOM or ELF specific relocation + as appropriate. This allows GAS to share much more code + between the two target object formats. */ + +#define R_HPPA_NONE R_PARISC_NONE +#define R_HPPA R_PARISC_DIR64 +#define R_HPPA_GOTOFF R_PARISC_DLTREL21L +#define R_HPPA_PCREL_CALL R_PARISC_PCREL21L +#define R_HPPA_ABS_CALL R_PARISC_DIR17F +#define R_HPPA_COMPLEX R_PARISC_UNIMPLEMENTED + +#endif /* _ELF64_HPPA_H */ diff --git a/gnu/dist/toolchain/bfd/elf64-mips.c b/gnu/dist/toolchain/bfd/elf64-mips.c index 6fc0dcdf0e4b..abd0f0e571c3 100644 --- a/gnu/dist/toolchain/bfd/elf64-mips.c +++ b/gnu/dist/toolchain/bfd/elf64-mips.c @@ -45,7 +45,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "coff/ecoff.h" /* The 64 bit versions of the mdebug data structures are in alpha.h. */ #include "coff/alpha.h" -#define ECOFF_64 +#define ECOFF_SIGNED_64 #include "ecoffswap.h" static void mips_elf64_swap_reloc_in @@ -623,7 +623,7 @@ static reloc_howto_type mips_elf64_howto_table_rel[] = 0, /* dst_mask */ false), /* pcrel_offset */ - /* Protected jump conversion. This is an optimization hint. No + /* Protected jump conversion. This is an optimization hint. No relocation is required for correctness. */ HOWTO (R_MIPS_JALR, /* type */ 0, /* rightshift */ @@ -1177,7 +1177,7 @@ static reloc_howto_type mips_elf64_howto_table_rela[] = 0, /* dst_mask */ false), /* pcrel_offset */ - /* Protected jump conversion. This is an optimization hint. No + /* Protected jump conversion. This is an optimization hint. No relocation is required for correctness. */ HOWTO (R_MIPS_JALR, /* type */ 0, /* rightshift */ @@ -1270,7 +1270,7 @@ mips_elf64_be_swap_reloc_in (abfd, src, dst) { Elf64_Mips_Internal_Rel mirel; - mips_elf64_swap_reloc_in (abfd, + mips_elf64_swap_reloc_in (abfd, (const Elf64_Mips_External_Rel *) src, &mirel); @@ -1292,7 +1292,7 @@ mips_elf64_be_swap_reloca_in (abfd, src, dst) { Elf64_Mips_Internal_Rela mirela; - mips_elf64_swap_reloca_in (abfd, + mips_elf64_swap_reloca_in (abfd, (const Elf64_Mips_External_Rela *) src, &mirela); @@ -1324,7 +1324,7 @@ mips_elf64_be_swap_reloc_out (abfd, src, dst) mirel.r_ssym = STN_UNDEF; mirel.r_type3 = R_MIPS_NONE; - mips_elf64_swap_reloc_out (abfd, &mirel, + mips_elf64_swap_reloc_out (abfd, &mirel, (Elf64_Mips_External_Rel *) dst); } @@ -1346,7 +1346,7 @@ mips_elf64_be_swap_reloca_out (abfd, src, dst) mirela.r_ssym = STN_UNDEF; mirela.r_type3 = R_MIPS_NONE; - mips_elf64_swap_reloca_out (abfd, &mirela, + mips_elf64_swap_reloca_out (abfd, &mirela, (Elf64_Mips_External_Rela *) dst); } @@ -2150,7 +2150,7 @@ const struct elf_size_info mips_elf64_size_info = #define elf_backend_plt_header_size 0 #define elf_backend_may_use_rel_p 1 -/* We don't set bfd_elf64_bfd_is_local_label_name because the 32-bit +/* We don't set bfd_elf64_bfd_is_local_label_name because the 32-bit MIPS-specific function only applies to IRIX5, which had no 64-bit ABI. */ #define bfd_elf64_find_nearest_line _bfd_mips_elf_find_nearest_line diff --git a/gnu/dist/toolchain/bfd/elf64-sparc.c b/gnu/dist/toolchain/bfd/elf64-sparc.c index c9e862677ac7..062791383b07 100644 --- a/gnu/dist/toolchain/bfd/elf64-sparc.c +++ b/gnu/dist/toolchain/bfd/elf64-sparc.c @@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "sysdep.h" #include "libbfd.h" #include "elf-bfd.h" +#include "opcode/sparc.h" /* This is defined if one wants to build upward compatible binaries with the original sparc64-elf toolchain. The support is kept in for @@ -65,6 +66,8 @@ static void sparc64_elf_symbol_processing static boolean sparc64_elf_merge_private_bfd_data PARAMS ((bfd *, bfd *)); +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 **)); @@ -212,7 +215,7 @@ static CONST struct elf_reloc_map sparc_reloc_map[] = static reloc_howto_type * sparc64_elf_reloc_type_lookup (abfd, code) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { unsigned int i; @@ -226,7 +229,7 @@ sparc64_elf_reloc_type_lookup (abfd, code) static void sparc64_elf_info_to_howto (abfd, cache_ptr, dst) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *cache_ptr; Elf64_Internal_Rela *dst; { @@ -237,10 +240,10 @@ sparc64_elf_info_to_howto (abfd, cache_ptr, dst) /* Due to the way how we handle R_SPARC_OLO10, each entry in a SHT_RELA section can represent up to two relocs, we must tell the user to allocate more space. */ - + static long sparc64_elf_get_reloc_upper_bound (abfd, sec) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; asection *sec; { return (sec->reloc_count * 2 + 1) * sizeof (arelent *); @@ -253,7 +256,7 @@ sparc64_elf_get_dynamic_reloc_upper_bound (abfd) return _bfd_elf_get_dynamic_reloc_upper_bound (abfd) * 2; } -/* Read relocations for ASECT from REL_HDR. There are RELOC_COUNT of +/* Read relocations for ASECT from REL_HDR. There are RELOC_COUNT of them. We cannot use generic elf routines for this, because R_SPARC_OLO10 has secondary addend in ELF64_R_TYPE_DATA. We handle it as two relocations for the same location, R_SPARC_LO10 and R_SPARC_13. */ @@ -266,7 +269,6 @@ sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic) asymbol **symbols; boolean dynamic; { - struct elf_backend_data * const ebd = get_elf_backend_data (abfd); PTR allocated = NULL; bfd_byte *native_relocs; arelent *relent; @@ -290,7 +292,7 @@ sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic) entsize = rel_hdr->sh_entsize; BFD_ASSERT (entsize == sizeof (Elf64_External_Rela)); - + count = rel_hdr->sh_size / entsize; for (i = 0, relent = relents; i < count; @@ -396,20 +398,20 @@ sparc64_elf_slurp_reloc_table (abfd, asect, symbols, dynamic) rel_hdr2 = NULL; } - asect->relocation = ((arelent *) - bfd_alloc (abfd, + asect->relocation = ((arelent *) + bfd_alloc (abfd, asect->reloc_count * 2 * sizeof (arelent))); if (asect->relocation == NULL) return false; /* The sparc64_elf_slurp_one_reloc_table routine increments reloc_count. */ asect->reloc_count = 0; - + if (!sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr, symbols, dynamic)) return false; - - if (rel_hdr2 + + if (rel_hdr2 && !sparc64_elf_slurp_one_reloc_table (abfd, asect, rel_hdr2, symbols, dynamic)) return false; @@ -501,7 +503,6 @@ sparc64_elf_write_relocs (abfd, sec, data) for (idx = 0; idx < sec->reloc_count; idx++) { bfd_vma addr; - unsigned int i; ++count; @@ -533,7 +534,7 @@ sparc64_elf_write_relocs (abfd, sec, data) if (rela_hdr->sh_type != SHT_RELA) abort (); - /* orelocation has the data, reloc_count has the count... */ + /* orelocation has the data, reloc_count has the count... */ outbound_relocas = (Elf64_External_Rela *) rela_hdr->contents; src_rela = outbound_relocas; @@ -627,7 +628,7 @@ struct sparc64_elf_link_hash_table #define sparc64_elf_hash_table(p) \ ((struct sparc64_elf_link_hash_table *) ((p)->hash)) - + /* Create a Sparc64 ELF linker hash table. */ static struct bfd_link_hash_table * @@ -650,7 +651,6 @@ sparc64_elf_bfd_link_hash_table_create (abfd) return &ret->root.root; } - /* Utility for performing the standard initial work of an instruction relocation. @@ -723,13 +723,13 @@ sparc_elf_notsup_reloc (abfd, input_section, output_bfd, error_message) - bfd *abfd; - arelent *reloc_entry; - asymbol *symbol; - PTR data; - asection *input_section; - bfd *output_bfd; - char **error_message; + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc_entry ATTRIBUTE_UNUSED; + asymbol *symbol ATTRIBUTE_UNUSED; + PTR data ATTRIBUTE_UNUSED; + asection *input_section ATTRIBUTE_UNUSED; + bfd *output_bfd ATTRIBUTE_UNUSED; + char **error_message ATTRIBUTE_UNUSED; { return bfd_reloc_notsupported; } @@ -745,7 +745,7 @@ sparc_elf_wdisp16_reloc (abfd, reloc_entry, symbol, data, input_section, PTR data; asection *input_section; bfd *output_bfd; - char **error_message; + char **error_message ATTRIBUTE_UNUSED; { bfd_vma relocation; bfd_vma insn; @@ -783,7 +783,7 @@ sparc_elf_hix22_reloc (abfd, PTR data; asection *input_section; bfd *output_bfd; - char **error_message; + char **error_message ATTRIBUTE_UNUSED; { bfd_vma relocation; bfd_vma insn; @@ -820,7 +820,7 @@ sparc_elf_lox10_reloc (abfd, PTR data; asection *input_section; bfd *output_bfd; - char **error_message; + char **error_message ATTRIBUTE_UNUSED; { bfd_vma relocation; bfd_vma insn; @@ -847,7 +847,6 @@ sparc_elf_lox10_reloc (abfd, #define ELF_DYNAMIC_INTERPRETER "/usr/lib/sparcv9/ld.so.1" - /* Fill in the .plt section. */ static void @@ -858,7 +857,7 @@ sparc64_elf_build_plt (output_bfd, contents, nentries) { const unsigned int nop = 0x01000000; int i, j; - + /* The first four entries are reserved, and are initially undefined. We fill them with `illtrap 0' to force ld.so to do something. */ @@ -892,7 +891,7 @@ sparc64_elf_build_plt (output_bfd, contents, nentries) /* Now the tricky bit. Entries 32768 and higher are grouped in blocks of 160: 160 entries and 160 pointers. This is to separate code from data, which is much friendlier on the cache. */ - + for (; i < nentries; i += 160) { int block = (i + 160 <= nentries ? 160 : nentries - i); @@ -935,7 +934,7 @@ 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 + return ((bfd_vma) (LARGE_PLT_THRESHOLD + block*160) * PLT_ENTRY_SIZE + ofs * 6*4); } @@ -961,8 +960,6 @@ sparc64_elf_plt_ptr_offset (index, max) + last * 6*4 + ofs * 8); } - - /* Look through the relocs for a section during the first phase, and allocate space in the global offset table or procedure linkage @@ -1197,7 +1194,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) case R_SPARC_UA16: /* When creating a shared object, we must copy these relocs into the output file. We create a reloc section in - dynobj and make room for the reloc. + dynobj and make room for the reloc. But don't do this for debugging sections -- this shows up with DWARF2 -- first because they are not loaded, and @@ -1246,7 +1243,7 @@ sparc64_elf_check_relocs (abfd, info, sec, relocs) break; default: - (*_bfd_error_handler)(_("%s: check_relocs: unhandled reloc type %d"), + (*_bfd_error_handler) (_("%s: check_relocs: unhandled reloc type %d"), bfd_get_filename(abfd), ELF64_R_TYPE_ID (rel->r_info)); return false; @@ -1265,9 +1262,9 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) struct bfd_link_info *info; const Elf_Internal_Sym *sym; const char **namep; - flagword *flagsp; - asection **secp; - bfd_vma *valp; + flagword *flagsp ATTRIBUTE_UNUSED; + asection **secp ATTRIBUTE_UNUSED; + bfd_vma *valp ATTRIBUTE_UNUSED; { static char *stt_types[] = { "NOTYPE", "OBJECT", "FUNCTION" }; @@ -1275,7 +1272,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) { int reg; struct sparc64_elf_app_reg *p; - + reg = (int)sym->st_value; switch (reg & ~1) { @@ -1316,7 +1313,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) if (**namep) { struct elf_link_hash_entry *h; - + h = (struct elf_link_hash_entry *) bfd_link_hash_lookup (info->hash, *namep, false, false, false); @@ -1387,7 +1384,7 @@ sparc64_elf_add_symbol_hook (abfd, info, sym, namep, flagsp, secp, valp) static boolean sparc64_elf_output_arch_syms (output_bfd, info, finfo, func) - bfd *output_bfd; + bfd *output_bfd ATTRIBUTE_UNUSED; struct bfd_link_info *info; PTR finfo; boolean (*func) PARAMS ((PTR, const char *, @@ -1460,7 +1457,7 @@ sparc64_elf_get_symbol_type (elf_sym, type) static void sparc64_elf_symbol_processing (abfd, asym) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; asymbol *asym; { elf_symbol_type *elfsym; @@ -1556,12 +1553,6 @@ sparc64_elf_adjust_dynamic_symbol (info, h) s = bfd_get_section_by_name (dynobj, ".rela.plt"); BFD_ASSERT (s != NULL); - /* The first plt entries are reserved, and the relocations must - pair up exactly. */ - if (s->_raw_size == 0) - s->_raw_size += (PLT_HEADER_SIZE/PLT_ENTRY_SIZE - * sizeof (Elf64_External_Rela)); - s->_raw_size += sizeof (Elf64_External_Rela); /* The procedure linkage table size is bounded by the magnitude @@ -1802,6 +1793,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) { if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0)) return false; + info->flags |= DF_TEXTREL; } /* Add dynamic STT_REGISTER symbols and corresponding DT_SPARC_REGISTER @@ -1813,7 +1805,7 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) if (app_regs [reg].name != NULL) { struct elf_link_local_dynamic_entry *entry, *e; - + if (! bfd_elf64_add_dynamic_entry (info, DT_SPARC_REGISTER, 0)) return false; @@ -1855,6 +1847,21 @@ sparc64_elf_size_dynamic_sections (output_bfd, info) return true; } +#define SET_SEC_DO_RELAX(section) do { elf_section_data(section)->tdata = (void *)1; } while (0) +#define SEC_DO_RELAX(section) (elf_section_data(section)->tdata == (void *)1) + +static boolean +sparc64_elf_relax_section (abfd, section, link_info, again) + bfd *abfd ATTRIBUTE_UNUSED; + asection *section ATTRIBUTE_UNUSED; + struct bfd_link_info *link_info ATTRIBUTE_UNUSED; + boolean *again; +{ + *again = false; + SET_SEC_DO_RELAX (section); + return true; +} + /* Relocate a SPARC64 ELF section. */ static boolean @@ -1898,7 +1905,7 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, { int r_type; reloc_howto_type *howto; - long r_symndx; + unsigned long r_symndx; struct elf_link_hash_entry *h; Elf_Internal_Sym *sym; asection *sec; @@ -2061,7 +2068,15 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, (!info->shared || info->no_undefined || ELF_ST_VISIBILITY (h->other))))) return false; - relocation = 0; + + /* To avoid generating warning messages about truncated + relocations, set the relocation's address to be the same as + the start of this section. */ + + if (input_section->output_section != NULL) + relocation = input_section->output_section->vma; + else + relocation = 0; } } @@ -2338,7 +2353,6 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, off &= ~1; else { - bfd_put_64 (output_bfd, relocation, sgot->contents + off); local_got_offsets[r_symndx] |= 1; if (info->shared) @@ -2346,6 +2360,13 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, asection *srelgot; Elf_Internal_Rela outrel; + /* The Solaris 2.7 64-bit linker adds the contents + of the location to the value of the reloc. + 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); + /* We need to generate a R_SPARC_RELATIVE reloc for the dynamic linker. */ srelgot = bfd_get_section_by_name(dynobj, ".rela.got"); @@ -2362,6 +2383,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, + srelgot->reloc_count)); ++srelgot->reloc_count; } + else + bfd_put_64 (output_bfd, relocation, sgot->contents + off); } relocation = sgot->output_offset + off - got_base; } @@ -2396,6 +2419,8 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, relocation = (splt->output_section->vma + splt->output_offset + sparc64_elf_plt_entry_offset (h->plt.offset)); + if (r_type == R_SPARC_WPLT30) + goto do_wplt30; goto do_default; case R_SPARC_OLO10: @@ -2471,6 +2496,97 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, } break; + case R_SPARC_WDISP30: + do_wplt30: + if (SEC_DO_RELAX (input_section) + && rel->r_offset + 4 < input_section->_raw_size) + { +#define G0 0 +#define O7 15 +#define XCC (2 << 20) +#define COND(x) (((x)&0xf)<<25) +#define CONDA COND(0x8) +#define INSN_BPA (F2(0,1) | CONDA | BPRED | XCC) +#define INSN_BA (F2(0,2) | CONDA) +#define INSN_OR F3(2, 0x2, 0) +#define INSN_NOP F2(0,4) + + bfd_vma x, y; + + /* If the instruction is a call with either: + restore + arithmetic instruction with rd == %o7 + where rs1 != %o7 and rs2 if it is register != %o7 + then we can optimize if the call destination is near + by changing the call into a branch always. */ + x = bfd_get_32 (input_bfd, contents + rel->r_offset); + y = bfd_get_32 (input_bfd, contents + rel->r_offset + 4); + if ((x & OP(~0)) == OP(1) && (y & OP(~0)) == OP(2)) + { + if (((y & OP3(~0)) == OP3(0x3d) /* restore */ + || ((y & OP3(0x28)) == 0 /* arithmetic */ + && (y & RD(~0)) == RD(O7))) + && (y & RS1(~0)) != RS1(O7) + && ((y & F3I(~0)) + || (y & RS2(~0)) != RS2(O7))) + { + bfd_vma reloc; + + reloc = relocation + rel->r_addend - rel->r_offset; + reloc -= (input_section->output_section->vma + + input_section->output_offset); + if (reloc & 3) + goto do_default; + + /* Ensure the branch fits into simm22. */ + if ((reloc & ~(bfd_vma)0x7fffff) + && ((reloc | 0x7fffff) != MINUS_ONE)) + goto do_default; + reloc >>= 2; + + /* Check whether it fits into simm19. */ + if ((reloc & 0x3c0000) == 0 + || (reloc & 0x3c0000) == 0x3c0000) + x = INSN_BPA | (reloc & 0x7ffff); /* ba,pt %xcc */ + else + x = INSN_BA | (reloc & 0x3fffff); /* ba */ + bfd_put_32 (input_bfd, x, contents + rel->r_offset); + r = bfd_reloc_ok; + if (rel->r_offset >= 4 + && (y & (0xffffffff ^ RS1(~0))) + == (INSN_OR | RD(O7) | RS2(G0))) + { + bfd_vma z; + unsigned int reg; + + z = bfd_get_32 (input_bfd, + contents + rel->r_offset - 4); + if ((z & (0xffffffff ^ RD(~0))) + != (INSN_OR | RS1(O7) | RS2(G0))) + break; + + /* The sequence was + or %o7, %g0, %rN + call foo + or %rN, %g0, %o7 + + If call foo was replaced with ba, replace + or %rN, %g0, %o7 with nop. */ + + reg = (y & RS1(~0)) >> 14; + if (reg != ((z & RD(~0)) >> 25) + || reg == G0 || reg == O7) + break; + + bfd_put_32 (input_bfd, INSN_NOP, + contents + rel->r_offset + 4); + } + break; + } + } + } + /* FALLTHROUGH */ + default: do_default: r = _bfd_final_link_relocate (howto, input_bfd, input_section, @@ -2499,12 +2615,12 @@ sparc64_elf_relocate_section (output_bfd, info, input_bfd, input_section, { /* Assume this is a call protected by other code that detect the symbol is undefined. If this is the case, - we can safely ignore the overflow. If not, the + we can safely ignore the overflow. If not, the program is hosed anyway, and a little warning isn't going to help. */ break; } - + name = h->root.root.string; } else @@ -2550,7 +2666,7 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) asection *srela; Elf_Internal_Rela rela; - /* This symbol has an entry in the PLT. Set it up. */ + /* This symbol has an entry in the PLT. Set it up. */ BFD_ASSERT (h->dynindx != -1); @@ -2575,9 +2691,14 @@ sparc64_elf_finish_dynamic_symbol (output_bfd, info, h, sym) rela.r_offset += (splt->output_section->vma + splt->output_offset); rela.r_info = ELF64_R_INFO (h->dynindx, R_SPARC_JMP_SLOT); + /* Adjust for the first 4 reserved elements in the .plt section + when setting the offset in the .rela.plt section. + Sun forgot to read their own ABI and copied elf32-sparc behaviour, + thus .plt[4] has corresponding .rela.plt[0] and so on. */ + bfd_elf64_swap_reloca_out (output_bfd, &rela, ((Elf64_External_Rela *) srela->contents - + h->plt.offset)); + + (h->plt.offset - 4))); if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) { @@ -2770,7 +2891,7 @@ sparc64_elf_finish_dynamic_sections (output_bfd, info) return true; } -/* Functions for dealing with the e_flags field. */ +/* Functions for dealing with the e_flags field. */ /* Merge backend specific data from an object file to the output object file when linking. */ @@ -2796,32 +2917,33 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd) 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 */ { error = false; - + +#define EF_SPARC_ISA_EXTENSIONS \ + (EF_SPARC_SUN_US1 | EF_SPARC_SUN_US3 | EF_SPARC_HAL_R1) + if ((ibfd->flags & DYNAMIC) != 0) { /* We don't want dynamic objects memory ordering and architecture to have any role. That's what dynamic linker should do. */ - old_flags &= ~(EF_SPARCV9_MM | EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1); - old_flags |= (new_flags - & (EF_SPARCV9_MM - | EF_SPARC_SUN_US1 - | EF_SPARC_HAL_R1)); + new_flags &= ~(EF_SPARCV9_MM | EF_SPARC_ISA_EXTENSIONS); + new_flags |= (old_flags + & (EF_SPARCV9_MM | EF_SPARC_ISA_EXTENSIONS)); } else { /* Choose the highest architecture requirements. */ - old_flags |= (new_flags & (EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1)); - new_flags |= (old_flags & (EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1)); - if ((old_flags & (EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1)) - == (EF_SPARC_SUN_US1 | EF_SPARC_HAL_R1)) + old_flags |= (new_flags & EF_SPARC_ISA_EXTENSIONS); + new_flags |= (old_flags & EF_SPARC_ISA_EXTENSIONS); + if ((old_flags & (EF_SPARC_SUN_US1 | EF_SPARC_SUN_US3)) + && (old_flags & EF_SPARC_HAL_R1)) { error = true; (*_bfd_error_handler) @@ -2863,13 +2985,13 @@ sparc64_elf_merge_private_bfd_data (ibfd, obfd) static const char * sparc64_elf_print_symbol_all (abfd, filep, symbol) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; PTR filep; asymbol *symbol; { FILE *file = (FILE *) filep; int reg, type; - + if (ELF_ST_TYPE (((elf_symbol_type *) symbol)->internal_elf_sym.st_info) != STT_REGISTER) return NULL; @@ -2894,8 +3016,10 @@ sparc64_elf_object_p (abfd) bfd *abfd; { unsigned long mach = bfd_mach_sparc_v9; - - if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US1) + + if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US3) + mach = bfd_mach_sparc_v9b; + else if (elf_elfheader (abfd)->e_flags & EF_SPARC_SUN_US1) mach = bfd_mach_sparc_v9a; return bfd_default_set_arch_mach (abfd, bfd_arch_sparc, mach); } @@ -2919,7 +3043,7 @@ const struct elf_size_info sparc64_elf_size_info = /* internal relocations per external relocations. For link purposes we use just 1 internal per 1 external, for assembly and slurp symbol table - we use 2. */ + we use 2. */ 1, 64, /* arch_size */ 8, /* file_align */ @@ -2952,7 +3076,7 @@ const struct elf_size_info sparc64_elf_size_info = #define bfd_elf64_bfd_link_hash_table_create \ sparc64_elf_bfd_link_hash_table_create - + #define elf_info_to_howto \ sparc64_elf_info_to_howto #define bfd_elf64_get_reloc_upper_bound \ @@ -2963,6 +3087,8 @@ const struct elf_size_info sparc64_elf_size_info = sparc64_elf_canonicalize_dynamic_reloc #define bfd_elf64_bfd_reloc_type_lookup \ sparc64_elf_reloc_type_lookup +#define bfd_elf64_bfd_relax_section \ + sparc64_elf_relax_section #define elf_backend_create_dynamic_sections \ _bfd_elf_create_dynamic_sections diff --git a/gnu/dist/toolchain/bfd/elf64-x86-64.c b/gnu/dist/toolchain/bfd/elf64-x86-64.c new file mode 100644 index 000000000000..d797165c3dbd --- /dev/null +++ b/gnu/dist/toolchain/bfd/elf64-x86-64.c @@ -0,0 +1,1918 @@ +/* X86-64 specific support for 64-bit ELF + Copyright 2000, 2001 Free Software Foundation, Inc. + Contributed by Jan Hubicka . + +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/x86-64.h" + +/* We use only the RELA entries. */ +#define USE_RELA + +/* In case we're on a 32-bit machine, construct a 64-bit "-1" value. */ +#define MINUS_ONE (~ (bfd_vma) 0) + +/* The relocation "howto" table. Order of fields: + type, size, bitsize, pc_relative, complain_on_overflow, + special_function, name, partial_inplace, src_mask, dst_pack, pcrel_offset. */ +static reloc_howto_type x86_64_elf_howto_table[] = +{ + HOWTO(R_X86_64_NONE, 0, 0, 0, false, 0, complain_overflow_dont, + bfd_elf_generic_reloc, "R_X86_64_NONE", false, 0x00000000, 0x00000000, false), + HOWTO(R_X86_64_64, 0, 4, 64, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_X86_64_64", false, MINUS_ONE, MINUS_ONE, false), + HOWTO(R_X86_64_PC32, 0, 4, 32, true, 0, complain_overflow_signed, + bfd_elf_generic_reloc, "R_X86_64_PC32", false, 0xffffffff, 0xffffffff, true), + HOWTO(R_X86_64_GOT32, 0, 4, 32, false, 0, complain_overflow_signed, + bfd_elf_generic_reloc, "R_X86_64_GOT32", false, 0xffffffff, 0xffffffff, false), + HOWTO(R_X86_64_PLT32, 0, 4, 32, true, 0, complain_overflow_signed, + bfd_elf_generic_reloc, "R_X86_64_PLT32", false, 0xffffffff, 0xffffffff, true), + HOWTO(R_X86_64_COPY, 0, 4, 32, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_X86_64_COPY", false, 0xffffffff, 0xffffffff, false), + HOWTO(R_X86_64_GLOB_DAT, 0, 4, 64, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_X86_64_GLOB_DAT", false, MINUS_ONE, MINUS_ONE, false), + HOWTO(R_X86_64_JUMP_SLOT, 0, 4, 64, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_X86_64_JUMP_SLOT", false, MINUS_ONE, MINUS_ONE, false), + HOWTO(R_X86_64_RELATIVE, 0, 4, 64, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_X86_64_RELATIVE", false, MINUS_ONE, MINUS_ONE, false), + HOWTO(R_X86_64_GOTPCREL, 0, 4, 32, true,0 , complain_overflow_signed, + bfd_elf_generic_reloc, "R_X86_64_GOTPCREL", false, 0xffffffff, 0xffffffff, true), + HOWTO(R_X86_64_32, 0, 4, 32, false, 0, complain_overflow_unsigned, + bfd_elf_generic_reloc, "R_X86_64_32", false, 0xffffffff, 0xffffffff, false), + HOWTO(R_X86_64_32S, 0, 4, 32, false, 0, complain_overflow_signed, + bfd_elf_generic_reloc, "R_X86_64_32S", false, 0xffffffff, 0xffffffff, false), + HOWTO(R_X86_64_16, 0, 1, 16, false, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_X86_64_16", false, 0xffff, 0xffff, false), + HOWTO(R_X86_64_PC16,0, 1, 16, true, 0, complain_overflow_bitfield, + bfd_elf_generic_reloc, "R_X86_64_PC16", false, 0xffff, 0xffff, true), + 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) +}; + +/* Map BFD relocs to the x86_64 elf relocs. */ +struct elf_reloc_map +{ + bfd_reloc_code_real_type bfd_reloc_val; + unsigned char elf_reloc_val; +}; + +static CONST struct elf_reloc_map x86_64_reloc_map[] = +{ + { BFD_RELOC_NONE, R_X86_64_NONE, }, + { BFD_RELOC_64, R_X86_64_64, }, + { BFD_RELOC_32_PCREL, R_X86_64_PC32, }, + { BFD_RELOC_X86_64_GOT32, R_X86_64_GOT32,}, + { BFD_RELOC_X86_64_PLT32, R_X86_64_PLT32,}, + { BFD_RELOC_X86_64_COPY, R_X86_64_COPY, }, + { BFD_RELOC_X86_64_GLOB_DAT, R_X86_64_GLOB_DAT, }, + { BFD_RELOC_X86_64_JUMP_SLOT, R_X86_64_JUMP_SLOT, }, + { BFD_RELOC_X86_64_RELATIVE, R_X86_64_RELATIVE, }, + { BFD_RELOC_X86_64_GOTPCREL, R_X86_64_GOTPCREL, }, + { BFD_RELOC_32, R_X86_64_32, }, + { BFD_RELOC_X86_64_32S, R_X86_64_32S, }, + { BFD_RELOC_16, R_X86_64_16, }, + { BFD_RELOC_16_PCREL, R_X86_64_PC16, }, + { BFD_RELOC_8, R_X86_64_8, }, + { BFD_RELOC_8_PCREL, R_X86_64_PC8, }, +}; + +static reloc_howto_type *elf64_x86_64_reloc_type_lookup + PARAMS ((bfd *, bfd_reloc_code_real_type)); +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 struct bfd_hash_entry *elf64_x86_64_link_hash_newfunc + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); +static boolean elf64_x86_64_adjust_dynamic_symbol + PARAMS ((struct bfd_link_info *, struct elf_link_hash_entry *)); + +static boolean elf64_x86_64_size_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); +static boolean elf64_x86_64_relocate_section + PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, + Elf_Internal_Rela *, Elf_Internal_Sym *, asection **)); +static boolean elf64_x86_64_finish_dynamic_symbol + PARAMS ((bfd *, struct bfd_link_info *, struct elf_link_hash_entry *, + Elf_Internal_Sym *sym)); +static boolean elf64_x86_64_finish_dynamic_sections + PARAMS ((bfd *, struct bfd_link_info *)); + +/* Given a BFD reloc type, return a HOWTO structure. */ +static reloc_howto_type * +elf64_x86_64_reloc_type_lookup (abfd, code) + bfd *abfd ATTRIBUTE_UNUSED; + bfd_reloc_code_real_type code; +{ + unsigned int i; + for (i = 0; i < sizeof (x86_64_reloc_map) / sizeof (struct elf_reloc_map); + 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 0; +} + +/* Given an x86_64 ELF reloc type, fill in an arelent structure. */ + +static void +elf64_x86_64_info_to_howto (abfd, cache_ptr, dst) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *cache_ptr; + Elf64_Internal_Rela *dst; +{ + unsigned r_type; + + 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]; + BFD_ASSERT (r_type == cache_ptr->howto->type); +} + +/* Functions for the x86-64 ELF linker. */ + +/* The name of the dynamic interpreter. This is put in the .interp + section. */ + +#define ELF_DYNAMIC_INTERPRETER "/lib/ld64.so.1" + +/* The size in bytes of an entry in the global offset table. */ + +#define GOT_ENTRY_SIZE 8 + +/* The size in bytes of an entry in the procedure linkage table. */ + +#define PLT_ENTRY_SIZE 16 + +/* The first entry in a procedure linkage table looks like this. See the + SVR4 ABI i386 supplement and the x86-64 ABI to see how this works. */ + +static const bfd_byte elf64_x86_64_plt0_entry[PLT_ENTRY_SIZE] = +{ + 0xff, 0xb3, 8, 0, 0, 0, /* pushq GOT+8(%rip) */ + 0xff, 0xa3, 16, 0, 0, 0, /* jmp GOT+16(%rip) */ + 0, 0, 0, 0 /* pad out to 16 bytes. */ +}; + +/* Subsequent entries in a procedure linkage table look like this. */ + +static const bfd_byte elf64_x86_64_plt_entry[PLT_ENTRY_SIZE] = +{ + 0xff, 0xa3, /* jmp *name@GOTPC(%rip) */ + 0, 0, 0, 0, /* replaced with offset to this symbol in .got. */ + 0x68, /* pushq immediate */ + 0, 0, 0, 0, /* replaced with index into relocation table. */ + 0xe9, /* jmp relative */ + 0, 0, 0, 0 /* replaced with offset to start of .plt0. */ +}; + +/* The x86-64 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. */ + +/* This structure keeps track of the number of PC relative relocs we + have copied for a given symbol. */ + +struct elf64_x86_64_pcrel_relocs_copied +{ + /* Next section. */ + struct elf64_x86_64_pcrel_relocs_copied *next; + /* A section in dynobj. */ + asection *section; + /* Number of relocs copied in this section. */ + bfd_size_type count; +}; + +/* x86-64 ELF linker hash entry. */ + +struct elf64_x86_64_link_hash_entry +{ + struct elf_link_hash_entry root; + + /* Number of PC relative relocs copied for this symbol. */ + struct elf64_x86_64_pcrel_relocs_copied *pcrel_relocs_copied; +}; + +/* x86-64 ELF linker hash table. */ + +struct elf64_x86_64_link_hash_table +{ + struct elf_link_hash_table root; +}; + +/* Declare this now that the above structures are defined. */ + +static boolean elf64_x86_64_discard_copies + PARAMS ((struct elf64_x86_64_link_hash_entry *, PTR)); + +/* Traverse an x86-64 ELF linker hash table. */ + +#define elf64_x86_64_link_hash_traverse(table, func, info) \ + (elf_link_hash_traverse \ + (&(table)->root, \ + (boolean (*) PARAMS ((struct elf_link_hash_entry *, PTR))) (func), \ + (info))) + +/* Get the x86-64 ELF linker hash table from a link_info structure. */ + +#define elf64_x86_64_hash_table(p) \ + ((struct elf64_x86_64_link_hash_table *) ((p)->hash)) + +/* Create an entry in an x86-64 ELF linker hash table. */ + +static struct bfd_hash_entry * +elf64_x86_64_link_hash_newfunc (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + struct elf64_x86_64_link_hash_entry *ret = + (struct elf64_x86_64_link_hash_entry *) entry; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (ret == (struct elf64_x86_64_link_hash_entry *) NULL) + ret = ((struct elf64_x86_64_link_hash_entry *) + bfd_hash_allocate (table, + sizeof (struct elf64_x86_64_link_hash_entry))); + if (ret == (struct elf64_x86_64_link_hash_entry *) NULL) + return (struct bfd_hash_entry *) ret; + + /* Call the allocation method of the superclass. */ + ret = ((struct elf64_x86_64_link_hash_entry *) + _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret, + table, string)); + if (ret != (struct elf64_x86_64_link_hash_entry *) NULL) + { + ret->pcrel_relocs_copied = NULL; + } + + return (struct bfd_hash_entry *) ret; +} + +/* Create an X86-64 ELF linker hash table. */ + +static struct bfd_link_hash_table * +elf64_x86_64_link_hash_table_create (abfd) + bfd *abfd; +{ + struct elf64_x86_64_link_hash_table *ret; + + ret = ((struct elf64_x86_64_link_hash_table *) + bfd_alloc (abfd, sizeof (struct elf64_x86_64_link_hash_table))); + if (ret == (struct elf64_x86_64_link_hash_table *) NULL) + return NULL; + + if (! _bfd_elf_link_hash_table_init (&ret->root, abfd, + elf64_x86_64_link_hash_newfunc)) + { + bfd_release (abfd, ret); + return NULL; + } + + return &ret->root.root; +} + +boolean +elf64_x86_64_elf_object_p (abfd) + bfd *abfd; +{ + /* Set the right machine number for an x86-64 elf64 file. */ + bfd_default_set_arch_mach (abfd, bfd_arch_i386, bfd_mach_x86_64); + return true; +} + +/* Look through the relocs for a section during the first phase, and + allocate space in the global offset table or procedure linkage + table. */ + +static boolean +elf64_x86_64_check_relocs (abfd, info, sec, relocs) + bfd *abfd; + struct bfd_link_info *info; + asection *sec; + const Elf_Internal_Rela *relocs; +{ + bfd *dynobj; + 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; + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + sym_hashes = elf_sym_hashes (abfd); + local_got_refcounts = elf_local_got_refcounts (abfd); + + sgot = srelgot = sreloc = NULL; + rel_end = relocs + sec->reloc_count; + for (rel = relocs; rel < rel_end; rel++) + { + unsigned long r_symndx; + struct elf_link_hash_entry *h; + + r_symndx = 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]; + + /* Some relocs require a global offset table. */ + if (dynobj == NULL) + { + switch (ELF64_R_TYPE (rel->r_info)) + { + case R_X86_64_GOT32: + case R_X86_64_GOTPCREL: + elf_hash_table (info)->dynobj = dynobj = abfd; + if (! _bfd_elf_create_got_section (dynobj, info)) + return false; + break; + } + } + + switch (ELF64_R_TYPE (rel->r_info)) + { + case R_X86_64_GOTPCREL: + case R_X86_64_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, ".rela.got"); + if (srelgot == NULL) + { + srelgot = bfd_make_section (dynobj, ".rela.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, 3)) + 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_elf64_link_record_dynamic_symbol (info, h)) + return false; + } + + sgot->_raw_size += GOT_ENTRY_SIZE; + srelgot->_raw_size += sizeof (Elf64_External_Rela); + } + else + h->got.refcount += 1; + } + else + { + /* This is a global offset table entry for a local symbol. */ + if (local_got_refcounts == NULL) + { + size_t size; + + size = symtab_hdr->sh_info * sizeof (bfd_signed_vma); + local_got_refcounts = ((bfd_signed_vma *) + bfd_alloc (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; + + sgot->_raw_size += GOT_ENTRY_SIZE; + if (info->shared) + { + /* If we are generating a shared object, we need to + output a R_X86_64_RELATIVE reloc so that the dynamic + linker can adjust this GOT entry. */ + srelgot->_raw_size += sizeof (Elf64_External_Rela); + } + } + else + local_got_refcounts[r_symndx] += 1; + } + break; + + case R_X86_64_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. */ + + /* If this is a local symbol, we resolve it directly without + 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; + break; + + case R_X86_64_32: + case R_X86_64_32S: + case R_X86_64_PC32: + if (h != NULL) + h->elf_link_hash_flags |= ELF_LINK_NON_GOT_REF; + + /* 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). We account for that + possibility below by storing information in the + pcrel_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 + && (ELF64_R_TYPE (rel->r_info) != R_X86_64_PC32 + || (h != NULL + && (! info->symbolic + || (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. */ + if (sreloc == NULL) + { + const char *name; + + 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; + + BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + && strcmp (bfd_get_section_name (abfd, sec), + name + 5) == 0); + + 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, 2)) + return false; + } + } + + sreloc->_raw_size += sizeof (Elf64_External_Rela); + + /* 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 + elf64_x86_64 linker hash table, which means that h is + really a pointer to an elf64_x86_64_link_hash_entry. */ + if (h != NULL + && ELF64_R_TYPE (rel->r_info) == R_X86_64_PC32) + { + struct elf64_x86_64_link_hash_entry *eh; + struct elf64_x86_64_pcrel_relocs_copied *p; + + eh = (struct elf64_x86_64_link_hash_entry *) h; + + for (p = eh->pcrel_relocs_copied; p != NULL; p = p->next) + if (p->section == sreloc) + break; + + if (p == NULL) + { + p = ((struct elf64_x86_64_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; + } + } + break; + } + } + + return true; +} + +/* Return the section that should be marked against GC for a given + relocation. */ + +static asection * +elf64_x86_64_gc_mark_hook (abfd, info, rel, h, sym) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + Elf_Internal_Rela *rel ATTRIBUTE_UNUSED; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; +{ + if (h != NULL) + { + switch (h->root.type) + { + case bfd_link_hash_defined: + case bfd_link_hash_defweak: + return h->root.u.def.section; + + case bfd_link_hash_common: + return h->root.u.c.p->section; + + default: + break; + } + } + else + { + if (!(elf_bad_symtab (abfd) + && ELF_ST_BIND (sym->st_info) != STB_LOCAL) + && ! ((sym->st_shndx <= 0 || sym->st_shndx >= SHN_LORESERVE) + && sym->st_shndx != SHN_COMMON)) + { + return bfd_section_from_elf_index (abfd, sym->st_shndx); + } + } + + return NULL; +} + +/* Update the got entry reference counts for the section being removed. */ + +static boolean +elf64_x86_64_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; + unsigned long r_symndx; + struct elf_link_hash_entry *h; + bfd *dynobj; + asection *sgot; + asection *srelgot; + + 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, ".rela.got"); + + relend = relocs + sec->reloc_count; + for (rel = relocs; rel < relend; rel++) + switch (ELF64_R_TYPE (rel->r_info)) + { + case R_X86_64_GOT32: + case R_X86_64_GOTPCREL: + r_symndx = ELF64_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + 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 -= GOT_ENTRY_SIZE; + srelgot->_raw_size -= sizeof (Elf64_External_Rela); + } + } + } + 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 -= GOT_ENTRY_SIZE; + if (info->shared) + srelgot->_raw_size -= sizeof (Elf64_External_Rela); + } + } + } + break; + + case R_X86_64_PLT32: + r_symndx = ELF64_R_SYM (rel->r_info); + if (r_symndx >= symtab_hdr->sh_info) + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + if (h->plt.refcount > 0) + h->plt.refcount -= 1; + } + break; + + default: + break; + } + + 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 +elf64_x86_64_adjust_dynamic_symbol (info, h) + struct bfd_link_info *info; + struct elf_link_hash_entry *h; +{ + bfd *dynobj; + 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)) + { + /* This case can occur if we saw a PLT32 reloc in an input + file, but the symbol was never referred to by a dynamic + object, or if all references were garbage collected. In + such a case, we don't actually need to build a procedure + 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_elf64_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 += GOT_ENTRY_SIZE; + + /* We also need to make an entry in the .rela.plt section. */ + s = bfd_get_section_by_name (dynobj, ".rela.plt"); + BFD_ASSERT (s != NULL); + s->_raw_size += sizeof (Elf64_External_Rela); + + return true; + } + + /* 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; + + /* 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. */ + + s = bfd_get_section_by_name (dynobj, ".dynbss"); + BFD_ASSERT (s != NULL); + + /* We must generate a R_X86_64_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) + { + asection *srel; + + srel = bfd_get_section_by_name (dynobj, ".rela.bss"); + BFD_ASSERT (srel != NULL); + srel->_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. 16-bytes is the size + of the largest type that requires hard alignment -- long double. */ + /* FIXME: This is VERY ugly. Should be fixed for all architectures using + this construct. */ + power_of_two = bfd_log2 (h->size); + if (power_of_two > 4) + power_of_two = 4; + + /* 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)) + { + if (! bfd_set_section_alignment (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; +} + +/* Set the sizes of the dynamic sections. */ + +static boolean +elf64_x86_64_size_dynamic_sections (output_bfd, info) + bfd *output_bfd; + 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); + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Set the contents of the .interp section to the interpreter. */ + if (! info->shared) + { + 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; + } + } + else + { + /* We may have created entries in the .rela.got section. + However, if we are not creating the dynamic sections, we will + not actually use these entries. Reset the size of .rela.got, + which will cause it to get stripped from the output file + below. */ + s = bfd_get_section_by_name (dynobj, ".rela.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) + elf64_x86_64_link_hash_traverse (elf64_x86_64_hash_table (info), + elf64_x86_64_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 = relocs = reltext = false; + for (s = dynobj->sections; s != NULL; s = s->next) + { + const char *name; + boolean strip; + + if ((s->flags & SEC_LINKER_CREATED) == 0) + continue; + + /* It's OK to base decisions on the section name, because none + of the dynobj section names depend upon the input files. */ + name = bfd_get_section_name (dynobj, s); + + strip = false; + if (strcmp (name, ".plt") == 0) + { + if (s->_raw_size == 0) + { + /* Strip this section if we don't need it; see the + comment below. */ + strip = true; + } + else + { + /* Remember whether there is a PLT. */ + plt = true; + } + } + else if (strncmp (name, ".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. */ + strip = true; + } + 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; + } + + /* We use the reloc_count field as a counter if we need + to copy relocs into the output file. */ + s->reloc_count = 0; + } + } + else if (strncmp (name, ".got", 4) != 0) + { + /* It's not one of our sections, so don't allocate space. */ + continue; + } + + if (strip) + { + _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_X86_64_NONE reloc instead + of garbage. */ + s->contents = (bfd_byte *) bfd_zalloc (dynobj, s->_raw_size); + if (s->contents == NULL && s->_raw_size != 0) + return false; + } + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Add some entries to the .dynamic section. We fill in the + values later, in elf64_x86_64_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. */ + if (! info->shared) + { + if (! bfd_elf64_add_dynamic_entry (info, 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)) + 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))) + return false; + } + + if (reltext) + { + if (! bfd_elf64_add_dynamic_entry (info, DT_TEXTREL, 0)) + return false; + info->flags |= DF_TEXTREL; + } + } + + return true; +} + +/* This function is called via elf64_x86_64_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. */ + +static boolean +elf64_x86_64_discard_copies (h, inf) + struct elf64_x86_64_link_hash_entry *h; + PTR inf; +{ + struct elf64_x86_64_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 (Elf64_External_Rela); + } + + return true; +} + +/* Relocate an x86_64 ELF section. */ + +static boolean +elf64_x86_64_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; +{ + bfd *dynobj; + 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 *rela; + Elf_Internal_Rela *relend; + + dynobj = elf_hash_table (info)->dynobj; + 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 = splt = sgot = NULL; + if (dynobj != NULL) + { + splt = bfd_get_section_by_name (dynobj, ".plt"); + sgot = bfd_get_section_by_name (dynobj, ".got"); + } + + rela = relocs; + relend = relocs + input_section->reloc_count; + for (; rela < relend; rela++) + { + int r_type; + reloc_howto_type *howto; + unsigned long r_symndx; + struct elf_link_hash_entry *h; + Elf_Internal_Sym *sym; + asection *sec; + bfd_vma relocation; + bfd_reloc_status_type r; + unsigned int indx; + + r_type = ELF64_R_TYPE (rela->r_info); + + if ((indx = (unsigned) r_type) >= R_X86_64_max) + { + bfd_set_error (bfd_error_bad_value); + return false; + } + howto = x86_64_elf_howto_table + indx; + + r_symndx = ELF64_R_SYM (rela->r_info); + + if (info->relocateable) + { + /* This is a relocateable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + sec = local_sections[r_symndx]; + rela->r_addend += sec->output_offset + sym->st_value; + } + } + + continue; + } + + /* This is a final link. */ + h = NULL; + sym = NULL; + sec = NULL; + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + sec = local_sections[r_symndx]; + relocation = (sec->output_section->vma + + sec->output_offset + + sym->st_value); + } + else + { + h = sym_hashes[r_symndx - symtab_hdr->sh_info]; + while (h->root.type == bfd_link_hash_indirect + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sec = h->root.u.def.section; + if (r_type == R_X86_64_GOTPCREL + || (r_type = R_X86_64_PLT32 + && splt != NULL + && h->plt.offset != (bfd_vma) -1) + || (r_type = R_X86_64_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_X86_64_8 || + r_type == R_X86_64_16 || + r_type == R_X86_64_32 || + r_type == R_X86_64_64 || + r_type == R_X86_64_PC16 || + r_type == R_X86_64_PC32) + && ((input_section->flags & SEC_ALLOC) != 0 + /* DWARF will emit R_X86_64_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; + } + 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 && !info->no_undefined + && ELF_ST_VISIBILITY (h->other) == STV_DEFAULT) + relocation = 0; + else + { + if (! ((*info->callbacks->undefined_symbol) + (info, h->root.root.string, input_bfd, + input_section, rela->r_offset, + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) + return false; + relocation = 0; + } + } + + /* When generating a shared object, the relocations handled here are + copied into the output file to be resolved at run time. */ + switch (r_type) + { + case R_X86_64_GOT32: + /* Relocation is to the entry for this symbol in the global + offset table. */ + BFD_ASSERT (sgot != NULL); + + if (h != NULL) + { + bfd_vma off = h->got.offset; + BFD_ASSERT (off != (bfd_vma) -1); + + 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))) + { + /* 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 .rela.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, + sgot->contents + off); + h->got.offset |= 1; + } + } + relocation = sgot->output_offset + off; + } + else + { + bfd_vma off; + + BFD_ASSERT (local_got_offsets != NULL + && local_got_offsets[r_symndx] != (bfd_vma) -1); + + 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 generated the necessary reloc. */ + if ((off & 1) != 0) + off &= ~1; + else + { + bfd_put_64 (output_bfd, relocation, sgot->contents + off); + + if (info->shared) + { + asection *srelgot; + Elf_Internal_Rela outrel; + + /* We need to generate a R_X86_64_RELATIVE reloc + for the dynamic linker. */ + srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); + BFD_ASSERT (srelgot != NULL); + + outrel.r_offset = (sgot->output_section->vma + + sgot->output_offset + + off); + outrel.r_info = ELF64_R_INFO (0, R_X86_64_RELATIVE); + outrel.r_addend = relocation; + bfd_elf64_swap_reloca_out (output_bfd, &outrel, + (((Elf64_External_Rela *) + srelgot->contents) + + srelgot->reloc_count)); + ++srelgot->reloc_count; + } + + local_got_offsets[r_symndx] |= 1; + } + + relocation = sgot->output_offset + off; + } + + break; + + case R_X86_64_GOTPCREL: + /* Use global offset table as symbol value. */ + + BFD_ASSERT (sgot != NULL); + if (h != NULL) + { + bfd_vma off = h->got.offset; + BFD_ASSERT (off != (bfd_vma) -1); + + 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))) + { + /* 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 .rela.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, + sgot->contents + off); + h->got.offset |= 1; + } + } + relocation = sgot->output_offset + off; + } + else + { + bfd_vma off; + + BFD_ASSERT (local_got_offsets != NULL + && local_got_offsets[r_symndx] != (bfd_vma) -1); + + 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 generated the necessary reloc. */ + if ((off & 1) != 0) + off &= ~1; + else + { + bfd_put_64 (output_bfd, relocation, sgot->contents + off); + + if (info->shared) + { + asection *srelgot; + Elf_Internal_Rela outrel; + + /* We need to generate a R_X86_64_RELATIVE reloc + for the dynamic linker. */ + srelgot = bfd_get_section_by_name (dynobj, ".rela.got"); + BFD_ASSERT (srelgot != NULL); + + outrel.r_offset = (sgot->output_section->vma + + sgot->output_offset + + off); + outrel.r_info = ELF64_R_INFO (0, R_X86_64_RELATIVE); + outrel.r_addend = relocation; + bfd_elf64_swap_reloca_out (output_bfd, &outrel, + (((Elf64_External_Rela *) + srelgot->contents) + + srelgot->reloc_count)); + ++srelgot->reloc_count; + } + + local_got_offsets[r_symndx] |= 1; + } + + relocation = sgot->output_section->vma + off; + } + break; + + case R_X86_64_PLT32: + /* Relocation is to the entry for this symbol in the + procedure linkage table. */ + + /* Resolve a PLT32 reloc against a local symbol directly, + without using the procedure linkage table. */ + if (h == NULL) + break; + + if (h->plt.offset == (bfd_vma) -1 || 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 = (splt->output_section->vma + + splt->output_offset + + h->plt.offset); + break; + + case R_X86_64_8: + case R_X86_64_16: + case R_X86_64_32: + case R_X86_64_PC8: + case R_X86_64_PC16: + case R_X86_64_PC32: + /* 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 + && ((r_type != R_X86_64_PC8 && r_type != R_X86_64_PC16 + && r_type != R_X86_64_PC32) + || (h != NULL + && h->dynindx != -1 + && (! info->symbolic + || (h->elf_link_hash_flags + & ELF_LINK_HASH_DEF_REGULAR) == 0)))) + { + Elf_Internal_Rela outrel; + boolean skip, relocate; + + /* 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; + + BFD_ASSERT (strncmp (name, ".rela", 5) == 0 + && strcmp (bfd_get_section_name (input_bfd, + input_section), + name + 5) == 0); + + 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 = 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 += (input_section->output_section->vma + + input_section->output_offset); + + if (skip) + { + memset (&outrel, 0, sizeof outrel); + relocate = false; + } + else if ((r_type == R_X86_64_PC8) || (r_type == R_X86_64_PC16) + || (r_type == R_X86_64_PC32)) + { + BFD_ASSERT (h != NULL && h->dynindx != -1); + relocate = false; + outrel.r_info = ELF64_R_INFO (h->dynindx, r_type); + outrel.r_addend = relocation + rela->r_addend; + } + 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 = ELF64_R_INFO (0, R_X86_64_RELATIVE); + outrel.r_addend = relocation + rela->r_addend; + } + else + { + BFD_ASSERT (h->dynindx != -1); + relocate = false; + outrel.r_info = ELF64_R_INFO (h->dynindx, R_X86_64_32); + outrel.r_addend = relocation + rela->r_addend; + } + } + + bfd_elf64_swap_reloca_out (output_bfd, &outrel, + (((Elf64_External_Rela *) + sreloc->contents) + + sreloc->reloc_count)); + ++sreloc->reloc_count; + + /* If this reloc is against an external symbol, we do + not want to fiddle with the addend. Otherwise, we + need to include the symbol value so that it becomes + an addend for the dynamic reloc. */ + if (! relocate) + continue; + } + + break; + + default: + break; + } + + r = _bfd_final_link_relocate (howto, input_bfd, input_section, + contents, rela->r_offset, + relocation, rela->r_addend); + + if (r != bfd_reloc_ok) + { + switch (r) + { + 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, rela->r_offset))) + return false; + } + break; + } + } + } + + return true; +} + +/* Finish up dynamic symbol handling. We set the contents of various + dynamic sections here. */ + +static boolean +elf64_x86_64_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; +{ + bfd *dynobj; + + dynobj = elf_hash_table (info)->dynobj; + + if (h->plt.offset != (bfd_vma) -1) + { + asection *splt; + asection *sgot; + asection *srela; + bfd_vma plt_index; + bfd_vma got_offset; + Elf_Internal_Rela rela; + + /* 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"); + srela = bfd_get_section_by_name (dynobj, ".rela.plt"); + BFD_ASSERT (splt != NULL && sgot != NULL && srela != NULL); + + /* Get the index in the procedure linkage table which + corresponds to this symbol. This is the index of this symbol + in all the symbols for which we are making plt entries. The + first entry in the procedure linkage table is reserved. */ + plt_index = h->plt.offset / PLT_ENTRY_SIZE - 1; + + /* Get the offset into the .got table of the entry that + corresponds to this function. Each .got entry is GOT_ENTRY_SIZE + bytes. The first three are reserved. */ + got_offset = (plt_index + 3) * GOT_ENTRY_SIZE; + + /* Fill in the entry in the procedure linkage table. */ + memcpy (splt->contents + h->plt.offset, elf64_x86_64_plt_entry, + PLT_ENTRY_SIZE); + + /* Insert the relocation positions of the plt section. The magic + numbers at the end of the statements are the positions of the + relocations in the plt section. */ + bfd_put_64 (output_bfd, got_offset, splt->contents + h->plt.offset + 2); + bfd_put_64 (output_bfd, plt_index * sizeof (Elf64_External_Rela), + splt->contents + h->plt.offset + 7); + bfd_put_64 (output_bfd, - (h->plt.offset + PLT_ENTRY_SIZE), + splt->contents + h->plt.offset + 12); + + /* Fill in the entry in the global offset table. */ + bfd_put_64 (output_bfd, (splt->output_section->vma + splt->output_offset + + h->plt.offset + 6), + sgot->contents + got_offset); + + /* Fill in the entry in the .rela.plt section. */ + rela.r_offset = (sgot->output_section->vma + + sgot->output_offset + + got_offset); + rela.r_info = ELF64_R_INFO (h->dynindx, R_X86_64_JUMP_SLOT); + rela.r_addend = 0; + bfd_elf64_swap_reloca_out (output_bfd, &rela, + ((Elf64_External_Rela *) srela->contents + + plt_index)); + + 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. */ + sym->st_shndx = SHN_UNDEF; + /* If the symbol is weak, we do need to clear the value. + Otherwise, the PLT entry would provide a definition for + the symbol even if the symbol wasn't defined anywhere, + and so the symbol would never be NULL. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_REF_REGULAR_NONWEAK) + == 0) + sym->st_value = 0; + } + } + + if ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_COPY) != 0) + { + asection *s; + Elf_Internal_Rela rela; + + /* 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, + ".rela.bss"); + BFD_ASSERT (s != NULL); + + 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_X86_64_COPY); + rela.r_addend = 0; + bfd_elf64_swap_reloca_out (output_bfd, &rela, + ((Elf64_External_Rela *) s->contents + + s->reloc_count)); + ++s->reloc_count; + } + + /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute. */ + if (strcmp (h->root.root.string, "_DYNAMIC") == 0 + || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0) + sym->st_shndx = SHN_ABS; + + return true; +} + +/* Finish up the dynamic sections. */ + +static boolean +elf64_x86_64_finish_dynamic_sections (output_bfd, info) + bfd *output_bfd; + struct bfd_link_info *info; +{ + bfd *dynobj; + asection *sdyn; + asection *sgot; + + dynobj = elf_hash_table (info)->dynobj; + + sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + + if (elf_hash_table (info)->dynamic_sections_created) + { + asection *splt; + Elf64_External_Dyn *dyncon, *dynconend; + + BFD_ASSERT (sdyn != NULL); + + dyncon = (Elf64_External_Dyn *) sdyn->contents; + dynconend = (Elf64_External_Dyn *) (sdyn->contents + sdyn->_raw_size); + for (; dyncon < dynconend; dyncon++) + { + Elf_Internal_Dyn dyn; + const char *name; + asection *s; + + bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn); + + switch (dyn.d_tag) + { + default: + break; + + case DT_PLTGOT: + name = ".got"; + goto get_vma; + + case DT_JMPREL: + name = ".rela.plt"; + + get_vma: + s = bfd_get_section_by_name (output_bfd, name); + BFD_ASSERT (s != NULL); + dyn.d_un.d_ptr = s->vma; + break; + + case DT_RELASZ: + /* FIXME: This comment and code is from elf64-alpha.c: */ + /* My interpretation of the TIS v1.1 ELF document indicates + that RELASZ should not include JMPREL. This is not what + the rest of the BFD does. It is, however, what the + glibc ld.so wants. Do this fixup here until we found + out who is right. */ + s = bfd_get_section_by_name (output_bfd, ".rela.plt"); + if (s) + { + /* Subtract JMPREL size from RELASZ. */ + dyn.d_un.d_val -= + (s->_cooked_size ? s->_cooked_size : s->_raw_size); + } + break; + + case DT_PLTRELSZ: + s = bfd_get_section_by_name (output_bfd, ".rela.plt"); + BFD_ASSERT (s != NULL); + dyn.d_un.d_val = + (s->_cooked_size != 0 ? s->_cooked_size : s->_raw_size); + break; + } + + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + } + + /* Initialize the contents of the .plt section. */ + splt = bfd_get_section_by_name (dynobj, ".plt"); + BFD_ASSERT (splt != NULL); + if (splt->_raw_size > 0) + { + memcpy (splt->contents, elf64_x86_64_plt0_entry, PLT_ENTRY_SIZE); + } + + elf_section_data (splt->output_section)->this_hdr.sh_entsize = + PLT_ENTRY_SIZE; + } + + /* Set the first entry in the global offset table to the address of + the dynamic section. */ + sgot = bfd_get_section_by_name (dynobj, ".got.plt"); + BFD_ASSERT (sgot != NULL); + if (sgot->_raw_size > 0) + { + if (sdyn == NULL) + bfd_put_64 (output_bfd, (bfd_vma) 0, sgot->contents); + else + bfd_put_64 (output_bfd, + sdyn->output_section->vma + sdyn->output_offset, + sgot->contents); + /* Write GOT[1] and GOT[2], needed for the linker. */ + bfd_put_64 (output_bfd, (bfd_vma) 0, sgot->contents + GOT_ENTRY_SIZE); + bfd_put_64 (output_bfd, (bfd_vma) 0, sgot->contents + GOT_ENTRY_SIZE*2); + } + + elf_section_data (sgot->output_section)->this_hdr.sh_entsize = + GOT_ENTRY_SIZE; + + return true; +} + +/* + * Why was the hash table entry size definition changed from + * ARCH_SIZE/8 to 4? This breaks the 64 bit dynamic linker and + * this is the only reason for the elf64_x86_64_size_info structure. + */ + +const struct elf_size_info elf64_86_64_size_info = +{ + sizeof (Elf64_External_Ehdr), + sizeof (Elf64_External_Phdr), + sizeof (Elf64_External_Shdr), + sizeof (Elf64_External_Rel), + sizeof (Elf64_External_Rela), + sizeof (Elf64_External_Sym), + sizeof (Elf64_External_Dyn), + sizeof (Elf_External_Note), + 8, /* hash-table entry size */ + 1, /* internal relocations per external relocations */ + 64, /* arch_size */ + 8, /* file_align */ + ELFCLASS64, EV_CURRENT, + bfd_elf64_write_out_phdrs, + bfd_elf64_write_shdrs_and_ehdr, + bfd_elf64_write_relocs, + bfd_elf64_swap_symbol_out, + bfd_elf64_slurp_reloc_table, + bfd_elf64_slurp_symbol_table, + bfd_elf64_swap_dyn_in, + bfd_elf64_swap_dyn_out, + NULL, + NULL, + NULL, + NULL +}; + +#define TARGET_LITTLE_SYM bfd_elf64_x86_64_vec +#define TARGET_LITTLE_NAME "elf64-x86-64" +#define ELF_ARCH bfd_arch_i386 +#define ELF_MACHINE_CODE EM_X86_64 +#define ELF_MAXPAGESIZE 0x100000 + +#define elf_backend_size_info elf64_86_64_size_info + +#define elf_backend_can_gc_sections 1 +#define elf_backend_want_got_plt 1 +#define elf_backend_plt_readonly 1 +#define elf_backend_want_plt_sym 0 +#define elf_backend_got_header_size (GOT_ENTRY_SIZE*3) +#define elf_backend_plt_header_size PLT_ENTRY_SIZE + +#define elf_info_to_howto elf64_x86_64_info_to_howto + +#define bfd_elf64_bfd_final_link _bfd_elf64_gc_common_final_link +#define bfd_elf64_bfd_link_hash_table_create \ + elf64_x86_64_link_hash_table_create +#define bfd_elf64_bfd_reloc_type_lookup elf64_x86_64_reloc_type_lookup + +#define elf_backend_adjust_dynamic_symbol elf64_x86_64_adjust_dynamic_symbol +#define elf_backend_check_relocs elf64_x86_64_check_relocs +#define elf_backend_create_dynamic_sections _bfd_elf_create_dynamic_sections +#define elf_backend_finish_dynamic_sections \ + elf64_x86_64_finish_dynamic_sections +#define elf_backend_finish_dynamic_symbol elf64_x86_64_finish_dynamic_symbol +#define elf_backend_gc_mark_hook elf64_x86_64_gc_mark_hook +#define elf_backend_gc_sweep_hook elf64_x86_64_gc_sweep_hook +#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 + +#include "elf64-target.h" diff --git a/gnu/dist/toolchain/bfd/elfarm-nabi.c b/gnu/dist/toolchain/bfd/elfarm-nabi.c index 38778b73be3a..55e1f03d9101 100644 --- a/gnu/dist/toolchain/bfd/elfarm-nabi.c +++ b/gnu/dist/toolchain/bfd/elfarm-nabi.c @@ -43,6 +43,10 @@ static reloc_howto_type * elf32_arm_reloc_type_lookup PARAMS ((bfd * abfd, bfd_reloc_code_real_type code)); +/* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g. + R_ARM_PC24 as an index into this, and find the R_ARM_PC24 HOWTO + in that slot. */ + static reloc_howto_type elf32_arm_howto_table[] = { /* No relocation */ @@ -262,36 +266,36 @@ static reloc_howto_type elf32_arm_howto_table[] = 0x00000000, /* dst_mask */ false), /* pcrel_offset */ - /* These next two relocs are defined, but I do not know what they do. */ - + /* BLX instruction for the ARM. */ HOWTO (R_ARM_XPC25, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 25, /* bitsize */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_XPC25", /* name */ false, /* partial_inplace */ - 0x00000000, /* src_mask */ - 0x00000000, /* dst_mask */ - false), /* pcrel_offset */ + 0x00ffffff, /* src_mask */ + 0x00ffffff, /* dst_mask */ + true), /* pcrel_offset */ + /* BLX instruction for the Thumb. */ HOWTO (R_ARM_THM_XPC22, /* type */ - 0, /* rightshift */ - 0, /* size (0 = byte, 1 = short, 2 = long) */ - 0, /* bitsize */ - false, /* pc_relative */ + 2, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 22, /* bitsize */ + true, /* pc_relative */ 0, /* bitpos */ complain_overflow_signed,/* complain_on_overflow */ bfd_elf_generic_reloc, /* special_function */ "R_ARM_THM_XPC22", /* name */ false, /* partial_inplace */ - 0x00000000, /* src_mask */ - 0x00000000, /* dst_mask */ - false), /* pcrel_offset */ - + 0x07ff07ff, /* src_mask */ + 0x07ff07ff, /* dst_mask */ + true), /* pcrel_offset */ + /* These next three relocs are not defined, but we need to fill the space. */ HOWTO (R_ARM_NONE, /* type */ @@ -337,7 +341,7 @@ static reloc_howto_type elf32_arm_howto_table[] = false), /* pcrel_offset */ /* Relocs used in ARM Linux */ - + HOWTO (R_ARM_COPY, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -365,7 +369,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (R_ARM_JUMP_SLOT, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -379,7 +383,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (R_ARM_RELATIVE, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -393,7 +397,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (R_ARM_GOTOFF, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -407,7 +411,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (R_ARM_GOTPC, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -421,7 +425,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ true), /* pcrel_offset */ - + HOWTO (R_ARM_GOT32, /* type */ 0, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -435,7 +439,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0xffffffff, /* src_mask */ 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + HOWTO (R_ARM_PLT32, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -449,8 +453,8 @@ static reloc_howto_type elf32_arm_howto_table[] = 0x00ffffff, /* src_mask */ 0x00ffffff, /* dst_mask */ true), /* pcrel_offset */ - - /* End of relocs used in ARM Linux */ + + /* End of relocs used in ARM Linux */ HOWTO (R_ARM_RREL32, /* type */ 0, /* rightshift */ @@ -574,7 +578,6 @@ static reloc_howto_type elf32_arm_thm_pc9_howto = 0x000000ff, /* dst_mask */ true); /* pcrel_offset */ - static void elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) bfd * abfd ATTRIBUTE_UNUSED; @@ -582,7 +585,7 @@ elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) Elf32_Internal_Rel * elf_reloc; { unsigned int r_type; - + r_type = ELF32_R_TYPE (elf_reloc->r_info); switch (r_type) @@ -590,19 +593,19 @@ elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) case R_ARM_GNU_VTINHERIT: bfd_reloc->howto = & elf32_arm_vtinherit_howto; break; - + case R_ARM_GNU_VTENTRY: bfd_reloc->howto = & elf32_arm_vtentry_howto; break; - + case R_ARM_THM_PC11: bfd_reloc->howto = & elf32_arm_thm_pc11_howto; break; - + case R_ARM_THM_PC9: bfd_reloc->howto = & elf32_arm_thm_pc9_howto; break; - + default: if (r_type >= NUM_ELEM (elf32_arm_howto_table)) bfd_reloc->howto = NULL; @@ -611,7 +614,7 @@ elf32_arm_info_to_howto (abfd, bfd_reloc, elf_reloc) break; } } - + struct elf32_arm_reloc_map { bfd_reloc_code_real_type bfd_reloc_val; @@ -622,6 +625,8 @@ 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}, @@ -664,7 +669,7 @@ elf32_arm_reloc_type_lookup (abfd, code) for (i = 0; i < NUM_ELEM (elf32_arm_reloc_map); i ++) if (elf32_arm_reloc_map[i].bfd_reloc_val == code) return & elf32_arm_howto_table[elf32_arm_reloc_map[i].elf_reloc_val]; - + return NULL; } } diff --git a/gnu/dist/toolchain/bfd/elfarm-oabi.c b/gnu/dist/toolchain/bfd/elfarm-oabi.c index 72f62f238095..e49ea9c40d4b 100644 --- a/gnu/dist/toolchain/bfd/elfarm-oabi.c +++ b/gnu/dist/toolchain/bfd/elfarm-oabi.c @@ -1,5 +1,5 @@ /* 32-bit ELF support for ARM old abi option. - Copyright 1999 Free Software Foundation, Inc. + Copyright 1999, 2000 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -17,7 +17,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "elf/arm-oabi.h" +#define OLD_ARM_ABI + +#include "elf/arm.h" #include "bfd.h" #include "sysdep.h" #include "libbfd.h" @@ -263,7 +265,7 @@ static reloc_howto_type elf32_arm_howto_table[] = false), /* pcrel_offset */ /* XXX - gap in index numbering here. */ - + HOWTO (R_ARM_PLT32, /* type */ 2, /* rightshift */ 2, /* size (0 = byte, 1 = short, 2 = long) */ @@ -277,7 +279,7 @@ static reloc_howto_type elf32_arm_howto_table[] = 0x00ffffff, /* src_mask */ 0x00ffffff, /* dst_mask */ true), /* pcrel_offset */ - + /* XXX - gap in index numbering here. */ HOWTO (R_ARM_RREL32, /* type */ @@ -344,7 +346,7 @@ find_howto (r_type) unsigned int r_type; { int i; - + for (i = NUM_ELEM (elf32_arm_howto_table); i--;) if (elf32_arm_howto_table [i].type == r_type) return elf32_arm_howto_table + i; @@ -388,7 +390,7 @@ static const struct elf32_arm_reloc_map elf32_arm_reloc_map[] = {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_THUMB_PCREL_BRANCH9, R_ARM_THM_PC9 }, {BFD_RELOC_VTABLE_INHERIT, R_ARM_GNU_VTINHERIT }, {BFD_RELOC_VTABLE_ENTRY, R_ARM_GNU_VTENTRY } }; @@ -406,7 +408,7 @@ elf32_arm_reloc_type_lookup (abfd, code) if (code == BFD_RELOC_ARM_PLT32) return find_howto (R_ARM_PLT32); - + return NULL; } diff --git a/gnu/dist/toolchain/bfd/elfcode.h b/gnu/dist/toolchain/bfd/elfcode.h index c5edf9b82507..1a5f63a6b1a1 100644 --- a/gnu/dist/toolchain/bfd/elfcode.h +++ b/gnu/dist/toolchain/bfd/elfcode.h @@ -1,6 +1,6 @@ /* ELF executable support for BFD. - Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 1999 Free Software - Foundation, Inc. + Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 1999, 2000 Free + Software Foundation, Inc. Written by Fred Fish @ Cygnus Support, from information published in "UNIX System V Release 4, Programmers Guide: ANSI C and @@ -118,6 +118,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define elf_add_dynamic_entry NAME(bfd_elf,add_dynamic_entry) #define elf_write_shdrs_and_ehdr NAME(bfd_elf,write_shdrs_and_ehdr) #define elf_write_out_phdrs NAME(bfd_elf,write_out_phdrs) +#define elf_write_relocs NAME(bfd_elf,write_relocs) +#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_link_record_dynamic_symbol _bfd_elf_link_record_dynamic_symbol @@ -165,13 +167,9 @@ static void elf_swap_shdr_out #define section_from_elf_index bfd_section_from_elf_index -static boolean elf_slurp_reloc_table_from_section +static boolean elf_slurp_reloc_table_from_section PARAMS ((bfd *, asection *, Elf_Internal_Shdr *, bfd_size_type, arelent *, asymbol **, boolean)); -static boolean elf_slurp_reloc_table - PARAMS ((bfd *, asection *, asymbol **, boolean)); - -static void write_relocs PARAMS ((bfd *, asection *, PTR)); static boolean elf_file_p PARAMS ((Elf_External_Ehdr *)); @@ -199,7 +197,7 @@ static char *elf_symbol_flags PARAMS ((flagword)); #endif /* Translate an ELF symbol in external format into an ELF symbol in internal - format. */ + format. */ void elf_swap_symbol_in (abfd, src, dst) @@ -221,7 +219,7 @@ elf_swap_symbol_in (abfd, src, dst) } /* Translate an ELF symbol in internal format into an ELF symbol in external - format. */ + format. */ void elf_swap_symbol_out (abfd, src, cdst) @@ -238,9 +236,8 @@ elf_swap_symbol_out (abfd, src, cdst) bfd_h_put_16 (abfd, src->st_shndx, dst->st_shndx); } - /* Translate an ELF file header in external format into an ELF file header in - internal format. */ + internal format. */ static void elf_swap_ehdr_in (abfd, src, dst) @@ -248,11 +245,15 @@ elf_swap_ehdr_in (abfd, src, dst) const Elf_External_Ehdr *src; Elf_Internal_Ehdr *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_entry = get_word (abfd, (bfd_byte *) src->e_entry); + if (signed_vma) + dst->e_entry = get_signed_word (abfd, (bfd_byte *) 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); @@ -265,7 +266,7 @@ elf_swap_ehdr_in (abfd, src, dst) } /* Translate an ELF file header in internal format into an ELF file header in - external format. */ + external format. */ static void elf_swap_ehdr_out (abfd, src, dst) @@ -273,12 +274,16 @@ elf_swap_ehdr_out (abfd, src, dst) const Elf_Internal_Ehdr *src; Elf_External_Ehdr *dst; { + 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... */ + /* 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); - put_word (abfd, src->e_entry, dst->e_entry); + if (signed_vma) + 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); @@ -290,9 +295,8 @@ elf_swap_ehdr_out (abfd, src, dst) bfd_h_put_16 (abfd, src->e_shstrndx, dst->e_shstrndx); } - /* Translate an ELF section header table entry in external format into an - ELF section header table entry in internal format. */ + ELF section header table entry in internal format. */ static void elf_swap_shdr_in (abfd, src, dst) @@ -320,7 +324,7 @@ elf_swap_shdr_in (abfd, src, dst) } /* Translate an ELF section header table entry in internal format into an - ELF section header table entry in external format. */ + ELF section header table entry in external format. */ static void elf_swap_shdr_out (abfd, src, dst) @@ -328,7 +332,7 @@ elf_swap_shdr_out (abfd, src, dst) const Elf_Internal_Shdr *src; Elf_External_Shdr *dst; { - /* note that all elements of dst are *arrays of unsigned char* already... */ + /* 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); @@ -341,9 +345,8 @@ elf_swap_shdr_out (abfd, src, dst) put_word (abfd, src->sh_entsize, dst->sh_entsize); } - /* Translate an ELF program header table entry in external format into an - ELF program header table entry in internal format. */ + ELF program header table entry in internal format. */ void elf_swap_phdr_in (abfd, src, dst) @@ -377,7 +380,7 @@ elf_swap_phdr_out (abfd, src, dst) const Elf_Internal_Phdr *src; Elf_External_Phdr *dst; { - /* note that all elements of dst are *arrays of unsigned char* already... */ + /* 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); @@ -388,7 +391,7 @@ elf_swap_phdr_out (abfd, src, dst) put_word (abfd, src->p_align, dst->p_align); } -/* Translate an ELF reloc from external format to internal format. */ +/* Translate an ELF reloc from external format to internal format. */ INLINE void elf_swap_reloc_in (abfd, src, dst) bfd *abfd; @@ -410,7 +413,7 @@ elf_swap_reloca_in (abfd, src, dst) dst->r_addend = get_signed_word (abfd, (bfd_byte *) src->r_addend); } -/* Translate an ELF reloc from internal format to external format. */ +/* Translate an ELF reloc from internal format to external format. */ INLINE void elf_swap_reloc_out (abfd, src, dst) bfd *abfd; @@ -458,7 +461,6 @@ elf_swap_dyn_out (abfd, src, p) /* ELF .o/exec file reading */ - /* Begin processing a given object. First we validate the file by reading in the ELF header and checking @@ -494,9 +496,18 @@ elf_object_p (abfd) 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 elf_obj_tdata *new_tdata = NULL; asection *s; + /* 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; + /* Read in the ELF header in external format. */ if (bfd_read ((PTR) & x_ehdr, sizeof (x_ehdr), 1, abfd) != sizeof (x_ehdr)) @@ -511,7 +522,7 @@ elf_object_p (abfd) make use of. The magic number must match, the address size ('class') and byte-swapping must match our XVEC entry, and it must have a section header table (FIXME: See comments re sections at top of this - file). */ + file). */ if ((elf_file_p (&x_ehdr) == false) || (x_ehdr.e_ident[EI_VERSION] != EV_CURRENT) || @@ -554,13 +565,13 @@ 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 there is no section header table, we're hosed. */ if (i_ehdrp->e_shoff == 0) 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. */ + recorded in the file. */ if (i_ehdrp->e_shentsize != sizeof (x_shdr)) goto got_wrong_format_error; @@ -614,8 +625,8 @@ elf_object_p (abfd) goto got_no_match; } - /* Remember the entry point specified in the ELF file header. */ - bfd_get_start_address (abfd) = i_ehdrp->e_entry; + /* 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, @@ -680,7 +691,7 @@ elf_object_p (abfd) } /* Read in the string table containing the names of the sections. We - will need the base pointer to this table later. */ + will need the base pointer to this table later. */ /* We read this inline now, so that we don't have to go through bfd_section_from_shdr with it (since this particular strtab is used to find all of the ELF section names.) */ @@ -729,6 +740,16 @@ elf_object_p (abfd) return (abfd->xvec); got_wrong_format_error: + /* 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_default_set_arch_mach (abfd, previous_arch, previous_mach); bfd_set_error (bfd_error_wrong_format); got_no_match: if (new_tdata != NULL @@ -739,6 +760,8 @@ elf_object_p (abfd) 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); } @@ -746,8 +769,8 @@ elf_object_p (abfd) /* Write out the relocs. */ -static void -write_relocs (abfd, sec, data) +void +elf_write_relocs (abfd, sec, data) bfd *abfd; asection *sec; PTR data; @@ -795,7 +818,7 @@ write_relocs (abfd, sec, data) SHT_REL section. */ abort (); - /* orelocation has the data, reloc_count has the count... */ + /* orelocation has the data, reloc_count has the count... */ if (use_rela_p) { outbound_relocas = (Elf_External_Rela *) rela_hdr->contents; @@ -941,7 +964,7 @@ elf_write_shdrs_and_ehdr (abfd) i_ehdrp = elf_elfheader (abfd); i_shdrp = elf_elfsections (abfd); - /* swap the header before spitting it out... */ + /* swap the header before spitting it out... */ #if DEBUG & 1 elf_debug_file (i_ehdrp); @@ -952,7 +975,7 @@ elf_write_shdrs_and_ehdr (abfd) != sizeof (x_ehdr))) return false; - /* at this point we've concocted all the ELF sections... */ + /* 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)); if (!x_shdrp) @@ -970,7 +993,7 @@ elf_write_shdrs_and_ehdr (abfd) != sizeof (*x_shdrp) * i_ehdrp->e_shnum)) return false; - /* need to dump the string table too... */ + /* need to dump the string table too... */ return true; } @@ -998,7 +1021,7 @@ elf_slurp_symbol_table (abfd, symptrs, dynamic) based on a one-to-one mapping of the ELF symbols to canonical symbols. We actually use all the ELF symbols, so there will be no space left over at the end. When we have all the symbols, we - build the caller's pointer vector. */ + build the caller's pointer vector. */ if (! dynamic) { @@ -1226,7 +1249,7 @@ error_return: return -1; } -/* Read relocations for ASECT from REL_HDR. There are RELOC_COUNT of +/* Read relocations for ASECT from REL_HDR. There are RELOC_COUNT of them. */ static boolean @@ -1325,7 +1348,7 @@ elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr, reloc_count, /* Read in and swap the external relocs. */ -static boolean +boolean elf_slurp_reloc_table (abfd, asect, symbols, dynamic) bfd *abfd; asection *asect; @@ -1351,7 +1374,7 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic) rel_hdr = &d->rel_hdr; reloc_count = rel_hdr->sh_size / rel_hdr->sh_entsize; rel_hdr2 = d->rel_hdr2; - reloc_count2 = (rel_hdr2 + reloc_count2 = (rel_hdr2 ? (rel_hdr2->sh_size / rel_hdr2->sh_entsize) : 0); @@ -1375,8 +1398,8 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic) reloc_count2 = 0; } - relents = ((arelent *) - bfd_alloc (abfd, + relents = ((arelent *) + bfd_alloc (abfd, (reloc_count + reloc_count2) * sizeof (arelent))); if (relents == NULL) return false; @@ -1386,15 +1409,14 @@ elf_slurp_reloc_table (abfd, asect, symbols, dynamic) relents, symbols, dynamic)) return false; - - if (rel_hdr2 + + if (rel_hdr2 && !elf_slurp_reloc_table_from_section (abfd, asect, rel_hdr2, reloc_count2, relents + reloc_count, symbols, dynamic)) return false; - asect->relocation = relents; return true; } @@ -1527,13 +1549,13 @@ const struct elf_size_info NAME(_bfd_elf,size_info) = { sizeof (Elf_External_Sym), sizeof (Elf_External_Dyn), sizeof (Elf_External_Note), - ARCH_SIZE / 8, + 4, 1, ARCH_SIZE, FILE_ALIGN, ELFCLASS, EV_CURRENT, elf_write_out_phdrs, elf_write_shdrs_and_ehdr, - write_relocs, + elf_write_relocs, elf_swap_symbol_out, elf_slurp_reloc_table, elf_slurp_symbol_table, diff --git a/gnu/dist/toolchain/bfd/elfcore.h b/gnu/dist/toolchain/bfd/elfcore.h index e4454aac9d0f..2c99e8b45404 100644 --- a/gnu/dist/toolchain/bfd/elfcore.h +++ b/gnu/dist/toolchain/bfd/elfcore.h @@ -17,7 +17,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. */ - char* elf_core_file_failing_command (abfd) bfd *abfd; @@ -32,7 +31,6 @@ elf_core_file_failing_signal (abfd) return elf_tdata (abfd)->core_signal; } - boolean elf_core_file_matches_executable_p (core_bfd, exec_bfd) bfd *core_bfd; @@ -40,7 +38,7 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd) { char* corename; - /* xvecs must match if both are ELF files for the same target. */ + /* xvecs must match if both are ELF files for the same target. */ if (core_bfd->xvec != exec_bfd->xvec) { @@ -48,7 +46,7 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd) return false; } - /* See if the name in the corefile matches the executable name. */ + /* See if the name in the corefile matches the executable name. */ corename = elf_tdata (core_bfd)->core_program; if (corename != NULL) @@ -63,7 +61,6 @@ elf_core_file_matches_executable_p (core_bfd, exec_bfd) return true; } - /* Core files are simply standard ELF formatted files that partition the file using the execution view of the file (program header table) rather than the linking view. In fact, there is no section header @@ -83,9 +80,11 @@ 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; /* Elf program header, internal form */ + Elf_Internal_Phdr *i_phdrp = NULL; /* Elf program header, internal form */ unsigned int phindex; struct elf_backend_data *ebd; + struct elf_obj_tdata *preserved_tdata = elf_tdata (abfd); + struct elf_obj_tdata *new_tdata = NULL; /* Read in the ELF header in external format. */ if (bfd_read ((PTR) & x_ehdr, sizeof (x_ehdr), 1, abfd) != sizeof (x_ehdr)) @@ -95,21 +94,17 @@ elf_core_file_p (abfd) return NULL; } - /* Check the magic number. */ + /* Check the magic number. */ if (elf_file_p (&x_ehdr) == false) - { - wrong: - bfd_set_error (bfd_error_wrong_format); - return NULL; - } + goto wrong; /* FIXME: Check EI_VERSION here ! */ - /* Check the address size ("class"). */ + /* Check the address size ("class"). */ if (x_ehdr.e_ident[EI_CLASS] != ELFCLASS) goto wrong; - /* Check the byteorder. */ + /* Check the byteorder. */ switch (x_ehdr.e_ident[EI_DATA]) { case ELFDATA2MSB: /* Big-endian */ @@ -124,15 +119,14 @@ elf_core_file_p (abfd) goto wrong; } - /* Give abfd an elf_obj_tdata. */ - elf_tdata (abfd) = + /* Give abfd an elf_obj_tdata. */ + new_tdata = (struct elf_obj_tdata *) bfd_zalloc (abfd, sizeof (struct elf_obj_tdata)); - if (elf_tdata (abfd) == NULL) + if (new_tdata == NULL) return NULL; + elf_tdata (abfd) = new_tdata; - /* FIXME: from here on down, "goto wrong" will leak memory. */ - - /* Swap in the rest of the header, now that we have the byte order. */ + /* 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); @@ -176,7 +170,7 @@ elf_core_file_p (abfd) } /* If there is no program header, or the type is not a core file, then - we are hosed. */ + we are hosed. */ if (i_ehdrp->e_phoff == 0 || i_ehdrp->e_type != ET_CORE) goto wrong; @@ -185,42 +179,64 @@ elf_core_file_p (abfd) if (i_ehdrp->e_phentsize != sizeof (Elf_External_Phdr)) goto wrong; - /* Allocate space for the program headers. */ + /* Move to the start of the program headers. */ + if (bfd_seek (abfd, 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); if (!i_phdrp) - return NULL; + goto fail; elf_tdata (abfd)->phdr = i_phdrp; - /* Read and convert to internal form. */ + /* Read and convert to internal form. */ 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) != sizeof (x_phdr)) - return NULL; + goto fail; elf_swap_phdr_in (abfd, &x_phdr, i_phdrp + phindex); } - /* Process each program header. */ + /* Process each program header. */ for (phindex = 0; phindex < i_ehdrp->e_phnum; ++phindex) { if (!_bfd_elfcore_section_from_phdr (abfd, i_phdrp + phindex, phindex)) - return NULL; + goto fail; } - /* Set the machine architecture. */ + /* Set the machine architecture. */ if (! bfd_default_set_arch_mach (abfd, ebd->arch, 0)) { /* It's OK if this fails for the generic target. */ if (ebd->elf_machine_code != EM_NONE) - return NULL; + goto fail; } - /* Save the entry point from the ELF header. */ + /* Save the entry point from the ELF header. */ bfd_get_start_address (abfd) = i_ehdrp->e_entry; + /* Let the backend double check the format and override global + information. */ + if (ebd->elf_backend_object_p) + { + if ((*ebd->elf_backend_object_p) (abfd) == false) + goto wrong; + } + return abfd->xvec; + +wrong: + bfd_set_error (bfd_error_wrong_format); +fail: + if (i_phdrp != NULL) + bfd_release (abfd, i_phdrp); + if (new_tdata != NULL) + bfd_release (abfd, new_tdata); + elf_tdata (abfd) = preserved_tdata; + return NULL; } diff --git a/gnu/dist/toolchain/bfd/elflink.c b/gnu/dist/toolchain/bfd/elflink.c index 8039b4fe35b0..bfaf44b3dde7 100644 --- a/gnu/dist/toolchain/bfd/elflink.c +++ b/gnu/dist/toolchain/bfd/elflink.c @@ -41,9 +41,17 @@ _bfd_elf_create_got_section (abfd, info) switch (bed->s->arch_size) { - case 32: ptralign = 2; break; - case 64: ptralign = 3; break; - default: abort(); + case 32: + ptralign = 2; + break; + + case 64: + ptralign = 3; + break; + + default: + bfd_set_error (bfd_error_bad_value); + return false; } flags = (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY @@ -89,7 +97,6 @@ _bfd_elf_create_got_section (abfd, info) return true; } - /* Create dynamic sections when linking against a dynamic object. */ boolean @@ -104,9 +111,17 @@ _bfd_elf_create_dynamic_sections (abfd, info) switch (bed->s->arch_size) { - case 32: ptralign = 2; break; - case 64: ptralign = 3; break; - default: abort(); + case 32: + ptralign = 2; + break; + + case 64: + ptralign = 3; + break; + + default: + bfd_set_error (bfd_error_bad_value); + return false; } /* We need to create .plt, .rel[a].plt, .got, .got.plt, .dynbss, and @@ -147,7 +162,7 @@ _bfd_elf_create_dynamic_sections (abfd, info) return false; } - s = bfd_make_section (abfd, + s = bfd_make_section (abfd, bed->default_use_rela_p ? ".rela.plt" : ".rel.plt"); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) @@ -183,9 +198,9 @@ _bfd_elf_create_dynamic_sections (abfd, info) copy relocs. */ if (! info->shared) { - s = bfd_make_section (abfd, - (bed->default_use_rela_p - ? ".rela.bss" : ".rel.bss")); + s = bfd_make_section (abfd, + (bed->default_use_rela_p + ? ".rela.bss" : ".rel.bss")); if (s == NULL || ! bfd_set_section_flags (abfd, s, flags | SEC_READONLY) || ! bfd_set_section_alignment (abfd, s, ptralign)) @@ -196,7 +211,6 @@ _bfd_elf_create_dynamic_sections (abfd, info) return true; } - /* Record a new dynamic symbol. We record the dynamic symbols as we read the input files, since we need to have a list of all of them before we can determine the final sizes of the output sections. @@ -482,7 +496,6 @@ _bfd_elf_create_linker_section (abfd, info, which, defaults) return lsect; } - /* Find a linker generated pointer with a given addend and type. */ @@ -500,7 +513,6 @@ _bfd_elf_find_pointer_linker_section (linker_pointers, addend, which) return (elf_linker_section_pointers_t *)0; } - /* Make the .rela section corresponding to the generated linker section. */ diff --git a/gnu/dist/toolchain/bfd/elfxx-ia64.c b/gnu/dist/toolchain/bfd/elfxx-ia64.c new file mode 100644 index 000000000000..200b8da19493 --- /dev/null +++ b/gnu/dist/toolchain/bfd/elfxx-ia64.c @@ -0,0 +1,4216 @@ +/* IA-64 support for 64-bit ELF + Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang + +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 "opcode/ia64.h" +#include "elf/ia64.h" + +/* + * THE RULES for all the stuff the linker creates -- + * + * GOT Entries created in response to LTOFF or LTOFF_FPTR + * relocations. Dynamic relocs created for dynamic + * symbols in an application; REL relocs for locals + * in a shared library. + * + * FPTR The canonical function descriptor. Created for local + * symbols in applications. Descriptors for dynamic symbols + * and local symbols in shared libraries are created by + * ld.so. Thus there are no dynamic relocs against these + * objects. The FPTR relocs for such _are_ passed through + * to the dynamic relocation tables. + * + * FULL_PLT Created for a PCREL21B relocation against a dynamic symbol. + * Requires the creation of a PLTOFF entry. This does not + * require any dynamic relocations. + * + * PLTOFF Created by PLTOFF relocations. For local symbols, this + * is an alternate function descriptor, and in shared libraries + * requires two REL relocations. Note that this cannot be + * transformed into an FPTR relocation, since it must be in + * range of the GP. For dynamic symbols, this is a function + * descriptor for a MIN_PLT entry, and requires one IPLT reloc. + * + * MIN_PLT Created by PLTOFF entries against dynamic symbols. This + * does not reqire dynamic relocations. + */ + +#define USE_RELA /* we want RELA relocs, not REL */ + +#define NELEMS(a) ((int) (sizeof (a) / sizeof ((a)[0]))) + +typedef struct bfd_hash_entry *(*new_hash_entry_func) + PARAMS ((struct bfd_hash_entry *, struct bfd_hash_table *, const char *)); + +/* In dynamically (linker-) created sections, we generally need to keep track + of the place a symbol or expression got allocated to. This is done via hash + tables that store entries of the following type. */ + +struct elfNN_ia64_dyn_sym_info +{ + /* The addend for which this entry is relevant. */ + bfd_vma addend; + + /* Next addend in the list. */ + struct elfNN_ia64_dyn_sym_info *next; + + bfd_vma got_offset; + bfd_vma fptr_offset; + bfd_vma pltoff_offset; + bfd_vma plt_offset; + bfd_vma plt2_offset; + + /* The symbol table entry, if any, that this was derrived from. */ + struct elf_link_hash_entry *h; + + /* Used to count non-got, non-plt relocations for delayed sizing + of relocation sections. */ + struct elfNN_ia64_dyn_reloc_entry + { + struct elfNN_ia64_dyn_reloc_entry *next; + asection *srel; + int type; + int count; + } *reloc_entries; + + /* True when the section contents have been updated. */ + unsigned got_done : 1; + unsigned fptr_done : 1; + unsigned pltoff_done : 1; + + /* True for the different kinds of linker data we want created. */ + unsigned want_got : 1; + unsigned want_fptr : 1; + unsigned want_ltoff_fptr : 1; + unsigned want_plt : 1; + unsigned want_plt2 : 1; + unsigned want_pltoff : 1; +}; + +struct elfNN_ia64_local_hash_entry +{ + struct bfd_hash_entry root; + struct elfNN_ia64_dyn_sym_info *info; +}; + +struct elfNN_ia64_local_hash_table +{ + struct bfd_hash_table root; + /* No additional fields for now. */ +}; + +struct elfNN_ia64_link_hash_entry +{ + struct elf_link_hash_entry root; + struct elfNN_ia64_dyn_sym_info *info; +}; + +struct elfNN_ia64_link_hash_table +{ + /* The main hash table */ + struct elf_link_hash_table root; + + asection *got_sec; /* the linkage table section (or NULL) */ + asection *rel_got_sec; /* dynamic relocation section for same */ + asection *fptr_sec; /* function descriptor table (or NULL) */ + asection *plt_sec; /* the primary plt section (or NULL) */ + asection *pltoff_sec; /* private descriptors for plt (or NULL) */ + asection *rel_pltoff_sec; /* dynamic relocation section for same */ + + bfd_size_type minplt_entries; /* number of minplt entries */ + + struct elfNN_ia64_local_hash_table loc_hash_table; +}; + +#define elfNN_ia64_hash_table(p) \ + ((struct elfNN_ia64_link_hash_table *) ((p)->hash)) + +static bfd_reloc_status_type elfNN_ia64_reloc + PARAMS ((bfd *abfd, arelent *reloc, asymbol *sym, PTR data, + asection *input_section, bfd *output_bfd, char **error_message)); +static reloc_howto_type * lookup_howto + PARAMS ((unsigned int rtype)); +static reloc_howto_type *elfNN_ia64_reloc_type_lookup + PARAMS ((bfd *abfd, bfd_reloc_code_real_type bfd_code)); +static void elfNN_ia64_info_to_howto + PARAMS ((bfd *abfd, arelent *bfd_reloc, ElfNN_Internal_Rela *elf_reloc)); +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 *)); +static boolean elfNN_ia64_section_from_shdr + PARAMS ((bfd *, ElfNN_Internal_Shdr *, char *)); +static boolean elfNN_ia64_fake_sections + PARAMS ((bfd *abfd, ElfNN_Internal_Shdr *hdr, asection *sec)); +static void elfNN_ia64_final_write_processing + PARAMS ((bfd *abfd, boolean linker)); +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 int elfNN_ia64_additional_program_headers + PARAMS ((bfd *abfd)); +static boolean elfNN_ia64_is_local_label_name + PARAMS ((bfd *abfd, const char *name)); +static boolean elfNN_ia64_dynamic_symbol_p + PARAMS ((struct elf_link_hash_entry *h, struct bfd_link_info *info)); +static boolean elfNN_ia64_local_hash_table_init + PARAMS ((struct elfNN_ia64_local_hash_table *ht, bfd *abfd, + new_hash_entry_func new)); +static struct bfd_hash_entry *elfNN_ia64_new_loc_hash_entry + PARAMS ((struct bfd_hash_entry *entry, struct bfd_hash_table *table, + const char *string)); +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 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 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_dyn_sym_info * get_dyn_sym_info + PARAMS ((struct elfNN_ia64_link_hash_table *ia64_info, + struct elf_link_hash_entry *h, + bfd *abfd, const Elf_Internal_Rela *rel, boolean create)); +static asection *get_got + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elfNN_ia64_link_hash_table *ia64_info)); +static asection *get_fptr + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elfNN_ia64_link_hash_table *ia64_info)); +static asection *get_pltoff + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elfNN_ia64_link_hash_table *ia64_info)); +static asection *get_reloc_section + PARAMS ((bfd *abfd, struct elfNN_ia64_link_hash_table *ia64_info, + asection *sec, boolean create)); +static boolean count_dyn_reloc + PARAMS ((bfd *abfd, struct elfNN_ia64_dyn_sym_info *dyn_i, + asection *srel, int type)); +static boolean elfNN_ia64_check_relocs + PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *sec, + 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 + PARAMS ((struct elf_link_hash_entry *h)); +static boolean allocate_fptr + PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_global_data_got + PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_global_fptr_got + PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_local_got + PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_pltoff_entries + PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_plt_entries + PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_plt2_entries + PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean allocate_dynrel_entries + PARAMS ((struct elfNN_ia64_dyn_sym_info *dyn_i, PTR data)); +static boolean elfNN_ia64_size_dynamic_sections + PARAMS ((bfd *output_bfd, struct bfd_link_info *info)); +static bfd_reloc_status_type elfNN_ia64_install_value + PARAMS ((bfd *abfd, bfd_byte *hit_addr, bfd_vma val, unsigned int r_type)); +static void elfNN_ia64_install_dyn_reloc + PARAMS ((bfd *abfd, struct bfd_link_info *info, asection *sec, + asection *srel, bfd_vma offset, unsigned int type, + long dynindx, bfd_vma addend)); +static bfd_vma set_got_entry + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elfNN_ia64_dyn_sym_info *dyn_i, long dynindx, + bfd_vma addend, bfd_vma value, unsigned int dyn_r_type)); +static bfd_vma set_fptr_entry + PARAMS ((bfd *abfd, struct bfd_link_info *info, + struct elfNN_ia64_dyn_sym_info *dyn_i, + bfd_vma value)); +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 boolean elfNN_ia64_final_link + PARAMS ((bfd *abfd, struct bfd_link_info *info)); +static boolean elfNN_ia64_relocate_section + PARAMS ((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)); +static boolean elfNN_ia64_finish_dynamic_symbol + PARAMS ((bfd *output_bfd, struct bfd_link_info *info, + struct elf_link_hash_entry *h, Elf_Internal_Sym *sym)); +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)); + +/* ia64-specific relocation */ + +/* Perform a relocation. Not much to do here as all the hard work is + done in elfNN_ia64_final_link_relocate. */ +static bfd_reloc_status_type +elfNN_ia64_reloc (abfd, reloc, sym, data, input_section, + output_bfd, error_message) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *reloc; + asymbol *sym ATTRIBUTE_UNUSED; + PTR data ATTRIBUTE_UNUSED; + asection *input_section; + bfd *output_bfd; + char **error_message; +{ + if (output_bfd) + { + reloc->address += input_section->output_offset; + return bfd_reloc_ok; + } + *error_message = "Unsupported call to elfNN_ia64_reloc"; + return bfd_reloc_notsupported; +} + +#define IA64_HOWTO(TYPE, NAME, SIZE, PCREL, IN) \ + HOWTO (TYPE, 0, SIZE, 0, PCREL, 0, complain_overflow_signed, \ + elfNN_ia64_reloc, NAME, false, 0, 0, IN) + +/* This table has to be sorted according to increasing number of the + TYPE field. */ +static reloc_howto_type ia64_howto_table[] = + { + IA64_HOWTO (R_IA64_NONE, "NONE", 0, false, true), + + IA64_HOWTO (R_IA64_IMM14, "IMM14", 0, false, true), + IA64_HOWTO (R_IA64_IMM22, "IMM22", 0, false, true), + IA64_HOWTO (R_IA64_IMM64, "IMM64", 0, false, true), + IA64_HOWTO (R_IA64_DIR32MSB, "DIR32MSB", 2, false, true), + IA64_HOWTO (R_IA64_DIR32LSB, "DIR32LSB", 2, false, true), + IA64_HOWTO (R_IA64_DIR64MSB, "DIR64MSB", 4, false, true), + IA64_HOWTO (R_IA64_DIR64LSB, "DIR64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_GPREL22, "GPREL22", 0, false, true), + IA64_HOWTO (R_IA64_GPREL64I, "GPREL64I", 0, false, true), + IA64_HOWTO (R_IA64_GPREL32MSB, "GPREL32MSB", 2, false, true), + IA64_HOWTO (R_IA64_GPREL32LSB, "GPREL32LSB", 2, false, true), + IA64_HOWTO (R_IA64_GPREL64MSB, "GPREL64MSB", 4, false, true), + IA64_HOWTO (R_IA64_GPREL64LSB, "GPREL64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_LTOFF22, "LTOFF22", 0, false, true), + IA64_HOWTO (R_IA64_LTOFF64I, "LTOFF64I", 0, false, true), + + IA64_HOWTO (R_IA64_PLTOFF22, "PLTOFF22", 0, false, true), + IA64_HOWTO (R_IA64_PLTOFF64I, "PLTOFF64I", 0, false, true), + IA64_HOWTO (R_IA64_PLTOFF64MSB, "PLTOFF64MSB", 4, false, true), + IA64_HOWTO (R_IA64_PLTOFF64LSB, "PLTOFF64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_FPTR64I, "FPTR64I", 0, false, true), + IA64_HOWTO (R_IA64_FPTR32MSB, "FPTR32MSB", 2, false, true), + IA64_HOWTO (R_IA64_FPTR32LSB, "FPTR32LSB", 2, false, true), + IA64_HOWTO (R_IA64_FPTR64MSB, "FPTR64MSB", 4, false, true), + IA64_HOWTO (R_IA64_FPTR64LSB, "FPTR64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_PCREL60B, "PCREL60B", 0, true, true), + IA64_HOWTO (R_IA64_PCREL21B, "PCREL21B", 0, true, true), + IA64_HOWTO (R_IA64_PCREL21M, "PCREL21M", 0, true, true), + IA64_HOWTO (R_IA64_PCREL21F, "PCREL21F", 0, true, true), + IA64_HOWTO (R_IA64_PCREL32MSB, "PCREL32MSB", 2, true, true), + IA64_HOWTO (R_IA64_PCREL32LSB, "PCREL32LSB", 2, true, true), + IA64_HOWTO (R_IA64_PCREL64MSB, "PCREL64MSB", 4, true, true), + IA64_HOWTO (R_IA64_PCREL64LSB, "PCREL64LSB", 4, true, true), + + 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_FPTR64MSB, "LTOFF_FPTR64MSB", 4, false, true), + IA64_HOWTO (R_IA64_LTOFF_FPTR64LSB, "LTOFF_FPTR64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_SEGREL32MSB, "SEGREL32MSB", 2, false, true), + IA64_HOWTO (R_IA64_SEGREL32LSB, "SEGREL32LSB", 2, false, true), + IA64_HOWTO (R_IA64_SEGREL64MSB, "SEGREL64MSB", 4, false, true), + IA64_HOWTO (R_IA64_SEGREL64LSB, "SEGREL64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_SECREL32MSB, "SECREL32MSB", 2, false, true), + IA64_HOWTO (R_IA64_SECREL32LSB, "SECREL32LSB", 2, false, true), + IA64_HOWTO (R_IA64_SECREL64MSB, "SECREL64MSB", 4, false, true), + IA64_HOWTO (R_IA64_SECREL64LSB, "SECREL64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_REL32MSB, "REL32MSB", 2, false, true), + IA64_HOWTO (R_IA64_REL32LSB, "REL32LSB", 2, false, true), + IA64_HOWTO (R_IA64_REL64MSB, "REL64MSB", 4, false, true), + IA64_HOWTO (R_IA64_REL64LSB, "REL64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_LTV32MSB, "LTV32MSB", 2, false, true), + IA64_HOWTO (R_IA64_LTV32LSB, "LTV32LSB", 2, false, true), + IA64_HOWTO (R_IA64_LTV64MSB, "LTV64MSB", 4, false, true), + IA64_HOWTO (R_IA64_LTV64LSB, "LTV64LSB", 4, false, true), + + IA64_HOWTO (R_IA64_PCREL21BI, "PCREL21BI", 0, true, true), + IA64_HOWTO (R_IA64_PCREL22, "PCREL22", 0, true, true), + IA64_HOWTO (R_IA64_PCREL64I, "PCREL64I", 0, true, true), + + IA64_HOWTO (R_IA64_IPLTMSB, "IPLTMSB", 4, false, true), + IA64_HOWTO (R_IA64_IPLTLSB, "IPLTLSB", 4, false, true), + IA64_HOWTO (R_IA64_COPY, "COPY", 4, false, true), + IA64_HOWTO (R_IA64_LTOFF22X, "LTOFF22X", 0, false, true), + IA64_HOWTO (R_IA64_LDXMOV, "LDXMOV", 0, false, true), + + IA64_HOWTO (R_IA64_TPREL22, "TPREL22", 0, false, false), + IA64_HOWTO (R_IA64_TPREL64MSB, "TPREL64MSB", 8, false, false), + IA64_HOWTO (R_IA64_TPREL64LSB, "TPREL64LSB", 8, false, false), + IA64_HOWTO (R_IA64_LTOFF_TP22, "LTOFF_TP22", 0, false, false), + }; + +static unsigned char elf_code_to_howto_index[R_IA64_MAX_RELOC_CODE + 1]; + +/* Given a BFD reloc type, return the matching HOWTO structure. */ + +static reloc_howto_type* +lookup_howto (rtype) + unsigned int rtype; +{ + static int inited = 0; + int i; + + if (!inited) + { + inited = 1; + + memset (elf_code_to_howto_index, 0xff, sizeof (elf_code_to_howto_index)); + for (i = 0; i < NELEMS (ia64_howto_table); ++i) + elf_code_to_howto_index[ia64_howto_table[i].type] = i; + } + + BFD_ASSERT (rtype <= R_IA64_MAX_RELOC_CODE); + i = elf_code_to_howto_index[rtype]; + if (i >= NELEMS (ia64_howto_table)) + return 0; + return ia64_howto_table + i; +} + +static reloc_howto_type* +elfNN_ia64_reloc_type_lookup (abfd, bfd_code) + bfd *abfd ATTRIBUTE_UNUSED; + bfd_reloc_code_real_type bfd_code; +{ + unsigned int rtype; + + switch (bfd_code) + { + case BFD_RELOC_NONE: rtype = R_IA64_NONE; break; + + case BFD_RELOC_IA64_IMM14: rtype = R_IA64_IMM14; break; + case BFD_RELOC_IA64_IMM22: rtype = R_IA64_IMM22; break; + case BFD_RELOC_IA64_IMM64: rtype = R_IA64_IMM64; break; + + case BFD_RELOC_IA64_DIR32MSB: rtype = R_IA64_DIR32MSB; break; + case BFD_RELOC_IA64_DIR32LSB: rtype = R_IA64_DIR32LSB; break; + case BFD_RELOC_IA64_DIR64MSB: rtype = R_IA64_DIR64MSB; break; + case BFD_RELOC_IA64_DIR64LSB: rtype = R_IA64_DIR64LSB; break; + + case BFD_RELOC_IA64_GPREL22: rtype = R_IA64_GPREL22; break; + case BFD_RELOC_IA64_GPREL64I: rtype = R_IA64_GPREL64I; break; + case BFD_RELOC_IA64_GPREL32MSB: rtype = R_IA64_GPREL32MSB; break; + case BFD_RELOC_IA64_GPREL32LSB: rtype = R_IA64_GPREL32LSB; break; + case BFD_RELOC_IA64_GPREL64MSB: rtype = R_IA64_GPREL64MSB; break; + case BFD_RELOC_IA64_GPREL64LSB: rtype = R_IA64_GPREL64LSB; break; + + case BFD_RELOC_IA64_LTOFF22: rtype = R_IA64_LTOFF22; break; + case BFD_RELOC_IA64_LTOFF64I: rtype = R_IA64_LTOFF64I; break; + + case BFD_RELOC_IA64_PLTOFF22: rtype = R_IA64_PLTOFF22; break; + case BFD_RELOC_IA64_PLTOFF64I: rtype = R_IA64_PLTOFF64I; break; + case BFD_RELOC_IA64_PLTOFF64MSB: rtype = R_IA64_PLTOFF64MSB; break; + case BFD_RELOC_IA64_PLTOFF64LSB: rtype = R_IA64_PLTOFF64LSB; break; + case BFD_RELOC_IA64_FPTR64I: rtype = R_IA64_FPTR64I; break; + case BFD_RELOC_IA64_FPTR32MSB: rtype = R_IA64_FPTR32MSB; break; + case BFD_RELOC_IA64_FPTR32LSB: rtype = R_IA64_FPTR32LSB; break; + case BFD_RELOC_IA64_FPTR64MSB: rtype = R_IA64_FPTR64MSB; break; + case BFD_RELOC_IA64_FPTR64LSB: rtype = R_IA64_FPTR64LSB; break; + + case BFD_RELOC_IA64_PCREL21B: rtype = R_IA64_PCREL21B; break; + case BFD_RELOC_IA64_PCREL21BI: rtype = R_IA64_PCREL21BI; break; + case BFD_RELOC_IA64_PCREL21M: rtype = R_IA64_PCREL21M; break; + case BFD_RELOC_IA64_PCREL21F: rtype = R_IA64_PCREL21F; break; + case BFD_RELOC_IA64_PCREL22: rtype = R_IA64_PCREL22; break; + case BFD_RELOC_IA64_PCREL60B: rtype = R_IA64_PCREL60B; break; + case BFD_RELOC_IA64_PCREL64I: rtype = R_IA64_PCREL64I; break; + case BFD_RELOC_IA64_PCREL32MSB: rtype = R_IA64_PCREL32MSB; break; + case BFD_RELOC_IA64_PCREL32LSB: rtype = R_IA64_PCREL32LSB; break; + case BFD_RELOC_IA64_PCREL64MSB: rtype = R_IA64_PCREL64MSB; break; + case BFD_RELOC_IA64_PCREL64LSB: rtype = R_IA64_PCREL64LSB; break; + + 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_FPTR64MSB: rtype = R_IA64_LTOFF_FPTR64MSB; break; + case BFD_RELOC_IA64_LTOFF_FPTR64LSB: rtype = R_IA64_LTOFF_FPTR64LSB; break; + + case BFD_RELOC_IA64_SEGREL32MSB: rtype = R_IA64_SEGREL32MSB; break; + case BFD_RELOC_IA64_SEGREL32LSB: rtype = R_IA64_SEGREL32LSB; break; + case BFD_RELOC_IA64_SEGREL64MSB: rtype = R_IA64_SEGREL64MSB; break; + case BFD_RELOC_IA64_SEGREL64LSB: rtype = R_IA64_SEGREL64LSB; break; + + case BFD_RELOC_IA64_SECREL32MSB: rtype = R_IA64_SECREL32MSB; break; + case BFD_RELOC_IA64_SECREL32LSB: rtype = R_IA64_SECREL32LSB; break; + case BFD_RELOC_IA64_SECREL64MSB: rtype = R_IA64_SECREL64MSB; break; + case BFD_RELOC_IA64_SECREL64LSB: rtype = R_IA64_SECREL64LSB; break; + + case BFD_RELOC_IA64_REL32MSB: rtype = R_IA64_REL32MSB; break; + case BFD_RELOC_IA64_REL32LSB: rtype = R_IA64_REL32LSB; break; + case BFD_RELOC_IA64_REL64MSB: rtype = R_IA64_REL64MSB; break; + case BFD_RELOC_IA64_REL64LSB: rtype = R_IA64_REL64LSB; break; + + case BFD_RELOC_IA64_LTV32MSB: rtype = R_IA64_LTV32MSB; break; + case BFD_RELOC_IA64_LTV32LSB: rtype = R_IA64_LTV32LSB; break; + case BFD_RELOC_IA64_LTV64MSB: rtype = R_IA64_LTV64MSB; break; + case BFD_RELOC_IA64_LTV64LSB: rtype = R_IA64_LTV64LSB; break; + + case BFD_RELOC_IA64_IPLTMSB: rtype = R_IA64_IPLTMSB; break; + case BFD_RELOC_IA64_IPLTLSB: rtype = R_IA64_IPLTLSB; break; + case BFD_RELOC_IA64_COPY: rtype = R_IA64_COPY; break; + case BFD_RELOC_IA64_LTOFF22X: rtype = R_IA64_LTOFF22X; break; + case BFD_RELOC_IA64_LDXMOV: rtype = R_IA64_LDXMOV; break; + + case BFD_RELOC_IA64_TPREL22: rtype = R_IA64_TPREL22; break; + case BFD_RELOC_IA64_TPREL64MSB: rtype = R_IA64_TPREL64MSB; break; + case BFD_RELOC_IA64_TPREL64LSB: rtype = R_IA64_TPREL64LSB; break; + case BFD_RELOC_IA64_LTOFF_TP22: rtype = R_IA64_LTOFF_TP22; break; + + default: return 0; + } + return lookup_howto (rtype); +} + +/* Given a ELF reloc, return the matching HOWTO structure. */ + +static void +elfNN_ia64_info_to_howto (abfd, bfd_reloc, elf_reloc) + bfd *abfd ATTRIBUTE_UNUSED; + arelent *bfd_reloc; + ElfNN_Internal_Rela *elf_reloc; +{ + bfd_reloc->howto = lookup_howto (ELFNN_R_TYPE (elf_reloc->r_info)); +} + +#define PLT_HEADER_SIZE (3 * 16) +#define PLT_MIN_ENTRY_SIZE (1 * 16) +#define PLT_FULL_ENTRY_SIZE (2 * 16) +#define PLT_RESERVED_WORDS 3 + +static const bfd_byte plt_header[PLT_HEADER_SIZE] = +{ + 0x0b, 0x10, 0x00, 0x1c, 0x00, 0x21, /* [MMI] mov r2=r14;; */ + 0xe0, 0x00, 0x08, 0x00, 0x48, 0x00, /* addl r14=0,r2 */ + 0x00, 0x00, 0x04, 0x00, /* nop.i 0x0;; */ + 0x0b, 0x80, 0x20, 0x1c, 0x18, 0x14, /* [MMI] ld8 r16=[r14],8;; */ + 0x10, 0x41, 0x38, 0x30, 0x28, 0x00, /* ld8 r17=[r14],8 */ + 0x00, 0x00, 0x04, 0x00, /* nop.i 0x0;; */ + 0x11, 0x08, 0x00, 0x1c, 0x18, 0x10, /* [MIB] ld8 r1=[r14] */ + 0x60, 0x88, 0x04, 0x80, 0x03, 0x00, /* mov b6=r17 */ + 0x60, 0x00, 0x80, 0x00 /* br.few b6;; */ +}; + +static const bfd_byte plt_min_entry[PLT_MIN_ENTRY_SIZE] = +{ + 0x11, 0x78, 0x00, 0x00, 0x00, 0x24, /* [MIB] mov r15=0 */ + 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, /* nop.i 0x0 */ + 0x00, 0x00, 0x00, 0x40 /* br.few 0 ;; */ +}; + +static const bfd_byte plt_full_entry[PLT_FULL_ENTRY_SIZE] = +{ + 0x0b, 0x78, 0x00, 0x02, 0x00, 0x24, /* [MMI] addl r15=0,r1;; */ + 0x00, 0x41, 0x3c, 0x30, 0x28, 0xc0, /* ld8 r16=[r15],8 */ + 0x01, 0x08, 0x00, 0x84, /* mov r14=r1;; */ + 0x11, 0x08, 0x00, 0x1e, 0x18, 0x10, /* [MIB] ld8 r1=[r15] */ + 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */ + 0x60, 0x00, 0x80, 0x00 /* br.few b6;; */ +}; + +#define ELF_DYNAMIC_INTERPRETER "/usr/lib/ld.so.1" + +/* Select out of range branch fixup type. Note that Itanium does + not support brl, and so it gets emulated by the kernel. */ +#undef USE_BRL + +static const bfd_byte oor_brl[16] = +{ + 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* brl.sptk.few tgt;; */ + 0x00, 0x00, 0x00, 0xc0 +}; + +static const bfd_byte oor_ip[48] = +{ + 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MLX] nop.m 0 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, /* movl r15=0 */ + 0x01, 0x00, 0x00, 0x60, + 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MII] nop.m 0 */ + 0x00, 0x01, 0x00, 0x60, 0x00, 0x00, /* mov r16=ip;; */ + 0xf2, 0x80, 0x00, 0x80, /* add r16=r15,r16;; */ + 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, /* [MIB] nop.m 0 */ + 0x60, 0x80, 0x04, 0x80, 0x03, 0x00, /* mov b6=r16 */ + 0x60, 0x00, 0x80, 0x00 /* br b6;; */ +}; + +/* These functions do relaxation for IA-64 ELF. + + This is primarily to support branches to targets out of range; + relaxation of R_IA64_LTOFF22X and R_IA64_LDXMOV not yet supported. */ + +static boolean +elfNN_ia64_relax_section (abfd, sec, link_info, again) + bfd *abfd; + asection *sec; + struct bfd_link_info *link_info; + boolean *again; +{ + struct one_fixup + { + struct one_fixup *next; + asection *tsec; + bfd_vma toff; + bfd_vma trampoff; + }; + + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Rela *internal_relocs; + Elf_Internal_Rela *free_relocs = NULL; + Elf_Internal_Rela *irel, *irelend; + bfd_byte *contents; + bfd_byte *free_contents = NULL; + ElfNN_External_Sym *extsyms; + ElfNN_External_Sym *free_extsyms = NULL; + struct elfNN_ia64_link_hash_table *ia64_info; + struct one_fixup *fixups = NULL; + boolean changed_contents = false; + boolean changed_relocs = false; + + /* Assume we're not going to change any sizes, and we'll only need + one pass. */ + *again = false; + + /* Nothing to do if there are no relocations. */ + if ((sec->flags & SEC_RELOC) == 0 + || sec->reloc_count == 0) + return true; + + /* If this is the first time we have been called for this section, + initialize the cooked size. */ + if (sec->_cooked_size == 0) + sec->_cooked_size = sec->_raw_size; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + + /* Load the relocations for this section. */ + internal_relocs = (_bfd_elfNN_link_read_relocs + (abfd, sec, (PTR) NULL, (Elf_Internal_Rela *) NULL, + link_info->keep_memory)); + if (internal_relocs == NULL) + goto error_return; + + if (! link_info->keep_memory) + free_relocs = internal_relocs; + + ia64_info = elfNN_ia64_hash_table (link_info); + irelend = internal_relocs + sec->reloc_count; + + for (irel = internal_relocs; irel < irelend; irel++) + if (ELFNN_R_TYPE (irel->r_info) == (int) R_IA64_PCREL21B) + break; + + /* No branch-type relocations. */ + if (irel == irelend) + { + if (free_relocs != NULL) + free (free_relocs); + return true; + } + + /* Get the section contents. */ + if (elf_section_data (sec)->this_hdr.contents != NULL) + contents = elf_section_data (sec)->this_hdr.contents; + else + { + contents = (bfd_byte *) bfd_malloc (sec->_raw_size); + if (contents == NULL) + goto error_return; + free_contents = contents; + + if (! bfd_get_section_contents (abfd, sec, contents, + (file_ptr) 0, sec->_raw_size)) + goto error_return; + } + + /* Read this BFD's symbols. */ + if (symtab_hdr->contents != NULL) + extsyms = (ElfNN_External_Sym *) symtab_hdr->contents; + else + { + extsyms = (ElfNN_External_Sym *) bfd_malloc (symtab_hdr->sh_size); + if (extsyms == NULL) + goto error_return; + free_extsyms = extsyms; + if (bfd_seek (abfd, symtab_hdr->sh_offset, SEEK_SET) != 0 + || (bfd_read (extsyms, 1, symtab_hdr->sh_size, abfd) + != symtab_hdr->sh_size)) + goto error_return; + } + + for (; irel < irelend; irel++) + { + bfd_vma symaddr, reladdr, trampoff, toff, roff; + Elf_Internal_Sym isym; + asection *tsec; + struct one_fixup *f; + + if (ELFNN_R_TYPE (irel->r_info) != (int) R_IA64_PCREL21B) + continue; + + /* Get the value of the symbol referred to by the reloc. */ + if (ELFNN_R_SYM (irel->r_info) < symtab_hdr->sh_info) + { + /* A local symbol. */ + bfd_elfNN_swap_symbol_in (abfd, + extsyms + ELFNN_R_SYM (irel->r_info), + &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 + continue; /* who knows. */ + + toff = isym.st_value; + } + else + { + unsigned long indx; + struct elf_link_hash_entry *h; + struct elfNN_ia64_dyn_sym_info *dyn_i; + + indx = ELFNN_R_SYM (irel->r_info) - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + BFD_ASSERT (h != NULL); + + 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; + + dyn_i = get_dyn_sym_info (ia64_info, h, abfd, irel, false); + + /* For branches to dynamic symbols, we're interested instead + in a branch to the PLT entry. */ + if (dyn_i && dyn_i->want_plt2) + { + tsec = ia64_info->plt_sec; + toff = dyn_i->plt2_offset; + } + else + { + /* We can't do anthing with undefined symbols. */ + if (h->root.type == bfd_link_hash_undefined + || h->root.type == bfd_link_hash_undefweak) + continue; + + tsec = h->root.u.def.section; + toff = h->root.u.def.value; + } + } + + symaddr = (tsec->output_section->vma + + tsec->output_offset + + toff + + irel->r_addend); + + roff = irel->r_offset; + reladdr = (sec->output_section->vma + + sec->output_offset + + roff) & -4; + + /* If the branch is in range, no need to do anything. */ + if ((bfd_signed_vma) (symaddr - reladdr) >= -0x1000000 + && (bfd_signed_vma) (symaddr - reladdr) <= 0x0FFFFF0) + continue; + + /* If the branch and target are in the same section, you've + got one honking big section and we can't help you. You'll + get an error message later. */ + if (tsec == sec) + continue; + + /* Look for an existing fixup to this address. */ + for (f = fixups; f ; f = f->next) + if (f->tsec == tsec && f->toff == toff) + break; + + if (f == NULL) + { + /* Two alternatives: If it's a branch to a PLT entry, we can + 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; + + if (tsec == ia64_info->plt_sec) + size = sizeof (plt_full_entry); + else + { +#ifdef USE_BRL + size = sizeof (oor_brl); +#else + size = sizeof (oor_ip); +#endif + } + + /* 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); + if (contents == NULL) + goto error_return; + sec->_cooked_size = trampoff + size; + + if (tsec == ia64_info->plt_sec) + { + memcpy (contents + trampoff, plt_full_entry, size); + + /* Hijack the old relocation for use as the PLTOFF reloc. */ + irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info), + R_IA64_PLTOFF22); + irel->r_offset = trampoff; + } + else + { +#ifdef USE_BRL + memcpy (contents + trampoff, oor_brl, size); + irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info), + R_IA64_PCREL60B); + irel->r_offset = trampoff + 2; +#else + memcpy (contents + trampoff, oor_ip, size); + irel->r_info = ELFNN_R_INFO (ELFNN_R_SYM (irel->r_info), + R_IA64_PCREL64I); + irel->r_addend -= 16; + irel->r_offset = trampoff + 2; +#endif + } + + /* Record the fixup so we don't do it again this section. */ + f = (struct one_fixup *) bfd_malloc (sizeof (*f)); + f->next = fixups; + f->tsec = tsec; + f->toff = toff; + f->trampoff = trampoff; + fixups = f; + } + else + { + /* Nop out the reloc, since we're finalizing things here. */ + irel->r_info = ELFNN_R_INFO (0, R_IA64_NONE); + } + + /* 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), + R_IA64_PCREL21B) != bfd_reloc_ok) + goto error_return; + + changed_contents = true; + changed_relocs = true; + } + + /* Clean up and go home. */ + while (fixups) + { + struct one_fixup *f = fixups; + fixups = fixups->next; + free (f); + } + + if (changed_relocs) + elf_section_data (sec)->relocs = internal_relocs; + else if (free_relocs != NULL) + free (free_relocs); + + if (changed_contents) + elf_section_data (sec)->this_hdr.contents = contents; + else if (free_contents != NULL) + { + if (! link_info->keep_memory) + free (free_contents); + else + { + /* Cache the section contents for elf_link_input_bfd. */ + elf_section_data (sec)->this_hdr.contents = contents; + } + } + + if (free_extsyms != NULL) + { + if (! link_info->keep_memory) + free (free_extsyms); + else + { + /* Cache the symbols for elf_link_input_bfd. */ + symtab_hdr->contents = extsyms; + } + } + + *again = changed_contents || changed_relocs; + return true; + + error_return: + if (free_relocs != NULL) + free (free_relocs); + if (free_contents != NULL) + free (free_contents); + if (free_extsyms != NULL) + free (free_extsyms); + return false; +} + +/* Return true if NAME is an unwind table section name. */ + +static inline boolean +is_unwind_section_name (name) + const char *name; +{ + size_t len1, len2; + + len1 = sizeof (ELF_STRING_ia64_unwind) - 1; + len2 = sizeof (ELF_STRING_ia64_unwind_info) - 1; + return (strncmp (name, ELF_STRING_ia64_unwind, len1) == 0 + && strncmp (name, ELF_STRING_ia64_unwind_info, len2) != 0); +} + +/* Handle an IA-64 specific section when reading an object file. This + is called when elfcode.h finds a section with an unknown type. */ + +static boolean +elfNN_ia64_section_from_shdr (abfd, hdr, name) + bfd *abfd; + ElfNN_Internal_Shdr *hdr; + char *name; +{ + asection *newsect; + + /* There ought to be a place to keep ELF backend specific flags, but + at the moment there isn't one. We just keep track of the + sections by their name, instead. Fortunately, the ABI gives + suggested names for all the MIPS specific sections, so we will + probably get away with this. */ + switch (hdr->sh_type) + { + case SHT_IA_64_UNWIND: + break; + + case SHT_IA_64_EXT: + if (strcmp (name, ELF_STRING_ia64_archext) != 0) + return false; + break; + + default: + return false; + } + + if (! _bfd_elf_make_section_from_shdr (abfd, hdr, name)) + return false; + newsect = hdr->bfd_section; + + return true; +} + +/* Convert IA-64 specific section flags to bfd internal section flags. */ + +/* ??? There is no bfd internal flag equivalent to the SHF_IA_64_NORECOV + flag. */ + +static boolean +elfNN_ia64_section_flags (flags, hdr) + flagword *flags; + ElfNN_Internal_Shdr *hdr; +{ + if (hdr->sh_flags & SHF_IA_64_SHORT) + *flags |= SEC_SMALL_DATA; + + return true; +} + +/* Set the correct type for an IA-64 ELF section. We do this by the + section name, which is a hack, but ought to work. */ + +static boolean +elfNN_ia64_fake_sections (abfd, hdr, sec) + bfd *abfd ATTRIBUTE_UNUSED; + ElfNN_Internal_Shdr *hdr; + asection *sec; +{ + register const char *name; + + name = bfd_get_section_name (abfd, sec); + + if (is_unwind_section_name (name)) + { + /* We don't have the sections numbered at this point, so sh_info + is set later, in elfNN_ia64_final_write_processing. */ + hdr->sh_type = SHT_IA_64_UNWIND; + hdr->sh_flags |= SHF_LINK_ORDER; + } + else if (strcmp (name, ELF_STRING_ia64_archext) == 0) + hdr->sh_type = SHT_IA_64_EXT; + else if (strcmp (name, ".reloc") == 0) + /* + * This is an ugly, but unfortunately necessary hack that is + * needed when producing EFI binaries on IA-64. 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; + + if (sec->flags & SEC_SMALL_DATA) + hdr->sh_flags |= SHF_IA_64_SHORT; + + return true; +} + +/* The final processing done just before writing out an IA-64 ELF + object file. */ + +static void +elfNN_ia64_final_write_processing (abfd, linker) + bfd *abfd; + boolean linker ATTRIBUTE_UNUSED; +{ + Elf_Internal_Shdr *hdr; + const char *sname; + asection *text_sect, *s; + size_t len; + + for (s = abfd->sections; s; s = s->next) + { + hdr = &elf_section_data (s)->this_hdr; + switch (hdr->sh_type) + { + case SHT_IA_64_UNWIND: + /* See comments in gas/config/tc-ia64.c:dot_endp on why we + have to do this. */ + sname = bfd_get_section_name (abfd, s); + len = sizeof (ELF_STRING_ia64_unwind) - 1; + if (sname && strncmp (sname, ELF_STRING_ia64_unwind, len) == 0) + { + sname += len; + + if (sname[0] == '\0') + /* .IA_64.unwind -> .text */ + text_sect = bfd_get_section_by_name (abfd, ".text"); + else + /* .IA_64.unwindFOO -> FOO */ + text_sect = bfd_get_section_by_name (abfd, sname); + } + else + /* last resort: fall back on .text */ + text_sect = bfd_get_section_by_name (abfd, ".text"); + + if (text_sect) + { + /* The IA-64 processor-specific ABI requires setting + sh_link to the unwind section, whereas HP-UX requires + sh_info to do so. For maximum compatibility, we'll + set both for now... */ + hdr->sh_link = elf_section_data (text_sect)->this_idx; + hdr->sh_info = elf_section_data (text_sect)->this_idx; + } + break; + } + } +} + +/* Hook called by the linker routine which adds symbols from an object + file. We use it to put .comm items in .sbss, and not .bss. */ + +static boolean +elfNN_ia64_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 ATTRIBUTE_UNUSED; + flagword *flagsp ATTRIBUTE_UNUSED; + asection **secp; + bfd_vma *valp; +{ + if (sym->st_shndx == SHN_COMMON + && !info->relocateable + && sym->st_size <= (unsigned) bfd_get_gp_size (abfd)) + { + /* Common symbols less than or equal to -G nn bytes are + automatically put into .sbss. */ + + asection *scomm = bfd_get_section_by_name (abfd, ".scommon"); + + if (scomm == NULL) + { + scomm = bfd_make_section (abfd, ".scommon"); + if (scomm == NULL + || !bfd_set_section_flags (abfd, scomm, (SEC_ALLOC + | SEC_IS_COMMON + | SEC_LINKER_CREATED))) + return false; + } + + *secp = scomm; + *valp = sym->st_size; + } + + return true; +} + +/* Return the number of additional phdrs we will need. */ + +static int +elfNN_ia64_additional_program_headers (abfd) + bfd *abfd; +{ + asection *s; + int ret = 0; + + /* See if we need a PT_IA_64_ARCHEXT segment. */ + s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_archext); + if (s && (s->flags & SEC_LOAD)) + ++ret; + + /* 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)) + ++ret; + + return ret; +} + +static boolean +elfNN_ia64_modify_segment_map (abfd) + bfd *abfd; +{ + struct elf_segment_map *m, **pm; + Elf_Internal_Shdr *hdr; + asection *s; + + /* If we need a PT_IA_64_ARCHEXT segment, it must come before + all PT_LOAD segments. */ + s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_archext); + 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_ARCHEXT) + break; + if (m == NULL) + { + m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m); + if (m == NULL) + return false; + + m->p_type = PT_IA_64_ARCHEXT; + m->count = 1; + m->sections[0] = s; + + /* We want to put it after the PHDR and INTERP segments. */ + pm = &elf_tdata (abfd)->segment_map; + while (*pm != NULL + && ((*pm)->p_type == PT_PHDR + || (*pm)->p_type == PT_INTERP)) + pm = &(*pm)->next; + + m->next = *pm; + *pm = m; + } + } + + /* Install PT_IA_64_UNWIND segments, if needed. */ + for (s = abfd->sections; s; s = s->next) + { + hdr = &elf_section_data (s)->this_hdr; + if (hdr->sh_type != SHT_IA_64_UNWIND) + continue; + + 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 == NULL) + { + m = (struct elf_segment_map *) bfd_zalloc (abfd, sizeof *m); + if (m == NULL) + return false; + + m->p_type = PT_IA_64_UNWIND; + m->count = 1; + m->sections[0] = s; + m->next = NULL; + + /* We want to put it last. */ + pm = &elf_tdata (abfd)->segment_map; + while (*pm != NULL) + pm = &(*pm)->next; + *pm = m; + } + } + } + + /* Turn on PF_IA_64_NORECOV if needed. This involves traversing all of + the input sections for each output section in the segment and testing + for SHF_IA_64_NORECOV on each. */ + for (m = elf_tdata (abfd)->segment_map; m != NULL; m = m->next) + if (m->p_type == PT_LOAD) + { + int i; + for (i = m->count - 1; i >= 0; --i) + { + struct bfd_link_order *order = m->sections[i]->link_order_head; + while (order) + { + if (order->type == bfd_indirect_link_order) + { + asection *is = order->u.indirect.section; + bfd_vma flags = elf_section_data(is)->this_hdr.sh_flags; + if (flags & SHF_IA_64_NORECOV) + { + m->p_flags |= PF_IA_64_NORECOV; + goto found; + } + } + order = order->next; + } + } + found:; + } + + return true; +} + +/* According to the Tahoe assembler spec, all labels starting with a + '.' are local. */ + +static boolean +elfNN_ia64_is_local_label_name (abfd, name) + bfd *abfd ATTRIBUTE_UNUSED; + const char *name; +{ + return name[0] == '.'; +} + +/* Should we do dynamic things to this symbol? */ + +static boolean +elfNN_ia64_dynamic_symbol_p (h, info) + struct elf_link_hash_entry *h; + struct bfd_link_info *info; +{ + if (h == NULL) + return false; + + 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->dynindx == -1) + return false; + if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT) + return false; + + if (h->root.type == bfd_link_hash_undefweak + || h->root.type == bfd_link_hash_defweak) + return true; + + if ((info->shared && !info->symbolic) + || ((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))) + return true; + + return false; +} + +static boolean +elfNN_ia64_local_hash_table_init (ht, abfd, new) + struct elfNN_ia64_local_hash_table *ht; + bfd *abfd ATTRIBUTE_UNUSED; + new_hash_entry_func new; +{ + memset (ht, 0, sizeof (*ht)); + return bfd_hash_table_init (&ht->root, new); +} + +static struct bfd_hash_entry* +elfNN_ia64_new_loc_hash_entry (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + struct elfNN_ia64_local_hash_entry *ret; + ret = (struct elfNN_ia64_local_hash_entry *) entry; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (!ret) + ret = bfd_hash_allocate (table, sizeof (*ret)); + + if (!ret) + return 0; + + /* Initialize our local data. All zeros, and definitely easier + than setting a handful of bit fields. */ + memset (ret, 0, sizeof (*ret)); + + /* Call the allocation method of the superclass. */ + ret = ((struct elfNN_ia64_local_hash_entry *) + bfd_hash_newfunc ((struct bfd_hash_entry *) ret, table, string)); + + return (struct bfd_hash_entry *) ret; +} + +static struct bfd_hash_entry* +elfNN_ia64_new_elf_hash_entry (entry, table, string) + struct bfd_hash_entry *entry; + struct bfd_hash_table *table; + const char *string; +{ + struct elfNN_ia64_link_hash_entry *ret; + ret = (struct elfNN_ia64_link_hash_entry *) entry; + + /* Allocate the structure if it has not already been allocated by a + subclass. */ + if (!ret) + ret = bfd_hash_allocate (table, sizeof (*ret)); + + if (!ret) + return 0; + + /* Initialize our local data. All zeros, and definitely easier + than setting a handful of bit fields. */ + memset (ret, 0, sizeof (*ret)); + + /* Call the allocation method of the superclass. */ + ret = ((struct elfNN_ia64_link_hash_entry *) + _bfd_elf_link_hash_newfunc ((struct bfd_hash_entry *) ret, + table, string)); + + return (struct bfd_hash_entry *) ret; +} + +static void +elfNN_ia64_hash_copy_indirect (xdir, xind) + struct elf_link_hash_entry *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; + + /* Copy down any references that we may have already seen to the + symbol which just became indirect. */ + + dir->root.elf_link_hash_flags |= + (ind->root.elf_link_hash_flags + & (ELF_LINK_HASH_REF_DYNAMIC + | ELF_LINK_HASH_REF_REGULAR + | ELF_LINK_HASH_REF_REGULAR_NONWEAK)); + + /* Copy over the got and plt data. This would have been done + by check_relocs. */ + + if (dir->info == NULL) + { + struct elfNN_ia64_dyn_sym_info *dyn_i; + + dir->info = dyn_i = ind->info; + ind->info = NULL; + + /* Fix up the dyn_sym_info pointers to the global symbol. */ + for (; dyn_i; dyn_i = dyn_i->next) + dyn_i->h = &dir->root; + } + BFD_ASSERT (ind->info == NULL); + + /* Copy over the dynindx. */ + + if (dir->root.dynindx == -1) + { + dir->root.dynindx = ind->root.dynindx; + dir->root.dynstr_index = ind->root.dynstr_index; + ind->root.dynindx = -1; + ind->root.dynstr_index = 0; + } + BFD_ASSERT (ind->root.dynindx == -1); +} + +static void +elfNN_ia64_hash_hide_symbol (info, xh) + struct bfd_link_info *info ATTRIBUTE_UNUSED; + struct elf_link_hash_entry *xh; +{ + 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; + h->root.dynindx = -1; + + for (dyn_i = h->info; dyn_i; dyn_i = dyn_i->next) + dyn_i->want_plt2 = 0; +} + +/* Create the derived linker hash table. The IA-64 ELF port uses this + derived hash table to keep information specific to the IA-64 ElF + linker (without using static variables). */ + +static struct bfd_link_hash_table* +elfNN_ia64_hash_table_create (abfd) + bfd *abfd; +{ + struct elfNN_ia64_link_hash_table *ret; + + ret = bfd_alloc (abfd, sizeof (*ret)); + if (!ret) + return 0; + if (!_bfd_elf_link_hash_table_init (&ret->root, abfd, + elfNN_ia64_new_elf_hash_entry)) + { + bfd_release (abfd, ret); + return 0; + } + + if (!elfNN_ia64_local_hash_table_init (&ret->loc_hash_table, abfd, + elfNN_ia64_new_loc_hash_entry)) + return 0; + return &ret->root.root; +} + +/* Look up an entry in a Alpha ELF linker hash table. */ + +static INLINE struct elfNN_ia64_local_hash_entry * +elfNN_ia64_local_hash_lookup(table, string, create, copy) + struct elfNN_ia64_local_hash_table *table; + const char *string; + boolean create, copy; +{ + return ((struct elfNN_ia64_local_hash_entry *) + bfd_hash_lookup (&table->root, string, create, copy)); +} + +/* Traverse both local and global hash tables. */ + +struct elfNN_ia64_dyn_sym_traverse_data +{ + boolean (*func) PARAMS ((struct elfNN_ia64_dyn_sym_info *, PTR)); + PTR data; +}; + +static boolean +elfNN_ia64_global_dyn_sym_thunk (xentry, xdata) + struct bfd_hash_entry *xentry; + PTR xdata; +{ + struct elfNN_ia64_link_hash_entry *entry + = (struct elfNN_ia64_link_hash_entry *) xentry; + struct elfNN_ia64_dyn_sym_traverse_data *data + = (struct elfNN_ia64_dyn_sym_traverse_data *) xdata; + struct elfNN_ia64_dyn_sym_info *dyn_i; + + for (dyn_i = entry->info; dyn_i; dyn_i = dyn_i->next) + if (! (*data->func) (dyn_i, data->data)) + return false; + return true; +} + +static boolean +elfNN_ia64_local_dyn_sym_thunk (xentry, xdata) + struct bfd_hash_entry *xentry; + PTR xdata; +{ + struct elfNN_ia64_local_hash_entry *entry + = (struct elfNN_ia64_local_hash_entry *) xentry; + struct elfNN_ia64_dyn_sym_traverse_data *data + = (struct elfNN_ia64_dyn_sym_traverse_data *) xdata; + struct elfNN_ia64_dyn_sym_info *dyn_i; + + for (dyn_i = entry->info; dyn_i; dyn_i = dyn_i->next) + if (! (*data->func) (dyn_i, data->data)) + return false; + return true; +} + +static void +elfNN_ia64_dyn_sym_traverse (ia64_info, func, data) + struct elfNN_ia64_link_hash_table *ia64_info; + boolean (*func) PARAMS ((struct elfNN_ia64_dyn_sym_info *, PTR)); + PTR data; +{ + struct elfNN_ia64_dyn_sym_traverse_data xdata; + + xdata.func = func; + xdata.data = data; + + elf_link_hash_traverse (&ia64_info->root, + elfNN_ia64_global_dyn_sym_thunk, &xdata); + bfd_hash_traverse (&ia64_info->loc_hash_table.root, + elfNN_ia64_local_dyn_sym_thunk, &xdata); +} + +static boolean +elfNN_ia64_create_dynamic_sections (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + asection *s; + + if (! _bfd_elf_create_dynamic_sections (abfd, info)) + return false; + + ia64_info = elfNN_ia64_hash_table (info); + + ia64_info->plt_sec = bfd_get_section_by_name (abfd, ".plt"); + ia64_info->got_sec = bfd_get_section_by_name (abfd, ".got"); + + { + flagword flags = bfd_get_section_flags (abfd, ia64_info->got_sec); + bfd_set_section_flags (abfd, ia64_info->got_sec, SEC_SMALL_DATA | flags); + } + + if (!get_pltoff (abfd, info, ia64_info)) + return false; + + s = bfd_make_section(abfd, ".rela.IA_64.pltoff"); + if (s == NULL + || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)) + || !bfd_set_section_alignment (abfd, s, 3)) + return false; + ia64_info->rel_pltoff_sec = s; + + s = bfd_make_section(abfd, ".rela.got"); + if (s == NULL + || !bfd_set_section_flags (abfd, s, (SEC_ALLOC | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)) + || !bfd_set_section_alignment (abfd, s, 3)) + return false; + ia64_info->rel_got_sec = s; + + return true; +} + +/* 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. */ + +static struct elfNN_ia64_dyn_sym_info * +get_dyn_sym_info (ia64_info, h, abfd, rel, create) + struct elfNN_ia64_link_hash_table *ia64_info; + struct elf_link_hash_entry *h; + bfd *abfd; + const Elf_Internal_Rela *rel; + boolean create; +{ + struct elfNN_ia64_dyn_sym_info **pp; + struct elfNN_ia64_dyn_sym_info *dyn_i; + bfd_vma addend = rel ? rel->r_addend : 0; + + if (h) + pp = &((struct elfNN_ia64_link_hash_entry *)h)->info; + 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); + BFD_ASSERT (loc_h); + + pp = &loc_h->info; + } + + for (dyn_i = *pp; dyn_i && dyn_i->addend != addend; dyn_i = *pp) + pp = &dyn_i->next; + + if (dyn_i == NULL && create) + { + dyn_i = (struct elfNN_ia64_dyn_sym_info *) + bfd_zalloc (abfd, sizeof *dyn_i); + *pp = dyn_i; + dyn_i->addend = addend; + } + + return dyn_i; +} + +static asection * +get_got (abfd, info, ia64_info) + bfd *abfd; + struct bfd_link_info *info; + struct elfNN_ia64_link_hash_table *ia64_info; +{ + asection *got; + bfd *dynobj; + + got = ia64_info->got_sec; + if (!got) + { + flagword flags; + + dynobj = ia64_info->root.dynobj; + if (!dynobj) + ia64_info->root.dynobj = dynobj = abfd; + if (!_bfd_elf_create_got_section (dynobj, info)) + return 0; + + got = bfd_get_section_by_name (dynobj, ".got"); + BFD_ASSERT (got); + ia64_info->got_sec = got; + + flags = bfd_get_section_flags (abfd, got); + bfd_set_section_flags (abfd, got, SEC_SMALL_DATA | flags); + } + + return got; +} + +/* Create function descriptor section (.opd). This section is called .opd + because it contains "official prodecure descriptors". The "official" + refers to the fact that these descriptors are used when taking the address + of a procedure, thus ensuring a unique address for each procedure. */ + +static asection * +get_fptr (abfd, info, ia64_info) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + struct elfNN_ia64_link_hash_table *ia64_info; +{ + asection *fptr; + bfd *dynobj; + + fptr = ia64_info->fptr_sec; + if (!fptr) + { + dynobj = ia64_info->root.dynobj; + if (!dynobj) + ia64_info->root.dynobj = dynobj = abfd; + + fptr = bfd_make_section (dynobj, ".opd"); + if (!fptr + || !bfd_set_section_flags (dynobj, fptr, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_READONLY + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, fptr, 4)) + { + BFD_ASSERT (0); + return NULL; + } + + ia64_info->fptr_sec = fptr; + } + + return fptr; +} + +static asection * +get_pltoff (abfd, info, ia64_info) + bfd *abfd; + struct bfd_link_info *info ATTRIBUTE_UNUSED; + struct elfNN_ia64_link_hash_table *ia64_info; +{ + asection *pltoff; + bfd *dynobj; + + pltoff = ia64_info->pltoff_sec; + if (!pltoff) + { + dynobj = ia64_info->root.dynobj; + if (!dynobj) + ia64_info->root.dynobj = dynobj = abfd; + + pltoff = bfd_make_section (dynobj, ELF_STRING_ia64_pltoff); + if (!pltoff + || !bfd_set_section_flags (dynobj, pltoff, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_SMALL_DATA + | SEC_LINKER_CREATED)) + || !bfd_set_section_alignment (abfd, pltoff, 4)) + { + BFD_ASSERT (0); + return NULL; + } + + ia64_info->pltoff_sec = pltoff; + } + + return pltoff; +} + +static asection * +get_reloc_section (abfd, ia64_info, sec, create) + bfd *abfd; + struct elfNN_ia64_link_hash_table *ia64_info; + asection *sec; + boolean create; +{ + const char *srel_name; + asection *srel; + bfd *dynobj; + + srel_name = (bfd_elf_string_from_elf_section + (abfd, elf_elfheader(abfd)->e_shstrndx, + elf_section_data(sec)->rel_hdr.sh_name)); + if (srel_name == NULL) + return NULL; + + BFD_ASSERT ((strncmp (srel_name, ".rela", 5) == 0 + && strcmp (bfd_get_section_name (abfd, sec), + srel_name+5) == 0) + || (strncmp (srel_name, ".rel", 4) == 0 + && strcmp (bfd_get_section_name (abfd, sec), + srel_name+4) == 0)); + + dynobj = ia64_info->root.dynobj; + if (!dynobj) + ia64_info->root.dynobj = dynobj = abfd; + + srel = bfd_get_section_by_name (dynobj, srel_name); + if (srel == NULL && create) + { + srel = bfd_make_section (dynobj, srel_name); + if (srel == NULL + || !bfd_set_section_flags (dynobj, srel, + (SEC_ALLOC + | SEC_LOAD + | SEC_HAS_CONTENTS + | SEC_IN_MEMORY + | SEC_LINKER_CREATED + | SEC_READONLY)) + || !bfd_set_section_alignment (dynobj, srel, 3)) + return NULL; + } + + return srel; +} + +static boolean +count_dyn_reloc (abfd, dyn_i, srel, type) + bfd *abfd; + struct elfNN_ia64_dyn_sym_info *dyn_i; + asection *srel; + int type; +{ + struct elfNN_ia64_dyn_reloc_entry *rent; + + for (rent = dyn_i->reloc_entries; rent; rent = rent->next) + if (rent->srel == srel && rent->type == type) + break; + + if (!rent) + { + rent = (struct elfNN_ia64_dyn_reloc_entry *) + bfd_alloc (abfd, sizeof (*rent)); + if (!rent) + return false; + + rent->next = dyn_i->reloc_entries; + rent->srel = srel; + rent->type = type; + rent->count = 0; + dyn_i->reloc_entries = rent; + } + rent->count++; + + return true; +} + +static boolean +elfNN_ia64_check_relocs (abfd, info, sec, relocs) + bfd *abfd; + struct bfd_link_info *info; + asection *sec; + const Elf_Internal_Rela *relocs; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + const Elf_Internal_Rela *relend; + Elf_Internal_Shdr *symtab_hdr; + const Elf_Internal_Rela *rel; + asection *got, *fptr, *srel; + + if (info->relocateable) + return true; + + symtab_hdr = &elf_tdata (abfd)->symtab_hdr; + ia64_info = elfNN_ia64_hash_table (info); + + got = fptr = srel = NULL; + + relend = relocs + sec->reloc_count; + for (rel = relocs; rel < relend; ++rel) + { + enum { + NEED_GOT = 1, + NEED_FPTR = 2, + NEED_PLTOFF = 4, + NEED_MIN_PLT = 8, + NEED_FULL_PLT = 16, + NEED_DYNREL = 32, + NEED_LTOFF_FPTR = 64, + }; + + struct elf_link_hash_entry *h = NULL; + unsigned long r_symndx = ELFNN_R_SYM (rel->r_info); + struct elfNN_ia64_dyn_sym_info *dyn_i; + int need_entry; + boolean maybe_dynamic; + int dynrel_type = R_IA64_NONE; + + if (r_symndx >= symtab_hdr->sh_info) + { + /* We're dealing with a global symbol -- find its hash entry + and mark it as being referenced. */ + long indx = r_symndx - symtab_hdr->sh_info; + h = elf_sym_hashes (abfd)[indx]; + 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; + + h->elf_link_hash_flags |= ELF_LINK_HASH_REF_REGULAR; + } + + /* We can only get preliminary data on whether a symbol is + locally or externally defined, as not all of the input files + have yet been processed. Do something with what we know, as + this may help reduce memory usage and processing time later. */ + maybe_dynamic = false; + if (h && ((info->shared && ! info->symbolic) + || ! (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) + || h->root.type == bfd_link_hash_defweak)) + maybe_dynamic = true; + + need_entry = 0; + switch (ELFNN_R_TYPE (rel->r_info)) + { + case R_IA64_TPREL22: + case R_IA64_TPREL64MSB: + case R_IA64_TPREL64LSB: + case R_IA64_LTOFF_TP22: + return false; + + case R_IA64_LTOFF_FPTR22: + case R_IA64_LTOFF_FPTR64I: + case R_IA64_LTOFF_FPTR64MSB: + case R_IA64_LTOFF_FPTR64LSB: + need_entry = NEED_FPTR | NEED_GOT | NEED_LTOFF_FPTR; + break; + + case R_IA64_FPTR64I: + case R_IA64_FPTR32MSB: + case R_IA64_FPTR32LSB: + case R_IA64_FPTR64MSB: + case R_IA64_FPTR64LSB: + if (info->shared || h) + need_entry = NEED_FPTR | NEED_DYNREL; + else + need_entry = NEED_FPTR; + dynrel_type = R_IA64_FPTR64LSB; + break; + + case R_IA64_LTOFF22: + case R_IA64_LTOFF22X: + case R_IA64_LTOFF64I: + need_entry = NEED_GOT; + break; + + case R_IA64_PLTOFF22: + case R_IA64_PLTOFF64I: + case R_IA64_PLTOFF64MSB: + case R_IA64_PLTOFF64LSB: + need_entry = NEED_PLTOFF; + if (h) + { + if (maybe_dynamic) + need_entry |= NEED_MIN_PLT; + } + else + { + (*info->callbacks->warning) + (info, _("@pltoff reloc against local symbol"), 0, + abfd, 0, 0); + } + break; + + case R_IA64_PCREL21B: + case R_IA64_PCREL60B: + /* Depending on where this symbol is defined, we may or may not + need a full plt entry. Only skip if we know we'll not need + the entry -- static or symbolic, and the symbol definition + has already been seen. */ + if (maybe_dynamic && rel->r_addend == 0) + need_entry = NEED_FULL_PLT; + break; + + case R_IA64_IMM14: + case R_IA64_IMM22: + case R_IA64_IMM64: + case R_IA64_DIR32MSB: + case R_IA64_DIR32LSB: + case R_IA64_DIR64MSB: + case R_IA64_DIR64LSB: + /* Shared objects will always need at least a REL relocation. */ + if (info->shared || maybe_dynamic) + need_entry = NEED_DYNREL; + dynrel_type = R_IA64_DIR64LSB; + break; + + case R_IA64_IPLTMSB: + case R_IA64_IPLTLSB: + /* Shared objects will always need at least a REL relocation. */ + if (info->shared || maybe_dynamic) + need_entry = NEED_DYNREL; + dynrel_type = R_IA64_IPLTLSB; + break; + + case R_IA64_PCREL22: + case R_IA64_PCREL64I: + case R_IA64_PCREL32MSB: + case R_IA64_PCREL32LSB: + case R_IA64_PCREL64MSB: + case R_IA64_PCREL64LSB: + if (maybe_dynamic) + need_entry = NEED_DYNREL; + dynrel_type = R_IA64_PCREL64LSB; + break; + } + + if (!need_entry) + continue; + + if ((need_entry & NEED_FPTR) != 0 + && rel->r_addend) + { + (*info->callbacks->warning) + (info, _("non-zero addend in @fptr reloc"), 0, + abfd, 0, 0); + } + + dyn_i = get_dyn_sym_info (ia64_info, h, abfd, rel, true); + + /* Record whether or not this is a local symbol. */ + dyn_i->h = h; + + /* Create what's needed. */ + if (need_entry & NEED_GOT) + { + if (!got) + { + got = get_got (abfd, info, ia64_info); + if (!got) + return false; + } + dyn_i->want_got = 1; + } + if (need_entry & NEED_FPTR) + { + if (!fptr) + { + fptr = get_fptr (abfd, info, ia64_info); + if (!fptr) + return false; + } + + /* 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 (! (_bfd_elfNN_link_record_local_dynamic_symbol + (info, abfd, r_symndx))) + return false; + } + + dyn_i->want_fptr = 1; + } + if (need_entry & NEED_LTOFF_FPTR) + dyn_i->want_ltoff_fptr = 1; + if (need_entry & (NEED_MIN_PLT | NEED_FULL_PLT)) + { + if (!ia64_info->root.dynobj) + ia64_info->root.dynobj = abfd; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + dyn_i->want_plt = 1; + } + if (need_entry & NEED_FULL_PLT) + dyn_i->want_plt2 = 1; + if (need_entry & NEED_PLTOFF) + dyn_i->want_pltoff = 1; + if ((need_entry & NEED_DYNREL) && (sec->flags & SEC_ALLOC)) + { + if (!srel) + { + srel = get_reloc_section (abfd, ia64_info, sec, true); + if (!srel) + return false; + } + if (!count_dyn_reloc (abfd, dyn_i, srel, dynrel_type)) + return false; + } + } + + return true; +} + +struct elfNN_ia64_allocate_data +{ + struct bfd_link_info *info; + bfd_size_type ofs; +}; + +/* For cleanliness, and potentially faster dynamic loading, allocate + external GOT entries first. */ + +static boolean +allocate_global_data_got (dyn_i, data) + struct elfNN_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; + + if (dyn_i->want_got + && ! dyn_i->want_fptr + && elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info)) + { + dyn_i->got_offset = x->ofs; + x->ofs += 8; + } + return true; +} + +/* Next, allocate all the GOT entries used by LTOFF_FPTR relocs. */ + +static boolean +allocate_global_fptr_got (dyn_i, data) + struct elfNN_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; + + if (dyn_i->want_got + && dyn_i->want_fptr + && elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info)) + { + dyn_i->got_offset = x->ofs; + x->ofs += 8; + } + return true; +} + +/* Lastly, allocate all the GOT entries for local data. */ + +static boolean +allocate_local_got (dyn_i, data) + struct elfNN_ia64_dyn_sym_info *dyn_i; + PTR 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)) + { + dyn_i->got_offset = x->ofs; + x->ofs += 8; + } + return true; +} + +/* Search for the index of a global symbol in it's defining object file. */ + +static unsigned long +global_sym_index (h) + struct elf_link_hash_entry *h; +{ + struct elf_link_hash_entry **p; + bfd *obj; + + BFD_ASSERT (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak); + + obj = h->root.u.def.section->owner; + for (p = elf_sym_hashes (obj); *p != h; ++p) + continue; + + return p - elf_sym_hashes (obj) + elf_tdata (obj)->symtab_hdr.sh_info; +} + +/* Allocate function descriptors. We can do these for every function + in a main executable that is not exported. */ + +static boolean +allocate_fptr (dyn_i, data) + struct elfNN_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; + + if (dyn_i->want_fptr) + { + struct elf_link_hash_entry *h = dyn_i->h; + + if (h) + 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 (x->info->shared) + { + if (h && h->dynindx == -1) + { + BFD_ASSERT ((h->root.type == bfd_link_hash_defined) + || (h->root.type == bfd_link_hash_defweak)); + + if (!_bfd_elfNN_link_record_local_dynamic_symbol + (x->info, h->root.u.def.section->owner, + global_sym_index (h))) + return false; + } + + dyn_i->want_fptr = 0; + } + else if (h == NULL || h->dynindx == -1) + { + dyn_i->fptr_offset = x->ofs; + x->ofs += 16; + } + else + dyn_i->want_fptr = 0; + } + return true; +} + +/* Allocate all the minimal PLT entries. */ + +static boolean +allocate_plt_entries (dyn_i, data) + struct elfNN_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; + + if (dyn_i->want_plt) + { + struct elf_link_hash_entry *h = dyn_i->h; + + if (h) + 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; + + /* ??? Versioned symbols seem to lose ELF_LINK_HASH_NEEDS_PLT. */ + if (elfNN_ia64_dynamic_symbol_p (h, x->info)) + { + bfd_size_type offset = x->ofs; + if (offset == 0) + offset = PLT_HEADER_SIZE; + dyn_i->plt_offset = offset; + x->ofs = offset + PLT_MIN_ENTRY_SIZE; + + dyn_i->want_pltoff = 1; + } + else + { + dyn_i->want_plt = 0; + dyn_i->want_plt2 = 0; + } + } + return true; +} + +/* Allocate all the full PLT entries. */ + +static boolean +allocate_plt2_entries (dyn_i, data) + struct elfNN_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; + + if (dyn_i->want_plt2) + { + struct elf_link_hash_entry *h = dyn_i->h; + bfd_size_type ofs = x->ofs; + + dyn_i->plt2_offset = ofs; + x->ofs = ofs + PLT_FULL_ENTRY_SIZE; + + 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; + dyn_i->h->plt.offset = ofs; + } + return true; +} + +/* Allocate all the PLTOFF entries requested by relocations and + plt entries. We can't share space with allocated FPTR entries, + because the latter are not necessarily addressable by the GP. + ??? Relaxation might be able to determine that they are. */ + +static boolean +allocate_pltoff_entries (dyn_i, data) + struct elfNN_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; + + if (dyn_i->want_pltoff) + { + dyn_i->pltoff_offset = x->ofs; + x->ofs += 16; + } + return true; +} + +/* Allocate dynamic relocations for those symbols that turned out + to be dynamic. */ + +static boolean +allocate_dynrel_entries (dyn_i, data) + struct elfNN_ia64_dyn_sym_info *dyn_i; + PTR data; +{ + struct elfNN_ia64_allocate_data *x = (struct elfNN_ia64_allocate_data *)data; + struct elfNN_ia64_link_hash_table *ia64_info; + struct elfNN_ia64_dyn_reloc_entry *rent; + boolean dynamic_symbol, shared; + + ia64_info = elfNN_ia64_hash_table (x->info); + dynamic_symbol = elfNN_ia64_dynamic_symbol_p (dyn_i->h, x->info); + shared = x->info->shared; + + /* Take care of the normal data relocations. */ + + for (rent = dyn_i->reloc_entries; rent; rent = rent->next) + { + int count = rent->count; + + switch (rent->type) + { + case R_IA64_FPTR64LSB: + /* Allocate one iff !want_fptr, which by this point will + be true only if we're actually allocating one statically + in the main executable. */ + if (dyn_i->want_fptr) + continue; + break; + case R_IA64_PCREL64LSB: + if (!dynamic_symbol) + continue; + break; + case R_IA64_DIR64LSB: + if (!dynamic_symbol && !shared) + continue; + break; + case R_IA64_IPLTLSB: + if (!dynamic_symbol && !shared) + continue; + /* Use two REL relocations for IPLT relocations + against local symbols. */ + if (!dynamic_symbol) + count *= 2; + break; + default: + abort (); + } + rent->srel->_raw_size += sizeof (ElfNN_External_Rela) * count; + } + + /* Take care of the GOT and PLT relocations. */ + + if (((dynamic_symbol || shared) && dyn_i->want_got) + || (dyn_i->want_ltoff_fptr && dyn_i->h && dyn_i->h->dynindx != -1)) + ia64_info->rel_got_sec->_raw_size += sizeof (ElfNN_External_Rela); + + if (dyn_i->want_pltoff) + { + bfd_size_type t = 0; + + /* Dynamic symbols get one IPLT relocation. Local symbols in + shared libraries get two REL relocations. Local symbols in + main applications get nothing. */ + if (dynamic_symbol) + t = sizeof (ElfNN_External_Rela); + else if (shared) + t = 2 * sizeof (ElfNN_External_Rela); + + ia64_info->rel_pltoff_sec->_raw_size += t; + } + + return true; +} + +static boolean +elfNN_ia64_adjust_dynamic_symbol (info, h) + struct bfd_link_info *info ATTRIBUTE_UNUSED; + struct elf_link_hash_entry *h; +{ + /* ??? Undefined symbols with PLT entries should be re-defined + to be the PLT entry. */ + + /* 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; + } + + /* If this is a reference to a symbol defined by a dynamic object which + is not a function, we might allocate the symbol in our .dynbss section + and allocate a COPY dynamic relocation. + + But IA-64 code is canonically PIC, so as a rule we can avoid this sort + of hackery. */ + + return true; +} + +static boolean +elfNN_ia64_size_dynamic_sections (output_bfd, info) + bfd *output_bfd; + struct bfd_link_info *info; +{ + struct elfNN_ia64_allocate_data data; + struct elfNN_ia64_link_hash_table *ia64_info; + asection *sec; + bfd *dynobj; + boolean reltext = false; + boolean relplt = false; + + dynobj = elf_hash_table(info)->dynobj; + ia64_info = elfNN_ia64_hash_table (info); + BFD_ASSERT(dynobj != NULL); + data.info = info; + + /* Set the contents of the .interp section to the interpreter. */ + if (ia64_info->root.dynamic_sections_created + && !info->shared) + { + 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; + } + + /* Allocate the GOT entries. */ + + if (ia64_info->got_sec) + { + data.ofs = 0; + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_global_data_got, &data); + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_global_fptr_got, &data); + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_local_got, &data); + ia64_info->got_sec->_raw_size = data.ofs; + } + + /* Allocate the FPTR entries. */ + + if (ia64_info->fptr_sec) + { + data.ofs = 0; + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_fptr, &data); + ia64_info->fptr_sec->_raw_size = data.ofs; + } + + /* Now that we've seen all of the input files, we can decide which + symbols need plt entries. Allocate the minimal PLT entries first. + We do this even though dynamic_sections_created may be false, because + this has the side-effect of clearing want_plt and want_plt2. */ + + data.ofs = 0; + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_plt_entries, &data); + + ia64_info->minplt_entries = 0; + if (data.ofs) + { + ia64_info->minplt_entries + = (data.ofs - PLT_HEADER_SIZE) / PLT_MIN_ENTRY_SIZE; + } + + /* Align the pointer for the plt2 entries. */ + data.ofs = (data.ofs + 31) & -32; + + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_plt2_entries, &data); + if (data.ofs != 0) + { + BFD_ASSERT (ia64_info->root.dynamic_sections_created); + + ia64_info->plt_sec->_raw_size = data.ofs; + + /* If we've got a .plt, we need some extra memory for the dynamic + linker. We stuff these in .got.plt. */ + sec = bfd_get_section_by_name (dynobj, ".got.plt"); + sec->_raw_size = 8 * PLT_RESERVED_WORDS; + } + + /* Allocate the PLTOFF entries. */ + + if (ia64_info->pltoff_sec) + { + data.ofs = 0; + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_pltoff_entries, &data); + ia64_info->pltoff_sec->_raw_size = data.ofs; + } + + if (ia64_info->root.dynamic_sections_created) + { + /* Allocate space for the dynamic relocations that turned out to be + required. */ + + elfNN_ia64_dyn_sym_traverse (ia64_info, allocate_dynrel_entries, &data); + } + + /* We have now determined the sizes of the various dynamic sections. + Allocate memory for them. */ + for (sec = dynobj->sections; sec != NULL; sec = sec->next) + { + boolean strip; + + if (!(sec->flags & SEC_LINKER_CREATED)) + continue; + + /* If we don't need this section, strip it from the output file. + There were several sections primarily related to dynamic + linking that must be create before the linker maps input + sections to output sections. The linker does that before + bfd_elf_size_dynamic_sections is called, and it is that + function which decides whether anything needs to go into + these sections. */ + + strip = (sec->_raw_size == 0); + + if (sec == ia64_info->got_sec) + strip = false; + else if (sec == ia64_info->rel_got_sec) + { + if (strip) + ia64_info->rel_got_sec = NULL; + else + /* We use the reloc_count field as a counter if we need to + copy relocs into the output file. */ + sec->reloc_count = 0; + } + else if (sec == ia64_info->fptr_sec) + { + if (strip) + ia64_info->fptr_sec = NULL; + } + else if (sec == ia64_info->plt_sec) + { + if (strip) + ia64_info->plt_sec = NULL; + } + else if (sec == ia64_info->pltoff_sec) + { + if (strip) + ia64_info->pltoff_sec = NULL; + } + else if (sec == ia64_info->rel_pltoff_sec) + { + if (strip) + ia64_info->rel_pltoff_sec = NULL; + else + { + relplt = true; + /* We use the reloc_count field as a counter if we need to + copy relocs into the output file. */ + sec->reloc_count = 0; + } + } + else + { + const char *name; + + /* 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, sec); + + if (strcmp (name, ".got.plt") == 0) + strip = false; + else if (strncmp (name, ".rel", 4) == 0) + { + 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; + } + } + else + continue; + } + + if (strip) + _bfd_strip_section_from_output (info, sec); + else + { + /* Allocate memory for the section contents. */ + sec->contents = (bfd_byte *) bfd_zalloc(dynobj, sec->_raw_size); + if (sec->contents == NULL && sec->_raw_size != 0) + return false; + } + } + + if (elf_hash_table (info)->dynamic_sections_created) + { + /* Add some entries to the .dynamic section. We fill in the values + later (in finish_dynamic_sections) but we must add the entries now + so that we get the correct size for the .dynamic section. */ + + if (!info->shared) + { + /* 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)) + return false; + } + + if (! bfd_elfNN_add_dynamic_entry (info, DT_IA_64_PLT_RESERVE, 0)) + return false; + if (! bfd_elfNN_add_dynamic_entry (info, 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)) + 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))) + return false; + + if (reltext) + { + if (! bfd_elfNN_add_dynamic_entry (info, DT_TEXTREL, 0)) + return false; + info->flags |= DF_TEXTREL; + } + } + + /* ??? Perhaps force __gp local. */ + + return true; +} + +static bfd_reloc_status_type +elfNN_ia64_install_value (abfd, hit_addr, val, r_type) + bfd *abfd; + bfd_byte *hit_addr; + bfd_vma val; + unsigned int r_type; +{ + const struct ia64_operand *op; + int bigendian = 0, shift = 0; + bfd_vma t0, t1, insn, dword; + enum ia64_opnd opnd; + const char *err; + size_t size = 8; + + opnd = IA64_OPND_NIL; + switch (r_type) + { + case R_IA64_NONE: + case R_IA64_LDXMOV: + return bfd_reloc_ok; + + /* Instruction relocations. */ + + case R_IA64_IMM14: opnd = IA64_OPND_IMM14; break; + + case R_IA64_PCREL21F: opnd = IA64_OPND_TGT25; break; + case R_IA64_PCREL21M: opnd = IA64_OPND_TGT25b; break; + case R_IA64_PCREL60B: opnd = IA64_OPND_TGT64; break; + case R_IA64_PCREL21B: + case R_IA64_PCREL21BI: + opnd = IA64_OPND_TGT25c; + break; + + case R_IA64_IMM22: + case R_IA64_GPREL22: + case R_IA64_LTOFF22: + case R_IA64_LTOFF22X: + case R_IA64_PLTOFF22: + case R_IA64_PCREL22: + case R_IA64_LTOFF_FPTR22: + opnd = IA64_OPND_IMM22; + break; + + case R_IA64_IMM64: + case R_IA64_GPREL64I: + case R_IA64_LTOFF64I: + case R_IA64_PLTOFF64I: + case R_IA64_PCREL64I: + case R_IA64_FPTR64I: + case R_IA64_LTOFF_FPTR64I: + opnd = IA64_OPND_IMMU64; + break; + + /* Data relocations. */ + + case R_IA64_DIR32MSB: + case R_IA64_GPREL32MSB: + case R_IA64_FPTR32MSB: + case R_IA64_PCREL32MSB: + case R_IA64_SEGREL32MSB: + case R_IA64_SECREL32MSB: + case R_IA64_LTV32MSB: + size = 4; bigendian = 1; + break; + + case R_IA64_DIR32LSB: + case R_IA64_GPREL32LSB: + case R_IA64_FPTR32LSB: + case R_IA64_PCREL32LSB: + case R_IA64_SEGREL32LSB: + case R_IA64_SECREL32LSB: + case R_IA64_LTV32LSB: + size = 4; bigendian = 0; + break; + + case R_IA64_DIR64MSB: + case R_IA64_GPREL64MSB: + case R_IA64_PLTOFF64MSB: + case R_IA64_FPTR64MSB: + case R_IA64_PCREL64MSB: + case R_IA64_LTOFF_FPTR64MSB: + case R_IA64_SEGREL64MSB: + case R_IA64_SECREL64MSB: + case R_IA64_LTV64MSB: + size = 8; bigendian = 1; + break; + + case R_IA64_DIR64LSB: + case R_IA64_GPREL64LSB: + case R_IA64_PLTOFF64LSB: + case R_IA64_FPTR64LSB: + case R_IA64_PCREL64LSB: + case R_IA64_LTOFF_FPTR64LSB: + case R_IA64_SEGREL64LSB: + case R_IA64_SECREL64LSB: + case R_IA64_LTV64LSB: + size = 8; bigendian = 0; + break; + + /* Unsupported / Dynamic relocations. */ + default: + return bfd_reloc_notsupported; + } + + switch (opnd) + { + case IA64_OPND_IMMU64: + hit_addr -= (long) hit_addr & 0x3; + t0 = bfd_get_64 (abfd, hit_addr); + t1 = bfd_get_64 (abfd, hit_addr + 8); + + /* tmpl/s: bits 0.. 5 in t0 + slot 0: bits 5..45 in t0 + slot 1: bits 46..63 in t0, bits 0..22 in t1 + slot 2: bits 23..63 in t1 */ + + /* First, clear the bits that form the 64 bit constant. */ + t0 &= ~(0x3ffffLL << 46); + t1 &= ~(0x7fffffLL + | (( (0x07fLL << 13) | (0x1ffLL << 27) + | (0x01fLL << 22) | (0x001LL << 21) + | (0x001LL << 36)) << 23)); + + t0 |= ((val >> 22) & 0x03ffffLL) << 46; /* 18 lsbs of imm41 */ + t1 |= ((val >> 40) & 0x7fffffLL) << 0; /* 23 msbs of imm41 */ + t1 |= ( (((val >> 0) & 0x07f) << 13) /* imm7b */ + | (((val >> 7) & 0x1ff) << 27) /* imm9d */ + | (((val >> 16) & 0x01f) << 22) /* imm5c */ + | (((val >> 21) & 0x001) << 21) /* ic */ + | (((val >> 63) & 0x001) << 36)) << 23; /* i */ + + bfd_put_64 (abfd, t0, hit_addr); + bfd_put_64 (abfd, t1, hit_addr + 8); + break; + + case IA64_OPND_TGT64: + hit_addr -= (long) hit_addr & 0x3; + t0 = bfd_get_64 (abfd, hit_addr); + t1 = bfd_get_64 (abfd, hit_addr + 8); + + /* tmpl/s: bits 0.. 5 in t0 + slot 0: bits 5..45 in t0 + slot 1: bits 46..63 in t0, bits 0..22 in t1 + slot 2: bits 23..63 in t1 */ + + /* First, clear the bits that form the 64 bit constant. */ + t0 &= ~(0x3ffffLL << 46); + t1 &= ~(0x7fffffLL + | ((1LL << 36 | 0xfffffLL << 13) << 23)); + + val >>= 4; + t0 |= ((val >> 20) & 0xffffLL) << 2 << 46; /* 16 lsbs of imm39 */ + t1 |= ((val >> 36) & 0x7fffffLL) << 0; /* 23 msbs of imm39 */ + t1 |= ((((val >> 0) & 0xfffffLL) << 13) /* imm20b */ + | (((val >> 59) & 0x1LL) << 36)) << 23; /* i */ + + bfd_put_64 (abfd, t0, hit_addr); + bfd_put_64 (abfd, t1, hit_addr + 8); + break; + + default: + switch ((long) hit_addr & 0x3) + { + case 0: shift = 5; break; + case 1: shift = 14; hit_addr += 3; break; + case 2: shift = 23; hit_addr += 6; break; + case 3: return bfd_reloc_notsupported; /* shouldn't happen... */ + } + dword = bfd_get_64 (abfd, hit_addr); + insn = (dword >> shift) & 0x1ffffffffffLL; + + op = elf64_ia64_operands + opnd; + err = (*op->insert) (op, val, &insn); + if (err) + return bfd_reloc_overflow; + + dword &= ~(0x1ffffffffffLL << shift); + dword |= (insn << shift); + bfd_put_64 (abfd, dword, hit_addr); + break; + + case IA64_OPND_NIL: + /* A data relocation. */ + if (bigendian) + if (size == 4) + bfd_putb32 (val, hit_addr); + else + bfd_putb64 (val, hit_addr); + else + if (size == 4) + bfd_putl32 (val, hit_addr); + else + bfd_putl64 (val, hit_addr); + break; + } + + return bfd_reloc_ok; +} + +static void +elfNN_ia64_install_dyn_reloc (abfd, info, sec, srel, offset, type, + dynindx, addend) + bfd *abfd; + struct bfd_link_info *info; + asection *sec; + asection *srel; + bfd_vma offset; + unsigned int type; + long dynindx; + bfd_vma addend; +{ + Elf_Internal_Rela outrel; + + outrel.r_offset = (sec->output_section->vma + + sec->output_offset + + 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) + { + /* 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; + } + + bfd_elfNN_swap_reloca_out (abfd, &outrel, + ((ElfNN_External_Rela *) srel->contents + + srel->reloc_count++)); + BFD_ASSERT (sizeof (ElfNN_External_Rela) * srel->reloc_count + <= srel->_cooked_size); +} + +/* Store an entry for target address TARGET_ADDR in the linkage table + and return the gp-relative address of the linkage table entry. */ + +static bfd_vma +set_got_entry (abfd, info, dyn_i, dynindx, addend, value, dyn_r_type) + bfd *abfd; + struct bfd_link_info *info; + struct elfNN_ia64_dyn_sym_info *dyn_i; + long dynindx; + bfd_vma addend; + bfd_vma value; + unsigned int dyn_r_type; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + asection *got_sec; + + ia64_info = elfNN_ia64_hash_table (info); + got_sec = ia64_info->got_sec; + + BFD_ASSERT ((dyn_i->got_offset & 7) == 0); + + if (! dyn_i->got_done) + { + dyn_i->got_done = true; + + /* Store the target address in the linkage table entry. */ + bfd_put_64 (abfd, value, got_sec->contents + dyn_i->got_offset); + + /* Install a dynamic relocation if needed. */ + if (info->shared + || elfNN_ia64_dynamic_symbol_p (dyn_i->h, info) + || (dynindx != -1 && dyn_r_type == R_IA64_FPTR64LSB)) + { + if (dynindx == -1) + { + dyn_r_type = R_IA64_REL64LSB; + dynindx = 0; + addend = value; + } + + if (bfd_big_endian (abfd)) + { + switch (dyn_r_type) + { + case R_IA64_REL64LSB: + dyn_r_type = R_IA64_REL64MSB; + break; + case R_IA64_DIR64LSB: + dyn_r_type = R_IA64_DIR64MSB; + break; + case R_IA64_FPTR64LSB: + dyn_r_type = R_IA64_FPTR64MSB; + break; + default: + BFD_ASSERT (false); + break; + } + } + + elfNN_ia64_install_dyn_reloc (abfd, NULL, got_sec, + ia64_info->rel_got_sec, + dyn_i->got_offset, dyn_r_type, + dynindx, addend); + } + } + + /* Return the address of the linkage table entry. */ + value = (got_sec->output_section->vma + + got_sec->output_offset + + dyn_i->got_offset); + + return value; +} + +/* Fill in a function descriptor consisting of the function's code + address and its global pointer. Return the descriptor's address. */ + +static bfd_vma +set_fptr_entry (abfd, info, dyn_i, value) + bfd *abfd; + struct bfd_link_info *info; + struct elfNN_ia64_dyn_sym_info *dyn_i; + bfd_vma value; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + asection *fptr_sec; + + ia64_info = elfNN_ia64_hash_table (info); + fptr_sec = ia64_info->fptr_sec; + + if (!dyn_i->fptr_done) + { + dyn_i->fptr_done = 1; + + /* Fill in the function descriptor. */ + bfd_put_64 (abfd, value, fptr_sec->contents + dyn_i->fptr_offset); + bfd_put_64 (abfd, _bfd_get_gp_value (abfd), + fptr_sec->contents + dyn_i->fptr_offset + 8); + } + + /* Return the descriptor's address. */ + value = (fptr_sec->output_section->vma + + fptr_sec->output_offset + + dyn_i->fptr_offset); + + return value; +} + +/* Fill in a PLTOFF entry consisting of the function's code address + and its global pointer. Return the descriptor's address. */ + +static bfd_vma +set_pltoff_entry (abfd, info, dyn_i, value, is_plt) + bfd *abfd; + struct bfd_link_info *info; + struct elfNN_ia64_dyn_sym_info *dyn_i; + bfd_vma value; + boolean is_plt; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + asection *pltoff_sec; + + ia64_info = elfNN_ia64_hash_table (info); + pltoff_sec = ia64_info->pltoff_sec; + + /* Don't do anything if this symbol uses a real PLT entry. In + that case, we'll fill this in during finish_dynamic_symbol. */ + if ((! dyn_i->want_plt || is_plt) + && !dyn_i->pltoff_done) + { + bfd_vma gp = _bfd_get_gp_value (abfd); + + /* Fill in the function descriptor. */ + bfd_put_64 (abfd, value, pltoff_sec->contents + dyn_i->pltoff_offset); + bfd_put_64 (abfd, gp, pltoff_sec->contents + dyn_i->pltoff_offset + 8); + + /* Install dynamic relocations if needed. */ + if (!is_plt && info->shared) + { + unsigned int dyn_r_type; + + if (bfd_big_endian (abfd)) + dyn_r_type = R_IA64_REL64MSB; + else + dyn_r_type = R_IA64_REL64LSB; + + elfNN_ia64_install_dyn_reloc (abfd, NULL, pltoff_sec, + ia64_info->rel_pltoff_sec, + dyn_i->pltoff_offset, + dyn_r_type, 0, value); + elfNN_ia64_install_dyn_reloc (abfd, NULL, pltoff_sec, + ia64_info->rel_pltoff_sec, + dyn_i->pltoff_offset + 8, + dyn_r_type, 0, gp); + } + + dyn_i->pltoff_done = 1; + } + + /* Return the descriptor's address. */ + value = (pltoff_sec->output_section->vma + + pltoff_sec->output_offset + + dyn_i->pltoff_offset); + + return value; +} + +/* Called through qsort to sort the .IA_64.unwind section during a + non-relocatable link. Set elfNN_ia64_unwind_entry_compare_bfd + to the output bfd so we can do proper endianness frobbing. */ + +static bfd *elfNN_ia64_unwind_entry_compare_bfd; + +static int +elfNN_ia64_unwind_entry_compare (a, b) + PTR a; + PTR b; +{ + bfd_vma av, bv; + + av = bfd_get_64 (elfNN_ia64_unwind_entry_compare_bfd, a); + bv = bfd_get_64 (elfNN_ia64_unwind_entry_compare_bfd, b); + + return (av < bv ? -1 : av > bv ? 1 : 0); +} + +static boolean +elfNN_ia64_final_link (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + asection *unwind_output_sec; + + ia64_info = elfNN_ia64_hash_table (info); + + /* Make sure we've got ourselves a nice fat __gp value. */ + if (!info->relocateable) + { + bfd_vma min_vma = (bfd_vma) -1, max_vma = 0; + bfd_vma min_short_vma = min_vma, max_short_vma = 0; + struct elf_link_hash_entry *gp; + bfd_vma gp_val; + asection *os; + + /* Find the min and max vma of all sections marked short. Also + collect min and max vma of any type, for use in selecting a + nice gp. */ + for (os = abfd->sections; os ; os = os->next) + { + bfd_vma lo, hi; + + if ((os->flags & SEC_ALLOC) == 0) + continue; + + lo = os->vma; + hi = os->vma + os->_raw_size; + if (hi < lo) + hi = (bfd_vma) -1; + + if (min_vma > lo) + min_vma = lo; + if (max_vma < hi) + max_vma = hi; + if (os->flags & SEC_SMALL_DATA) + { + if (min_short_vma > lo) + min_short_vma = lo; + if (max_short_vma < hi) + max_short_vma = hi; + } + } + + /* See if the user wants to force a value. */ + gp = elf_link_hash_lookup (elf_hash_table (info), "__gp", false, + false, false); + + if (gp + && (gp->root.type == bfd_link_hash_defined + || gp->root.type == bfd_link_hash_defweak)) + { + asection *gp_sec = gp->root.u.def.section; + gp_val = (gp->root.u.def.value + + gp_sec->output_section->vma + + gp_sec->output_offset); + } + else + { + /* Pick a sensible value. */ + + asection *got_sec = ia64_info->got_sec; + + /* Start with just the address of the .got. */ + if (got_sec) + gp_val = got_sec->output_section->vma; + else if (max_short_vma != 0) + gp_val = min_short_vma; + else + gp_val = min_vma; + + /* If it is possible to address the entire image, but we + don't with the choice above, adjust. */ + if (max_vma - min_vma < 0x400000 + && max_vma - gp_val <= 0x200000 + && gp_val - min_vma > 0x200000) + gp_val = min_vma + 0x200000; + else if (max_short_vma != 0) + { + /* If we don't cover all the short data, adjust. */ + if (max_short_vma - gp_val >= 0x200000) + gp_val = min_short_vma + 0x200000; + + /* If we're addressing stuff past the end, adjust back. */ + if (gp_val > max_vma) + gp_val = max_vma - 0x200000 + 8; + } + } + + /* Validate whether all SHF_IA_64_SHORT sections are within + range of the chosen GP. */ + + if (max_short_vma != 0) + { + if (max_short_vma - min_short_vma >= 0x400000) + { + (*_bfd_error_handler) + (_("%s: short data segment overflowed (0x%lx >= 0x400000)"), + bfd_get_filename (abfd), + (unsigned long) (max_short_vma - min_short_vma)); + return false; + } + else if ((gp_val > min_short_vma + && gp_val - min_short_vma > 0x200000) + || (gp_val < max_short_vma + && max_short_vma - gp_val >= 0x200000)) + { + (*_bfd_error_handler) + (_("%s: __gp does not cover short data segment"), + bfd_get_filename (abfd)); + return false; + } + } + + _bfd_set_gp_value (abfd, gp_val); + + if (gp) + { + gp->root.type = bfd_link_hash_defined; + gp->root.u.def.value = gp_val; + gp->root.u.def.section = bfd_abs_section_ptr; + } + } + + /* If we're producing a final executable, we need to sort the contents + of the .IA_64.unwind section. Force this section to be relocated + into memory rather than written immediately to the output file. */ + unwind_output_sec = NULL; + if (!info->relocateable) + { + asection *s = bfd_get_section_by_name (abfd, ELF_STRING_ia64_unwind); + if (s) + { + unwind_output_sec = s->output_section; + unwind_output_sec->contents + = bfd_malloc (unwind_output_sec->_raw_size); + if (unwind_output_sec->contents == NULL) + return false; + } + } + + /* Invoke the regular ELF backend linker to do all the work. */ + if (!bfd_elfNN_bfd_final_link (abfd, info)) + return false; + + 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); + + if (! bfd_set_section_contents (abfd, unwind_output_sec, + unwind_output_sec->contents, 0, + unwind_output_sec->_raw_size)) + return false; + } + + return true; +} + +static boolean +elfNN_ia64_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 elfNN_ia64_link_hash_table *ia64_info; + Elf_Internal_Shdr *symtab_hdr; + Elf_Internal_Rela *rel; + Elf_Internal_Rela *relend; + asection *srel; + boolean ret_val = true; /* for non-fatal errors */ + bfd_vma gp_val; + + symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr; + ia64_info = elfNN_ia64_hash_table (info); + + /* Infect various flags from the input section to the output section. */ + if (info->relocateable) + { + bfd_vma flags; + + flags = elf_section_data(input_section)->this_hdr.sh_flags; + flags &= SHF_IA_64_NORECOV; + + elf_section_data(input_section->output_section) + ->this_hdr.sh_flags |= flags; + } + + gp_val = _bfd_get_gp_value (output_bfd); + srel = get_reloc_section (input_bfd, ia64_info, input_section, false); + + rel = relocs; + relend = relocs + input_section->reloc_count; + for (; rel < relend; ++rel) + { + struct elf_link_hash_entry *h; + struct elfNN_ia64_dyn_sym_info *dyn_i; + bfd_reloc_status_type r; + reloc_howto_type *howto; + unsigned long r_symndx; + Elf_Internal_Sym *sym; + unsigned int r_type; + bfd_vma value; + asection *sym_sec; + bfd_byte *hit_addr; + boolean dynamic_symbol_p; + boolean undef_weak_ref; + + r_type = ELFNN_R_TYPE (rel->r_info); + if (r_type > R_IA64_MAX_RELOC_CODE) + { + (*_bfd_error_handler) + (_("%s: unknown relocation type %d"), + bfd_get_filename (input_bfd), (int)r_type); + bfd_set_error (bfd_error_bad_value); + ret_val = false; + continue; + } + howto = lookup_howto (r_type); + r_symndx = ELFNN_R_SYM (rel->r_info); + + if (info->relocateable) + { + /* This is a relocateable link. We don't have to change + anything, unless the reloc is against a section symbol, + in which case we have to adjust according to where the + section symbol winds up in the output section. */ + if (r_symndx < symtab_hdr->sh_info) + { + sym = local_syms + r_symndx; + if (ELF_ST_TYPE (sym->st_info) == STT_SECTION) + { + sym_sec = local_sections[r_symndx]; + rel->r_addend += sym_sec->output_offset; + } + } + continue; + } + + /* This is a final link. */ + + h = NULL; + sym = NULL; + sym_sec = NULL; + undef_weak_ref = false; + + if (r_symndx < symtab_hdr->sh_info) + { + /* 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); + } + else + { + long indx; + + /* Reloc against global symbol. */ + indx = r_symndx - symtab_hdr->sh_info; + h = elf_sym_hashes (input_bfd)[indx]; + 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; + + value = 0; + if (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + { + sym_sec = h->root.u.def.section; + + /* Detect the cases that sym_sec->output_section is + expected to be NULL -- all cases in which the symbol + is defined in another shared module. This includes + PLT relocs for which we've created a PLT entry and + other relocs for which we're prepared to create + dynamic relocations. */ + /* ??? Just accept it NULL and continue. */ + + if (sym_sec->output_section != NULL) + { + value = (h->root.u.def.value + + sym_sec->output_section->vma + + sym_sec->output_offset); + } + } + else if (h->root.type == bfd_link_hash_undefweak) + undef_weak_ref = true; + else if (info->shared && !info->symbolic + && !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, rel->r_offset, + (!info->shared || info->no_undefined + || ELF_ST_VISIBILITY (h->other))))) + return false; + ret_val = false; + continue; + } + } + + hit_addr = contents + rel->r_offset; + value += rel->r_addend; + dynamic_symbol_p = elfNN_ia64_dynamic_symbol_p (h, info); + + switch (r_type) + { + case R_IA64_NONE: + case R_IA64_LDXMOV: + continue; + + case R_IA64_IMM14: + case R_IA64_IMM22: + case R_IA64_IMM64: + case R_IA64_DIR32MSB: + case R_IA64_DIR32LSB: + case R_IA64_DIR64MSB: + case R_IA64_DIR64LSB: + /* Install a dynamic relocation for this reloc. */ + if ((dynamic_symbol_p || info->shared) + && (input_section->flags & SEC_ALLOC) != 0) + { + unsigned int dyn_r_type; + long dynindx; + bfd_vma addend; + + BFD_ASSERT (srel != NULL); + + /* If we don't need dynamic symbol lookup, find a + matching RELATIVE relocation. */ + dyn_r_type = r_type; + if (dynamic_symbol_p) + { + dynindx = h->dynindx; + addend = rel->r_addend; + value = 0; + } + else + { + switch (r_type) + { + case R_IA64_DIR32MSB: + dyn_r_type = R_IA64_REL32MSB; + break; + case R_IA64_DIR32LSB: + dyn_r_type = R_IA64_REL32LSB; + break; + case R_IA64_DIR64MSB: + dyn_r_type = R_IA64_REL64MSB; + break; + case R_IA64_DIR64LSB: + dyn_r_type = R_IA64_REL64LSB; + break; + + default: + /* We can't represent this without a dynamic symbol. + Adjust the relocation to be against an output + section symbol, which are always present in the + dynamic symbol table. */ + /* ??? People shouldn't be doing non-pic code in + shared libraries. Hork. */ + (*_bfd_error_handler) + (_("%s: linking non-pic code in a shared library"), + bfd_get_filename (input_bfd)); + ret_val = false; + continue; + } + dynindx = 0; + addend = value; + } + + elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section, + srel, rel->r_offset, dyn_r_type, + dynindx, addend); + } + /* FALLTHRU */ + + case R_IA64_LTV32MSB: + case R_IA64_LTV32LSB: + case R_IA64_LTV64MSB: + case R_IA64_LTV64LSB: + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_GPREL22: + case R_IA64_GPREL64I: + case R_IA64_GPREL32MSB: + case R_IA64_GPREL32LSB: + case R_IA64_GPREL64MSB: + case R_IA64_GPREL64LSB: + if (dynamic_symbol_p) + { + (*_bfd_error_handler) + (_("%s: @gprel relocation against dynamic symbol %s"), + bfd_get_filename (input_bfd), h->root.root.string); + ret_val = false; + continue; + } + value -= gp_val; + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_LTOFF22: + case R_IA64_LTOFF22X: + case R_IA64_LTOFF64I: + dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false); + value = set_got_entry (input_bfd, info, dyn_i, (h ? h->dynindx : -1), + rel->r_addend, value, R_IA64_DIR64LSB); + value -= gp_val; + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_PLTOFF22: + case R_IA64_PLTOFF64I: + case R_IA64_PLTOFF64MSB: + case R_IA64_PLTOFF64LSB: + dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false); + value = set_pltoff_entry (output_bfd, info, dyn_i, value, false); + value -= gp_val; + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_FPTR64I: + case R_IA64_FPTR32MSB: + case R_IA64_FPTR32LSB: + case R_IA64_FPTR64MSB: + case R_IA64_FPTR64LSB: + dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false); + if (dyn_i->want_fptr) + { + if (!undef_weak_ref) + value = set_fptr_entry (output_bfd, info, dyn_i, value); + } + else + { + long dynindx; + + /* Otherwise, we expect the dynamic linker to create + the entry. */ + + if (h) + { + if (h->dynindx != -1) + dynindx = h->dynindx; + else + dynindx = (_bfd_elf_link_lookup_local_dynindx + (info, h->root.u.def.section->owner, + global_sym_index (h))); + } + else + { + dynindx = (_bfd_elf_link_lookup_local_dynindx + (info, input_bfd, r_symndx)); + } + + elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section, + srel, rel->r_offset, r_type, + dynindx, rel->r_addend); + value = 0; + } + + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_LTOFF_FPTR22: + case R_IA64_LTOFF_FPTR64I: + case R_IA64_LTOFF_FPTR64MSB: + case R_IA64_LTOFF_FPTR64LSB: + { + long dynindx; + + dyn_i = get_dyn_sym_info (ia64_info, h, input_bfd, rel, false); + if (dyn_i->want_fptr) + { + BFD_ASSERT (h == NULL || h->dynindx == -1) + if (!undef_weak_ref) + value = set_fptr_entry (output_bfd, info, dyn_i, value); + dynindx = -1; + } + else + { + /* Otherwise, we expect the dynamic linker to create + the entry. */ + if (h) + { + if (h->dynindx != -1) + dynindx = h->dynindx; + else + dynindx = (_bfd_elf_link_lookup_local_dynindx + (info, h->root.u.def.section->owner, + global_sym_index (h))); + } + else + dynindx = (_bfd_elf_link_lookup_local_dynindx + (info, input_bfd, r_symndx)); + value = 0; + } + + value = set_got_entry (output_bfd, info, dyn_i, dynindx, + rel->r_addend, value, R_IA64_FPTR64LSB); + value -= gp_val; + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + } + break; + + case R_IA64_PCREL32MSB: + case R_IA64_PCREL32LSB: + case R_IA64_PCREL64MSB: + case R_IA64_PCREL64LSB: + /* Install a dynamic relocation for this reloc. */ + if (dynamic_symbol_p) + { + BFD_ASSERT (srel != NULL); + + elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section, + srel, rel->r_offset, r_type, + h->dynindx, rel->r_addend); + } + goto finish_pcrel; + + case R_IA64_PCREL21BI: + case R_IA64_PCREL21F: + case R_IA64_PCREL21M: + /* ??? These two are only used for speculation fixup code. + They should never be dynamic. */ + if (dynamic_symbol_p) + { + (*_bfd_error_handler) + (_("%s: dynamic relocation against speculation fixup"), + bfd_get_filename (input_bfd)); + ret_val = false; + continue; + } + if (undef_weak_ref) + { + (*_bfd_error_handler) + (_("%s: speculation fixup against undefined weak symbol"), + bfd_get_filename (input_bfd)); + ret_val = false; + continue; + } + goto finish_pcrel; + + case R_IA64_PCREL21B: + case R_IA64_PCREL60B: + /* We should have created a PLT entry for any dynamic symbol. */ + dyn_i = NULL; + if (h) + dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false); + + if (dyn_i && dyn_i->want_plt2) + { + /* Should have caught this earlier. */ + BFD_ASSERT (rel->r_addend == 0); + + value = (ia64_info->plt_sec->output_section->vma + + ia64_info->plt_sec->output_offset + + dyn_i->plt2_offset); + } + else + { + /* Since there's no PLT entry, Validate that this is + locally defined. */ + BFD_ASSERT (undef_weak_ref || sym_sec->output_section != NULL); + + /* If the symbol is undef_weak, we shouldn't be trying + to call it. There's every chance that we'd wind up + with an out-of-range fixup here. Don't bother setting + any value at all. */ + if (undef_weak_ref) + continue; + } + goto finish_pcrel; + + case R_IA64_PCREL22: + case R_IA64_PCREL64I: + finish_pcrel: + /* Make pc-relative. */ + value -= (input_section->output_section->vma + + input_section->output_offset + + rel->r_offset) & ~ (bfd_vma) 0x3; + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_SEGREL32MSB: + 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) + 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 + 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; + } + + case R_IA64_SECREL32MSB: + case R_IA64_SECREL32LSB: + case R_IA64_SECREL64MSB: + case R_IA64_SECREL64LSB: + /* Make output-section relative. */ + if (value > input_section->output_section->vma) + value -= input_section->output_section->vma; + else + value = 0; + r = elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + break; + + case R_IA64_IPLTMSB: + case R_IA64_IPLTLSB: + /* Install a dynamic relocation for this reloc. */ + if ((dynamic_symbol_p || info->shared) + && (input_section->flags & SEC_ALLOC) != 0) + { + BFD_ASSERT (srel != NULL); + + /* If we don't need dynamic symbol lookup, install two + RELATIVE relocations. */ + if (! dynamic_symbol_p) + { + unsigned int dyn_r_type; + + if (r_type == R_IA64_IPLTMSB) + dyn_r_type = R_IA64_REL64MSB; + else + dyn_r_type = R_IA64_REL64LSB; + + elfNN_ia64_install_dyn_reloc (output_bfd, info, + input_section, + srel, rel->r_offset, + dyn_r_type, 0, value); + elfNN_ia64_install_dyn_reloc (output_bfd, info, + input_section, + srel, rel->r_offset + 8, + dyn_r_type, 0, gp_val); + } + else + elfNN_ia64_install_dyn_reloc (output_bfd, info, input_section, + srel, rel->r_offset, r_type, + h->dynindx, rel->r_addend); + } + + if (r_type == R_IA64_IPLTMSB) + r_type = R_IA64_DIR64MSB; + else + r_type = R_IA64_DIR64LSB; + elfNN_ia64_install_value (output_bfd, hit_addr, value, r_type); + r = elfNN_ia64_install_value (output_bfd, hit_addr + 8, gp_val, + r_type); + break; + + default: + r = bfd_reloc_notsupported; + break; + } + + switch (r) + { + case bfd_reloc_ok: + break; + + case bfd_reloc_undefined: + /* This can happen for global table relative relocs if + __gp is undefined. This is a panic situation so we + don't try to continue. */ + (*info->callbacks->undefined_symbol) + (info, "__gp", input_bfd, input_section, rel->r_offset, 1); + return false; + + case bfd_reloc_notsupported: + { + const char *name; + + if (h) + 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, input_section); + } + if (!(*info->callbacks->warning) (info, _("unsupported reloc"), + name, input_bfd, + input_section, rel->r_offset)) + return false; + ret_val = false; + } + break; + + case bfd_reloc_dangerous: + case bfd_reloc_outofrange: + case bfd_reloc_overflow: + default: + { + const char *name; + + if (h) + 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, input_section); + } + if (!(*info->callbacks->reloc_overflow) (info, name, + howto->name, 0, + input_bfd, + input_section, + rel->r_offset)) + return false; + ret_val = false; + } + break; + } + } + + return ret_val; +} + +static boolean +elfNN_ia64_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 elfNN_ia64_link_hash_table *ia64_info; + struct elfNN_ia64_dyn_sym_info *dyn_i; + + ia64_info = elfNN_ia64_hash_table (info); + dyn_i = get_dyn_sym_info (ia64_info, h, NULL, NULL, false); + + /* Fill in the PLT data, if required. */ + if (dyn_i && dyn_i->want_plt) + { + Elf_Internal_Rela outrel; + bfd_byte *loc; + asection *plt_sec; + bfd_vma plt_addr, pltoff_addr, gp_val, index; + ElfNN_External_Rela *rel; + + gp_val = _bfd_get_gp_value (output_bfd); + + /* Initialize the minimal PLT entry. */ + + index = (dyn_i->plt_offset - PLT_HEADER_SIZE) / PLT_MIN_ENTRY_SIZE; + plt_sec = ia64_info->plt_sec; + loc = plt_sec->contents + dyn_i->plt_offset; + + memcpy (loc, plt_min_entry, PLT_MIN_ENTRY_SIZE); + elfNN_ia64_install_value (output_bfd, loc, index, R_IA64_IMM22); + elfNN_ia64_install_value (output_bfd, loc+2, -dyn_i->plt_offset, + R_IA64_PCREL21B); + + plt_addr = (plt_sec->output_section->vma + + plt_sec->output_offset + + dyn_i->plt_offset); + pltoff_addr = set_pltoff_entry (output_bfd, info, dyn_i, plt_addr, true); + + /* Initialize the FULL PLT entry, if needed. */ + if (dyn_i->want_plt2) + { + loc = plt_sec->contents + dyn_i->plt2_offset; + + memcpy (loc, plt_full_entry, PLT_FULL_ENTRY_SIZE); + elfNN_ia64_install_value (output_bfd, loc, pltoff_addr - gp_val, + R_IA64_IMM22); + + /* Mark the symbol as undefined, rather than as defined in the + plt section. Leave the value alone. */ + /* ??? We didn't redefine it in adjust_dynamic_symbol in the + first place. But perhaps elflink.h did some for us. */ + if ((h->elf_link_hash_flags & ELF_LINK_HASH_DEF_REGULAR) == 0) + sym->st_shndx = SHN_UNDEF; + } + + /* Create the dynamic relocation. */ + outrel.r_offset = pltoff_addr; + if (bfd_little_endian (output_bfd)) + outrel.r_info = ELFNN_R_INFO (h->dynindx, R_IA64_IPLTLSB); + else + outrel.r_info = ELFNN_R_INFO (h->dynindx, R_IA64_IPLTMSB); + outrel.r_addend = 0; + + /* This is fun. In the .IA_64.pltoff section, we've got entries + that correspond both to real PLT entries, and those that + happened to resolve to local symbols but need to be created + to satisfy @pltoff relocations. The .rela.IA_64.pltoff + relocations for the real PLT should come at the end of the + section, so that they can be indexed by plt entry at runtime. + + We emitted all of the relocations for the non-PLT @pltoff + entries during relocate_section. So we can consider the + existing sec->reloc_count to be the base of the array of + PLT relocations. */ + + rel = (ElfNN_External_Rela *)ia64_info->rel_pltoff_sec->contents; + rel += ia64_info->rel_pltoff_sec->reloc_count; + + bfd_elfNN_swap_reloca_out (output_bfd, &outrel, rel + index); + } + + /* Mark some specially defined symbols as absolute. */ + if (strcmp (h->root.root.string, "_DYNAMIC") == 0 + || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0 + || strcmp (h->root.root.string, "_PROCEDURE_LINKAGE_TABLE_") == 0) + sym->st_shndx = SHN_ABS; + + return true; +} + +static boolean +elfNN_ia64_finish_dynamic_sections (abfd, info) + bfd *abfd; + struct bfd_link_info *info; +{ + struct elfNN_ia64_link_hash_table *ia64_info; + bfd *dynobj; + + ia64_info = elfNN_ia64_hash_table (info); + dynobj = ia64_info->root.dynobj; + + if (elf_hash_table (info)->dynamic_sections_created) + { + ElfNN_External_Dyn *dyncon, *dynconend; + asection *sdyn, *sgotplt; + bfd_vma gp_val; + + sdyn = bfd_get_section_by_name (dynobj, ".dynamic"); + sgotplt = bfd_get_section_by_name (dynobj, ".got.plt"); + BFD_ASSERT (sdyn != NULL); + dyncon = (ElfNN_External_Dyn *) sdyn->contents; + dynconend = (ElfNN_External_Dyn *) (sdyn->contents + sdyn->_raw_size); + + gp_val = _bfd_get_gp_value (abfd); + + for (; dyncon < dynconend; dyncon++) + { + Elf_Internal_Dyn dyn; + + bfd_elfNN_swap_dyn_in (dynobj, dyncon, &dyn); + + switch (dyn.d_tag) + { + case DT_PLTGOT: + dyn.d_un.d_ptr = gp_val; + break; + + case DT_PLTRELSZ: + dyn.d_un.d_val = (ia64_info->minplt_entries + * sizeof (ElfNN_External_Rela)); + break; + + case DT_JMPREL: + /* See the comment above in finish_dynamic_symbol. */ + dyn.d_un.d_ptr = (ia64_info->rel_pltoff_sec->output_section->vma + + ia64_info->rel_pltoff_sec->output_offset + + (ia64_info->rel_pltoff_sec->reloc_count + * sizeof (ElfNN_External_Rela))); + break; + + case DT_IA_64_PLT_RESERVE: + dyn.d_un.d_ptr = (sgotplt->output_section->vma + + sgotplt->output_offset); + break; + + case DT_RELASZ: + /* Do not have RELASZ include JMPREL. This makes things + easier on ld.so. This is not what the rest of BFD set up. */ + dyn.d_un.d_val -= (ia64_info->minplt_entries + * sizeof (ElfNN_External_Rela)); + break; + } + + bfd_elfNN_swap_dyn_out (abfd, &dyn, dyncon); + } + + /* Initialize the PLT0 entry */ + if (ia64_info->plt_sec) + { + bfd_byte *loc = ia64_info->plt_sec->contents; + bfd_vma pltres; + + memcpy (loc, plt_header, PLT_HEADER_SIZE); + + pltres = (sgotplt->output_section->vma + + sgotplt->output_offset + - gp_val); + + elfNN_ia64_install_value (abfd, loc+1, pltres, R_IA64_GPREL22); + } + } + + return true; +} + +/* ELF file flag handling: */ + +/* Function to keep IA-64 specific file flags. */ +static boolean +elfNN_ia64_set_private_flags (abfd, flags) + bfd *abfd; + flagword flags; +{ + BFD_ASSERT (!elf_flags_init (abfd) + || elf_elfheader (abfd)->e_flags == flags); + + elf_elfheader (abfd)->e_flags = flags; + elf_flags_init (abfd) = true; + return true; +} + +/* Copy backend specific data from one object module to another */ +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 +elfNN_ia64_merge_private_bfd_data (ibfd, obfd) + bfd *ibfd, *obfd; +{ + flagword out_flags; + flagword in_flags; + boolean ok = true; + + /* Don't even pretend to support mixed-format linking. */ + if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour + || bfd_get_flavour (obfd) != bfd_target_elf_flavour) + return false; + + in_flags = elf_elfheader (ibfd)->e_flags; + out_flags = elf_elfheader (obfd)->e_flags; + + if (! elf_flags_init (obfd)) + { + elf_flags_init (obfd) = true; + elf_elfheader (obfd)->e_flags = in_flags; + + if (bfd_get_arch (obfd) == bfd_get_arch (ibfd) + && bfd_get_arch_info (obfd)->the_default) + { + return bfd_set_arch_mach (obfd, bfd_get_arch (ibfd), + bfd_get_mach (ibfd)); + } + + return true; + } + + /* Check flag compatibility. */ + if (in_flags == out_flags) + return true; + + /* Output has EF_IA_64_REDUCEDFP set only if all inputs have it set. */ + if (!(in_flags & EF_IA_64_REDUCEDFP) && (out_flags & EF_IA_64_REDUCEDFP)) + elf_elfheader (obfd)->e_flags &= ~EF_IA_64_REDUCEDFP; + + if ((in_flags & EF_IA_64_TRAPNIL) != (out_flags & EF_IA_64_TRAPNIL)) + { + (*_bfd_error_handler) + (_("%s: linking trap-on-NULL-dereference with non-trapping files"), + bfd_get_filename (ibfd)); + + bfd_set_error (bfd_error_bad_value); + ok = false; + } + if ((in_flags & EF_IA_64_BE) != (out_flags & EF_IA_64_BE)) + { + (*_bfd_error_handler) + (_("%s: linking big-endian files with little-endian files"), + bfd_get_filename (ibfd)); + + bfd_set_error (bfd_error_bad_value); + ok = false; + } + if ((in_flags & EF_IA_64_ABI64) != (out_flags & EF_IA_64_ABI64)) + { + (*_bfd_error_handler) + (_("%s: linking 64-bit files with 32-bit files"), + bfd_get_filename (ibfd)); + + bfd_set_error (bfd_error_bad_value); + ok = false; + } + if ((in_flags & EF_IA_64_CONS_GP) != (out_flags & EF_IA_64_CONS_GP)) + { + (*_bfd_error_handler) + (_("%s: linking constant-gp files with non-constant-gp files"), + bfd_get_filename (ibfd)); + + bfd_set_error (bfd_error_bad_value); + ok = false; + } + if ((in_flags & EF_IA_64_NOFUNCDESC_CONS_GP) + != (out_flags & EF_IA_64_NOFUNCDESC_CONS_GP)) + { + (*_bfd_error_handler) + (_("%s: linking auto-pic files with non-auto-pic files"), + bfd_get_filename (ibfd)); + + bfd_set_error (bfd_error_bad_value); + ok = false; + } + + return ok; +} + +static boolean +elfNN_ia64_print_private_bfd_data (abfd, ptr) + bfd *abfd; + PTR ptr; +{ + FILE *file = (FILE *) ptr; + flagword flags = elf_elfheader (abfd)->e_flags; + + BFD_ASSERT (abfd != NULL && ptr != NULL); + + fprintf (file, "private flags = %s%s%s%s%s%s%s%s\n", + (flags & EF_IA_64_TRAPNIL) ? "TRAPNIL, " : "", + (flags & EF_IA_64_EXT) ? "EXT, " : "", + (flags & EF_IA_64_BE) ? "BE, " : "LE, ", + (flags & EF_IA_64_REDUCEDFP) ? "REDUCEDFP, " : "", + (flags & EF_IA_64_CONS_GP) ? "CONS_GP, " : "", + (flags & EF_IA_64_NOFUNCDESC_CONS_GP) ? "NOFUNCDESC_CONS_GP, " : "", + (flags & EF_IA_64_ABSOLUTE) ? "ABSOLUTE, " : "", + (flags & EF_IA_64_ABI64) ? "ABI64" : "ABI32"); + + _bfd_elf_print_private_bfd_data (abfd, ptr); + return true; +} + +#define TARGET_LITTLE_SYM bfd_elfNN_ia64_little_vec +#define TARGET_LITTLE_NAME "elfNN-ia64-little" +#define TARGET_BIG_SYM bfd_elfNN_ia64_big_vec +#define TARGET_BIG_NAME "elfNN-ia64-big" +#define ELF_ARCH bfd_arch_ia64 +#define ELF_MACHINE_CODE EM_IA_64 +#define ELF_MACHINE_ALT1 1999 /* EAS2.3 */ +#define ELF_MACHINE_ALT2 1998 /* EAS2.2 */ +#define ELF_MAXPAGESIZE 0x10000 /* 64KB */ + +#define elf_backend_section_from_shdr \ + elfNN_ia64_section_from_shdr +#define elf_backend_section_flags \ + elfNN_ia64_section_flags +#define elf_backend_fake_sections \ + elfNN_ia64_fake_sections +#define elf_backend_final_write_processing \ + elfNN_ia64_final_write_processing +#define elf_backend_add_symbol_hook \ + elfNN_ia64_add_symbol_hook +#define elf_backend_additional_program_headers \ + elfNN_ia64_additional_program_headers +#define elf_backend_modify_segment_map \ + elfNN_ia64_modify_segment_map +#define elf_info_to_howto \ + elfNN_ia64_info_to_howto + +#define bfd_elfNN_bfd_reloc_type_lookup \ + elfNN_ia64_reloc_type_lookup +#define bfd_elfNN_bfd_is_local_label_name \ + elfNN_ia64_is_local_label_name +#define bfd_elfNN_bfd_relax_section \ + elfNN_ia64_relax_section + +/* Stuff for the BFD linker: */ +#define bfd_elfNN_bfd_link_hash_table_create \ + elfNN_ia64_hash_table_create +#define elf_backend_create_dynamic_sections \ + elfNN_ia64_create_dynamic_sections +#define elf_backend_check_relocs \ + elfNN_ia64_check_relocs +#define elf_backend_adjust_dynamic_symbol \ + elfNN_ia64_adjust_dynamic_symbol +#define elf_backend_size_dynamic_sections \ + elfNN_ia64_size_dynamic_sections +#define elf_backend_relocate_section \ + elfNN_ia64_relocate_section +#define elf_backend_finish_dynamic_symbol \ + elfNN_ia64_finish_dynamic_symbol +#define elf_backend_finish_dynamic_sections \ + elfNN_ia64_finish_dynamic_sections +#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 \ + elfNN_ia64_set_private_flags +#define bfd_elfNN_bfd_print_private_bfd_data \ + elfNN_ia64_print_private_bfd_data + +#define elf_backend_plt_readonly 1 +#define elf_backend_want_plt_sym 0 +#define elf_backend_plt_alignment 5 +#define elf_backend_got_header_size 0 +#define elf_backend_plt_header_size PLT_HEADER_SIZE +#define elf_backend_want_got_plt 1 +#define elf_backend_may_use_rel_p 1 +#define elf_backend_may_use_rela_p 1 +#define elf_backend_default_use_rela_p 1 +#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 + +#include "elfNN-target.h" diff --git a/gnu/dist/toolchain/bfd/elfxx-target.h b/gnu/dist/toolchain/bfd/elfxx-target.h index b1f4867e5694..e69036f48943 100644 --- a/gnu/dist/toolchain/bfd/elfxx-target.h +++ b/gnu/dist/toolchain/bfd/elfxx-target.h @@ -237,6 +237,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef elf_backend_section_from_shdr #define elf_backend_section_from_shdr 0 #endif +#ifndef elf_backend_section_flags +#define elf_backend_section_flags 0 +#endif #ifndef elf_backend_section_from_phdr #define elf_backend_section_from_phdr 0 #endif @@ -313,7 +316,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define elf_backend_hide_symbol _bfd_elf_link_hash_hide_symbol #endif - /* Previously, backends could only use SHT_REL or SHT_RELA relocation sections, but not both. They defined USE_REL to indicate SHT_REL sections, and left it undefined to indicated SHT_RELA sections. @@ -323,16 +325,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #else #undef USE_REL #define USE_REL 1 -#endif +#endif /* Use these in new code. */ -#ifndef elf_backend_may_use_rel_p +#ifndef elf_backend_may_use_rel_p #define elf_backend_may_use_rel_p USE_REL -#endif +#endif #ifndef elf_backend_may_use_rela_p #define elf_backend_may_use_rela_p !USE_REL #endif -#ifndef elf_backend_default_use_rela_p +#ifndef elf_backend_default_use_rela_p #define elf_backend_default_use_rela_p !USE_REL #endif @@ -354,6 +356,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 = { ELF_ARCH, /* arch */ @@ -368,6 +371,7 @@ static CONST struct elf_backend_data elfNN_bed = elf_backend_get_symbol_type, elf_backend_section_processing, elf_backend_section_from_shdr, + elf_backend_section_flags, elf_backend_section_from_phdr, elf_backend_fake_sections, elf_backend_section_from_bfd_section, @@ -413,6 +417,7 @@ static CONST struct elf_backend_data elfNN_bed = elf_backend_can_gc_sections, elf_backend_want_dynbss }; +#endif /* Forward declaration for use when initialising alternative_target field. */ #ifdef TARGET_LITTLE_SYM @@ -603,7 +608,7 @@ const bfd_target TARGET_LITTLE_SYM = #else NULL, #endif - + /* backend_data: */ (PTR) &elfNN_bed }; diff --git a/gnu/dist/toolchain/bfd/epoc-pe-arm.c b/gnu/dist/toolchain/bfd/epoc-pe-arm.c index 48a277a9dca8..02eeb04762c7 100644 --- a/gnu/dist/toolchain/bfd/epoc-pe-arm.c +++ b/gnu/dist/toolchain/bfd/epoc-pe-arm.c @@ -32,5 +32,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define bfd_arm_process_before_allocation \ bfd_arm_epoc_pe_process_before_allocation -#include "pe-arm.c" +#define EXTRA_S_FLAGS (SEC_LINK_ONCE | SEC_LINK_DUPLICATES | SEC_CODE | SEC_READONLY | SEC_DATA) +#include "pe-arm.c" diff --git a/gnu/dist/toolchain/bfd/epoc-pei-arm.c b/gnu/dist/toolchain/bfd/epoc-pei-arm.c index 0f2548d3809e..58c77df943f7 100644 --- a/gnu/dist/toolchain/bfd/epoc-pei-arm.c +++ b/gnu/dist/toolchain/bfd/epoc-pei-arm.c @@ -25,5 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define TARGET_BIG_SYM arm_epoc_pei_big_vec #define TARGET_BIG_NAME "epoc-pei-arm-big" -#include "pei-arm.c" +#define EXTRA_S_FLAGS (SEC_CODE | SEC_READONLY | SEC_DATA) +#include "pei-arm.c" diff --git a/gnu/dist/toolchain/bfd/format.c b/gnu/dist/toolchain/bfd/format.c index c9f1f9cd4be3..ad4a6a8733ee 100644 --- a/gnu/dist/toolchain/bfd/format.c +++ b/gnu/dist/toolchain/bfd/format.c @@ -23,7 +23,7 @@ SECTION File formats A format is a BFD concept of high level file contents type. The - formats supported by BFD are: + formats supported by BFD are: o <> @@ -37,7 +37,6 @@ SECTION The BFD contains the result of an executable core dump. - */ #include "bfd.h" @@ -68,7 +67,7 @@ DESCRIPTION the file, or an error results. The function returns <> on success, otherwise <> - with one of the following error codes: + with one of the following error codes: o <> - if <> is not one of <>, <> or @@ -109,7 +108,7 @@ DESCRIPTION Then the user may choose a format and try again. When done with the list that @var{matching} points to, the caller - should free it. + should free it. */ boolean @@ -125,20 +124,20 @@ bfd_check_format_matches (abfd, format, matching) if (!bfd_read_p (abfd) || ((int)(abfd->format) < (int)bfd_unknown) || - ((int)(abfd->format) >= (int)bfd_type_end)) { - bfd_set_error (bfd_error_invalid_operation); - return false; - } + ((int)(abfd->format) >= (int)bfd_type_end)) + { + bfd_set_error (bfd_error_invalid_operation); + return false; + } if (abfd->format != bfd_unknown) return (abfd->format == format)? true: false; - - /* Since the target type was defaulted, check them + /* 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; + if (matching) { matching_vector = @@ -149,119 +148,147 @@ bfd_check_format_matches (abfd, format, matching) matching_vector[0] = NULL; *matching = matching_vector; } + right_targ = 0; - - /* presume the answer is yes */ + /* Presume the answer is yes. */ abfd->format = format; /* 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! */ + return false; - if (!abfd->target_defaulted) { - if (bfd_seek (abfd, (file_ptr)0, SEEK_SET) != 0) /* rewind! */ - return false; - right_targ = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); - if (right_targ) { - abfd->xvec = right_targ; /* Set the target as returned */ - if (matching) - free (matching_vector); - return true; /* File position has moved, BTW */ + right_targ = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); + + if (right_targ) + { + abfd->xvec = right_targ; /* Set the target as returned. */ + + if (matching) + free (matching_vector); + + return true; /* File position has moved, BTW. */ + } + + /* For a long time the code has dropped through to check all + targets if the specified target was wrong. I don't know why, + and I'm reluctant to change it. However, in the case of an + archive, it can cause problems. If the specified target does + not permit archives (e.g., the binary target), then we should + not allow some other target to recognize it as an archive, but + should instead allow the specified target to recognize it as an + object. When I first made this change, it broke the PE target, + because the specified pei-i386 target did not recognize the + actual pe-i386 archive. Since there may be other problems of + this sort, I changed this test to check only for the binary + target. */ + if (format == bfd_archive && save_targ == &binary_vec) + { + abfd->xvec = save_targ; + abfd->format = bfd_unknown; + + if (matching) + free (matching_vector); + + bfd_set_error (bfd_error_file_not_recognized); + + return false; + } } - /* For a long time the code has dropped through to check all - targets if the specified target was wrong. I don't know why, - and I'm reluctant to change it. However, in the case of an - archive, it can cause problems. If the specified target does - not permit archives (e.g., the binary target), then we should - not allow some other target to recognize it as an archive, but - should instead allow the specified target to recognize it as an - object. When I first made this change, it broke the PE target, - because the specified pei-i386 target did not recognize the - actual pe-i386 archive. Since there may be other problems of - this sort, I changed this test to check only for the binary - target. */ + for (target = bfd_target_vector; *target != NULL; target++) + { + const bfd_target *temp; - if (format == bfd_archive && save_targ == &binary_vec) - { - abfd->xvec = save_targ; - abfd->format = bfd_unknown; - if (matching) - free (matching_vector); - bfd_set_error (bfd_error_file_not_recognized); + if (*target == &binary_vec) + continue; + + abfd->xvec = *target; /* Change BFD's target temporarily */ + + if (bfd_seek (abfd, (file_ptr)0, SEEK_SET) != 0) return false; - } - } - for (target = bfd_target_vector; *target != NULL; target++) { - const bfd_target *temp; + /* If _bfd_check_format neglects to set bfd_error, assume + bfd_error_wrong_format. We didn't used to even pay any + attention to bfd_error, so I suspect that some + _bfd_check_format might have this problem. */ + bfd_set_error (bfd_error_wrong_format); - if (*target == &binary_vec) - continue; + temp = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); + + if (temp) + { /* This format checks out as ok! */ + right_targ = temp; - abfd->xvec = *target; /* Change BFD's target temporarily */ - if (bfd_seek (abfd, (file_ptr)0, SEEK_SET) != 0) - return false; - /* If _bfd_check_format neglects to set bfd_error, assume bfd_error_wrong_format. - We didn't used to even pay any attention to bfd_error, so I suspect - that some _bfd_check_format might have this problem. */ - bfd_set_error (bfd_error_wrong_format); - temp = BFD_SEND_FMT (abfd, _bfd_check_format, (abfd)); - if (temp) { /* 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; + 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; } - match_count = 1; - break; - } #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 member file byte - * orders will (I hope) be handled appropriately by bfd. Ditto for big - * and little coff archives. And the 4 coff/b.out object formats are - * unambiguous. So accept the first match we find. - */ - break; + /* Big- and little-endian b.out archives look the same, but it + doesn't matter: there is no difference in their headers, and + member file byte orders will (I hope) be handled appropriately + by bfd. Ditto for big and little coff archives. And the 4 + coff/b.out object formats are unambiguous. So accept the + first match we find. */ + break; #endif - } else if (bfd_get_error () != bfd_error_wrong_format) { - abfd->xvec = save_targ; - abfd->format = bfd_unknown; - if (matching && bfd_get_error () != bfd_error_file_ambiguously_recognized) - free (matching_vector); - return false; + } + else if (bfd_get_error () != bfd_error_wrong_format) + { + abfd->xvec = save_targ; + abfd->format = bfd_unknown; + + if (matching && bfd_get_error () + != bfd_error_file_ambiguously_recognized) + free (matching_vector); + + return false; + } } - } - if (match_count == 1) { - abfd->xvec = right_targ; /* Change BFD's target permanently */ - if (matching) - free (matching_vector); - return true; /* File position has moved, BTW */ - } + if (match_count == 1) + { + abfd->xvec = right_targ; /* Change BFD's target permanently. */ + + if (matching) + free (matching_vector); + + return true; /* File position has moved, BTW. */ + } + + abfd->xvec = save_targ; /* Restore original target type. */ + abfd->format = bfd_unknown; /* Restore original format. */ - abfd->xvec = save_targ; /* Restore original target type */ - abfd->format = bfd_unknown; /* Restore original format */ if (match_count == 0) { bfd_set_error (bfd_error_file_not_recognized); + if (matching) free (matching_vector); } else bfd_set_error (bfd_error_file_ambiguously_recognized); + return false; } @@ -277,7 +304,6 @@ DESCRIPTION format @var{format}. If the target set in the BFD does not support the format requested, the format is invalid, or the BFD is not open for writing, then an error occurs. - */ boolean @@ -285,29 +311,29 @@ 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)) { - bfd_set_error (bfd_error_invalid_operation); - return false; - } + ((int)abfd->format >= (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) ? true : false; - /* presume the answer is yes */ + /* Presume the answer is yes. */ abfd->format = format; - if (!BFD_SEND_FMT (abfd, _bfd_set_format, (abfd))) { - abfd->format = bfd_unknown; - return false; - } + if (!BFD_SEND_FMT (abfd, _bfd_set_format, (abfd))) + { + abfd->format = bfd_unknown; + return false; + } return true; } - /* FUNCTION bfd_format_string @@ -325,18 +351,19 @@ CONST char * bfd_format_string (format) bfd_format format; { - if (((int)format <(int) bfd_unknown) - || ((int)format >=(int) bfd_type_end)) + if (((int)format <(int) bfd_unknown) + || ((int)format >=(int) bfd_type_end)) return "invalid"; - - switch (format) { - case bfd_object: - return "object"; /* linker/assember/compiler output */ - case bfd_archive: - return "archive"; /* object archive file */ - case bfd_core: - return "core"; /* core dump */ - default: - return "unknown"; - } + + switch (format) + { + case bfd_object: + return "object"; /* Linker/assember/compiler output. */ + case bfd_archive: + return "archive"; /* Object archive file. */ + case bfd_core: + return "core"; /* Core dump. */ + default: + return "unknown"; + } } diff --git a/gnu/dist/toolchain/bfd/freebsd.h b/gnu/dist/toolchain/bfd/freebsd.h index e80c213b28a6..0203d99f481b 100644 --- a/gnu/dist/toolchain/bfd/freebsd.h +++ b/gnu/dist/toolchain/bfd/freebsd.h @@ -59,7 +59,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. format. I think. */ #define SWAP_MAGIC(ext) bfd_getl32 (ext) - #define MY_write_object_contents MY(write_object_contents) static boolean MY(write_object_contents) PARAMS ((bfd *abfd)); diff --git a/gnu/dist/toolchain/bfd/go32stub.h b/gnu/dist/toolchain/bfd/go32stub.h index 3e4388c087b2..333eec068be9 100644 --- a/gnu/dist/toolchain/bfd/go32stub.h +++ b/gnu/dist/toolchain/bfd/go32stub.h @@ -1,128 +1,128 @@ 0x4d,0x5a,0x00,0x00,0x04,0x00,0x00,0x00,0x20,0x00,0x27,0x00,0xff,0xff,0x00,0x00, -0x60,0x07,0x00,0x00,0x54,0x00,0x00,0x00,0x0d,0x0a,0x73,0x74,0x75,0x62,0x2e,0x68, -0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x64,0x20,0x66,0x72,0x6f,0x6d,0x20, -0x73,0x74,0x75,0x62,0x2e,0x61,0x73,0x6d,0x20,0x62,0x79,0x20,0x64,0x6a,0x61,0x73, -0x6d,0x2c,0x20,0x6f,0x6e,0x20,0x57,0x65,0x64,0x20,0x4a,0x75,0x6e,0x20,0x31,0x31, -0x20,0x31,0x36,0x3a,0x30,0x39,0x3a,0x31,0x35,0x20,0x31,0x39,0x39,0x37,0x0d,0x0a, -0x54,0x68,0x65,0x20,0x53,0x54,0x55,0x42,0x2e,0x45,0x58,0x45,0x20,0x73,0x74,0x75, -0x62,0x20,0x6c,0x6f,0x61,0x64,0x65,0x72,0x20,0x69,0x73,0x20,0x43,0x6f,0x70,0x79, -0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x43,0x29,0x20,0x31,0x39,0x39,0x33,0x2d,0x31, -0x39,0x39,0x35,0x20,0x44,0x4a,0x20,0x44,0x65,0x6c,0x6f,0x72,0x69,0x65,0x2e,0x20, -0x0d,0x0a,0x50,0x65,0x72,0x6d,0x69,0x73,0x73,0x69,0x6f,0x6e,0x20,0x67,0x72,0x61, -0x6e,0x74,0x65,0x64,0x20,0x74,0x6f,0x20,0x75,0x73,0x65,0x20,0x66,0x6f,0x72,0x20, -0x61,0x6e,0x79,0x20,0x70,0x75,0x72,0x70,0x6f,0x73,0x65,0x20,0x70,0x72,0x6f,0x76, -0x69,0x64,0x65,0x64,0x20,0x74,0x68,0x69,0x73,0x20,0x63,0x6f,0x70,0x79,0x72,0x69, -0x67,0x68,0x74,0x20,0x0d,0x0a,0x72,0x65,0x6d,0x61,0x69,0x6e,0x73,0x20,0x70,0x72, -0x65,0x73,0x65,0x6e,0x74,0x20,0x61,0x6e,0x64,0x20,0x75,0x6e,0x6d,0x6f,0x64,0x69, -0x66,0x69,0x65,0x64,0x2e,0x20,0x0d,0x0a,0x54,0x68,0x69,0x73,0x20,0x6f,0x6e,0x6c, -0x79,0x20,0x61,0x70,0x70,0x6c,0x69,0x65,0x73,0x20,0x74,0x6f,0x20,0x74,0x68,0x65, -0x20,0x73,0x74,0x75,0x62,0x2c,0x20,0x61,0x6e,0x64,0x20,0x6e,0x6f,0x74,0x20,0x6e, -0x65,0x63,0x63,0x65,0x73,0x73,0x61,0x72,0x69,0x6c,0x79,0x20,0x74,0x68,0x65,0x20, -0x77,0x68,0x6f,0x6c,0x65,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d,0x2e,0x0a,0x0d, -0x0a,0x24,0x49,0x64,0x3a,0x20,0x73,0x74,0x75,0x62,0x2e,0x61,0x73,0x6d,0x20,0x62, -0x75,0x69,0x6c,0x74,0x20,0x30,0x36,0x2f,0x31,0x31,0x2f,0x39,0x37,0x20,0x31,0x36, -0x3a,0x30,0x39,0x3a,0x31,0x35,0x20,0x62,0x79,0x20,0x64,0x6a,0x61,0x73,0x6d,0x20, -0x24,0x0a,0x0d,0x0a,0x40,0x28,0x23,0x29,0x20,0x73,0x74,0x75,0x62,0x2e,0x61,0x73, -0x6d,0x20,0x62,0x75,0x69,0x6c,0x74,0x20,0x30,0x36,0x2f,0x31,0x31,0x2f,0x39,0x37, -0x20,0x31,0x36,0x3a,0x30,0x39,0x3a,0x31,0x35,0x20,0x62,0x79,0x20,0x64,0x6a,0x61, -0x73,0x6d,0x0a,0x0d,0x0a,0x1a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x60,0x07,0x00,0x00,0x54,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0d,0x0a,0x73,0x74, +0x75,0x62,0x2e,0x68,0x20,0x67,0x65,0x6e,0x65,0x72,0x61,0x74,0x65,0x64,0x20,0x66, +0x72,0x6f,0x6d,0x20,0x73,0x74,0x75,0x62,0x2e,0x61,0x73,0x6d,0x20,0x62,0x79,0x20, +0x64,0x6a,0x61,0x73,0x6d,0x2c,0x20,0x6f,0x6e,0x20,0x57,0x65,0x64,0x20,0x4a,0x75, +0x6e,0x20,0x32,0x38,0x20,0x31,0x31,0x3a,0x31,0x35,0x3a,0x30,0x34,0x20,0x32,0x30, +0x30,0x30,0x0d,0x0a,0x54,0x68,0x65,0x20,0x53,0x54,0x55,0x42,0x2e,0x45,0x58,0x45, +0x20,0x73,0x74,0x75,0x62,0x20,0x6c,0x6f,0x61,0x64,0x65,0x72,0x20,0x69,0x73,0x20, +0x43,0x6f,0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x28,0x43,0x29,0x20,0x31,0x39, +0x39,0x33,0x2d,0x31,0x39,0x39,0x35,0x20,0x44,0x4a,0x20,0x44,0x65,0x6c,0x6f,0x72, +0x69,0x65,0x2e,0x20,0x0d,0x0a,0x50,0x65,0x72,0x6d,0x69,0x73,0x73,0x69,0x6f,0x6e, +0x20,0x67,0x72,0x61,0x6e,0x74,0x65,0x64,0x20,0x74,0x6f,0x20,0x75,0x73,0x65,0x20, +0x66,0x6f,0x72,0x20,0x61,0x6e,0x79,0x20,0x70,0x75,0x72,0x70,0x6f,0x73,0x65,0x20, +0x70,0x72,0x6f,0x76,0x69,0x64,0x65,0x64,0x20,0x74,0x68,0x69,0x73,0x20,0x63,0x6f, +0x70,0x79,0x72,0x69,0x67,0x68,0x74,0x20,0x0d,0x0a,0x72,0x65,0x6d,0x61,0x69,0x6e, +0x73,0x20,0x70,0x72,0x65,0x73,0x65,0x6e,0x74,0x20,0x61,0x6e,0x64,0x20,0x75,0x6e, +0x6d,0x6f,0x64,0x69,0x66,0x69,0x65,0x64,0x2e,0x20,0x0d,0x0a,0x54,0x68,0x69,0x73, +0x20,0x6f,0x6e,0x6c,0x79,0x20,0x61,0x70,0x70,0x6c,0x69,0x65,0x73,0x20,0x74,0x6f, +0x20,0x74,0x68,0x65,0x20,0x73,0x74,0x75,0x62,0x2c,0x20,0x61,0x6e,0x64,0x20,0x6e, +0x6f,0x74,0x20,0x6e,0x65,0x63,0x65,0x73,0x73,0x61,0x72,0x69,0x6c,0x79,0x20,0x74, +0x68,0x65,0x20,0x77,0x68,0x6f,0x6c,0x65,0x20,0x70,0x72,0x6f,0x67,0x72,0x61,0x6d, +0x2e,0x0a,0x0d,0x0a,0x24,0x49,0x64,0x3a,0x20,0x73,0x74,0x75,0x62,0x2e,0x61,0x73, +0x6d,0x20,0x62,0x75,0x69,0x6c,0x74,0x20,0x30,0x36,0x2f,0x32,0x38,0x2f,0x31,0x30, +0x30,0x20,0x31,0x31,0x3a,0x31,0x35,0x3a,0x30,0x34,0x20,0x62,0x79,0x20,0x64,0x6a, +0x61,0x73,0x6d,0x20,0x24,0x0a,0x0d,0x0a,0x40,0x28,0x23,0x29,0x20,0x73,0x74,0x75, +0x62,0x2e,0x61,0x73,0x6d,0x20,0x62,0x75,0x69,0x6c,0x74,0x20,0x30,0x36,0x2f,0x32, +0x38,0x2f,0x31,0x30,0x30,0x20,0x31,0x31,0x3a,0x31,0x35,0x3a,0x30,0x34,0x20,0x62, +0x79,0x20,0x64,0x6a,0x61,0x73,0x6d,0x0a,0x0d,0x0a,0x1a,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, -0x67,0x6f,0x33,0x32,0x73,0x74,0x75,0x62,0x2c,0x20,0x76,0x20,0x32,0x2e,0x30,0x30, -0x54,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +0x67,0x6f,0x33,0x32,0x73,0x74,0x75,0x62,0x2c,0x20,0x76,0x20,0x32,0x2e,0x30,0x32, +0x54,0x00,0x00,0x00,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00,0x00,0x43,0x57,0x53,0x44,0x50,0x4d,0x49,0x2e,0x45,0x58,0x45,0x00, 0x00,0x00,0x00,0x00,0x0e,0x1f,0x8c,0x1e,0x24,0x00,0x8c,0x06,0x60,0x07,0xfc,0xb4, -0x30,0xcd,0x21,0x3c,0x03,0x73,0x06,0xba,0x86,0x05,0xe9,0xb2,0x03,0xa2,0x69,0x08, -0xbb,0x70,0x08,0xa1,0x20,0x00,0x39,0xc3,0x73,0x02,0x89,0xc3,0x89,0x1e,0x20,0x00, -0xfe,0xc7,0xb9,0x04,0xff,0xd3,0xeb,0xb4,0x4a,0xcd,0x21,0x73,0x0a,0xd3,0xe3,0xfe, -0xcf,0x89,0x1e,0x20,0x00,0xeb,0xd9,0x26,0x8e,0x06,0x2c,0x00,0x31,0xff,0x30,0xc0, -0xa9,0xf2,0xae,0x26,0x81,0x3d,0x50,0x41,0x75,0x15,0xaf,0x26,0x81,0x3d,0x54,0x48, -0x75,0x0d,0xaf,0x26,0x80,0x3d,0x3d,0x75,0x06,0x47,0x89,0x3e,0x67,0x04,0x4f,0xae, -0x75,0xdf,0xaf,0x06,0x57,0x31,0xc9,0x74,0x10,0xba,0x5d,0x05,0xe9,0x50,0x03,0x09, -0xc9,0x75,0xf6,0x41,0xe8,0x92,0x03,0x72,0xf0,0xb8,0x87,0x16,0xcd,0x2f,0x09,0xc0, -0x75,0xed,0x80,0xe3,0x01,0x74,0xe8,0x89,0x3e,0x00,0x06,0x8c,0x06,0x02,0x06,0x89, -0x36,0x04,0x06,0x5f,0x07,0xe8,0xd5,0x02,0x89,0x3e,0x2a,0x00,0x89,0x36,0x62,0x07, -0x80,0x3e,0x2c,0x00,0x00,0x74,0x24,0xb9,0x08,0x00,0xbf,0x2c,0x00,0x8a,0x05,0x47, -0x08,0xc0,0x74,0x05,0x88,0x07,0x43,0xe2,0xf4,0x66,0xc7,0x07,0x2e,0x45,0x58,0x45, -0x81,0xc3,0x04,0x00,0xc6,0x07,0x00,0x89,0x1e,0x62,0x07,0xb8,0x00,0x3d,0xba,0x64, -0x07,0xcd,0x21,0x0f,0x82,0xb4,0x02,0xa3,0x06,0x06,0x89,0xc3,0xb9,0x06,0x00,0xba, -0xb5,0x07,0xb4,0x3f,0xcd,0x21,0x31,0xd2,0x31,0xc9,0xa1,0xb5,0x07,0x3d,0x4c,0x01, -0x74,0x1b,0x3d,0x4d,0x5a,0x0f,0x85,0x97,0x02,0x8b,0x16,0xb9,0x07,0xc1,0xe2,0x09, -0x8b,0x1e,0xb7,0x07,0x09,0xdb,0x74,0x05,0x80,0xee,0x02,0x01,0xda,0x89,0x16,0xbb, -0x07,0x89,0x0e,0xbd,0x07,0xb8,0x00,0x42,0x8b,0x1e,0x06,0x06,0xcd,0x21,0xb9,0xa8, -0x00,0xba,0xbf,0x07,0xb4,0x3f,0xcd,0x21,0x3d,0xa8,0x00,0x75,0x06,0x81,0x3e,0xbf, -0x07,0x4c,0x01,0x0f,0x85,0x5e,0x02,0x66,0xa1,0xe3,0x07,0x66,0xa3,0x10,0x06,0x66, -0x8b,0x0e,0xbb,0x07,0x66,0xa1,0x03,0x08,0x66,0x01,0xc8,0x66,0xa3,0x08,0x06,0x66, -0xa1,0x2b,0x08,0x66,0x01,0xc8,0x66,0xa3,0x0c,0x06,0x66,0x8b,0x1e,0x4b,0x08,0x66, -0xa1,0x4f,0x08,0x66,0x01,0xc3,0x66,0xb8,0x01,0x00,0x01,0x00,0x66,0x39,0xc3,0x73, -0x03,0x66,0x89,0xc3,0x66,0x81,0xc3,0xff,0xff,0x00,0x00,0x31,0xdb,0x66,0x89,0x1e, -0x1c,0x00,0xe8,0xe8,0x02,0x8b,0x1e,0x04,0x06,0x09,0xdb,0x74,0x0a,0xb4,0x48,0xcd, -0x21,0x0f,0x82,0x10,0x02,0x8e,0xc0,0xe8,0xfb,0x02,0xb8,0x01,0x00,0xff,0x1e,0x00, -0x06,0x0f,0x82,0x08,0x02,0x8c,0x06,0x26,0x00,0x8c,0x0e,0x28,0x00,0x8c,0xd8,0xa3, -0x22,0x00,0x8e,0xc0,0x31,0xc0,0xb9,0x01,0x00,0xcd,0x31,0x72,0x07,0xa3,0x14,0x06, -0x31,0xc0,0xcd,0x31,0x0f,0x82,0xea,0x01,0xa3,0x16,0x06,0x66,0x8b,0x0e,0x1c,0x00, -0xb8,0x01,0x05,0x8b,0x1e,0x1e,0x00,0xcd,0x31,0x0f,0x82,0xda,0x01,0x89,0x1e,0x1a, -0x06,0x89,0x0e,0x18,0x06,0x89,0x36,0x1a,0x00,0x89,0x3e,0x18,0x00,0xb8,0x07,0x00, -0x8b,0x1e,0x14,0x06,0x8b,0x0e,0x1a,0x06,0x8b,0x16,0x18,0x06,0xcd,0x31,0xb8,0x09, -0x00,0x8c,0xc9,0x81,0xe1,0x03,0x00,0xc1,0xe1,0x05,0x51,0x81,0xc9,0x9b,0xc0,0xcd, -0x31,0xb8,0x08,0x00,0x8b,0x0e,0x1e,0x00,0x49,0xba,0xff,0xff,0xcd,0x31,0xb8,0x07, -0x00,0x8b,0x1e,0x16,0x06,0x8b,0x0e,0x1a,0x06,0x8b,0x16,0x18,0x06,0xcd,0x31,0xb8, -0x09,0x00,0x59,0x81,0xc9,0x93,0xc0,0xcd,0x31,0xb8,0x08,0x00,0x8b,0x0e,0x1e,0x00, -0x49,0xba,0xff,0xff,0xcd,0x31,0xb8,0x00,0x01,0xbb,0x00,0x0f,0xcd,0x31,0x73,0x10, -0x3d,0x08,0x00,0x0f,0x85,0x65,0x01,0xb8,0x00,0x01,0xcd,0x31,0x0f,0x82,0x5c,0x01, -0xa3,0x1c,0x06,0x89,0x16,0x1e,0x06,0xc1,0xe3,0x04,0x89,0x1e,0x20,0x06,0x66,0x8b, -0x36,0x08,0x06,0x66,0x8b,0x3e,0xfb,0x07,0x66,0x8b,0x0e,0xff,0x07,0xe8,0x49,0x00, -0x66,0x8b,0x36,0x0c,0x06,0x66,0x8b,0x3e,0x23,0x08,0x66,0x8b,0x0e,0x27,0x08,0xe8, -0x37,0x00,0x8e,0x06,0x16,0x06,0x66,0x8b,0x3e,0x4b,0x08,0x66,0x8b,0x0e,0x4f,0x08, -0x66,0x31,0xc0,0x66,0xc1,0xe9,0x02,0x67,0xf3,0x66,0xab,0xb4,0x3e,0x8b,0x1e,0x06, -0x06,0xcd,0x21,0xb8,0x01,0x01,0x8b,0x16,0x1e,0x06,0xcd,0x31,0x1e,0x0f,0xa1,0x8e, -0x1e,0x16,0x06,0x66,0x64,0xff,0x2e,0x10,0x06,0x66,0x89,0xf0,0x66,0x25,0xff,0x01, -0x00,0x00,0x66,0x01,0xc1,0x29,0xc6,0x66,0x29,0xc7,0x66,0x89,0x0e,0x26,0x06,0x66, -0x89,0x3e,0x22,0x06,0xe8,0xfe,0x00,0x89,0x36,0x3e,0x06,0x66,0xc1,0xee,0x10,0x89, -0x36,0x42,0x06,0x8b,0x1e,0x06,0x06,0x89,0x1e,0x3a,0x06,0xc7,0x06,0x46,0x06,0x00, -0x42,0xe8,0xf2,0x00,0xa1,0x1c,0x06,0xa3,0x4e,0x06,0xc7,0x06,0x3e,0x06,0x00,0x00, -0xc6,0x06,0x47,0x06,0x3f,0xa1,0x28,0x06,0x09,0xc0,0x75,0x09,0xa1,0x26,0x06,0x3b, -0x06,0x20,0x06,0x76,0x03,0xa1,0x20,0x06,0xa3,0x42,0x06,0xe8,0xc8,0x00,0x66,0x31, -0xc9,0x8b,0x0e,0x46,0x06,0x66,0x8b,0x3e,0x22,0x06,0x66,0x01,0x0e,0x22,0x06,0x66, -0x29,0x0e,0x26,0x06,0x66,0x31,0xf6,0xc1,0xe9,0x02,0x1e,0x06,0x8e,0x06,0x16,0x06, -0x8e,0x1e,0x1e,0x06,0x67,0xf3,0x66,0xa5,0x07,0x1f,0x66,0x03,0x0e,0x26,0x06,0x75, -0xaf,0xc3,0x3c,0x3a,0x74,0x06,0x3c,0x2f,0x74,0x02,0x3c,0x5c,0xc3,0xbe,0x64,0x07, -0x89,0xf3,0x26,0x8a,0x05,0x47,0x88,0x04,0x38,0xe0,0x74,0x0e,0x08,0xc0,0x74,0x0a, -0x46,0xe8,0xde,0xff,0x75,0xec,0x89,0xf3,0x74,0xe8,0xc3,0xba,0x26,0x05,0xeb,0x08, -0xba,0x34,0x05,0xeb,0x03,0xba,0x3e,0x05,0x52,0x8b,0x1e,0x62,0x07,0xc6,0x07,0x24, -0xbb,0x64,0x07,0xeb,0x1e,0xe8,0xed,0x00,0xba,0x78,0x05,0xeb,0x12,0xba,0x91,0x05, -0xeb,0x0d,0xba,0xa3,0x05,0xeb,0x08,0xba,0xb5,0x05,0xeb,0x03,0xba,0x78,0x05,0x52, -0xbb,0x19,0x05,0xe8,0x14,0x00,0x5b,0xe8,0x10,0x00,0xbb,0x42,0x04,0xe8,0x0a,0x00, -0xb8,0xff,0x4c,0xcd,0x21,0x43,0xb4,0x02,0xcd,0x21,0x8a,0x17,0x80,0xfa,0x24,0x75, -0xf4,0xc3,0x0d,0x0a,0x24,0x50,0x51,0x57,0x31,0xc0,0xbf,0x2a,0x06,0xb9,0x19,0x00, -0xf3,0xab,0x5f,0x59,0x58,0xc3,0xb8,0x00,0x03,0xbb,0x21,0x00,0x31,0xc9,0x66,0xbf, -0x2a,0x06,0x00,0x00,0xcd,0x31,0xc3,0x00,0x00,0x30,0xe4,0xe8,0x5f,0xff,0x89,0xde, -0x8b,0x3e,0x67,0x04,0xeb,0x18,0xb4,0x3b,0xe8,0x52,0xff,0x81,0xfe,0x64,0x07,0x74, -0x13,0x8a,0x84,0xff,0xff,0xe8,0x3a,0xff,0x74,0x04,0xc6,0x04,0x5c,0x46,0xe8,0x03, -0x00,0x72,0xe3,0xc3,0xe8,0x36,0x00,0xbb,0x44,0x00,0x8a,0x07,0x88,0x04,0x43,0x46, -0x08,0xc0,0x75,0xf6,0x06,0x57,0x1e,0x07,0xe8,0x9a,0xff,0xbb,0x2a,0x06,0x8c,0x9f, -0x04,0x00,0x89,0x9f,0x02,0x00,0xba,0x64,0x07,0xb8,0x00,0x4b,0xcd,0x21,0x5f,0x07, -0x72,0x09,0xb4,0x4d,0xcd,0x21,0x2d,0x00,0x03,0xf7,0xd8,0xeb,0x28,0x80,0x3e,0x69, -0x08,0x05,0x72,0x20,0xb8,0x00,0x58,0xcd,0x21,0xa2,0x67,0x08,0xb8,0x02,0x58,0xcd, -0x21,0xa2,0x68,0x08,0xb8,0x01,0x58,0xbb,0x80,0x00,0xcd,0x21,0xb8,0x03,0x58,0xbb, -0x01,0x00,0xcd,0x21,0xc3,0x9c,0x80,0x3e,0x69,0x08,0x05,0x72,0x1a,0x50,0x53,0xb8, -0x03,0x58,0x8a,0x1e,0x68,0x08,0x30,0xff,0xcd,0x21,0xb8,0x01,0x58,0x8a,0x1e,0x67, -0x08,0x30,0xff,0xcd,0x21,0x5b,0x58,0x9d,0xc3,0x4c,0x6f,0x61,0x64,0x20,0x65,0x72, -0x72,0x6f,0x72,0x3a,0x20,0x24,0x3a,0x20,0x63,0x61,0x6e,0x6e,0x6f,0x74,0x20,0x6f, -0x70,0x65,0x6e,0x24,0x3a,0x20,0x6e,0x6f,0x74,0x20,0x45,0x58,0x45,0x24,0x3a,0x20, -0x6e,0x6f,0x74,0x20,0x43,0x4f,0x46,0x46,0x20,0x28,0x43,0x68,0x65,0x63,0x6b,0x20, -0x66,0x6f,0x72,0x20,0x76,0x69,0x72,0x75,0x73,0x65,0x73,0x29,0x24,0x6e,0x6f,0x20, -0x44,0x50,0x4d,0x49,0x20,0x2d,0x20,0x47,0x65,0x74,0x20,0x63,0x73,0x64,0x70,0x6d, -0x69,0x2a,0x62,0x2e,0x7a,0x69,0x70,0x24,0x6e,0x6f,0x20,0x44,0x4f,0x53,0x20,0x6d, -0x65,0x6d,0x6f,0x72,0x79,0x24,0x6e,0x65,0x65,0x64,0x20,0x44,0x4f,0x53,0x20,0x33, -0x24,0x63,0x61,0x6e,0x27,0x74,0x20,0x73,0x77,0x69,0x74,0x63,0x68,0x20,0x6d,0x6f, -0x64,0x65,0x24,0x6e,0x6f,0x20,0x44,0x50,0x4d,0x49,0x20,0x73,0x65,0x6c,0x65,0x63, -0x74,0x6f,0x72,0x73,0x24,0x6e,0x6f,0x20,0x44,0x50,0x4d,0x49,0x20,0x6d,0x65,0x6d, -0x6f,0x72,0x79,0x24,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, -0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, -0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, +0x30,0xcd,0x21,0x3c,0x03,0x73,0x08,0xb0,0x6d,0xba,0xa7,0x05,0xe9,0xd4,0x03,0xa2, +0x69,0x08,0xbe,0x20,0x00,0x8b,0x04,0x09,0xc0,0x75,0x02,0xb4,0xfe,0xbb,0x70,0x08, +0x39,0xc3,0x73,0x02,0x89,0xc3,0x89,0x1c,0xfe,0xc7,0xb9,0x04,0xff,0xd3,0xeb,0xb4, +0x4a,0xcd,0x21,0x73,0x08,0xd3,0xe3,0xfe,0xcf,0x89,0x1c,0xeb,0xd8,0x26,0x8e,0x06, +0x2c,0x00,0x31,0xff,0x30,0xc0,0xa9,0xf2,0xae,0x26,0x81,0x3d,0x50,0x41,0x75,0x15, +0xaf,0x26,0x81,0x3d,0x54,0x48,0x75,0x0d,0xaf,0x26,0x80,0x3d,0x3d,0x75,0x06,0x47, +0x89,0x3e,0x8c,0x04,0x4f,0xae,0x75,0xdf,0xaf,0xb4,0x3e,0xbb,0x13,0x00,0xcd,0x21, +0xb4,0x3e,0xbb,0x12,0x00,0xcd,0x21,0x06,0x57,0x31,0xc9,0x74,0x12,0xb0,0x6e,0xba, +0x7e,0x05,0xe9,0x5e,0x03,0x09,0xc9,0x75,0xf4,0x41,0xe8,0xa1,0x03,0x72,0xee,0xb8, +0x87,0x16,0xcd,0x2f,0x09,0xc0,0x75,0xed,0x80,0xe3,0x01,0x74,0xe8,0x89,0x3e,0x00, +0x06,0x8c,0x06,0x02,0x06,0x89,0x36,0x04,0x06,0x5f,0x07,0xe8,0xd3,0x02,0x89,0x3e, +0x2a,0x00,0x89,0x36,0x62,0x07,0x80,0x3e,0x2c,0x00,0x00,0x74,0x23,0xb9,0x08,0x00, +0xbf,0x2c,0x00,0x8a,0x05,0x47,0x08,0xc0,0x74,0x05,0x88,0x07,0x43,0xe2,0xf4,0x66, +0xc7,0x07,0x2e,0x45,0x58,0x45,0x83,0xc3,0x04,0xc6,0x07,0x00,0x89,0x1e,0x62,0x07, +0xb8,0x00,0x3d,0xba,0x64,0x07,0xcd,0x21,0x0f,0x82,0xb3,0x02,0xa3,0x06,0x06,0x89, +0xc3,0xb9,0x06,0x00,0xba,0xb5,0x07,0xb4,0x3f,0xcd,0x21,0x31,0xd2,0x31,0xc9,0xa1, +0xb5,0x07,0x3d,0x4c,0x01,0x74,0x1b,0x3d,0x4d,0x5a,0x0f,0x85,0x98,0x02,0x8b,0x16, +0xb9,0x07,0xc1,0xe2,0x09,0x8b,0x1e,0xb7,0x07,0x09,0xdb,0x74,0x05,0x80,0xee,0x02, +0x01,0xda,0x89,0x16,0xbb,0x07,0x89,0x0e,0xbd,0x07,0xb8,0x00,0x42,0x8b,0x1e,0x06, +0x06,0xcd,0x21,0xb9,0xa8,0x00,0xba,0xbf,0x07,0xb4,0x3f,0xcd,0x21,0x3d,0xa8,0x00, +0x75,0x06,0x81,0x3e,0xbf,0x07,0x4c,0x01,0x0f,0x85,0x61,0x02,0x66,0xa1,0xe3,0x07, +0x66,0xa3,0x10,0x06,0x66,0x8b,0x0e,0xbb,0x07,0x66,0xa1,0x03,0x08,0x66,0x01,0xc8, +0x66,0xa3,0x08,0x06,0x66,0xa1,0x2b,0x08,0x66,0x01,0xc8,0x66,0xa3,0x0c,0x06,0x66, +0x8b,0x1e,0x4b,0x08,0x66,0xa1,0x4f,0x08,0x66,0x01,0xc3,0x66,0xb8,0x01,0x00,0x01, +0x00,0x66,0x39,0xc3,0x73,0x03,0x66,0x89,0xc3,0x66,0x81,0xc3,0xff,0xff,0x00,0x00, +0x31,0xdb,0x66,0x89,0x1e,0x1c,0x00,0xe8,0xf5,0x02,0x8b,0x1e,0x04,0x06,0x09,0xdb, +0x74,0x0a,0xb4,0x48,0xcd,0x21,0x0f,0x82,0x15,0x02,0x8e,0xc0,0xe8,0x08,0x03,0xb8, +0x01,0x00,0xff,0x1e,0x00,0x06,0x0f,0x82,0x0f,0x02,0x8c,0x06,0x26,0x00,0x8c,0x0e, +0x28,0x00,0x8c,0xd8,0xa3,0x22,0x00,0x8e,0xc0,0x31,0xc0,0xb9,0x01,0x00,0xcd,0x31, +0x72,0x07,0xa3,0x14,0x06,0x31,0xc0,0xcd,0x31,0x0f,0x82,0xf3,0x01,0xa3,0x16,0x06, +0x66,0x8b,0x0e,0x1c,0x00,0xb8,0x01,0x05,0x8b,0x1e,0x1e,0x00,0xcd,0x31,0x0f,0x82, +0xe5,0x01,0x89,0x1e,0x1a,0x06,0x89,0x0e,0x18,0x06,0x89,0x36,0x1a,0x00,0x89,0x3e, +0x18,0x00,0xb8,0x07,0x00,0x8b,0x1e,0x14,0x06,0x8b,0x0e,0x1a,0x06,0x8b,0x16,0x18, +0x06,0xcd,0x31,0xb8,0x09,0x00,0x8c,0xc9,0x83,0xe1,0x03,0xc1,0xe1,0x05,0x51,0x81, +0xc9,0x9b,0xc0,0xcd,0x31,0xb8,0x08,0x00,0x8b,0x0e,0x1e,0x00,0x49,0xba,0xff,0xff, +0xcd,0x31,0xb8,0x07,0x00,0x8b,0x1e,0x16,0x06,0x8b,0x0e,0x1a,0x06,0x8b,0x16,0x18, +0x06,0xcd,0x31,0xb8,0x09,0x00,0x59,0x81,0xc9,0x93,0xc0,0xcd,0x31,0xb8,0x08,0x00, +0x8b,0x0e,0x1e,0x00,0x49,0xba,0xff,0xff,0xcd,0x31,0xb8,0x00,0x01,0xbb,0x00,0x0f, +0xcd,0x31,0x73,0x10,0x3d,0x08,0x00,0x0f,0x85,0x73,0x01,0xb8,0x00,0x01,0xcd,0x31, +0x0f,0x82,0x6a,0x01,0xa3,0x1c,0x06,0x89,0x16,0x1e,0x06,0xc1,0xe3,0x04,0x89,0x1e, +0x20,0x06,0x66,0x8b,0x36,0x08,0x06,0x66,0x8b,0x3e,0xfb,0x07,0x66,0x8b,0x0e,0xff, +0x07,0xe8,0x49,0x00,0x66,0x8b,0x36,0x0c,0x06,0x66,0x8b,0x3e,0x23,0x08,0x66,0x8b, +0x0e,0x27,0x08,0xe8,0x37,0x00,0x8e,0x06,0x16,0x06,0x66,0x8b,0x3e,0x4b,0x08,0x66, +0x8b,0x0e,0x4f,0x08,0x66,0x31,0xc0,0x66,0xc1,0xe9,0x02,0x67,0xf3,0x66,0xab,0xb4, +0x3e,0x8b,0x1e,0x06,0x06,0xcd,0x21,0xb8,0x01,0x01,0x8b,0x16,0x1e,0x06,0xcd,0x31, +0x1e,0x0f,0xa1,0x8e,0x1e,0x16,0x06,0x66,0x64,0xff,0x2e,0x10,0x06,0x66,0x89,0xf0, +0x66,0x25,0xff,0x01,0x00,0x00,0x66,0x01,0xc1,0x29,0xc6,0x66,0x29,0xc7,0x66,0x89, +0x0e,0x26,0x06,0x66,0x89,0x3e,0x22,0x06,0xe8,0x0f,0x01,0x89,0x36,0x3e,0x06,0x66, +0xc1,0xee,0x10,0x89,0x36,0x42,0x06,0x8b,0x1e,0x06,0x06,0x89,0x1e,0x3a,0x06,0xc7, +0x06,0x46,0x06,0x00,0x42,0xe8,0x03,0x01,0xa1,0x1c,0x06,0xa3,0x4e,0x06,0xc7,0x06, +0x3e,0x06,0x00,0x00,0xc6,0x06,0x47,0x06,0x3f,0xa1,0x28,0x06,0x09,0xc0,0x75,0x09, +0xa1,0x26,0x06,0x3b,0x06,0x20,0x06,0x76,0x03,0xa1,0x20,0x06,0xa3,0x42,0x06,0xe8, +0xd9,0x00,0x66,0x31,0xc9,0x8b,0x0e,0x46,0x06,0x66,0x8b,0x3e,0x22,0x06,0x66,0x01, +0x0e,0x22,0x06,0x66,0x29,0x0e,0x26,0x06,0x66,0x31,0xf6,0xc1,0xe9,0x02,0x1e,0x06, +0x8e,0x06,0x16,0x06,0x8e,0x1e,0x1e,0x06,0x67,0xf3,0x66,0xa5,0x07,0x1f,0x66,0x03, +0x0e,0x26,0x06,0x75,0xaf,0xc3,0x3c,0x3a,0x74,0x06,0x3c,0x2f,0x74,0x02,0x3c,0x5c, +0xc3,0xbe,0x64,0x07,0x89,0xf3,0x26,0x8a,0x05,0x47,0x88,0x04,0x38,0xe0,0x74,0x0e, +0x08,0xc0,0x74,0x0a,0x46,0xe8,0xde,0xff,0x75,0xec,0x89,0xf3,0x74,0xe8,0xc3,0xb0, +0x66,0xba,0x48,0x05,0xeb,0x0c,0xb0,0x67,0xba,0x55,0x05,0xeb,0x05,0xb0,0x68,0xba, +0x5f,0x05,0x52,0x8b,0x1e,0x62,0x07,0xc6,0x07,0x24,0xbb,0x64,0x07,0xeb,0x28,0xe8, +0xf5,0x00,0xb0,0x69,0xba,0x99,0x05,0xeb,0x1a,0xb0,0x6a,0xba,0xb2,0x05,0xeb,0x13, +0xb0,0x6b,0xba,0xc4,0x05,0xeb,0x0c,0xb0,0x6c,0xba,0xd6,0x05,0xeb,0x05,0xb0,0x69, +0xba,0x99,0x05,0x52,0xbb,0x3b,0x05,0xe8,0x15,0x00,0x5b,0xe8,0x11,0x00,0xbb,0x67, +0x04,0xe8,0x0b,0x00,0xb4,0x4c,0xcd,0x21,0x43,0x50,0xb4,0x02,0xcd,0x21,0x58,0x8a, +0x17,0x80,0xfa,0x24,0x75,0xf2,0xc3,0x0d,0x0a,0x24,0x50,0x51,0x57,0x31,0xc0,0xbf, +0x2a,0x06,0xb9,0x19,0x00,0xf3,0xab,0x5f,0x59,0x58,0xc3,0xb8,0x00,0x03,0xbb,0x21, +0x00,0x31,0xc9,0x66,0xbf,0x2a,0x06,0x00,0x00,0xcd,0x31,0xc3,0x00,0x00,0x30,0xe4, +0xe8,0x4e,0xff,0x89,0xde,0x8b,0x3e,0x8c,0x04,0xeb,0x17,0xb4,0x3b,0xe8,0x41,0xff, +0x81,0xfe,0x64,0x07,0x74,0x12,0x8a,0x44,0xff,0xe8,0x2a,0xff,0x74,0x04,0xc6,0x04, +0x5c,0x46,0xe8,0x03,0x00,0x72,0xe4,0xc3,0xe8,0x34,0x00,0xbb,0x44,0x00,0x8a,0x07, +0x88,0x04,0x43,0x46,0x08,0xc0,0x75,0xf6,0x06,0x57,0x1e,0x07,0xe8,0x9b,0xff,0xbb, +0x2a,0x06,0x8c,0x5f,0x04,0x89,0x5f,0x02,0xba,0x64,0x07,0xb8,0x00,0x4b,0xcd,0x21, +0x5f,0x07,0x72,0x09,0xb4,0x4d,0xcd,0x21,0x2d,0x00,0x03,0xf7,0xd8,0xeb,0x28,0x80, +0x3e,0x69,0x08,0x05,0x72,0x20,0xb8,0x00,0x58,0xcd,0x21,0xa2,0x67,0x08,0xb8,0x02, +0x58,0xcd,0x21,0xa2,0x68,0x08,0xb8,0x01,0x58,0xbb,0x80,0x00,0xcd,0x21,0xb8,0x03, +0x58,0xbb,0x01,0x00,0xcd,0x21,0xc3,0x9c,0x80,0x3e,0x69,0x08,0x05,0x72,0x1a,0x50, +0x53,0xb8,0x03,0x58,0x8a,0x1e,0x68,0x08,0x30,0xff,0xcd,0x21,0xb8,0x01,0x58,0x8a, +0x1e,0x67,0x08,0x30,0xff,0xcd,0x21,0x5b,0x58,0x9d,0xc3,0x4c,0x6f,0x61,0x64,0x20, +0x65,0x72,0x72,0x6f,0x72,0x3a,0x20,0x24,0x3a,0x20,0x63,0x61,0x6e,0x27,0x74,0x20, +0x6f,0x70,0x65,0x6e,0x24,0x3a,0x20,0x6e,0x6f,0x74,0x20,0x45,0x58,0x45,0x24,0x3a, +0x20,0x6e,0x6f,0x74,0x20,0x43,0x4f,0x46,0x46,0x20,0x28,0x43,0x68,0x65,0x63,0x6b, +0x20,0x66,0x6f,0x72,0x20,0x76,0x69,0x72,0x75,0x73,0x65,0x73,0x29,0x24,0x6e,0x6f, +0x20,0x44,0x50,0x4d,0x49,0x20,0x2d,0x20,0x47,0x65,0x74,0x20,0x63,0x73,0x64,0x70, +0x6d,0x69,0x2a,0x62,0x2e,0x7a,0x69,0x70,0x24,0x6e,0x6f,0x20,0x44,0x4f,0x53,0x20, +0x6d,0x65,0x6d,0x6f,0x72,0x79,0x24,0x6e,0x65,0x65,0x64,0x20,0x44,0x4f,0x53,0x20, +0x33,0x24,0x63,0x61,0x6e,0x27,0x74,0x20,0x73,0x77,0x69,0x74,0x63,0x68,0x20,0x6d, +0x6f,0x64,0x65,0x24,0x6e,0x6f,0x20,0x44,0x50,0x4d,0x49,0x20,0x73,0x65,0x6c,0x65, +0x63,0x74,0x6f,0x72,0x73,0x24,0x6e,0x6f,0x20,0x44,0x50,0x4d,0x49,0x20,0x6d,0x65, +0x6d,0x6f,0x72,0x79,0x24,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90, 0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90,0x90 diff --git a/gnu/dist/toolchain/bfd/hash.c b/gnu/dist/toolchain/bfd/hash.c index 173eaf76eef6..a1bca281dbd5 100644 --- a/gnu/dist/toolchain/bfd/hash.c +++ b/gnu/dist/toolchain/bfd/hash.c @@ -268,7 +268,7 @@ SUBSUBSECTION Write other derived routines You will want to write other routines for your new hash table, - as well. + as well. You will want an initialization routine which calls the initialization routine of the hash table you are deriving from @@ -366,7 +366,7 @@ bfd_hash_lookup (table, string, create, copy) struct bfd_hash_entry *hashp; unsigned int len; unsigned int index; - + hash = 0; len = 0; s = (const unsigned char *) string; diff --git a/gnu/dist/toolchain/bfd/hp300hpux.c b/gnu/dist/toolchain/bfd/hp300hpux.c index 46bfea054cfa..b6920826f566 100644 --- a/gnu/dist/toolchain/bfd/hp300hpux.c +++ b/gnu/dist/toolchain/bfd/hp300hpux.c @@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ | hp300hpux bfd | ----------> hpux w/gnu ext hpux w/gnu extension ----> | | - Support for the 9000/[34]00 has several limitations. 1. Shared libraries are not supported. 2. The output format from this bfd is not usable by native tools. @@ -238,7 +237,6 @@ MY (callback) (abfd) bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0); #endif - if (obj_aout_subformat (abfd) == gnu_encap_format) { /* The file offsets of the relocation info */ @@ -419,7 +417,6 @@ convert_sym_type (sym_pointer, cache_ptr, abfd) } - /* DESCRIPTION Swaps the information in an executable header taken from a raw @@ -485,7 +482,6 @@ NAME (aout,swap_exec_header_in) (abfd, raw_bytes, execp) while (0); } - /* The hp symbol table is a bit different than other a.out targets. Instead of having an array of nlist items and an array of strings, hp's format has them mixed together in one structure. In addition, the strings are @@ -538,7 +534,6 @@ MY (slurp_symbol_table) (abfd) return false; } - sym_end = (struct external_nlist *) (((char *) syms) + symbol_bytes); /* first, march thru the table and figure out how many symbols there are */ @@ -615,8 +610,6 @@ MY (slurp_symbol_table) (abfd) return true; } - - void MY (swap_std_reloc_in) (abfd, bytes, cache_ptr, symbols, symcount) bfd *abfd; @@ -739,7 +732,6 @@ doit: count = reloc_size / each_size; - reloc_cache = (arelent *) bfd_zalloc (abfd, (size_t) (count * sizeof (arelent))); if (!reloc_cache && count != 0) @@ -769,14 +761,12 @@ doit: bfd_get_symcount (abfd)); } - bfd_release (abfd, relocs); asect->relocation = reloc_cache; asect->reloc_count = count; return true; } - /************************************************************************/ /* The following functions are identical to functions in aoutx.h except */ /* they refer to MY(func) rather than NAME(aout,func) and they also */ @@ -822,9 +812,6 @@ MY (get_symtab_upper_bound) (abfd) return (bfd_get_symcount (abfd) + 1) * (sizeof (aout_symbol_type *)); } - - - long MY (canonicalize_reloc) (abfd, section, relptr, symbols) bfd *abfd; @@ -863,5 +850,4 @@ MY (canonicalize_reloc) (abfd, section, relptr, symbols) return section->reloc_count; } - #include "aout-target.h" diff --git a/gnu/dist/toolchain/bfd/hppabsd-core.c b/gnu/dist/toolchain/bfd/hppabsd-core.c index 0a3e6b224d21..63a78ef3f6ba 100644 --- a/gnu/dist/toolchain/bfd/hppabsd-core.c +++ b/gnu/dist/toolchain/bfd/hppabsd-core.c @@ -18,14 +18,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Written by the Center for Software Science at the University of Utah - and by Cygnus Support. + and by Cygnus Support. The core file structure for the Utah 4.3BSD and OSF1 ports on the PA is a mix between traditional cores and hpux cores -- just different enough that supporting this format would tend to add gross hacks to trad-core.c or hpux-core.c. So instead we keep any gross hacks isolated to this file. */ - /* This file can only be compiled on systems which use HPPA-BSD style core files. @@ -141,7 +140,6 @@ hppabsd_core_core_file_p (abfd) return NULL; } - /* Sanity checks. Make sure the size of the core file matches the the size computed from information within the core itself. */ { @@ -180,9 +178,9 @@ hppabsd_core_core_file_p (abfd) core_stacksec (abfd) = make_bfd_asection (abfd, ".stack", SEC_ALLOC + SEC_HAS_CONTENTS, clicksz * u.u_ssize, - NBPG * (USIZE + KSTAKSIZE) + NBPG * (USIZE + KSTAKSIZE) + clicksz * u.u_dsize, 2); - core_stacksec (abfd)->vma = USRSTACK; + core_stacksec (abfd)->vma = USRSTACK; core_datasec (abfd) = make_bfd_asection (abfd, ".data", SEC_ALLOC + SEC_LOAD @@ -225,7 +223,6 @@ hppabsd_core_core_file_matches_executable_p (core_bfd, exec_bfd) /* There's no way to know this... */ return true; } - #define hppabsd_core_get_symtab_upper_bound \ _bfd_nosymbols_get_symtab_upper_bound @@ -245,7 +242,7 @@ static void swap_abort () { /* This way doesn't require any declaration for ANSI to fuck up. */ - abort (); + abort (); } #define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort ) @@ -287,7 +284,7 @@ const bfd_target hppabsd_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 (hppabsd_core), @@ -299,7 +296,7 @@ const bfd_target hppabsd_core_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 /* backend_data */ }; #endif diff --git a/gnu/dist/toolchain/bfd/hpux-core.c b/gnu/dist/toolchain/bfd/hpux-core.c index bfaa2c21b258..cc8207769fd7 100644 --- a/gnu/dist/toolchain/bfd/hpux-core.c +++ b/gnu/dist/toolchain/bfd/hpux-core.c @@ -85,7 +85,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* .lwpid and .user_tid are only valid if PROC_INFO_HAS_THREAD_ID, else they are set to 0. Also, until HP-UX implements MxN threads, .user_tid and .lwpid are synonymous. */ -struct hpux_core_struct +struct hpux_core_struct { int sig; int lwpid; /* Kernel thread ID. */ @@ -142,7 +142,6 @@ hpux_core_make_empty_symbol (abfd) return new; } - /* this function builds a bfd target if the file is a corefile. It returns null or 0 if it finds out thaat it is not a core file. The way it checks this is by looking for allowed 'type' field values. @@ -288,7 +287,7 @@ hpux_core_core_file_p (abfd) */ unknown_sections++; break; - + default: return 0; /*unrecognized core file type */ } } @@ -389,7 +388,7 @@ const bfd_target hpux_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 (hpux_core), @@ -401,6 +400,6 @@ const bfd_target hpux_core_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 /* backend_data */ }; diff --git a/gnu/dist/toolchain/bfd/ieee.c b/gnu/dist/toolchain/bfd/ieee.c index 71b967ac4181..70f0d130d446 100644 --- a/gnu/dist/toolchain/bfd/ieee.c +++ b/gnu/dist/toolchain/bfd/ieee.c @@ -1343,27 +1343,21 @@ ieee_archive_p (abfd) ieee->h.abfd = abfd; if (this_byte (&(ieee->h)) != Module_Beginning) - { - abfd->tdata.ieee_ar_data = save; - goto got_wrong_format_error; - } + goto got_wrong_format_error; next_byte (&(ieee->h)); library = read_id (&(ieee->h)); if (strcmp (library, "LIBRARY") != 0) - { - bfd_release (abfd, ieee); - abfd->tdata.ieee_ar_data = save; - goto got_wrong_format_error; - } - /* Throw away the filename */ + goto got_wrong_format_error; + + /* Throw away the filename. */ read_id (&(ieee->h)); ieee->element_count = 0; ieee->element_index = 0; - next_byte (&(ieee->h)); /* Drop the ad part */ - must_parse_int (&(ieee->h)); /* And the two dummy numbers */ + next_byte (&(ieee->h)); /* Drop the ad part. */ + must_parse_int (&(ieee->h)); /* And the two dummy numbers. */ must_parse_int (&(ieee->h)); alc_elts = 10; @@ -1371,7 +1365,7 @@ ieee_archive_p (abfd) if (elts == NULL) goto error_return; - /* Read the index of the BB table */ + /* Read the index of the BB table. */ while (1) { int rec; @@ -1400,14 +1394,14 @@ ieee_archive_p (abfd) t->file_offset = must_parse_int (&(ieee->h)); t->abfd = (bfd *) NULL; - /* Make sure that we don't go over the end of the buffer */ - + /* Make sure that we don't go over the end of the buffer. */ if ((size_t) ieee_pos (abfd) > sizeof (buffer) / 2) { - /* Past half way, reseek and reprime */ + /* Past half way, reseek and reprime. */ buffer_offset += ieee_pos (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); @@ -1421,36 +1415,33 @@ ieee_archive_p (abfd) ieee->element_count * sizeof *ieee->elements)); if (ieee->elements == NULL) goto error_return; + memcpy (ieee->elements, elts, ieee->element_count * sizeof *ieee->elements); free (elts); elts = NULL; - /* Now scan the area again, and replace BB offsets with file */ - /* offsets */ - + /* Now scan the area again, and replace BB offsets with file offsets. */ for (i = 2; i < ieee->element_count; i++) { 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); 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 */ + 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; - } + /* This object has been deleted. */ + ieee->elements[i].file_offset = 0; else - { - ieee->elements[i].file_offset = must_parse_int (&(ieee->h)); - } + ieee->elements[i].file_offset = must_parse_int (&(ieee->h)); } /* abfd->has_armap = ;*/ @@ -1458,10 +1449,14 @@ ieee_archive_p (abfd) return abfd->xvec; got_wrong_format_error: + bfd_release (abfd, ieee); + abfd->tdata.ieee_ar_data = save; bfd_set_error (bfd_error_wrong_format); + error_return: if (elts != NULL) free (elts); + return NULL; } @@ -3197,11 +3192,8 @@ relocate_debug (output, input) block (); } -/* - During linking, we we told about the bfds which made up our - contents, we have a list of them. They will still be open, so go to - the debug info in each, and copy it out, relocating it as we go. -*/ +/* Gather together all the debug information from each input BFD into + one place, relocating it and emitting it as we go. */ static boolean ieee_write_debug_part (abfd) @@ -3728,7 +3720,7 @@ ieee_make_empty_symbol (abfd) bfd *abfd; { ieee_symbol_type *new = - (ieee_symbol_type *) bfd_zmalloc (sizeof (ieee_symbol_type)); + (ieee_symbol_type *) bfd_zalloc (abfd, sizeof (ieee_symbol_type)); if (!new) return NULL; new->symbol.the_bfd = abfd; diff --git a/gnu/dist/toolchain/bfd/libcoff-in.h b/gnu/dist/toolchain/bfd/libcoff-in.h index 9b1a02684870..e5f5f9e81a2d 100644 --- a/gnu/dist/toolchain/bfd/libcoff-in.h +++ b/gnu/dist/toolchain/bfd/libcoff-in.h @@ -43,6 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define obj_coff_strings(bfd) (coff_data (bfd)->strings) #define obj_coff_keep_strings(bfd) (coff_data (bfd)->keep_strings) #define obj_coff_sym_hashes(bfd) (coff_data (bfd)->sym_hashes) +#define obj_coff_strings_written(bfd) (coff_data (bfd)->strings_written) #define obj_coff_local_toc_table(bfd) (coff_data(bfd)->local_toc_sym_map) @@ -83,6 +84,8 @@ typedef struct coff_tdata char *strings; /* If this is true, the strings may not be freed. */ boolean keep_strings; + /* If this is true, the strings have been written out already. */ + boolean strings_written; /* is this a PE format coff file */ int pe; @@ -97,6 +100,9 @@ typedef struct coff_tdata /* Used by coff_find_nearest_line. */ PTR line_info; + /* A place to stash dwarf2 info for this bfd. */ + PTR dwarf2_find_line_info; + /* The timestamp from the COFF file header. */ long timestamp; @@ -126,6 +132,9 @@ struct xcoff_tdata /* Basic COFF information. */ coff_data_type coff; + /* True if this is an XCOFF64 file. */ + boolean xcoff64; + /* True if a large a.out header should be generated. */ boolean full_aouthdr; diff --git a/gnu/dist/toolchain/bfd/libcoff.h b/gnu/dist/toolchain/bfd/libcoff.h index bee4ce9e8587..511553865fe1 100644 --- a/gnu/dist/toolchain/bfd/libcoff.h +++ b/gnu/dist/toolchain/bfd/libcoff.h @@ -43,6 +43,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define obj_coff_strings(bfd) (coff_data (bfd)->strings) #define obj_coff_keep_strings(bfd) (coff_data (bfd)->keep_strings) #define obj_coff_sym_hashes(bfd) (coff_data (bfd)->sym_hashes) +#define obj_coff_strings_written(bfd) (coff_data (bfd)->strings_written) #define obj_coff_local_toc_table(bfd) (coff_data(bfd)->local_toc_sym_map) @@ -83,6 +84,8 @@ typedef struct coff_tdata char *strings; /* If this is true, the strings may not be freed. */ boolean keep_strings; + /* If this is true, the strings have been written out already. */ + boolean strings_written; /* is this a PE format coff file */ int pe; @@ -97,6 +100,9 @@ typedef struct coff_tdata /* Used by coff_find_nearest_line. */ PTR line_info; + /* A place to stash dwarf2 info for this bfd. */ + PTR dwarf2_find_line_info; + /* The timestamp from the COFF file header. */ long timestamp; @@ -126,6 +132,9 @@ struct xcoff_tdata /* Basic COFF information. */ coff_data_type coff; + /* True if this is an XCOFF64 file. */ + boolean xcoff64; + /* True if a large a.out header should be generated. */ boolean full_aouthdr; @@ -575,32 +584,32 @@ extern boolean ppc_process_before_allocation typedef struct coff_ptr_struct { - /* Remembers the offset from the first symbol in the file for + /* 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 + /* 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. + /* 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. + /* 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. + /* 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 + /* 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 + /* The container for the symbol structure as read and translated from the file. */ union { @@ -610,35 +619,35 @@ union { } combined_entry_type; - /* Each canonical asymbol really looks like this: */ +/* Each canonical asymbol really looks like this: */ typedef struct coff_symbol_struct { - /* The actual symbol which the rest of BFD works with */ + /* The actual symbol which the rest of BFD works with */ asymbol symbol; - /* A pointer to the hidden information for this symbol */ + /* A pointer to the hidden information for this symbol */ combined_entry_type *native; - /* A pointer to the linenumber information for this symbol */ + /* A pointer to the linenumber information for this symbol */ struct lineno_cache_entry *lineno; - /* Have the line numbers been relocated yet ? */ + /* Have the line numbers been relocated yet ? */ boolean done_lineno; } coff_symbol_type; - /* COFF symbol classifications. */ +/* COFF symbol classifications. */ enum coff_symbol_classification { - /* Global symbol. */ + /* Global symbol. */ COFF_SYMBOL_GLOBAL, - /* Common symbol. */ + /* Common symbol. */ COFF_SYMBOL_COMMON, - /* Undefined symbol. */ + /* Undefined symbol. */ COFF_SYMBOL_UNDEFINED, - /* Local symbol. */ + /* Local symbol. */ COFF_SYMBOL_LOCAL, - /* PE section symbol. */ + /* PE section symbol. */ COFF_SYMBOL_PE_SECTION }; @@ -713,6 +722,8 @@ typedef struct 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, @@ -815,12 +826,12 @@ typedef struct struct bfd_link_info *info, bfd *abfd, const char *name, - flagword flags, + flagword flags, asection *section, bfd_vma value, const char *string, boolean copy, - boolean collect, + boolean collect, struct bfd_link_hash_entry **hashp)); boolean (*_bfd_coff_link_output_has_begun) PARAMS (( @@ -910,6 +921,12 @@ typedef struct #define 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) + +#define bfd_coff_debug_string_prefix_length(abfd)\ + (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)) diff --git a/gnu/dist/toolchain/bfd/libhppa.h b/gnu/dist/toolchain/bfd/libhppa.h index 1392742876f1..8ef8f53b3688 100644 --- a/gnu/dist/toolchain/bfd/libhppa.h +++ b/gnu/dist/toolchain/bfd/libhppa.h @@ -21,8 +21,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef _HPPA_H -#define _HPPA_H +#ifndef _LIBHPPA_H +#define _LIBHPPA_H #define BYTES_IN_WORD 4 #define PA_PAGESIZE 0x1000 @@ -35,53 +35,8 @@ #endif /* GNU C? */ #endif /* INLINE */ -#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) -/* Declare the functions with the unused attribute to avoid warnings. */ -static INLINE unsigned int assemble_3 (unsigned int) - __attribute__ ((__unused__)); -static INLINE void dis_assemble_3 (unsigned int, unsigned int *) - __attribute__ ((__unused__)); -static INLINE unsigned int assemble_12 (unsigned int, unsigned int) - __attribute__ ((__unused__)); -static INLINE void dis_assemble_12 (unsigned int, unsigned int *, - unsigned int *) - __attribute__ ((__unused__)); -static INLINE unsigned long assemble_17 (unsigned int, unsigned int, - unsigned int) - __attribute__ ((__unused__)); -static INLINE void dis_assemble_17 (unsigned int, unsigned int *, - unsigned int *, unsigned int *) - __attribute__ ((__unused__)); -static INLINE void dis_assemble_22 (unsigned int, unsigned int *, - unsigned int *, unsigned int *, - unsigned int *) - __attribute__ ((__unused__)); -static INLINE unsigned long assemble_21 (unsigned int) - __attribute ((__unused__)); -static INLINE void dis_assemble_21 (unsigned int, unsigned int *) - __attribute__ ((__unused__)); -static INLINE unsigned long sign_extend (unsigned int, unsigned int) - __attribute__ ((__unused__)); -static INLINE unsigned int ones (int) __attribute ((__unused__)); -static INLINE void sign_unext (unsigned int, unsigned int, unsigned int *) - __attribute__ ((__unused__)); -static INLINE unsigned long low_sign_extend (unsigned int, unsigned int) - __attribute__ ((__unused__)); -static INLINE void low_sign_unext (unsigned int, unsigned int, unsigned int *) - __attribute__ ((__unused__)); -static INLINE unsigned long hppa_field_adjust (unsigned long, unsigned long, - unsigned short) - __attribute__ ((__unused__)); -static INLINE int bfd_hppa_insn2fmt (unsigned long) - __attribute__ ((__unused__)); -static INLINE unsigned long hppa_rebuild_insn (bfd *, unsigned long, - unsigned long, unsigned long) - __attribute__ ((__unused__)); -#endif /* gcc 2.7 or higher */ - - /* The PA instruction set variants. */ -enum pa_arch {pa10 = 10, pa11 = 11, pa20 = 20}; +enum pa_arch {pa10 = 10, pa11 = 11, pa20 = 20, pa20w = 25}; /* HP PA-RISC relocation types */ @@ -197,527 +152,462 @@ enum hppa_reloc_expr_type_alt The high order 10 bits contain parameter relocation information, the low order 22 bits contain the constant offset. */ - -#define HPPA_R_ARG_RELOC(a) (((a) >> 22) & 0x3FF) -#define HPPA_R_CONSTANT(a) ((((int)(a)) << 10) >> 10) -#define HPPA_R_ADDEND(r,c) (((r) << 22) + ((c) & 0x3FFFFF)) -#define HPPA_WIDE (0) /* PSW W-bit, need to check! FIXME */ -/* These macros get bit fields using HP's numbering (MSB = 0), - * but note that "MASK" assumes that the LSB bits are what's - * wanted. - */ -#ifndef GET_FIELD -#define GET_FIELD(X, FROM, TO) \ - ((X) >> (31 - (TO)) & ((1 << ((TO) - (FROM) + 1)) - 1)) -#endif -#define GET_BIT(X, WHICH) \ - GET_FIELD (X, WHICH, WHICH) +#define HPPA_R_ARG_RELOC(a) \ + (((a) >> 22) & 0x3ff) +#define HPPA_R_CONSTANT(a) \ + ((((bfd_signed_vma)(a)) << (BFD_ARCH_SIZE-22)) >> (BFD_ARCH_SIZE-22)) +#define HPPA_R_ADDEND(r, c) \ + (((r) << 22) + ((c) & 0x3fffff)) -#define MASK(SIZE) \ - (~((-1) << SIZE)) - -#define CATENATE(X, XSIZE, Y, YSIZE) \ - (((X & MASK (XSIZE)) << YSIZE) | (Y & MASK (YSIZE))) -#define ELEVEN(X) \ - CATENATE (GET_BIT (X, 10), 1, GET_FIELD (X, 0, 9), 10) - /* Some functions to manipulate PA instructions. */ -/* NOTE: these use the HP convention that f{1} is the _left_ most - * bit (MSB) of f; they sometimes have to impose an assumption - * about the size of a field; and as far as I can tell, most - * aren't used. - */ +/* Declare the functions with the unused attribute to avoid warnings. */ +static INLINE int sign_extend PARAMS ((int, int)) ATTRIBUTE_UNUSED; +static INLINE int low_sign_extend PARAMS ((int, int)) ATTRIBUTE_UNUSED; +static INLINE int sign_unext PARAMS ((int, int)) ATTRIBUTE_UNUSED; +static INLINE int low_sign_unext PARAMS ((int, int)) ATTRIBUTE_UNUSED; +static INLINE int re_assemble_3 PARAMS ((int)) ATTRIBUTE_UNUSED; +static INLINE int re_assemble_12 PARAMS ((int)) ATTRIBUTE_UNUSED; +static INLINE int re_assemble_14 PARAMS ((int)) ATTRIBUTE_UNUSED; +static INLINE int re_assemble_16 PARAMS ((int)) ATTRIBUTE_UNUSED; +static INLINE int re_assemble_17 PARAMS ((int)) ATTRIBUTE_UNUSED; +static INLINE int re_assemble_21 PARAMS ((int)) ATTRIBUTE_UNUSED; +static INLINE int re_assemble_22 PARAMS ((int)) ATTRIBUTE_UNUSED; +static INLINE bfd_signed_vma hppa_field_adjust + PARAMS ((bfd_vma, bfd_signed_vma, + enum hppa_reloc_field_selector_type_alt)) ATTRIBUTE_UNUSED; +static INLINE int bfd_hppa_insn2fmt PARAMS ((bfd *, int)) ATTRIBUTE_UNUSED; +static INLINE int hppa_rebuild_insn PARAMS ((int, int, int)) ATTRIBUTE_UNUSED; -static INLINE unsigned long + +/* The *sign_extend functions are used to assemble various bitfields + taken from an instruction and return the resulting immediate + value. */ + +static INLINE int sign_extend (x, len) - unsigned int x, len; + int x, len; { - return (int)(x >> (len - 1) ? (-1 << len) | x : x); + int signbit = (1 << (len - 1)); + int mask = (signbit << 1) - 1; + return ((x & mask) ^ signbit) - signbit; } -static INLINE unsigned int -assemble_3 (x) - unsigned int x; -{ - return CATENATE (GET_BIT (x, 2), 1, GET_FIELD (x, 0, 1), 2); -} - -static INLINE void -dis_assemble_3 (x, r) - unsigned int x; - unsigned int *r; -{ - *r = (((x & 4) >> 2) | ((x & 3) << 1)) & 7; -} - -static INLINE unsigned int -assemble_6 (x, y) - unsigned int x, y; -{ - return (((x & 0x1) << 5) + (32 - (y & 0x1f))); -} - -static INLINE unsigned int -assemble_12 (x, y) - unsigned int x, y; -{ - return CATENATE (CATENATE (y, 1, GET_BIT (x, 10), 1), 2, - GET_FIELD (x, 0, 9), 9); -} - -static INLINE void -dis_assemble_12 (as12, x, y) - unsigned int as12; - unsigned int *x, *y; -{ - *y = (as12 & 0x800) >> 11; - *x = ((as12 & 0x3ff) << 1) | ((as12 & 0x400) >> 10); -} - -static INLINE unsigned long -assemble_16 (x, y) - unsigned int x, y; -{ - /* Depends on PSW W-bit !*/ - unsigned int temp; - - if (HPPA_WIDE) - temp = CATENATE (CATENATE (GET_BIT (y, 13), 1, - (GET_BIT (y, 13) ^ GET_BIT (x, 0)), 1), 2, - CATENATE ((GET_BIT (y, 13) ^ GET_BIT (x, 1)), 1, - GET_FIELD (y, 0, 12), 13), 14); - else - temp = CATENATE (CATENATE (GET_BIT (y, 13), 1, GET_BIT (y, 13), 1), 2, - CATENATE (GET_BIT (y, 13), 1, GET_FIELD (y, 0, 12), 13), 14); - - return sign_extend (temp, 16); -} - - -static INLINE unsigned long -assemble_16a (x, y, z) - unsigned int x, y, z; -{ - /* Depends on PSW W-bit !*/ - unsigned int temp; - - if (HPPA_WIDE) - temp = CATENATE (CATENATE (z, 1, (z ^ GET_BIT (x, 0)), 1), 2, - CATENATE ((z ^ GET_BIT (x, 1)), 1, y, 11), 12); - else - temp = CATENATE (CATENATE (z, 1, z, 1), 2, CATENATE (z, 1, y, 11), 12); - - return sign_extend ((temp << 2), 16); -} - -static INLINE unsigned long -assemble_17 (x, y, z) - unsigned int x, y, z; -{ - unsigned long temp; - - temp = CATENATE (CATENATE (z, 1, x, 5), 6, - CATENATE (GET_BIT (y, 10), 1, GET_FIELD (y, 0, 9), 10), 11); - - return temp; -} - -static INLINE void -dis_assemble_17 (as17, x, y, z) - unsigned int as17; - unsigned int *x, *y, *z; -{ - - *z = (as17 & 0x10000) >> 16; - *x = (as17 & 0x0f800) >> 11; - *y = (((as17 & 0x00400) >> 10) | ((as17 & 0x3ff) << 1)) & 0x7ff; -} - -static INLINE void -dis_assemble_22 (as22, a, b, c, d) - unsigned int as22; - unsigned int *a, *b, *c, *d; -{ - - *d = (as22 & 0x200000) >> 21; - *a = (as22 & 0x1f0000) >> 16; - *b = (as22 & 0x0f800) >> 11; - *c = (((as22 & 0x00400) >> 10) | ((as22 & 0x3ff) << 1)) & 0x7ff; -} - -static INLINE unsigned long -assemble_21 (x) - unsigned int x; -{ - unsigned long temp; - - temp = ((x & 1) << 20) | - ((x & 0xffe) << 8) | - ((x & 0xc000) >> 7) | - ((x & 0x1f0000) >> 14) | - ((x & 0x003000) >> 12); - return temp & 0x1fffff; -} - -static INLINE unsigned long -assemble_22 (a,b,c,d) - unsigned int a,b,c,d; -{ - unsigned long temp; - - temp = CATENATE (CATENATE (d, 1, a, 5), 6, - CATENATE (b, 5, ELEVEN (c), 11), 16); - - return sign_extend (temp, 22); -} - -static INLINE void -dis_assemble_21 (as21, x) - unsigned int as21, *x; -{ - unsigned long temp; - - - temp = (as21 & 0x100000) >> 20; - temp |= (as21 & 0x0ffe00) >> 8; - temp |= (as21 & 0x000180) << 7; - temp |= (as21 & 0x00007c) << 14; - temp |= (as21 & 0x000003) << 12; - *x = temp; -} - -static INLINE unsigned int -ones (n) - int n; -{ - unsigned int len_ones; - int i; - - i = 0; - len_ones = 0; - while (i < n) - { - len_ones = (len_ones << 1) | 1; - i++; - } - - return len_ones; -} - -static INLINE void -sign_unext (x, len, result) - unsigned int x, len; - unsigned int *result; -{ - unsigned int len_ones; - - len_ones = ones (len); - - *result = x & len_ones; -} - -static INLINE unsigned long +static INLINE int low_sign_extend (x, len) - unsigned int x, len; + int x, len; { - return (int)((x & 0x1 ? (-1 << (len - 1)) : 0) | x >> 1); + return (x >> 1) - ((x & 1) << (len - 1)); } -static INLINE void -low_sign_unext (x, len, result) - unsigned int x, len; - unsigned int *result; + +/* The re_assemble_* functions prepare an immediate value for + insertion into an opcode. pa-risc uses all sorts of weird bitfields + in the instruction to hold the value. */ + +static INLINE int +sign_unext (x, len) + int x, len; { - unsigned int temp; - unsigned int sign; - unsigned int rest; - unsigned int one_bit_at_len; - unsigned int len_ones; + int len_ones; - len_ones = ones (len); - one_bit_at_len = 1 << (len - 1); + len_ones = (1 << len) - 1; - sign_unext (x, len, &temp); - sign = temp & one_bit_at_len; - sign >>= (len - 1); - - rest = temp & (len_ones ^ one_bit_at_len); - rest <<= 1; - - *result = rest | sign; + return x & len_ones; } -/* Handle field selectors for PA instructions. */ - -static INLINE unsigned long -hppa_field_adjust (value, constant_value, r_field) - unsigned long value; - unsigned long constant_value; - unsigned short r_field; +static INLINE int +low_sign_unext (x, len) + int x, len; { + int temp; + int sign; + + sign = (x >> (len-1)) & 1; + + temp = sign_unext (x, len-1); + + return (temp << 1) | sign; +} + +static INLINE int +re_assemble_3 (as3) + int as3; +{ + return (( (as3 & 4) << (13-2)) + | ((as3 & 3) << (13+1))); +} + +static INLINE int +re_assemble_12 (as12) + int as12; +{ + return (( (as12 & 0x800) >> 11) + | ((as12 & 0x400) >> (10 - 2)) + | ((as12 & 0x3ff) << (1 + 2))); +} + +static INLINE int +re_assemble_14 (as14) + int as14; +{ + return (( (as14 & 0x1fff) << 1) + | ((as14 & 0x2000) >> 13)); +} + +static INLINE int +re_assemble_16 (as16) + int as16; +{ + int s, t; + + /* Unusual 16-bit encoding, for wide mode only. */ + t = (as16 << 1) & 0xffff; + s = (as16 & 0x8000); + return (t ^ s ^ (s >> 1)) | (s >> 15); +} + +static INLINE int +re_assemble_17 (as17) + int as17; +{ + return (( (as17 & 0x10000) >> 16) + | ((as17 & 0x0f800) << (16 - 11)) + | ((as17 & 0x00400) >> (10 - 2)) + | ((as17 & 0x003ff) << (1 + 2))); +} + +static INLINE int +re_assemble_21 (as21) + int as21; +{ + return (( (as21 & 0x100000) >> 20) + | ((as21 & 0x0ffe00) >> 8) + | ((as21 & 0x000180) << 7) + | ((as21 & 0x00007c) << 14) + | ((as21 & 0x000003) << 12)); +} + +static INLINE int +re_assemble_22 (as22) + int as22; +{ + return (( (as22 & 0x200000) >> 21) + | ((as22 & 0x1f0000) << (21 - 16)) + | ((as22 & 0x00f800) << (16 - 11)) + | ((as22 & 0x000400) >> (10 - 2)) + | ((as22 & 0x0003ff) << (1 + 2))); +} + + +/* Handle field selectors for PA instructions. + The L and R (and LS, RS etc.) selectors are used in pairs to form a + full 32 bit address. eg. + + LDIL L'start,%r1 ; put left part into r1 + LDW R'start(%r1),%r2 ; add r1 and right part to form address + + This function returns sign extended values in all cases. +*/ + +static INLINE bfd_signed_vma +hppa_field_adjust (sym_val, addend, r_field) + bfd_vma sym_val; + bfd_signed_vma addend; + enum hppa_reloc_field_selector_type_alt r_field; +{ + bfd_signed_vma value; + + value = sym_val + addend; switch (r_field) { - case e_fsel: /* F : no change */ - case e_nsel: /* N : no change */ - value += constant_value; + case e_fsel: + /* F: No change. */ break; - case e_lssel: /* LS : if (bit 21) then add 0x800 - arithmetic shift right 11 bits */ - value += constant_value; - if (value & 0x00000400) - value += 0x800; - value = (value & 0xfffff800) >> 11; + case e_nsel: + /* N: null selector. I don't really understand what this is all + about, but HP's documentation says "this indicates that zero + bits are to be used for the displacement on the instruction. + This fixup is used to identify three-instruction sequences to + access data (for importing shared library data)." */ + value = 0; break; - case e_rssel: /* RS : Sign extend from bit 21 */ - value += constant_value; - if (value & 0x00000400) - value |= 0xfffff800; - else - value &= 0x7ff; + case e_lsel: + case e_nlsel: + /* L: Select top 21 bits. */ + value = value >> 11; break; - case e_lsel: /* L : Arithmetic shift right 11 bits */ - case e_nlsel: /* NL : Arithmetic shift right 11 bits */ - value += constant_value; - value = (value & 0xfffff800) >> 11; - break; - - case e_rsel: /* R : Set bits 0-20 to zero */ - value += constant_value; + case e_rsel: + /* R: Select bottom 11 bits. */ value = value & 0x7ff; break; - case e_ldsel: /* LD : Add 0x800, arithmetic shift - right 11 bits */ - value += constant_value; - value += 0x800; - value = (value & 0xfffff800) >> 11; + case e_lssel: + /* LS: Round to nearest multiple of 2048 then select top 21 bits. */ + value = value + 0x400; + value = value >> 11; break; - case e_rdsel: /* RD : Set bits 0-20 to one */ - value += constant_value; - value |= 0xfffff800; + case e_rssel: + /* RS: Select bottom 11 bits for LS. + We need to return a value such that 2048 * LS'x + RS'x == x. + ie. RS'x = x - ((x + 0x400) & -0x800) + this is just a sign extension from bit 21. */ + value = ((value & 0x7ff) ^ 0x400) - 0x400; break; - case e_lrsel: /* LR : L with "rounded" constant */ - case e_nlrsel: /* NLR : NL with "rounded" constant */ - value = value + ((constant_value + 0x1000) & 0xffffe000); - value = (value & 0xfffff800) >> 11; + case e_ldsel: + /* LD: Round to next multiple of 2048 then select top 21 bits. + Yes, if we are already on a multiple of 2048, we go up to the + next one. RD in this case will be -2048. */ + value = value + 0x800; + value = value >> 11; break; - case e_rrsel: /* RR : R with "rounded" constant */ - value = value + ((constant_value + 0x1000) & 0xffffe000); - value = (value & 0x7ff) + constant_value - ((constant_value + 0x1000) & 0xffffe000); + case e_rdsel: + /* RD: Set bits 0-20 to one. */ + value = value | -0x800; + break; + + case e_lrsel: + case e_nlrsel: + /* LR: L with rounding of the addend to nearest 8k. */ + value = sym_val + ((addend + 0x1000) & -0x2000); + value = value >> 11; + break; + + case e_rrsel: + /* RR: R with rounding of the addend to nearest 8k. + We need to return a value such that 2048 * LR'x + RR'x == x + ie. RR'x = s+a - (s + (((a + 0x1000) & -0x2000) & -0x800)) + . = s+a - ((s & -0x800) + ((a + 0x1000) & -0x2000)) + . = (s & 0x7ff) + a - ((a + 0x1000) & -0x2000) */ + value = (sym_val & 0x7ff) + (((addend & 0x1fff) ^ 0x1000) - 0x1000); break; default: abort (); } return value; - } /* PA-RISC OPCODES */ -#define get_opcode(insn) ((insn) & 0xfc000000) >> 26 +#define get_opcode(insn) (((insn) >> 26) & 0x3f) -/* FIXME: this list is incomplete. It should also be an enumerated - type rather than #defines. */ +enum hppa_opcode_type +{ + /* None of the opcodes in the first group generate relocs, so we + aren't too concerned about them. */ + OP_SYSOP = 0x00, + OP_MEMMNG = 0x01, + OP_ALU = 0x02, + OP_NDXMEM = 0x03, + OP_SPOP = 0x04, + OP_DIAG = 0x05, + OP_FMPYADD = 0x06, + OP_UNDEF07 = 0x07, + OP_COPRW = 0x09, + OP_COPRDW = 0x0b, + OP_COPR = 0x0c, + OP_FLOAT = 0x0e, + OP_PRDSPEC = 0x0f, + OP_UNDEF15 = 0x15, + OP_UNDEF1d = 0x1d, + OP_FMPYSUB = 0x26, + OP_FPFUSED = 0x2e, + OP_SHEXDP0 = 0x34, + OP_SHEXDP1 = 0x35, + OP_SHEXDP2 = 0x36, + OP_UNDEF37 = 0x37, + OP_SHEXDP3 = 0x3c, + OP_SHEXDP4 = 0x3d, + OP_MULTMED = 0x3e, + OP_UNDEF3f = 0x3f, -#define LDO 0x0d -#define LDB 0x10 -#define LDH 0x11 -#define LDW 0x12 -#define LDWM 0x13 -#define STB 0x18 -#define STH 0x19 -#define STW 0x1a -#define STWM 0x1b -#define COMICLR 0x24 -#define SUBI 0x25 -#define SUBIO 0x25 -#define ADDIT 0x2c -#define ADDITO 0x2c -#define ADDI 0x2d -#define ADDIO 0x2d -#define LDIL 0x08 -#define ADDIL 0x0a + OP_LDIL = 0x08, + OP_ADDIL = 0x0a, -#define MOVB 0x32 -#define MOVIB 0x33 -#define COMBT 0x20 -#define COMBF 0x22 -#define COMIBT 0x21 -#define COMIBF 0x23 -#define ADDBT 0x28 -#define ADDBF 0x2a -#define ADDIBT 0x29 -#define ADDIBF 0x2b -#define BVB 0x30 -#define BB 0x31 + OP_LDO = 0x0d, + OP_LDB = 0x10, + OP_LDH = 0x11, + OP_LDW = 0x12, + OP_LDWM = 0x13, + OP_STB = 0x18, + OP_STH = 0x19, + OP_STW = 0x1a, + OP_STWM = 0x1b, -#define BL 0x3a -#define BLE 0x39 -#define BE 0x38 + OP_LDD = 0x14, + OP_STD = 0x1c, -#define CMPBDT 0x27 -#define CMPBDF 0x2f -#define CMPIBD 0x3b -#define LDD 0x14 -#define STD 0x1c -#define LDWL 0x17 -#define STWL 0x1f -#define FDLW 0x16 -#define FSTW 0x1e - -/* Given a machine instruction, return its format. + OP_FLDW = 0x16, + OP_LDWL = 0x17, + OP_FSTW = 0x1e, + OP_STWL = 0x1f, - FIXME: opcodes which do not map to a known format - should return an error of some sort. */ + OP_COMBT = 0x20, + OP_COMIBT = 0x21, + OP_COMBF = 0x22, + OP_COMIBF = 0x23, + OP_CMPBDT = 0x27, + OP_ADDBT = 0x28, + OP_ADDIBT = 0x29, + OP_ADDBF = 0x2a, + OP_ADDIBF = 0x2b, + OP_CMPBDF = 0x2f, + OP_BVB = 0x30, + OP_BB = 0x31, + OP_MOVB = 0x32, + OP_MOVIB = 0x33, + OP_CMPIBD = 0x3b, + + OP_COMICLR = 0x24, + OP_SUBI = 0x25, + OP_ADDIT = 0x2c, + OP_ADDI = 0x2d, + + OP_BE = 0x38, + OP_BLE = 0x39, + OP_BL = 0x3a +}; + + +/* Given a machine instruction, return its format. */ static INLINE int -bfd_hppa_insn2fmt (insn) - unsigned long insn; +bfd_hppa_insn2fmt (abfd, insn) + bfd *abfd; + int insn; { - int fmt = -1; - unsigned char op = get_opcode (insn); - + enum hppa_opcode_type op = get_opcode (insn); + switch (op) { - case ADDI: - case ADDIT: - case SUBI: - fmt = 11; - break; - case MOVB: - case MOVIB: - case COMBT: - case COMBF: - case COMIBT: - case COMIBF: - case ADDBT: - case ADDBF: - case ADDIBT: - case ADDIBF: - case BVB: - case BB: - case CMPBDT: - case CMPBDF: - case CMPIBD: - fmt = 12; - break; - case LDO: - case LDB: - case LDH: - case LDW: - case LDWM: - case STB: - case STH: - case STW: - case STWM: - fmt = 14; - break; - case LDWL: - case STWL: - case FDLW: - case FSTW: + case OP_COMICLR: + case OP_SUBI: + case OP_ADDIT: + case OP_ADDI: + return 11; + + case OP_COMBT: + case OP_COMIBT: + case OP_COMBF: + case OP_COMIBF: + case OP_CMPBDT: + case OP_ADDBT: + case OP_ADDIBT: + case OP_ADDBF: + case OP_ADDIBF: + case OP_CMPBDF: + case OP_BVB: + case OP_BB: + case OP_MOVB: + case OP_MOVIB: + case OP_CMPIBD: + return 12; + + case OP_LDO: + case OP_LDB: + case OP_LDH: + case OP_LDW: + case OP_LDWM: + case OP_STB: + case OP_STH: + case OP_STW: + case OP_STWM: + if (abfd->arch_info->mach >= 25) + return 16; /* Wide mode, format 16. */ + return 14; + + case OP_FLDW: + case OP_LDWL: + case OP_FSTW: + case OP_STWL: /* This is a hack. Unfortunately, format 11 is already taken and we're using integers rather than an enum, so it's hard - to describe the 10a format. */ - fmt = -11; - break; - case LDD: - case STD: - fmt = 10; - break; - case BL: - case BE: - case BLE: - if ((insn & 0x00008000) == 0x00008000) + to describe the 11a format. */ + if (abfd->arch_info->mach >= 25) + return -16; /* Wide mode, format 16a. */ + return -11; + + case OP_LDD: + case OP_STD: + if (abfd->arch_info->mach >= 25) + return -10; /* Wide mode, format 10a. */ + return 10; + + case OP_BL: + if ((insn & 0x8000) != 0) return 22; - fmt = 17; - break; - case LDIL: - case ADDIL: - fmt = 21; - break; + /* fall thru */ + case OP_BE: + case OP_BLE: + return 17; + + case OP_LDIL: + case OP_ADDIL: + return 21; + default: - fmt = 32; break; } - return fmt; + return 32; } /* Insert VALUE into INSN using R_FORMAT to determine exactly what bits to change. */ - -static INLINE unsigned long -hppa_rebuild_insn (abfd, insn, value, r_format) - bfd *abfd ATTRIBUTE_UNUSED; - unsigned long insn; - unsigned long value; - unsigned long r_format; -{ - unsigned long const_part; - unsigned long rebuilt_part; +static INLINE int +hppa_rebuild_insn (insn, value, r_format) + int insn; + int value; + int r_format; +{ switch (r_format) { case 11: - { - unsigned w1, w; - - const_part = insn & 0xffffe002; - dis_assemble_12 (value, &w1, &w); - rebuilt_part = (w1 << 2) | w; - return const_part | rebuilt_part; - } + return (insn & ~ 0x7ff) | low_sign_unext (value, 11); case 12: - { - unsigned w1, w; + return (insn & ~ 0x1ffd) | re_assemble_12 (value); - const_part = insn & 0xffffe002; - dis_assemble_12 (value, &w1, &w); - rebuilt_part = (w1 << 2) | w; - return const_part | rebuilt_part; - } + + case 10: + return (insn & ~ 0x3ff1) | re_assemble_14 (value & -8); + + case -11: + return (insn & ~ 0x3ff9) | re_assemble_14 (value & -4); case 14: - { - unsigned int ext; - - const_part = insn & 0xffffc000; - low_sign_unext (value, 14, &ext); - return const_part | ext; - } + return (insn & ~ 0x3fff) | re_assemble_14 (value); + + + case -10: + return (insn & ~ 0xfff1) | re_assemble_16 (value & -8); + + case -16: + return (insn & ~ 0xfff9) | re_assemble_16 (value & -4); + + case 16: + return (insn & ~ 0xffff) | re_assemble_16 (value); + case 17: - { - unsigned w1, w2, w; - - const_part = insn & 0xffe0e002; - dis_assemble_17 (value, &w1, &w2, &w); - rebuilt_part = (w2 << 2) | (w1 << 16) | w; - return const_part | rebuilt_part; - } + return (insn & ~ 0x1f1ffd) | re_assemble_17 (value); case 21: - { - unsigned int w; + return (insn & ~ 0x1fffff) | re_assemble_21 (value); - const_part = insn & 0xffe00000; - dis_assemble_21 (value, &w); - return const_part | w; - } + case 22: + return (insn & ~ 0x3ff1ffd) | re_assemble_22 (value); case 32: - const_part = 0; return value; default: @@ -726,4 +616,4 @@ hppa_rebuild_insn (abfd, insn, value, r_format) return insn; } -#endif /* _HPPA_H */ +#endif /* _LIBHPPA_H */ diff --git a/gnu/dist/toolchain/bfd/libpei.h b/gnu/dist/toolchain/bfd/libpei.h index 88f9f7382295..db47e374818c 100644 --- a/gnu/dist/toolchain/bfd/libpei.h +++ b/gnu/dist/toolchain/bfd/libpei.h @@ -192,6 +192,36 @@ PE/PEI rearrangement (and code added): Donn Terry #define PUT_SCNHDR_LNNOPTR bfd_h_put_32 #endif +#ifdef COFF_WITH_PEP64 + +#define GET_OPTHDR_IMAGE_BASE bfd_h_get_64 +#define PUT_OPTHDR_IMAGE_BASE bfd_h_put_64 +#define GET_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_get_64 +#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_put_64 +#define GET_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_get_64 +#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_put_64 +#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_get_64 +#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_put_64 +#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_get_64 +#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_put_64 +#define GET_PDATA_ENTRY bfd_get_64 + +#else /* !COFF_WITH_PEP64 */ + +#define GET_OPTHDR_IMAGE_BASE bfd_h_get_32 +#define PUT_OPTHDR_IMAGE_BASE bfd_h_put_32 +#define GET_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_get_32 +#define PUT_OPTHDR_SIZE_OF_STACK_RESERVE bfd_h_put_32 +#define GET_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_get_32 +#define PUT_OPTHDR_SIZE_OF_STACK_COMMIT bfd_h_put_32 +#define GET_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_get_32 +#define PUT_OPTHDR_SIZE_OF_HEAP_RESERVE bfd_h_put_32 +#define GET_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_get_32 +#define PUT_OPTHDR_SIZE_OF_HEAP_COMMIT bfd_h_put_32 +#define GET_PDATA_ENTRY bfd_get_32 + +#endif /* !COFF_WITH_PEP64 */ + /* These functions are architecture dependent, and are in peicode.h: coff_swap_reloc_in int coff_swap_reloc_out diff --git a/gnu/dist/toolchain/bfd/linker.c b/gnu/dist/toolchain/bfd/linker.c index 6e9ee65581b1..1fb3cc59aee4 100644 --- a/gnu/dist/toolchain/bfd/linker.c +++ b/gnu/dist/toolchain/bfd/linker.c @@ -60,7 +60,7 @@ SECTION a.out (in <>) and ECOFF (in <>). The a.out routines are used as examples throughout this section. -@menu +@menu @* Creating a Linker Hash Table:: @* Adding Symbols to the Hash Table:: @* Performing the Final Link:: @@ -601,7 +601,7 @@ bfd_wrapped_link_hash_lookup (abfd, info, string, create, copy, follow) struct bfd_link_hash_entry * with no explicit cast required on the call. */ -void +void bfd_link_hash_traverse (table, func, info) struct bfd_link_hash_table *table; boolean (*func) PARAMS ((struct bfd_link_hash_entry *, PTR)); @@ -1361,7 +1361,7 @@ enum link_row enum link_action { - FAIL, /* Abort. */ + FAIL, /* Abort. */ UND, /* Mark symbol undefined. */ WEAK, /* Mark symbol weak undefined. */ DEF, /* Mark symbol defined. */ @@ -1464,7 +1464,7 @@ hash_entry_bfd (h) or destructor names as collect2 does. HASHP, if not NULL, is a place to store the created hash table entry; if *HASHP is not NULL, the caller has already looked up - the hash table entry, and stored it in *HASHP. */ + the hash table entry, and stored it in *HASHP. */ boolean _bfd_generic_link_add_one_symbol (info, abfd, name, flags, section, value, @@ -2054,7 +2054,7 @@ _bfd_generic_final_link (abfd, info) } } } - + return true; } @@ -2452,7 +2452,7 @@ _bfd_generic_reloc_link_order (abfd, info, sec, link_order) r = (arelent *) bfd_alloc (abfd, sizeof (arelent)); if (r == (arelent *) NULL) return false; - + r->address = link_order->offset; r->howto = bfd_reloc_type_lookup (abfd, link_order->u.reloc.p->reloc); if (r->howto == 0) @@ -2524,7 +2524,7 @@ _bfd_generic_reloc_link_order (abfd, info, sec, link_order) break; } ok = bfd_set_section_contents (abfd, sec, (PTR) buf, - (file_ptr) + (file_ptr) (link_order->offset * bfd_octets_per_byte (abfd)), size); free (buf); @@ -2594,7 +2594,7 @@ _bfd_default_link_order (abfd, info, sec, link_order) case bfd_data_link_order: return bfd_set_section_contents (abfd, sec, (PTR) link_order->u.data.contents, - (file_ptr) + (file_ptr) (link_order->offset * bfd_octets_per_byte (abfd)), link_order->size); @@ -2603,7 +2603,6 @@ _bfd_default_link_order (abfd, info, sec, link_order) /* Default routine to handle a bfd_fill_link_order. */ -/*ARGSUSED*/ static boolean default_fill_link_order (abfd, info, sec, link_order) bfd *abfd; @@ -2630,8 +2629,8 @@ default_fill_link_order (abfd, info, sec, link_order) for (i = 1; i < size; i += 2) space[i] = fill; result = bfd_set_section_contents (abfd, sec, space, - (file_ptr) - (link_order->offset * + (file_ptr) + (link_order->offset * bfd_octets_per_byte (abfd)), link_order->size); free (space); @@ -2732,7 +2731,7 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, if (h != NULL) set_symbol_from_hash (sym, h); } - } + } } /* Get and relocate the section contents. */ @@ -2750,8 +2749,8 @@ default_indirect_link_order (output_bfd, info, output_section, link_order, 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->offset * + bfd_octets_per_byte (output_bfd)), link_order->size)) goto error_return; @@ -2803,8 +2802,6 @@ DESCRIPTION */ - - boolean _bfd_generic_link_split_section (abfd, sec) bfd *abfd ATTRIBUTE_UNUSED; diff --git a/gnu/dist/toolchain/bfd/lynx-core.c b/gnu/dist/toolchain/bfd/lynx-core.c index 2358177dbc62..b9890124a87d 100644 --- a/gnu/dist/toolchain/bfd/lynx-core.c +++ b/gnu/dist/toolchain/bfd/lynx-core.c @@ -26,7 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include -/* sys/kernel.h should define this, but doesn't always, sigh. */ +/* sys/kernel.h should define this, but doesn't always, sigh. */ #ifndef __LYNXOS #define __LYNXOS #endif @@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* These are stored in the bfd's tdata */ -struct lynx_core_struct +struct lynx_core_struct { int sig; char cmd[PNMLEN + 1]; @@ -83,7 +83,6 @@ make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos) return asect; } -/* ARGSUSED */ const bfd_target * lynx_core_file_p (abfd) bfd *abfd; @@ -146,7 +145,7 @@ lynx_core_file_p (abfd) bfd_set_error (bfd_error_wrong_format); return NULL; } - + core_signal (abfd) = threadp->currsig; newsect = make_bfd_asection (abfd, ".stack", @@ -214,7 +213,6 @@ lynx_core_file_failing_command (abfd) return core_command (abfd); } -/* ARGSUSED */ int lynx_core_file_failing_signal (abfd) bfd *abfd; @@ -222,7 +220,6 @@ lynx_core_file_failing_signal (abfd) return core_signal (abfd); } -/* ARGSUSED */ boolean lynx_core_file_matches_executable_p (core_bfd, exec_bfd) bfd *core_bfd, *exec_bfd; diff --git a/gnu/dist/toolchain/bfd/m68klinux.c b/gnu/dist/toolchain/bfd/m68klinux.c index 22517575bf70..9c445bd48c3e 100644 --- a/gnu/dist/toolchain/bfd/m68klinux.c +++ b/gnu/dist/toolchain/bfd/m68klinux.c @@ -479,8 +479,8 @@ linux_tally_symbols (h, data) (h->root.root.root.string + sizeof PLT_REF_PREFIX - 1), false, false, true); - /* h2 does not follow indirect symbols. */ - h2 = linux_link_hash_lookup (linux_hash_table (info), + /* h2 does not follow indirect symbols. */ + h2 = linux_link_hash_lookup (linux_hash_table (info), (h->root.root.root.string + sizeof PLT_REF_PREFIX - 1), false, false, false); @@ -536,7 +536,7 @@ linux_tally_symbols (h, data) } /* Quick and dirty way of stripping these symbols from the - symtab. */ + symtab. */ if (bfd_is_abs_section (h->root.root.u.def.section)) h->root.written = true; } @@ -561,7 +561,7 @@ bfd_m68klinux_size_dynamic_sections (output_bfd, info) if (output_bfd->xvec != &MY(vec)) return true; - /* First find the fixups... */ + /* First find the fixups... */ linux_link_hash_traverse (linux_hash_table (info), linux_tally_symbols, (PTR) info); @@ -631,7 +631,7 @@ 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 @@ -733,7 +733,7 @@ linux_finish_dynamic_link (output_bfd, info) } } - h = linux_link_hash_lookup (linux_hash_table (info), + h = linux_link_hash_lookup (linux_hash_table (info), "__BUILTIN_FIXUPS__", false, false, false); diff --git a/gnu/dist/toolchain/bfd/m68knetbsd.c b/gnu/dist/toolchain/bfd/m68knetbsd.c index 24d166565399..b350ec2eb36b 100644 --- a/gnu/dist/toolchain/bfd/m68knetbsd.c +++ b/gnu/dist/toolchain/bfd/m68knetbsd.c @@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define TARGET_IS_BIG_ENDIAN_P /* Our m68k ports use either 4K or 8K pages, but object files always - assume 8K page alignment so they will work on all m68k machines. */ + assume 8K page alignment so they will work on all m68k machines. */ #define TARGET_PAGE_SIZE 0x2000 #define DEFAULT_ARCH bfd_arch_m68k diff --git a/gnu/dist/toolchain/bfd/mipsbsd.c b/gnu/dist/toolchain/bfd/mipsbsd.c index 7a680fb38949..7bed6a8fee56 100644 --- a/gnu/dist/toolchain/bfd/mipsbsd.c +++ b/gnu/dist/toolchain/bfd/mipsbsd.c @@ -43,8 +43,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libaout.h" #define SET_ARCH_MACH(ABFD, EXEC) \ - MY(set_arch_mach)(ABFD, N_MACHTYPE (EXEC)); \ - MY(choose_reloc_size)(ABFD); + MY(set_arch_mach) (ABFD, N_MACHTYPE (EXEC)); \ + MY(choose_reloc_size) (ABFD); static void MY(set_arch_mach) PARAMS ((bfd *abfd, int machtype)); static void MY(choose_reloc_size) PARAMS ((bfd *abfd)); @@ -74,7 +74,7 @@ MY(set_arch_mach) (abfd, machtype) enum bfd_architecture arch; long machine; - /* Determine the architecture and machine type of the object file. */ + /* Determine the architecture and machine type of the object file. */ switch (machtype) { case M_MIPS1: @@ -92,7 +92,7 @@ MY(set_arch_mach) (abfd, machtype) machine = 0; break; } - bfd_set_arch_mach(abfd, arch, machine); + bfd_set_arch_mach(abfd, arch, machine); } /* Determine the size of a relocation entry, based on the architecture */ @@ -160,7 +160,7 @@ MY(write_object_contents) (abfd) N_SET_MACHTYPE(*execp, M_UNKNOWN); } - MY(choose_reloc_size)(abfd); + MY(choose_reloc_size) (abfd); WRITE_HEADERS(abfd, execp); @@ -195,8 +195,8 @@ mips_fix_jmp_addr (abfd,reloc_entry,symbol,data,input_section,output_bfd) bfd *output_bfd; { bfd_vma relocation, pc; - - /* If this is a partial relocation, just continue. */ + + /* If this is a partial relocation, just continue. */ if (output_bfd != (bfd *)NULL) return bfd_reloc_continue; @@ -205,7 +205,7 @@ mips_fix_jmp_addr (abfd,reloc_entry,symbol,data,input_section,output_bfd) && (symbol->flags & BSF_WEAK) == 0) return bfd_reloc_undefined; - /* + /* * Work out which section the relocation is targetted at and the * initial relocation command value. */ @@ -249,8 +249,8 @@ mips_fix_hi16_s (abfd, reloc_entry, symbol, data, input_section, char **error_message ATTRIBUTE_UNUSED; { bfd_vma relocation; - - /* If this is a partial relocation, just continue. */ + + /* If this is a partial relocation, just continue. */ if (output_bfd != (bfd *)NULL) return bfd_reloc_continue; @@ -259,7 +259,7 @@ mips_fix_hi16_s (abfd, reloc_entry, symbol, data, input_section, && (symbol->flags & BSF_WEAK) == 0) return bfd_reloc_undefined; - /* + /* * Work out which section the relocation is targetted at and the * initial relocation command value. */ @@ -329,7 +329,7 @@ MY(reloc_howto_type_lookup) (abfd, code) * own mapping of external reloc type values to howto entries. */ long -MY(canonicalize_reloc)(abfd, section, relptr, symbols) +MY(canonicalize_reloc) (abfd, section, relptr, symbols) bfd *abfd; sec_ptr section; arelent **relptr; @@ -339,7 +339,7 @@ MY(canonicalize_reloc)(abfd, section, relptr, symbols) unsigned int count, c; extern reloc_howto_type NAME(aout,ext_howto_table)[]; - /* If we have already read in the relocation table, return the values. */ + /* If we have already read in the relocation table, return the values. */ if (section->flags & SEC_CONSTRUCTOR) { arelent_chain *chain = section->constructor_chain; @@ -351,18 +351,18 @@ MY(canonicalize_reloc)(abfd, section, relptr, symbols) return section->reloc_count; } if (tblptr && section->reloc_count) { - for (count = 0; count++ < section->reloc_count;) + for (count = 0; count++ < section->reloc_count;) *relptr++ = tblptr++; *relptr = 0; return section->reloc_count; } - if (!NAME(aout,slurp_reloc_table)(abfd, section, symbols)) + if (!NAME(aout,slurp_reloc_table) (abfd, section, symbols)) return -1; tblptr = section->relocation; /* fix up howto entries */ - for (count = 0; count++ < section->reloc_count;) + for (count = 0; count++ < section->reloc_count;) { c = tblptr->howto - NAME(aout,ext_howto_table); tblptr->howto = &mips_howto_table_ext[c]; @@ -428,7 +428,7 @@ const bfd_target aout_mips_little_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), & aout_mips_big_vec, - + (PTR) MY_backend_data }; @@ -469,6 +469,6 @@ const bfd_target aout_mips_big_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), & aout_mips_little_vec, - + (PTR) MY_backend_data }; diff --git a/gnu/dist/toolchain/bfd/netbsd-core.c b/gnu/dist/toolchain/bfd/netbsd-core.c index 828c2a1ceb13..b94c4a117b92 100644 --- a/gnu/dist/toolchain/bfd/netbsd-core.c +++ b/gnu/dist/toolchain/bfd/netbsd-core.c @@ -16,7 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include /* - * FIXME: On NetBSD/sparc CORE_FPU_OFFSET should be (sizeof(struct trapframe)) + * FIXME: On NetBSD/sparc CORE_FPU_OFFSET should be (sizeof (struct trapframe)) */ struct netbsd_core_struct { @@ -98,7 +98,7 @@ netbsd_core_file_p (abfd) offset += core.c_seghdrsize; - asect = (asection *) bfd_zalloc (abfd, sizeof(asection)); + asect = (asection *) bfd_zalloc (abfd, sizeof (asection)); if (asect == NULL) { bfd_set_error(bfd_error_no_memory); goto punt; @@ -118,7 +118,7 @@ netbsd_core_file_p (abfd) asect->name = ".reg"; asect->flags = SEC_ALLOC + SEC_HAS_CONTENTS; #ifdef CORE_FPU_OFFSET - /* Hackish... */ + /* Hackish... */ asect->_raw_size = CORE_FPU_OFFSET; asect2 = (asection *)bfd_zalloc (abfd, sizeof (asection)); @@ -193,9 +193,9 @@ netbsd_core_file_matches_executable_p (core_bfd, exec_bfd) /* If somebody calls any byte-swapping routines, shoot them. */ static void -swap_abort() +swap_abort () { - abort(); /* This way doesn't require any declaration for ANSI to fuck up */ + abort (); /* This way doesn't require any declaration for ANSI to fuck up */ } #define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort ) #define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort ) @@ -236,7 +236,7 @@ const bfd_target netbsd_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 (netbsd), @@ -248,6 +248,6 @@ const bfd_target netbsd_core_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 /* backend_data */ }; diff --git a/gnu/dist/toolchain/bfd/newsos3.c b/gnu/dist/toolchain/bfd/newsos3.c index 7ec7a75a87c0..c1389e17782b 100644 --- a/gnu/dist/toolchain/bfd/newsos3.c +++ b/gnu/dist/toolchain/bfd/newsos3.c @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define MY(OP) CAT(newsos3_,OP) #define TARGETNAME "a.out-newsos3" #define ENTRY_CAN_BE_ZERO -#define N_SHARED_LIB(x) 0 /* Avoids warning when compiled with -Wall. */ +#define N_SHARED_LIB(x) 0 /* Avoids warning when compiled with -Wall. */ #define DEFAULT_ARCH bfd_arch_m68k #define TARGET_IS_BIG_ENDIAN_P #define N_HEADER_IN_TEXT(x) 0 diff --git a/gnu/dist/toolchain/bfd/nlm-target.h b/gnu/dist/toolchain/bfd/nlm-target.h index 5c1e255b4c88..5303c1044c21 100644 --- a/gnu/dist/toolchain/bfd/nlm-target.h +++ b/gnu/dist/toolchain/bfd/nlm-target.h @@ -78,10 +78,10 @@ const bfd_target TARGET_BIG_SYM = /* object_flags: mask of all file flags */ (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | WP_TEXT), - + /* section_flags: mask of all section flags */ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | - SEC_CODE | SEC_DATA), + SEC_CODE | SEC_DATA), /* leading_symbol_char: is the first char of a user symbol predictable, and if so what is it */ @@ -147,7 +147,7 @@ const bfd_target TARGET_BIG_SYM = #else NULL, #endif - + /* backend_data: */ (PTR) TARGET_BACKEND_DATA }; @@ -171,10 +171,10 @@ const bfd_target TARGET_LITTLE_SYM = /* object_flags: mask of all file flags */ (HAS_RELOC | EXEC_P | HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | WP_TEXT), - + /* section_flags: mask of all section flags */ (SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC | SEC_READONLY | - SEC_DATA), + SEC_DATA), /* leading_symbol_char: is the first char of a user symbol predictable, and if so what is it */ @@ -240,7 +240,7 @@ const bfd_target TARGET_LITTLE_SYM = #else NULL, #endif - + /* backend_data: */ (PTR) TARGET_BACKEND_DATA }; diff --git a/gnu/dist/toolchain/bfd/nlm32-alpha.c b/gnu/dist/toolchain/bfd/nlm32-alpha.c index 24c8e5167628..c1a0cbe7ba31 100644 --- a/gnu/dist/toolchain/bfd/nlm32-alpha.c +++ b/gnu/dist/toolchain/bfd/nlm32-alpha.c @@ -651,7 +651,7 @@ nlm_alpha_read_import (abfd, sym) while (sym -> rcnt < rcount) { asection *section; - + if (nlm_alpha_read_reloc (abfd, sym, §ion, &nlm_relocs -> reloc) == false) @@ -828,7 +828,7 @@ nlm_alpha_write_external (abfd, count, sym, relocs) arelent r; len = strlen (sym->name); - if ((bfd_write (&len, sizeof (bfd_byte), 1, abfd) != sizeof(bfd_byte)) + if ((bfd_write (&len, sizeof (bfd_byte), 1, abfd) != sizeof (bfd_byte)) || bfd_write (sym->name, len, 1, abfd) != len) return false; diff --git a/gnu/dist/toolchain/bfd/nlm32-i386.c b/gnu/dist/toolchain/bfd/nlm32-i386.c index f16c74d985eb..356d00e295fb 100644 --- a/gnu/dist/toolchain/bfd/nlm32-i386.c +++ b/gnu/dist/toolchain/bfd/nlm32-i386.c @@ -226,7 +226,7 @@ nlm_i386_write_import (abfd, sec, rel) } } } - + bfd_put_32 (abfd, val, temp); if (bfd_write (temp, sizeof (temp), 1, abfd) != sizeof (temp)) return false; @@ -376,7 +376,7 @@ nlm_i386_read_import (abfd, sym) while (sym -> rcnt < rcount) { asection *section; - + if (nlm_i386_read_reloc (abfd, sym, §ion, &nlm_relocs -> reloc) == false) @@ -402,12 +402,12 @@ nlm_i386_write_external (abfd, count, sym, relocs) unsigned char temp[NLM_TARGET_LONG_SIZE]; len = strlen (sym->name); - if ((bfd_write (&len, sizeof (bfd_byte), 1, abfd) != sizeof(bfd_byte)) + if ((bfd_write (&len, sizeof (bfd_byte), 1, abfd) != sizeof (bfd_byte)) || bfd_write (sym->name, len, 1, abfd) != len) return false; bfd_put_32 (abfd, count, temp); - if (bfd_write (temp, sizeof(temp), 1, abfd) != sizeof (temp)) + if (bfd_write (temp, sizeof (temp), 1, abfd) != sizeof (temp)) return false; for (i = 0; i < count; i++) diff --git a/gnu/dist/toolchain/bfd/nlm32-ppc.c b/gnu/dist/toolchain/bfd/nlm32-ppc.c index 5af48345cc73..4eae8d08c059 100644 --- a/gnu/dist/toolchain/bfd/nlm32-ppc.c +++ b/gnu/dist/toolchain/bfd/nlm32-ppc.c @@ -200,344 +200,344 @@ nlm_powerpc_read_reloc (abfd, sym, secp, rel) static reloc_howto_type nlm_powerpc_howto_table[] = { /* Standard 32 bit relocation. */ - HOWTO (0, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + 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 */ + 0, /* special_function */ + "R_POS", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ /* 32 bit relocation, but store negative value. */ - HOWTO (1, /* type */ - 0, /* rightshift */ - -2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (1, /* 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_NEG", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + 0, /* special_function */ + "R_NEG", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ /* 32 bit PC relative relocation. */ - HOWTO (2, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ + 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", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + 0, /* special_function */ + "R_REL", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + /* 16 bit TOC relative relocation. */ - HOWTO (3, /* type */ - 0, /* rightshift */ - 1, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (3, /* type */ + 0, /* rightshift */ + 1, /* size (0 = byte, 1 = short, 2 = long) */ + 16, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ - "R_TOC", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_TOC", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* I don't really know what this is. */ - HOWTO (4, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (4, /* type */ + 1, /* 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_RTB", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + 0, /* special_function */ + "R_RTB", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + /* External TOC relative symbol. */ - HOWTO (5, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (5, /* 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_GL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_GL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Local TOC relative symbol. */ - HOWTO (6, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (6, /* 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_TCL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_TCL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + { 7 }, - + /* Non modifiable absolute branch. */ - HOWTO (8, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (8, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - 0, /* special_function */ - "R_BA", /* name */ - true, /* partial_inplace */ - 0x3fffffc, /* src_mask */ - 0x3fffffc, /* dst_mask */ + 0, /* special_function */ + "R_BA", /* name */ + true, /* partial_inplace */ + 0x3fffffc, /* src_mask */ + 0x3fffffc, /* dst_mask */ false), /* pcrel_offset */ - + { 9 }, /* Non modifiable relative branch. */ - HOWTO (0xa, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - true, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0xa, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + true, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ - "R_BR", /* name */ - true, /* partial_inplace */ - 0x3fffffc, /* src_mask */ - 0x3fffffc, /* dst_mask */ + 0, /* special_function */ + "R_BR", /* name */ + true, /* partial_inplace */ + 0x3fffffc, /* src_mask */ + 0x3fffffc, /* dst_mask */ false), /* pcrel_offset */ - + { 0xb }, /* Indirect load. */ - HOWTO (0xc, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0xc, /* 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_RL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_RL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Load address. */ - HOWTO (0xd, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0xd, /* 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_RLA", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_RLA", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + { 0xe }, - + /* Non-relocating reference. */ - HOWTO (0xf, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0xf, /* 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_REF", /* name */ - false, /* partial_inplace */ - 0, /* src_mask */ - 0, /* dst_mask */ + 0, /* special_function */ + "R_REF", /* name */ + false, /* partial_inplace */ + 0, /* src_mask */ + 0, /* dst_mask */ false), /* pcrel_offset */ - + { 0x10 }, { 0x11 }, - + /* TOC relative indirect load. */ - HOWTO (0x12, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x12, /* 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_TRL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_TRL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* TOC relative load address. */ - HOWTO (0x13, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x13, /* 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_TRLA", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_TRLA", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Modifiable relative branch. */ - HOWTO (0x14, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x14, /* type */ + 1, /* 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_RRTBI", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + 0, /* special_function */ + "R_RRTBI", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Modifiable absolute branch. */ - HOWTO (0x15, /* type */ - 1, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x15, /* type */ + 1, /* 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_RRTBA", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + 0, /* special_function */ + "R_RRTBA", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Modifiable call absolute indirect. */ - HOWTO (0x16, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x16, /* 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_CAI", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_CAI", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Modifiable call relative. */ - HOWTO (0x17, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x17, /* 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_REL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_REL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Modifiable branch absolute. */ - HOWTO (0x18, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x18, /* 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_RBA", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_RBA", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Modifiable branch absolute. */ - HOWTO (0x19, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x19, /* 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_RBAC", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_RBAC", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Modifiable branch relative. */ - HOWTO (0x1a, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 26, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x1a, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 26, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_signed, /* complain_on_overflow */ - 0, /* special_function */ - "R_REL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_REL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false), /* pcrel_offset */ - + /* Modifiable branch absolute. */ - HOWTO (0x1b, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 16, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (0x1b, /* 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_REL", /* name */ - true, /* partial_inplace */ - 0xffff, /* src_mask */ - 0xffff, /* dst_mask */ + 0, /* special_function */ + "R_REL", /* name */ + true, /* partial_inplace */ + 0xffff, /* src_mask */ + 0xffff, /* dst_mask */ false) /* pcrel_offset */ }; @@ -687,7 +687,7 @@ nlm_powerpc_read_import (abfd, sym) while (sym -> rcnt < rcount) { asection *section; - + if (nlm_powerpc_read_reloc (abfd, sym, §ion, &nlm_relocs -> reloc) == false) @@ -751,7 +751,7 @@ nlm_powerpc_write_import (abfd, sec, rel) val -= nlm_get_text_low (abfd); val |= NLM_HIBIT; } - + if (! bfd_is_und_section (bfd_get_section (sym))) { /* This is an internal relocation fixup. The second most @@ -907,12 +907,12 @@ nlm_powerpc_write_external (abfd, count, sym, relocs) #endif len = strlen (sym->name); - if ((bfd_write (&len, sizeof (bfd_byte), 1, abfd) != sizeof(bfd_byte)) + if ((bfd_write (&len, sizeof (bfd_byte), 1, abfd) != sizeof (bfd_byte)) || bfd_write (sym->name, len, 1, abfd) != len) return false; bfd_put_32 (abfd, count, temp); - if (bfd_write (temp, sizeof(temp), 1, abfd) != sizeof (temp)) + if (bfd_write (temp, sizeof (temp), 1, abfd) != sizeof (temp)) return false; for (i = 0; i < count; i++) diff --git a/gnu/dist/toolchain/bfd/nlm32-sparc.c b/gnu/dist/toolchain/bfd/nlm32-sparc.c index ab4d80aa878a..095b8bf89235 100644 --- a/gnu/dist/toolchain/bfd/nlm32-sparc.c +++ b/gnu/dist/toolchain/bfd/nlm32-sparc.c @@ -44,8 +44,8 @@ static boolean nlm_sparc_write_external enum reloc_type { R_SPARC_NONE = 0, - R_SPARC_8, R_SPARC_16, R_SPARC_32, - R_SPARC_DISP8, R_SPARC_DISP16, R_SPARC_DISP32, + R_SPARC_8, R_SPARC_16, R_SPARC_32, + R_SPARC_DISP8, R_SPARC_DISP16, R_SPARC_DISP32, R_SPARC_WDISP30, R_SPARC_WDISP22, R_SPARC_HI22, R_SPARC_22, R_SPARC_13, R_SPARC_LO10, @@ -78,7 +78,7 @@ static CONST char *CONST reloc_type_names[] = }; #endif -static reloc_howto_type nlm32_sparc_howto_table[] = +static reloc_howto_type nlm32_sparc_howto_table[] = { HOWTO(R_SPARC_NONE, 0,0, 0,false,0,complain_overflow_dont, 0,"R_SPARC_NONE", false,0,0x00000000,true), HOWTO(R_SPARC_8, 0,0, 8,false,0,complain_overflow_bitfield,0,"R_SPARC_8", false,0,0x000000ff,true), @@ -145,7 +145,7 @@ nlm_sparc_read_reloc (abfd, sym, secp, rel) rel->howto = NULL; for (index = 0; - index < sizeof(nlm32_sparc_howto_table) / sizeof(reloc_howto_type); + index < sizeof (nlm32_sparc_howto_table) / sizeof (reloc_howto_type); index++) if (nlm32_sparc_howto_table[index].type == type) { rel->howto = &nlm32_sparc_howto_table[index]; @@ -174,9 +174,8 @@ nlm_sparc_write_reloc (abfd, sec, rel) int type = -1; reloc_howto_type *tmp; - for (index = 0; - index < sizeof (nlm32_sparc_howto_table) / sizeof(reloc_howto_type); + index < sizeof (nlm32_sparc_howto_table) / sizeof (reloc_howto_type); index++) { tmp = &nlm32_sparc_howto_table[index]; @@ -192,7 +191,7 @@ nlm_sparc_write_reloc (abfd, sec, rel) } } if (type == -1) - abort(); + abort (); /* * Netware wants a list of relocs for each address. @@ -219,7 +218,7 @@ nlm_sparc_write_reloc (abfd, sec, rel) #endif bfd_put_32 (abfd, val, tmp_reloc.offset); bfd_put_32 (abfd, rel->addend, tmp_reloc.addend); - bfd_put_8 (abfd, (short)(rel->howto->type), tmp_reloc.type); + bfd_put_8 (abfd, (short) (rel->howto->type), tmp_reloc.type); if (bfd_write (&tmp_reloc, 12, 1, abfd) != 12) return false; @@ -252,20 +251,20 @@ nlm_sparc_read_import (abfd, sym) bfd_byte temp[NLM_TARGET_LONG_SIZE]; /* temporary 32-bit value */ unsigned char symlength; /* length of symbol name */ char *name; - + /* * First, read in the number of relocation * entries for this symbol */ if (bfd_read ((PTR) temp, 4, 1, abfd) != 4) return false; - + rcount = bfd_get_32 (abfd, temp); - + /* * Next, read in the length of the symbol */ - + if (bfd_read ((PTR) &symlength, sizeof (symlength), 1, abfd) != sizeof (symlength)) return false; @@ -273,11 +272,11 @@ nlm_sparc_read_import (abfd, sym) name = bfd_alloc (abfd, symlength + 1); if (name == NULL) return false; - + /* * Then read in the symbol */ - + if (bfd_read (name, symlength, 1, abfd) != symlength) return false; name[symlength] = '\0'; @@ -285,11 +284,11 @@ nlm_sparc_read_import (abfd, sym) sym -> symbol.flags = 0; sym -> symbol.value = 0; sym -> symbol.section = bfd_und_section_ptr; - + /* * Next, start reading in the relocs. */ - + nlm_relocs = ((struct nlm_relent *) bfd_alloc (abfd, rcount * sizeof (struct nlm_relent))); if (!nlm_relocs) @@ -299,7 +298,7 @@ nlm_sparc_read_import (abfd, sym) while (sym -> rcnt < rcount) { asection *section; - + if (nlm_sparc_read_reloc (abfd, sym, §ion, &nlm_relocs -> reloc) == false) @@ -364,11 +363,11 @@ nlm_sparc_write_external (abfd, count, sym, relocs) unsigned char temp[NLM_TARGET_LONG_SIZE]; bfd_put_32 (abfd, count, temp); - if (bfd_write (temp, sizeof(temp), 1, abfd) != sizeof (temp)) + if (bfd_write (temp, sizeof (temp), 1, abfd) != sizeof (temp)) return false; len = strlen (sym->name); - if ((bfd_write (&len, sizeof (bfd_byte), 1, abfd) != sizeof(bfd_byte)) + if ((bfd_write (&len, sizeof (bfd_byte), 1, abfd) != sizeof (bfd_byte)) || bfd_write (sym->name, len, 1, abfd) != len) return false; diff --git a/gnu/dist/toolchain/bfd/nlmcode.h b/gnu/dist/toolchain/bfd/nlmcode.h index ad1a2f8355b0..b49c75e5017d 100644 --- a/gnu/dist/toolchain/bfd/nlmcode.h +++ b/gnu/dist/toolchain/bfd/nlmcode.h @@ -52,9 +52,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define nlm_write_object_contents nlmNAME(write_object_contents) #define nlm_swap_fixed_header_in(abfd,src,dst) \ - (nlm_swap_fixed_header_in_func(abfd))(abfd,src,dst) + (nlm_swap_fixed_header_in_func(abfd)) (abfd,src,dst) #define nlm_swap_fixed_header_out(abfd,src,dst) \ - (nlm_swap_fixed_header_out_func(abfd))(abfd,src,dst) + (nlm_swap_fixed_header_out_func(abfd)) (abfd,src,dst) /* Forward declarations of static functions */ @@ -142,7 +142,7 @@ nlm_object_p (abfd) x_fxdhdr = NULL; /* Check to see if we have an NLM file for this backend by matching - the NLM signature. */ + the NLM signature. */ signature = nlm_signature (abfd); if (signature != NULL @@ -223,7 +223,7 @@ got_no_match: return (NULL); } -/* Add a section to the bfd. */ +/* Add a section to the bfd. */ static boolean add_bfd_section (abfd, name, offset, size, flags) @@ -240,7 +240,7 @@ add_bfd_section (abfd, name, offset, size, flags) { return (false); } - newsect->vma = 0; /* NLM's are relocatable. */ + newsect->vma = 0; /* NLM's are relocatable. */ newsect->_raw_size = size; newsect->filepos = offset; newsect->flags = flags; @@ -249,7 +249,7 @@ add_bfd_section (abfd, name, offset, size, flags) } /* Read and swap in the variable length header. All the fields must - exist in the NLM, and must exist in the order they are read here. */ + exist in the NLM, and must exist in the order they are read here. */ static boolean nlm_swap_variable_header_in (abfd) @@ -257,7 +257,7 @@ nlm_swap_variable_header_in (abfd) { unsigned char temp[NLM_TARGET_LONG_SIZE]; - /* Read the description length and text members. */ + /* Read the description length and text members. */ if (bfd_read ((PTR) & nlm_variable_header (abfd)->descriptionLength, sizeof (nlm_variable_header (abfd)->descriptionLength), @@ -270,19 +270,19 @@ nlm_swap_variable_header_in (abfd) (bfd_size_type) nlm_variable_header (abfd)->descriptionLength + 1) return (false); - /* Read and convert the stackSize field. */ + /* Read and convert the stackSize field. */ if (bfd_read ((PTR) temp, sizeof (temp), 1, abfd) != sizeof (temp)) return (false); nlm_variable_header (abfd)->stackSize = get_word (abfd, (bfd_byte *) temp); - /* Read and convert the reserved field. */ + /* Read and convert the reserved field. */ if (bfd_read ((PTR) temp, sizeof (temp), 1, abfd) != sizeof (temp)) return (false); nlm_variable_header (abfd)->reserved = get_word (abfd, (bfd_byte *) temp); - /* Read the oldThreadName field. This field is a fixed length string. */ + /* Read the oldThreadName field. This field is a fixed length string. */ if (bfd_read ((PTR) nlm_variable_header (abfd)->oldThreadName, sizeof (nlm_variable_header (abfd)->oldThreadName), @@ -290,7 +290,7 @@ nlm_swap_variable_header_in (abfd) sizeof (nlm_variable_header (abfd)->oldThreadName)) return (false); - /* Read the screen name length and text members. */ + /* Read the screen name length and text members. */ if (bfd_read ((PTR) & nlm_variable_header (abfd)->screenNameLength, sizeof (nlm_variable_header (abfd)->screenNameLength), @@ -303,7 +303,7 @@ nlm_swap_variable_header_in (abfd) (bfd_size_type) nlm_variable_header (abfd)->screenNameLength + 1) return (false); - /* Read the thread name length and text members. */ + /* Read the thread name length and text members. */ if (bfd_read ((PTR) & nlm_variable_header (abfd)->threadNameLength, sizeof (nlm_variable_header (abfd)->threadNameLength), @@ -327,7 +327,7 @@ nlm_swap_variable_header_out (abfd) { unsigned char temp[NLM_TARGET_LONG_SIZE]; - /* Write the description length and text members. */ + /* Write the description length and text members. */ if (bfd_write ((PTR) & nlm_variable_header (abfd)->descriptionLength, sizeof (nlm_variable_header (abfd)->descriptionLength), @@ -340,21 +340,21 @@ nlm_swap_variable_header_out (abfd) (bfd_size_type) nlm_variable_header (abfd)->descriptionLength + 1) return (false); - /* Convert and write the stackSize field. */ + /* Convert and write the stackSize field. */ put_word (abfd, (bfd_vma) nlm_variable_header (abfd)->stackSize, (bfd_byte *) temp); if (bfd_write ((PTR) temp, sizeof (temp), 1, abfd) != sizeof (temp)) return (false); - /* Convert and write the reserved field. */ + /* Convert and write the reserved field. */ put_word (abfd, (bfd_vma) nlm_variable_header (abfd)->reserved, (bfd_byte *) temp); if (bfd_write ((PTR) temp, sizeof (temp), 1, abfd) != sizeof (temp)) return (false); - /* Write the oldThreadName field. This field is a fixed length string. */ + /* Write the oldThreadName field. This field is a fixed length string. */ if (bfd_write ((PTR) nlm_variable_header (abfd)->oldThreadName, sizeof (nlm_variable_header (abfd)->oldThreadName), @@ -362,7 +362,7 @@ nlm_swap_variable_header_out (abfd) sizeof (nlm_variable_header (abfd)->oldThreadName)) return (false); - /* Write the screen name length and text members. */ + /* Write the screen name length and text members. */ if (bfd_write ((PTR) & nlm_variable_header (abfd)->screenNameLength, sizeof (nlm_variable_header (abfd)->screenNameLength), @@ -375,7 +375,7 @@ nlm_swap_variable_header_out (abfd) (bfd_size_type) nlm_variable_header (abfd)->screenNameLength + 1) return (false); - /* Write the thread name length and text members. */ + /* Write the thread name length and text members. */ if (bfd_write ((PTR) & nlm_variable_header (abfd)->threadNameLength, sizeof (nlm_variable_header (abfd)->threadNameLength), @@ -397,7 +397,7 @@ nlm_swap_variable_header_out (abfd) of the auxiliary headers are, except by finding something that doesn't look like a known auxiliary header. This means that the first new type of auxiliary header added will break all existing tools that don't - recognize it. */ + recognize it. */ static boolean nlm_swap_auxiliary_headers_in (abfd) @@ -511,7 +511,7 @@ nlm_swap_auxiliary_headers_in (abfd) ->copyrightMessageLength), 1, 1, abfd) != 1) return (false); - /* The copyright message is a variable length string. */ + /* The copyright message is a variable length string. */ if (bfd_read ((PTR) nlm_copyright_header (abfd)->copyrightMessage, nlm_copyright_header (abfd)->copyrightMessageLength + 1, 1, abfd) != @@ -820,7 +820,6 @@ nlm_swap_auxiliary_headers_out (abfd) return false; } - /* Write out the copyright header if there is one. */ if (find_nonzero ((PTR) nlm_copyright_header (abfd), sizeof (Nlm_Internal_Copyright_Header))) @@ -835,7 +834,7 @@ nlm_swap_auxiliary_headers_out (abfd) nlm_copyright_header (abfd)->copyrightMessageLength; if (bfd_write ((PTR) thdr.copyrightMessageLength, 1, 1, abfd) != 1) return false; - /* The copyright message is a variable length string. */ + /* The copyright message is a variable length string. */ if (bfd_write ((PTR) nlm_copyright_header (abfd)->copyrightMessage, nlm_copyright_header (abfd)->copyrightMessageLength + 1, 1, abfd) != @@ -911,7 +910,7 @@ nlm_swap_auxiliary_headers_out (abfd) Return the number of bytes required to hold the symtab vector, based on the count plus 1, since we will NULL terminate the vector allocated based - on this size. */ + on this size. */ long nlm_get_symtab_upper_bound (abfd) @@ -930,7 +929,7 @@ nlm_get_symtab_upper_bound (abfd) } /* Note that bfd_get_symcount is guaranteed to be zero if slurping the - symbol table fails. */ + symbol table fails. */ long nlm_get_symtab (abfd, alocation) @@ -1048,7 +1047,7 @@ nlm_slurp_symbol_table (abfd) Note that we allocate the initial bfd canonical symbol buffer based on a one-to-one mapping of the NLM symbols to canonical symbols. We actually use all the NLM symbols, so there will be no space left over at the end. - When we have all the symbols, we build the caller's pointer vector. */ + When we have all the symbols, we build the caller's pointer vector. */ abfd->symcount = 0; i_fxdhdrp = nlm_fixed_header (abfd); @@ -1071,7 +1070,7 @@ nlm_slurp_symbol_table (abfd) /* We use the bfd's symcount directly as the control count, so that early termination of the loop leaves the symcount correct for the symbols that - were read. */ + were read. */ set_public_section_func = nlm_set_public_section_func (abfd); symcount = i_fxdhdrp->numberOfPublics; diff --git a/gnu/dist/toolchain/bfd/nlmswap.h b/gnu/dist/toolchain/bfd/nlmswap.h index 5a9ce7268d00..e6d28862d8e2 100644 --- a/gnu/dist/toolchain/bfd/nlmswap.h +++ b/gnu/dist/toolchain/bfd/nlmswap.h @@ -36,7 +36,7 @@ static void nlm_swap_fixed_header_out PARAMS ((bfd *, PTR)); /* Translate an NLM fixed length file header in external format into an NLM - file header in internal format. */ + file header in internal format. */ static void nlm_swap_fixed_header_in (abfd, realsrc, dst) @@ -96,7 +96,7 @@ nlm_swap_fixed_header_in (abfd, realsrc, dst) } /* Translate an NLM fixed length file header in internal format into - an NLM file header in external format. */ + an NLM file header in external format. */ static void nlm_swap_fixed_header_out (abfd, src, realdst) diff --git a/gnu/dist/toolchain/bfd/ns32knetbsd.c b/gnu/dist/toolchain/bfd/ns32knetbsd.c index a22356df6e1e..f7fd8ce71c80 100644 --- a/gnu/dist/toolchain/bfd/ns32knetbsd.c +++ b/gnu/dist/toolchain/bfd/ns32knetbsd.c @@ -15,7 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define BYTES_IN_WORD 4 #undef TARGET_IS_BIG_ENDIAN_P @@ -49,5 +49,4 @@ MY_bfd_reloc_type_lookup PARAMS((bfd *abfd AND bfd_reloc_code_real_type code)); - #include "netbsd.h" diff --git a/gnu/dist/toolchain/bfd/opncls.c b/gnu/dist/toolchain/bfd/opncls.c index 57ca0d0a2594..39947dadb4a1 100644 --- a/gnu/dist/toolchain/bfd/opncls.c +++ b/gnu/dist/toolchain/bfd/opncls.c @@ -1,5 +1,5 @@ /* opncls.c -- open and close a BFD. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997 + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 1997, 2001 Free Software Foundation, Inc. Written by Cygnus Support. @@ -248,7 +248,7 @@ bfd_fdopenr (filename, target, fd) be written through, although doing so requires that we end the previous clause with a preposition. */ /* (O_ACCMODE) parens are to avoid Ultrix header file bug */ - switch (fdflags & O_ACCMODE) + switch (fdflags & (O_ACCMODE)) { case O_RDONLY: nbfd->direction = read_direction; break; case O_WRONLY: nbfd->direction = write_direction; break; diff --git a/gnu/dist/toolchain/bfd/pc532-mach.c b/gnu/dist/toolchain/bfd/pc532-mach.c index 3b77d5dab146..08ccc38046ec 100644 --- a/gnu/dist/toolchain/bfd/pc532-mach.c +++ b/gnu/dist/toolchain/bfd/pc532-mach.c @@ -33,7 +33,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define N_HEADER_IN_TEXT(x) 1 #define N_TXTSIZE(x) ((x).a_text) - #define TEXT_START_ADDR 0x10000 /* from old ld */ #define TARGET_PAGE_SIZE 0x1000 /* from old ld, 032 & 532 are really 512/4k */ @@ -49,7 +48,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define N_SHARED_LIB(x) 0 #define SEGMENT_SIZE TARGET_PAGE_SIZE #define DEFAULT_ARCH bfd_arch_ns32k - + #define MY(OP) CAT(pc532machaout_,OP) /* Must be the same as aout-ns32k.c */ @@ -67,14 +66,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define MY_bfd_reloc_type_lookup ns32kaout_bfd_reloc_type_lookup -/* libaout doesn't use NAME for these ... */ +/* libaout doesn't use NAME for these ... */ #define MY_get_section_contents aout_32_get_section_contents #define MY_text_includes_header 1 #define MY_exec_header_not_counted 1 - + #define MYNSX(OP) CAT(ns32kaout_,OP) reloc_howto_type * MYNSX(bfd_reloc_type_lookup) @@ -91,9 +90,9 @@ bfd *abfd; { struct external_exec exec_bytes; struct internal_exec *execp = exec_hdr (abfd); - + obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; - + BFD_ASSERT (bfd_get_arch (abfd) == bfd_arch_ns32k); switch (bfd_get_mach (abfd)) { @@ -106,9 +105,9 @@ bfd *abfd; break; } N_SET_FLAGS (*execp, aout_backend_info (abfd)->exec_hdr_flags); - + WRITE_HEADERS(abfd, execp); - + return true; } diff --git a/gnu/dist/toolchain/bfd/pe-arm.c b/gnu/dist/toolchain/bfd/pe-arm.c index 6c6b65980071..a4e128b3fd76 100644 --- a/gnu/dist/toolchain/bfd/pe-arm.c +++ b/gnu/dist/toolchain/bfd/pe-arm.c @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define PCRELOFFSET true #define COFF_LONG_SECTION_NAMES -#ifndef bfd_arm_allocate_interworking_sections +#ifndef bfd_arm_allocate_interworking_sections #define bfd_arm_allocate_interworking_sections \ bfd_arm_pe_allocate_interworking_sections #define bfd_arm_get_bfd_for_interworking \ @@ -39,7 +39,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define bfd_arm_process_before_allocation \ bfd_arm_pe_process_before_allocation #endif - + #ifdef ARM_WINCE #define TARGET_UNDERSCORE 0 #endif diff --git a/gnu/dist/toolchain/bfd/pe-i386.c b/gnu/dist/toolchain/bfd/pe-i386.c index a2eb78477c2f..1e7e66e9d475 100644 --- a/gnu/dist/toolchain/bfd/pe-i386.c +++ b/gnu/dist/toolchain/bfd/pe-i386.c @@ -20,7 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" - #define TARGET_SYM i386pe_vec #define TARGET_NAME "pe-i386" #define COFF_WITH_PE diff --git a/gnu/dist/toolchain/bfd/pe-mips.c b/gnu/dist/toolchain/bfd/pe-mips.c index 9b89369b37b6..fe6e0a1f0d60 100644 --- a/gnu/dist/toolchain/bfd/pe-mips.c +++ b/gnu/dist/toolchain/bfd/pe-mips.c @@ -34,7 +34,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libcoff.h" -static bfd_reloc_status_type coff_mips_reloc +static bfd_reloc_status_type coff_mips_reloc PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); static reloc_howto_type *coff_mips_rtype_to_howto PARAMS ((bfd *, asection *, struct internal_reloc *, @@ -166,21 +166,21 @@ coff_mips_reloc (abfd, reloc_entry, symbol, data, input_section, output_bfd, #ifdef COFF_WITH_PE /* Return true if this relocation should - appear in the output .reloc section. */ + appear in the output .reloc section. */ static boolean in_reloc_p(abfd, howto) bfd * abfd ATTRIBUTE_UNUSED; reloc_howto_type *howto; { return ! howto->pc_relative && howto->type != MIPS_R_RVA; -} +} #endif #ifndef PCRELOFFSET #define PCRELOFFSET false #endif -static reloc_howto_type howto_table[] = +static reloc_howto_type howto_table[] = { /* Reloc type 0 is ignored. The reloc reading code ensures that this is a reference to the .abs section, which will cause @@ -336,33 +336,33 @@ static reloc_howto_type howto_table[] = EMPTY_HOWTO (31), EMPTY_HOWTO (32), EMPTY_HOWTO (33), - HOWTO (MIPS_R_RVA, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (MIPS_R_RVA, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - coff_mips_reloc, /* special_function */ - "rva32", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + coff_mips_reloc, /* special_function */ + "rva32", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ EMPTY_HOWTO (35), EMPTY_HOWTO (36), - HOWTO (MIPS_R_PAIR, /* type */ - 0, /* rightshift */ - 2, /* size (0 = byte, 1 = short, 2 = long) */ - 32, /* bitsize */ - false, /* pc_relative */ - 0, /* bitpos */ + HOWTO (MIPS_R_PAIR, /* type */ + 0, /* rightshift */ + 2, /* size (0 = byte, 1 = short, 2 = long) */ + 32, /* bitsize */ + false, /* pc_relative */ + 0, /* bitpos */ complain_overflow_bitfield, /* complain_on_overflow */ - coff_mips_reloc, /* special_function */ - "PAIR", /* name */ - true, /* partial_inplace */ - 0xffffffff, /* src_mask */ - 0xffffffff, /* dst_mask */ + coff_mips_reloc, /* special_function */ + "PAIR", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false), /* pcrel_offset */ }; @@ -408,7 +408,6 @@ static reloc_howto_type howto_table[] = cache_ptr->addend += asect->vma; \ } - /* Convert an rtype to howto for the COFF backend linker. */ static reloc_howto_type * @@ -439,7 +438,7 @@ coff_mips_rtype_to_howto (abfd, sec, rel, h, sym, addendp) function will be adding in the final value of the symbol. We need to subtract out the current size in order to get the correct result. */ - + BFD_ASSERT (h != NULL); #ifndef COFF_WITH_PE @@ -458,7 +457,7 @@ coff_mips_rtype_to_howto (abfd, sec, rel, h, sym, addendp) /* If the output symbol is common (in which case this must be a relocateable link), we need to add in the final size of the common symbol. */ - if (h != NULL && h->root.type == bfd_link_hash_common) + if (h != NULL && h->root.type == bfd_link_hash_common) *addendp += h->root.u.c.size; #endif @@ -488,11 +487,8 @@ coff_mips_rtype_to_howto (abfd, sec, rel, h, sym, addendp) #define coff_rtype_to_howto coff_mips_rtype_to_howto - #define coff_bfd_reloc_type_lookup coff_mips_reloc_type_lookup - - /* Get the howto structure for a generic reloc type. */ static reloc_howto_type * @@ -577,7 +573,7 @@ mips_swap_reloc_in (abfd, src, dst) reloc_dst->r_offset = reloc_dst->r_symndx; if (reloc_dst->r_offset & 0x8000) reloc_dst->r_offset -= 0x10000; - /*printf("dj: pair offset is %08x\n", reloc_dst->r_offset);*/ + /*printf ("dj: pair offset is %08x\n", reloc_dst->r_offset);*/ reloc_dst->r_symndx = pair_prev.r_symndx; break; } @@ -654,7 +650,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd, if (info->relocateable) { - (*_bfd_error_handler)(_("\ + (*_bfd_error_handler) (_("\ %s: `ld -r' not supported with PE MIPS objects\n"), bfd_get_filename (input_bfd)); bfd_set_error (bfd_error_bad_value); @@ -665,7 +661,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd, == output_bfd->xvec->byteorder); #if 0 - printf("dj: relocate %s(%s) %08x\n", + printf ("dj: relocate %s(%s) %08x\n", input_bfd->filename, input_section->name, input_section->output_section->vma + input_section->output_offset); #endif @@ -700,7 +696,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd, sym = NULL; } else - { + { h = obj_coff_sym_hashes (input_bfd)[symndx]; sym = syms + symndx; } @@ -715,7 +711,6 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd, else addend = 0; - howto = bfd_coff_rtype_to_howto (input_bfd, input_section, rel, h, sym, &addend); if (howto == NULL) @@ -779,7 +774,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd, src = rel->r_vaddr + input_section->output_section->vma + input_section->output_offset; #if 0 - printf("dj: reloc %02x %-8s a=%08x/%08x(%08x) v=%08x+%08x %s\n", + printf ("dj: reloc %02x %-8s a=%08x/%08x(%08x) v=%08x+%08x %s\n", rel->r_type, howto_table[rel->r_type].name, src, rel->r_vaddr, *(unsigned long *)mem, val, rel->r_offset, h?h->root.root.string:"(none)"); @@ -791,7 +786,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd, val = VMA of what we need to refer to */ -#define UI(x) (*_bfd_error_handler)(_("%s: unimplemented %s\n"), \ +#define UI(x) (*_bfd_error_handler) (_("%s: unimplemented %s\n"), \ bfd_get_filename (input_bfd), x); \ bfd_set_error (bfd_error_bad_value); @@ -807,7 +802,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd, case MIPS_R_REFWORD: tmp = bfd_get_32(input_bfd, mem); - /* printf("refword: src=%08x targ=%08x+%08x\n", src, tmp, val); */ + /* printf ("refword: src=%08x targ=%08x+%08x\n", src, tmp, val); */ tmp += val; bfd_put_32(input_bfd, tmp, mem); break; @@ -817,7 +812,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd, targ = val + (tmp&0x03ffffff)*4; if ((src & 0xf0000000) != (targ & 0xf0000000)) { - (*_bfd_error_handler)(_("%s: jump too far away\n"), + (*_bfd_error_handler) (_("%s: jump too far away\n"), bfd_get_filename (input_bfd)); bfd_set_error (bfd_error_bad_value); return false; @@ -844,7 +839,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd, targ = val + low + ((tmp & 0xffff) << 16); break; default: - (*_bfd_error_handler)(_("%s: bad pair/reflo after refhi\n"), + (*_bfd_error_handler) (_("%s: bad pair/reflo after refhi\n"), bfd_get_filename (input_bfd)); bfd_set_error (bfd_error_bad_value); return false; @@ -857,7 +852,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd, case MIPS_R_REFLO: tmp = bfd_get_32(input_bfd, mem); targ = val + (tmp & 0xffff); - /* printf("refword: src=%08x targ=%08x\n", src, targ); */ + /* printf ("refword: src=%08x targ=%08x\n", src, targ); */ tmp &= 0xffff0000; tmp |= targ & 0xffff; bfd_put_32(input_bfd, tmp, mem); @@ -886,7 +881,7 @@ coff_pe_mips_relocate_section (output_bfd, info, input_bfd, case MIPS_R_RVA: tmp = bfd_get_32 (input_bfd, mem); - /* printf("rva: src=%08x targ=%08x+%08x\n", src, tmp, val); */ + /* printf ("rva: src=%08x targ=%08x+%08x\n", src, tmp, val); */ tmp += val - pe_data (input_section->output_section->owner)->pe_opthdr.ImageBase; bfd_put_32 (input_bfd, tmp, mem); @@ -974,7 +969,7 @@ const bfd_target bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ -/* Note that we allow an object file to be treated as a core file as well. */ +/* Note that we allow an object file to be treated as a core file as well. */ {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ bfd_generic_archive_p, coff_object_p}, {bfd_false, coff_mkobject, _bfd_generic_mkarchive, /* bfd_set_format */ @@ -993,6 +988,6 @@ const bfd_target BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + COFF_SWAP_TABLE }; diff --git a/gnu/dist/toolchain/bfd/pe-ppc.c b/gnu/dist/toolchain/bfd/pe-ppc.c index 7d4a54716237..f96e68b679a2 100644 --- a/gnu/dist/toolchain/bfd/pe-ppc.c +++ b/gnu/dist/toolchain/bfd/pe-ppc.c @@ -21,7 +21,6 @@ Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" - #define E_FILENMLEN 18 #define PPC_PE diff --git a/gnu/dist/toolchain/bfd/pe-sh.c b/gnu/dist/toolchain/bfd/pe-sh.c index 7e48b0ef5277..4156468b8940 100644 --- a/gnu/dist/toolchain/bfd/pe-sh.c +++ b/gnu/dist/toolchain/bfd/pe-sh.c @@ -20,7 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" #include "sysdep.h" - #define TARGET_SHL_SYM shlpe_vec #define TARGET_SHL_NAME "pe-shl" #define COFF_WITH_PE diff --git a/gnu/dist/toolchain/bfd/pei-mips.c b/gnu/dist/toolchain/bfd/pei-mips.c index 472d35d97b2b..acd8e19026f9 100644 --- a/gnu/dist/toolchain/bfd/pei-mips.c +++ b/gnu/dist/toolchain/bfd/pei-mips.c @@ -28,5 +28,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "pe-mips.c" - - diff --git a/gnu/dist/toolchain/bfd/pei-sh.c b/gnu/dist/toolchain/bfd/pei-sh.c index 2fb8b1ca23a2..2429b0f3a13c 100644 --- a/gnu/dist/toolchain/bfd/pei-sh.c +++ b/gnu/dist/toolchain/bfd/pei-sh.c @@ -31,5 +31,3 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "coff-sh.c" - - diff --git a/gnu/dist/toolchain/bfd/peicode.h b/gnu/dist/toolchain/bfd/peicode.h index 7238c7802e8e..666e68c115df 100644 --- a/gnu/dist/toolchain/bfd/peicode.h +++ b/gnu/dist/toolchain/bfd/peicode.h @@ -69,7 +69,6 @@ static boolean (*pe_saved_coff_bfd_print_private_bfd_data) static boolean pe_print_private_bfd_data PARAMS ((bfd *, PTR)); #define coff_bfd_print_private_bfd_data pe_print_private_bfd_data - static boolean (*pe_saved_coff_bfd_copy_private_bfd_data) PARAMS ((bfd *, bfd *)) = #ifndef coff_bfd_copy_private_bfd_data @@ -104,29 +103,29 @@ typedef struct bfd_byte * data; struct bfd_in_memory * bim; unsigned short magic; - + arelent * reltab; unsigned int relcount; coff_symbol_type * sym_cache; coff_symbol_type * sym_ptr; unsigned int sym_index; - + unsigned int * sym_table; unsigned int * table_ptr; - + combined_entry_type * native_syms; combined_entry_type * native_ptr; coff_symbol_type ** sym_ptr_table; coff_symbol_type ** sym_ptr_ptr; - + unsigned int sec_index; char * string_table; char * string_ptr; char * end_string_ptr; - + SYMENT * esym_table; SYMENT * esym_ptr; @@ -138,7 +137,7 @@ static asection_ptr pe_ILF_make_a_section PARAMS ((pe_ILF_vars *, const static void pe_ILF_make_a_reloc PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, asection_ptr)); static void pe_ILF_make_a_symbol PARAMS ((pe_ILF_vars *, const char *, const char *, asection_ptr, flagword)); static void pe_ILF_save_relocs PARAMS ((pe_ILF_vars *, asection_ptr)); -static void pe_ILF_make_a_symbol_reloc PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, struct symbol_cache_entry **, unsigned int)); +static void pe_ILF_make_a_symbol_reloc PARAMS ((pe_ILF_vars *, bfd_vma, bfd_reloc_code_real_type, struct symbol_cache_entry **, unsigned int)); static boolean pe_ILF_build_a_bfd PARAMS ((bfd *, unsigned short, bfd_byte *, bfd_byte *, unsigned int, unsigned int)); static const bfd_target * pe_ILF_object_p PARAMS ((bfd *)); static const bfd_target * pe_bfd_object_p PARAMS ((bfd *)); @@ -167,7 +166,6 @@ coff_swap_reloc_in (abfd, src, dst) #endif } - static unsigned int coff_swap_reloc_out (abfd, src, dst) bfd *abfd; @@ -210,21 +208,6 @@ coff_swap_filehdr_in (abfd, src, dst) filehdr_dst->f_flags = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_flags); filehdr_dst->f_symptr = bfd_h_get_32 (abfd, (bfd_byte *) filehdr_src->f_symptr); -#ifdef COFF_IMAGE_WITH_PE - /* There are really two magic numbers involved; the magic number - that says this is a NT executable (PEI) and the magic number that - determines the architecture. The former is DOSMAGIC, stored in - the e_magic field. The latter is stored in the f_magic field. - If the NT magic number isn't valid, the architecture magic number - could be mimicked by some other field (specifically, the number - of relocs in section 3). Since 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 *) filehdr_src->e_magic) != DOSMAGIC) - filehdr_dst->f_magic = -1; -#endif - /* Other people's tools sometimes generate headers with an nsyms but a zero symptr. */ if (filehdr_dst->f_nsyms != 0 && filehdr_dst->f_symptr == 0) @@ -233,7 +216,7 @@ coff_swap_filehdr_in (abfd, src, dst) filehdr_dst->f_flags |= F_LSYMS; } - filehdr_dst->f_opthdr = bfd_h_get_16(abfd, + filehdr_dst->f_opthdr = bfd_h_get_16(abfd, (bfd_byte *)filehdr_src-> f_opthdr); } @@ -243,7 +226,6 @@ coff_swap_filehdr_in (abfd, src, dst) #define coff_swap_filehdr_out _bfd_pe_only_swap_filehdr_out #endif - static void coff_swap_scnhdr_in (abfd, ext, in) bfd *abfd; @@ -253,7 +235,7 @@ coff_swap_scnhdr_in (abfd, ext, in) SCNHDR *scnhdr_ext = (SCNHDR *) ext; struct internal_scnhdr *scnhdr_int = (struct internal_scnhdr *) in; - memcpy(scnhdr_int->s_name, scnhdr_ext->s_name, sizeof(scnhdr_int->s_name)); + 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 = @@ -283,7 +265,7 @@ coff_swap_scnhdr_in (abfd, ext, in) (bfd_byte *) scnhdr_ext->s_nlnno); #endif - if (scnhdr_int->s_vaddr != 0) + if (scnhdr_int->s_vaddr != 0) { scnhdr_int->s_vaddr += pe_data (abfd)->pe_opthdr.ImageBase; scnhdr_int->s_vaddr &= 0xffffffff; @@ -308,7 +290,7 @@ pe_mkobject (abfd) bfd * abfd; { pe_data_type *pe; - abfd->tdata.pe_obj_data = + abfd->tdata.pe_obj_data = (struct pe_tdata *) bfd_zalloc (abfd, sizeof (pe_data_type)); if (abfd->tdata.pe_obj_data == 0) @@ -364,15 +346,15 @@ pe_mkobject_hook (abfd, filehdr, aouthdr) abfd->flags |= HAS_DEBUG; #ifdef COFF_IMAGE_WITH_PE - if (aouthdr) + if (aouthdr) pe->pe_opthdr = ((struct internal_aouthdr *)aouthdr)->pe; #endif -#ifdef ARM +#ifdef ARM if (! _bfd_coff_arm_set_private_flags (abfd, internal_f->f_flags)) coff_data (abfd) ->flags = 0; #endif - + return (PTR) pe; } @@ -421,7 +403,7 @@ pe_bfd_copy_private_bfd_data (ibfd, obfd) /* Code to handle Microsoft's Image Library Format. Also known as LINK6 format. - Documentation about this format can be found at: + Documentation about this format can be found at: http://msdn.microsoft.com/library/specs/pecoff_section8.htm */ @@ -447,7 +429,7 @@ pe_bfd_copy_private_bfd_data (ibfd, obfd) #define NUM_ILF_RELOCS 8 #define NUM_ILF_SECTIONS 6 #define NUM_ILF_SYMS (2 + NUM_ILF_SECTIONS) - + #define SIZEOF_ILF_SYMS (NUM_ILF_SYMS * sizeof (* vars.sym_cache)) #define SIZEOF_ILF_SYM_TABLE (NUM_ILF_SYMS * sizeof (* vars.sym_table)) #define SIZEOF_ILF_NATIVE_SYMS (NUM_ILF_SYMS * sizeof (* vars.native_syms)) @@ -465,7 +447,7 @@ pe_bfd_copy_private_bfd_data (ibfd, obfd) #define SIZEOF_IDATA6 (2 + strlen (symbol_name) + 1 + 1) #define SIZEOF_IDATA7 (strlen (source_dll) + 1 + 1) #define SIZEOF_ILF_SECTIONS (NUM_ILF_SECTIONS * sizeof (struct coff_section_tdata)) - + #define ILF_DATA_SIZE \ sizeof (* vars.bim) \ + SIZEOF_ILF_SYMS \ @@ -484,7 +466,6 @@ pe_bfd_copy_private_bfd_data (ibfd, obfd) + SIZEOF_ILF_SECTIONS \ + MAX_TEXT_SECTION_SIZE - /* Create an empty relocation against the given symbol. */ static void pe_ILF_make_a_symbol_reloc (pe_ILF_vars * vars, @@ -498,7 +479,7 @@ pe_ILF_make_a_symbol_reloc (pe_ILF_vars * vars, entry = vars->reltab + vars->relcount; internal = vars->int_reltab + vars->relcount; - + entry->address = address; entry->addend = 0; entry->howto = bfd_reloc_type_lookup (vars->abfd, reloc); @@ -512,9 +493,9 @@ pe_ILF_make_a_symbol_reloc (pe_ILF_vars * vars, internal->r_extern = 0; internal->r_offset = 0; #endif - + vars->relcount ++; - + BFD_ASSERT (vars->relcount <= NUM_ILF_RELOCS); } @@ -570,8 +551,8 @@ pe_ILF_make_a_symbol (pe_ILF_vars * vars, sclass = C_STAT; else sclass = C_EXT; - -#ifdef THUMBPEMAGIC + +#ifdef THUMBPEMAGIC if (vars->magic == THUMBPEMAGIC) { if (extra_flags & BSF_FUNCTION) @@ -584,7 +565,7 @@ pe_ILF_make_a_symbol (pe_ILF_vars * vars, #endif BFD_ASSERT (vars->sym_index < NUM_ILF_SYMS); - + sym = vars->sym_ptr; ent = vars->native_ptr; esym = vars->esym_ptr; @@ -594,7 +575,7 @@ pe_ILF_make_a_symbol (pe_ILF_vars * vars, if (section == NULL) section = (asection_ptr) & bfd_und_section; - + /* Initialise the external symbol. */ bfd_h_put_32 (vars->abfd, vars->string_ptr - vars->string_table, (bfd_byte *) esym->e.e.e_offset); bfd_h_put_16 (vars->abfd, section->target_index, (bfd_byte *) esym->e_scnum); @@ -608,12 +589,12 @@ pe_ILF_make_a_symbol (pe_ILF_vars * vars, esym->e_type = T_NULL; esym->e_numaux = 0; #endif - + /* Initialise the internal symbol structure. */ ent->u.syment.n_sclass = sclass; ent->u.syment.n_scnum = section->target_index; ent->u.syment._n._n_n._n_offset = (long) sym; - + #if 0 /* See comment above. */ ent->u.syment.n_value = 0; ent->u.syment.n_flags = 0; @@ -621,23 +602,23 @@ pe_ILF_make_a_symbol (pe_ILF_vars * vars, ent->u.syment.n_numaux = 0; ent->fix_value = 0; #endif - + sym->symbol.the_bfd = vars->abfd; sym->symbol.name = vars->string_ptr; sym->symbol.flags = BSF_EXPORT | BSF_GLOBAL | extra_flags; sym->symbol.section = section; sym->native = ent; - + #if 0 /* See comment above. */ sym->symbol.value = 0; sym->symbol.udata.i = 0; sym->done_lineno = false; sym->lineno = NULL; #endif - + * vars->table_ptr = vars->sym_index; * vars->sym_ptr_ptr = sym; - + /* Adjust pointers for the next symbol. */ vars->sym_index ++; vars->sym_ptr ++; @@ -659,20 +640,20 @@ pe_ILF_make_a_section (pe_ILF_vars * vars, { asection_ptr sec; flagword flags; - + sec = bfd_make_section_old_way (vars->abfd, name); if (sec == NULL) return NULL; - + flags = SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_KEEP | SEC_IN_MEMORY; - + bfd_set_section_flags (vars->abfd, sec, flags | extra_flags); - + bfd_set_section_alignment (vars->abfd, sec, 2); - + /* Check that we will not run out of space. */ BFD_ASSERT (vars->data + size < vars->bim->buffer + vars->bim->size); - + /* Set the section size and contents. The actual contents are filled in by our parent. */ bfd_set_section_size (vars->abfd, sec, size); @@ -681,26 +662,26 @@ pe_ILF_make_a_section (pe_ILF_vars * vars, /* Advance data pointer in the vars structure. */ vars->data += size; - + /* Skip the padding byte if it was not needed. The logic here is that if the string length is odd, then the entire string length, including the null byte, is even and so the extra, padding byte, is not needed. */ if (size & 1) vars->data --; - + /* Create a coff_section_tdata structure for our use. */ sec->used_by_bfd = (struct coff_section_tdata *) vars->data; vars->data += sizeof (struct coff_section_tdata); BFD_ASSERT (vars->data <= vars->bim->buffer + vars->bim->size); - + /* Create a symbol to refer to this section. */ pe_ILF_make_a_symbol (vars, "", name, sec, BSF_LOCAL); /* Cache the index to the symbol in the coff_section_data structure. */ coff_section_data (vars->abfd, sec)->i = vars->sym_index - 1; - + return sec; } @@ -731,7 +712,7 @@ static jump_table jtab[] = 8, 2 }, #endif - + #ifdef MC68MAGIC { MC68MAGIC, { /* XXX fill me in */ }, 0, 0 }, #endif @@ -742,7 +723,7 @@ static jump_table jtab[] = 16, 0 }, #endif - + #ifdef SH_ARCH_MAGIC_WINCE { SH_ARCH_MAGIC_WINCE, { 0x01, 0xd0, 0x02, 0x60, 0x2b, 0x40, @@ -750,7 +731,7 @@ static jump_table jtab[] = 12, 8 }, #endif - + #ifdef ARMPEMAGIC { ARMPEMAGIC, { 0x00, 0xc0, 0x9f, 0xe5, 0x00, 0xf0, @@ -758,7 +739,7 @@ static jump_table jtab[] = 12, 8 }, #endif - + #ifdef THUMBPEMAGIC { THUMBPEMAGIC, { 0x40, 0xb4, 0x02, 0x4e, 0x36, 0x68, 0xb4, 0x46, @@ -781,7 +762,7 @@ pe_ILF_build_a_bfd (bfd * abfd, bfd_byte * source_dll, unsigned int ordinal, unsigned int types) -{ +{ bfd_byte * ptr; pe_ILF_vars vars; struct internal_filehdr internal_f; @@ -800,13 +781,13 @@ pe_ILF_build_a_bfd (bfd * abfd, case IMPORT_CODE: case IMPORT_DATA: break; - + case IMPORT_CONST: /* XXX code yet to be written. */ _bfd_error_handler (_("%s: Unhandled import type; %x"), bfd_get_filename (abfd), import_type); return false; - + default: _bfd_error_handler (_("%s: Unrecognised import type; %x"), bfd_get_filename (abfd), import_type); @@ -820,7 +801,7 @@ pe_ILF_build_a_bfd (bfd * abfd, case IMPORT_NAME_NOPREFIX: case IMPORT_NAME_UNDECORATE: break; - + default: _bfd_error_handler (_("%s: Unrecognised import name type; %x"), bfd_get_filename (abfd), import_name_type); @@ -828,10 +809,10 @@ pe_ILF_build_a_bfd (bfd * abfd, } /* Initialise local variables. - + Note these are kept in a structure rather than being declared as statics since bfd frowns on global variables. - + We are going to construct the contents of the BFD in memory, so allocate all the space that we will need right now. */ ptr = bfd_zalloc (abfd, ILF_DATA_SIZE); @@ -843,14 +824,14 @@ pe_ILF_build_a_bfd (bfd * abfd, vars.bim->buffer = ptr; vars.bim->size = ILF_DATA_SIZE; ptr += sizeof (* vars.bim); - + /* Initialise the pointers to regions of the memory and the other contents of the pe_ILF_vars structure as well. */ vars.sym_cache = (coff_symbol_type *) ptr; vars.sym_ptr = (coff_symbol_type *) ptr; vars.sym_index = 0; ptr += SIZEOF_ILF_SYMS; - + vars.sym_table = (unsigned int *) ptr; vars.table_ptr = (unsigned int *) ptr; ptr += SIZEOF_ILF_SYM_TABLE; @@ -862,11 +843,11 @@ pe_ILF_build_a_bfd (bfd * abfd, vars.sym_ptr_table = (coff_symbol_type **) ptr; vars.sym_ptr_ptr = (coff_symbol_type **) ptr; ptr += SIZEOF_ILF_SYM_PTR_TABLE; - + vars.esym_table = (SYMENT *) ptr; vars.esym_ptr = (SYMENT *) ptr; ptr += SIZEOF_ILF_EXT_SYMS; - + vars.reltab = (arelent *) ptr; vars.relcount = 0; ptr += SIZEOF_ILF_RELOCS; @@ -878,14 +859,14 @@ pe_ILF_build_a_bfd (bfd * abfd, vars.string_ptr = ptr + STRING_SIZE_SIZE; ptr += SIZEOF_ILF_STRINGS; vars.end_string_ptr = ptr; - + /* The remaining space in bim->buffer is used by the pe_ILF_make_a_section() function. */ vars.data = ptr; vars.abfd = abfd; vars.sec_index = 0; vars.magic = magic; - + /* Create the initial .idata$ sections: [.idata$2: Import Directory Table -- not needed] .idata$4: Import Lookup Table @@ -897,21 +878,21 @@ pe_ILF_build_a_bfd (bfd * abfd, id5 = pe_ILF_make_a_section (& vars, ".idata$5", SIZEOF_IDATA5, 0); if (id4 == NULL || id5 == NULL) return false; - + /* Fill in the contents of these sections. */ if (import_name_type == IMPORT_ORDINAL) { if (ordinal == 0) /* XXX - treat as IMPORT_NAME ??? */ abort (); - - * (unsigned int *) id4->contents = ordinal | 0x80000000UL; - * (unsigned int *) id5->contents = ordinal | 0x80000000UL; + + * (unsigned int *) id4->contents = ordinal | 0x80000000; + * (unsigned int *) id5->contents = ordinal | 0x80000000; } else { char * symbol; - + /* Create .idata$6 - the Hint Name Table. */ id6 = pe_ILF_make_a_section (& vars, ".idata$6", SIZEOF_IDATA6, 0); if (id6 == NULL) @@ -933,10 +914,10 @@ pe_ILF_build_a_bfd (bfd * abfd, * symbol = 0; } - + id6->contents[0] = ordinal & 0xff; id6->contents[1] = ordinal >> 8; - + strcpy (id6->contents + 2, symbol); } @@ -944,7 +925,7 @@ pe_ILF_build_a_bfd (bfd * abfd, { pe_ILF_make_a_reloc (& vars, 0, BFD_RELOC_RVA, id6); pe_ILF_save_relocs (& vars, id4); - + pe_ILF_make_a_reloc (& vars, 0, BFD_RELOC_RVA, id6); pe_ILF_save_relocs (& vars, id5); } @@ -953,7 +934,7 @@ pe_ILF_build_a_bfd (bfd * abfd, switch (import_type) { int i; - + case IMPORT_CODE: /* Create a .text section. First we need to look up its contents in the jump table. */ @@ -980,22 +961,22 @@ pe_ILF_build_a_bfd (bfd * abfd, pe_ILF_make_a_symbol (& vars, "__imp_", symbol_name, id5, 0); imp_sym = vars.sym_ptr_ptr - 1; imp_index = vars.sym_index - 1; - + /* Create a reloc for the data in the text section. */ -#ifdef MIPS_ARCH_MAGIC_WINCE +#ifdef MIPS_ARCH_MAGIC_WINCE if (magic == MIPS_ARCH_MAGIC_WINCE) { pe_ILF_make_a_symbol_reloc (& vars, 0, BFD_RELOC_HI16_S, - (asection **) imp_sym, imp_index); + (struct symbol_cache_entry **) imp_sym, imp_index); pe_ILF_make_a_reloc (& vars, 0, BFD_RELOC_LO16, text); pe_ILF_make_a_symbol_reloc (& vars, 4, BFD_RELOC_LO16, - (asection **) imp_sym, imp_index); + (struct symbol_cache_entry **) imp_sym, imp_index); } else #endif pe_ILF_make_a_symbol_reloc (& vars, jtab[i].offset, BFD_RELOC_32, (asymbol **) imp_sym, imp_index); - + pe_ILF_save_relocs (& vars, text); break; @@ -1006,15 +987,15 @@ pe_ILF_build_a_bfd (bfd * abfd, /* XXX code not yet written. */ abort (); } - + /* Initialise the bfd. */ memset (& internal_f, 0, sizeof (internal_f)); - + internal_f.f_magic = magic; internal_f.f_symptr = 0; internal_f.f_nsyms = 0; internal_f.f_flags = F_AR32WR | F_LNNO; /* XXX is this correct ? */ - + if ( ! bfd_set_start_address (abfd, 0) || ! bfd_coff_set_arch_mach_hook (abfd, & internal_f)) return false; @@ -1023,12 +1004,12 @@ pe_ILF_build_a_bfd (bfd * abfd, return false; coff_data (abfd)->pe = 1; -#ifdef THUMBPEMAGIC +#ifdef THUMBPEMAGIC if (vars.magic == THUMBPEMAGIC) /* Stop some linker warnings about thumb code not supporting interworking. */ coff_data (abfd)->flags |= F_INTERWORK | F_INTERWORK_SET; #endif - + /* Switch from file contents to memory contents. */ bfd_cache_close (abfd); @@ -1041,11 +1022,11 @@ pe_ILF_build_a_bfd (bfd * abfd, switch (import_type) { bfd_byte * ptr; - + case IMPORT_CODE: pe_ILF_make_a_symbol (& vars, "", symbol_name, text, BSF_NOT_AT_END | BSF_FUNCTION); - + /* Create an import symbol for the DLL, without the .dll suffix. */ ptr = strrchr (source_dll, '.'); @@ -1059,7 +1040,7 @@ pe_ILF_build_a_bfd (bfd * abfd, case IMPORT_DATA: /* Nothing to do here. */ break; - + default: /* XXX code not yet written. */ abort (); @@ -1068,16 +1049,16 @@ pe_ILF_build_a_bfd (bfd * abfd, /* Point the bfd at the symbol table. */ obj_symbols (abfd) = vars.sym_cache; bfd_get_symcount (abfd) = vars.sym_index; - + obj_raw_syments (abfd) = vars.native_syms; obj_raw_syment_count (abfd) = vars.sym_index; obj_coff_external_syms (abfd) = (PTR) vars.esym_table; obj_coff_keep_syms (abfd) = true; - + obj_convert (abfd) = vars.sym_table; obj_conv_table_size (abfd) = vars.sym_index; - + obj_coff_strings (abfd) = vars.string_table; obj_coff_keep_strings (abfd) = true; @@ -1100,14 +1081,14 @@ pe_ILF_object_p (bfd * abfd) unsigned int ordinal; unsigned int types; unsigned short magic; - + /* Upon entry the first four buyes of the ILF header have already been read. Now read the rest of the header. */ if (bfd_read (buffer, 1, 16, abfd) != 16) return NULL; ptr = buffer; - + /* We do not bother to check the version number. version = bfd_h_get_16 (abfd, ptr); */ ptr += 2; @@ -1117,7 +1098,7 @@ pe_ILF_object_p (bfd * abfd) /* Check that the machine type is recognised. */ magic = 0; - + switch (machine) { case IMAGE_FILE_MACHINE_UNKNOWN: @@ -1125,23 +1106,23 @@ pe_ILF_object_p (bfd * abfd) case IMAGE_FILE_MACHINE_ALPHA64: case IMAGE_FILE_MACHINE_IA64: break; - + case IMAGE_FILE_MACHINE_I386: #ifdef I386MAGIC magic = I386MAGIC; #endif break; - + case IMAGE_FILE_MACHINE_M68K: #ifdef MC68AGIC magic = MC68MAGIC; #endif break; - + case IMAGE_FILE_MACHINE_R3000: case IMAGE_FILE_MACHINE_R4000: case IMAGE_FILE_MACHINE_R10000: - + case IMAGE_FILE_MACHINE_MIPS16: case IMAGE_FILE_MACHINE_MIPSFPU: case IMAGE_FILE_MACHINE_MIPSFPU16: @@ -1149,31 +1130,31 @@ pe_ILF_object_p (bfd * abfd) magic = MIPS_ARCH_MAGIC_WINCE; #endif break; - + case IMAGE_FILE_MACHINE_SH3: case IMAGE_FILE_MACHINE_SH4: #ifdef SH_ARCH_MAGIC_WINCE magic = SH_ARCH_MAGIC_WINCE; #endif break; - + case IMAGE_FILE_MACHINE_ARM: #ifdef ARMPEMAGIC magic = ARMPEMAGIC; -#endif +#endif break; - + case IMAGE_FILE_MACHINE_THUMB: #ifdef THUMBPEMAGIC { - extern bfd_target armpei_little_vec; - - if (abfd->xvec == & armpei_little_vec) + extern const bfd_target TARGET_LITTLE_SYM; + + if (abfd->xvec == & TARGET_LITTLE_SYM) magic = THUMBPEMAGIC; } -#endif +#endif break; - + case IMAGE_FILE_MACHINE_POWERPC: /* We no longer support PowerPC. */ default: @@ -1182,7 +1163,7 @@ pe_ILF_object_p (bfd * abfd) _("%s: Unrecognised machine type (0x%x) in Import Library Format archive"), bfd_get_filename (abfd), machine); bfd_set_error (bfd_error_malformed_archive); - + return NULL; break; } @@ -1194,14 +1175,14 @@ _("%s: Unrecognised machine type (0x%x) in Import Library Format archive"), _("%s: Recognised but unhandled machine type (0x%x) in Import Library Format archive"), bfd_get_filename (abfd), machine); bfd_set_error (bfd_error_wrong_format); - + return NULL; - } + } /* We do not bother to check the date. date = bfd_h_get_32 (abfd, ptr); */ ptr += 4; - + size = bfd_h_get_32 (abfd, ptr); ptr += 4; @@ -1211,7 +1192,7 @@ _("%s: Recognised but unhandled machine type (0x%x) in Import Library Format arc (_("%s: size field is zero in Import Library Format header"), bfd_get_filename (abfd)); bfd_set_error (bfd_error_malformed_archive); - + return NULL; } @@ -1225,13 +1206,13 @@ _("%s: Recognised but unhandled machine type (0x%x) in Import Library Format arc ptr = bfd_alloc (abfd, size); if (ptr == NULL) return NULL; - + if (bfd_read (ptr, 1, size, abfd) != size) return NULL; symbol_name = ptr; source_dll = ptr + strlen (ptr) + 1; - + /* Verify that the strings are null terminated. */ if (ptr[size - 1] != 0 || ((unsigned long) (source_dll - ptr) >= size)) { @@ -1239,31 +1220,25 @@ _("%s: Recognised but unhandled machine type (0x%x) in Import Library Format arc (_("%s: string not null terminated in ILF object file."), bfd_get_filename (abfd)); bfd_set_error (bfd_error_malformed_archive); - + return NULL; } - + /* Now construct the bfd. */ if (! pe_ILF_build_a_bfd (abfd, magic, symbol_name, source_dll, ordinal, types)) return NULL; - + return abfd->xvec; } static const bfd_target * pe_bfd_object_p (bfd * abfd) { - /* We need to handle a PE image correctly. In PE images created by - the GNU linker, the offset to the COFF header is always the size. - However, this is not the case in images generated by other PE - linkers. The PE format stores a four byte offset to the PE - signature just before the COFF header at location 0x3c of the file. - We pick up that offset, verify that the PE signature is there, and - then set ourselves up to read in the COFF header. */ bfd_byte buffer[4]; + struct external_PEI_DOS_hdr dos_hdr; + struct external_PEI_IMAGE_hdr image_hdr; file_ptr offset; - unsigned long signature; /* Detect if this a Microsoft Import Library Format element. */ if (bfd_seek (abfd, 0x00, SEEK_SET) != 0 @@ -1273,45 +1248,57 @@ pe_bfd_object_p (bfd * abfd) bfd_set_error (bfd_error_wrong_format); return NULL; } - - signature = bfd_h_get_32 (abfd, buffer); - - if (signature == 0xffff0000) + + if (bfd_h_get_32 (abfd, buffer) == 0xffff0000) return pe_ILF_object_p (abfd); - - if (bfd_seek (abfd, 0x3c, SEEK_SET) != 0 - || bfd_read (buffer, 1, 4, abfd) != 4) + + if (bfd_seek (abfd, 0x00, SEEK_SET) != 0 + || bfd_read (&dos_hdr, 1, sizeof (dos_hdr), abfd) + != sizeof (dos_hdr)) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); return NULL; } - offset = bfd_h_get_32 (abfd, buffer); - - if (bfd_seek (abfd, offset, SEEK_SET) != 0 - || bfd_read (buffer, 1, 4, abfd) != 4) - { - if (bfd_get_error () != bfd_error_system_call) - bfd_set_error (bfd_error_wrong_format); - return NULL; - } - - signature = bfd_h_get_32 (abfd, buffer); - - if (signature != 0x4550) + /* There are really two magic numbers involved; the magic number + that says this is a NT executable (PEI) and the magic number that + determines the architecture. The former is DOSMAGIC, stored in + the e_magic field. The latter is stored in the f_magic field. + If the NT magic number isn't valid, the architecture magic number + could be mimicked by some other field (specifically, the number + of relocs in section 3). Since 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) { 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)) + { + 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) + != 0x4550) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } + /* Here is the hack. coff_object_p wants to read filhsz bytes to - pick up the COFF header. We adjust so that that will work. 20 - is the size of the i386 COFF filehdr. */ + 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, - (bfd_tell (abfd) - - bfd_coff_filhsz (abfd) - + 20), + (file_ptr) (offset - sizeof (dos_hdr)), SEEK_SET) != 0) { diff --git a/gnu/dist/toolchain/bfd/peigen.c b/gnu/dist/toolchain/bfd/peigen.c index 8e40bd3cd613..094920cfd4d1 100644 --- a/gnu/dist/toolchain/bfd/peigen.c +++ b/gnu/dist/toolchain/bfd/peigen.c @@ -1,5 +1,5 @@ /* Support for the generic parts of PE/PEI; the common executable parts. - Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright 1995, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Cygnus Solutions. This file is part of BFD, the Binary File Descriptor library. @@ -18,12 +18,10 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* -Most of this hacked by Steve Chamberlain, - sac@cygnus.com +/* Most of this hacked by Steve Chamberlain . -PE/PEI rearrangement (and code added): Donn Terry - Softway Systems, Inc. + PE/PEI rearrangement (and code added): Donn Terry + Softway Systems, Inc. */ /* Hey look, some documentation [and in a place you expect to find it]! @@ -91,30 +89,35 @@ _bfd_pei_swap_sym_in (abfd, ext1, in1) PTR ext1; PTR in1; { - SYMENT *ext = (SYMENT *)ext1; - struct internal_syment *in = (struct internal_syment *)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 { - memcpy(in->_n._n_name, ext->e.e_name, SYMNMLEN); - } + 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 + { + memcpy (in->_n._n_name, ext->e.e_name, SYMNMLEN); + } - 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); + 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); #ifndef STRICT_PE_FORMAT - /* This is for Gnu-created DLLs */ + /* This is for Gnu-created DLLs. */ /* The section symbols for the .idata$ sections have class 0x68 (C_SECTION), which MS documentation indicates is a section @@ -136,17 +139,19 @@ _bfd_pei_swap_sym_in (abfd, ext1, in1) /* I have tried setting the class to 3 and using the following to set the section number. This will put the address of the pointer to the string kernel32.dll at addresses 0 and 0x10 - off start of idata section which is not correct */ - /* if (strcmp (in->_n._n_name, ".idata$4") == 0) */ - /* in->n_scnum = 3; */ - /* else */ - /* in->n_scnum = 2; */ + off start of idata section which is not correct. */ +#if 0 + if (strcmp (in->_n._n_name, ".idata$4") == 0) + in->n_scnum = 3; + else + in->n_scnum = 2; +#endif #else /* Create synthetic empty sections as needed. DJ */ if (in->n_scnum == 0) { asection *sec; - for (sec=abfd->sections; sec; sec=sec->next) + for (sec = abfd->sections; sec; sec = sec->next) { if (strcmp (sec->name, in->n_name) == 0) { @@ -160,9 +165,9 @@ _bfd_pei_swap_sym_in (abfd, ext1, in1) int unused_section_number = 0; asection *sec; char *name; - for (sec=abfd->sections; sec; sec=sec->next) + for (sec = abfd->sections; sec; sec = sec->next) if (unused_section_number <= sec->target_index) - unused_section_number = sec->target_index+1; + unused_section_number = sec->target_index + 1; name = bfd_alloc (abfd, strlen (in->n_name) + 10); if (name == NULL) @@ -196,8 +201,8 @@ _bfd_pei_swap_sym_in (abfd, ext1, in1) #ifdef coff_swap_sym_in_hook /* This won't work in peigen.c, but since it's for PPC PE, it's not - worth fixing. */ - coff_swap_sym_in_hook(abfd, ext1, in1); + worth fixing. */ + coff_swap_sym_in_hook (abfd, ext1, in1); #endif } @@ -207,28 +212,30 @@ _bfd_pei_swap_sym_out (abfd, inp, extp) 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 { - memcpy(ext->e.e_name, in->_n._n_name, SYMNMLEN); - } - - 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) + struct internal_syment *in = (struct internal_syment *) inp; + SYMENT *ext = (SYMENT *) extp; + if (in->_n._n_name[0] == 0) { - bfd_h_put_16(abfd, in->n_type , (bfd_byte *) ext->e_type); + 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 { - bfd_h_put_32(abfd, in->n_type , (bfd_byte *) ext->e_type); + memcpy (ext->e.e_name, in->_n._n_name, SYMNMLEN); } - bfd_h_put_8(abfd, in->n_sclass , ext->e_sclass); - bfd_h_put_8(abfd, in->n_numaux , ext->e_numaux); + + 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); + } + 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); return SYMESZ; } @@ -243,41 +250,45 @@ _bfd_pei_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) int numaux ATTRIBUTE_UNUSED; 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; - switch (class) { - case C_FILE: - 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 { - memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); - } - return; - - - case C_STAT: - case C_LEAFSTAT: - 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); - 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); + switch (class) + { + case C_FILE: + 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 + { + memcpy (in->x_file.x_fname, ext->x_file.x_fname, FILNMLEN); + } 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); + case C_STAT: + case C_LEAFSTAT: + 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); + 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); + 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); if (class == C_BLOCK || class == C_FCN || ISFCN (type) || ISTAG (class)) { @@ -296,13 +307,16 @@ _bfd_pei_swap_aux_in (abfd, ext1, type, class, indx, numaux, in1) bfd_h_get_16 (abfd, (bfd_byte *) 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 = + 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); + } } unsigned int @@ -315,49 +329,52 @@ _bfd_pei_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) 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; - memset((PTR)ext, 0, AUXESZ); - switch (class) { - 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); - } - else { - memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); - } - return AUXESZ; - - - case C_STAT: - case C_LEAFSTAT: - 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); - 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); + memset ((PTR) ext, 0, AUXESZ); + switch (class) + { + 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); + } + else + { + memcpy (ext->x_file.x_fname, in->x_file.x_fname, FILNMLEN); + } 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); + case C_STAT: + case C_LEAFSTAT: + 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); + 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); + 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); 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 { @@ -373,7 +390,7 @@ _bfd_pei_swap_aux_out (abfd, inp, type, class, indx, numaux, extp) if (ISFCN (type)) bfd_h_put_32 (abfd, in->x_sym.x_misc.x_fsize, - (bfd_byte *) ext->x_sym.x_misc.x_fsize); + (bfd_byte *) ext->x_sym.x_misc.x_fsize); else { PUT_LNSZ_LNNO (abfd, in->x_sym.x_misc.x_lnsz.x_lnno, ext); @@ -389,11 +406,11 @@ _bfd_pei_swap_lineno_in (abfd, ext1, in1) 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 = bfd_h_get_32 (abfd, (bfd_byte *) ext->l_addr.l_symndx); + in->l_lnno = GET_LINENO_LNNO (abfd, ext); } unsigned int @@ -402,9 +419,9 @@ _bfd_pei_swap_lineno_out (abfd, inp, outp) PTR inp; PTR 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 *) + 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); PUT_LINENO_LNNO (abfd, in->l_lnno, ext); @@ -418,12 +435,12 @@ _bfd_pei_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) PTR aouthdr_int1; { struct internal_extra_pe_aouthdr *a; - PEAOUTHDR *src = (PEAOUTHDR *)(aouthdr_ext1); + PEAOUTHDR *src = (PEAOUTHDR *) (aouthdr_ext1); 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->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 = @@ -434,66 +451,84 @@ _bfd_pei_swap_aouthdr_in (abfd, aouthdr_ext1, aouthdr_int1) GET_AOUTHDR_ENTRY (abfd, (bfd_byte *) aouthdr_ext->entry); aouthdr_int->text_start = GET_AOUTHDR_TEXT_START (abfd, (bfd_byte *) aouthdr_ext->text_start); +#ifndef COFF_WITH_PEP64 + /* PE32+ does not have data_start member! */ aouthdr_int->data_start = GET_AOUTHDR_DATA_START (abfd, (bfd_byte *) aouthdr_ext->data_start); +#endif a = &aouthdr_int->pe; - a->ImageBase = bfd_h_get_32 (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, (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->MajorOperatingSystemVersion = - bfd_h_get_16 (abfd, (bfd_byte *)src->MajorOperatingSystemVersion); + bfd_h_get_16 (abfd, (bfd_byte *) 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 = bfd_h_get_32 (abfd, (bfd_byte *)src->SizeOfStackReserve); - a->SizeOfStackCommit = bfd_h_get_32 (abfd, (bfd_byte *)src->SizeOfStackCommit); - a->SizeOfHeapReserve = bfd_h_get_32 (abfd, (bfd_byte *)src->SizeOfHeapReserve); - a->SizeOfHeapCommit = bfd_h_get_32 (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); + 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); { int idx; - for (idx=0; idx < 16; idx++) + for (idx = 0; idx < 16; idx++) { - a->DataDirectory[idx].VirtualAddress = - bfd_h_get_32 (abfd, (bfd_byte *)src->DataDirectory[idx][0]); - a->DataDirectory[idx].Size = - bfd_h_get_32 (abfd, (bfd_byte *)src->DataDirectory[idx][1]); + /* If data directory is empty, rva also should be 0. */ + int size = + bfd_h_get_32 (abfd, (bfd_byte *) 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]); + } + else + a->DataDirectory[idx].VirtualAddress = 0; } } if (aouthdr_int->entry) { aouthdr_int->entry += a->ImageBase; +#ifndef COFF_WITH_PEP64 aouthdr_int->entry &= 0xffffffff; +#endif } - if (aouthdr_int->tsize) + if (aouthdr_int->tsize) { aouthdr_int->text_start += a->ImageBase; +#ifndef COFF_WITH_PEP64 aouthdr_int->text_start &= 0xffffffff; +#endif } - if (aouthdr_int->dsize) +#ifndef COFF_WITH_PEP64 + /* PE32+ does not have data_start member! */ + if (aouthdr_int->dsize) { aouthdr_int->data_start += a->ImageBase; aouthdr_int->data_start &= 0xffffffff; } +#endif #ifdef POWERPC_LE_PE /* These three fields are normally set up by ppc_relocate_section. In the case of reading a file in, we can pick them up from the DataDirectory. */ - first_thunk_address = a->DataDirectory[12].VirtualAddress ; + first_thunk_address = a->DataDirectory[12].VirtualAddress; thunk_size = a->DataDirectory[12].Size; import_table_size = a->DataDirectory[1].Size; #endif @@ -517,9 +552,16 @@ add_data_entry (abfd, aout, idx, name, base) && (coff_section_data (abfd, sec) != NULL) && (pei_section_data (abfd, sec) != NULL)) { - aout->DataDirectory[idx].VirtualAddress = (sec->vma - base) & 0xffffffff; - aout->DataDirectory[idx].Size = pei_section_data (abfd, sec)->virt_size; - sec->flags |= SEC_DATA; + /* If data directory is empty, rva also should be 0 */ + int size = pei_section_data (abfd, sec)->virt_size; + aout->DataDirectory[idx].Size = size; + + if (size) + { + aout->DataDirectory[idx].VirtualAddress = + (sec->vma - base) & 0xffffffff; + sec->flags |= SEC_DATA; + } } } @@ -529,41 +571,58 @@ _bfd_pei_swap_aouthdr_out (abfd, in, out) PTR in; PTR out; { - struct internal_aouthdr *aouthdr_in = (struct internal_aouthdr *)in; + struct internal_aouthdr *aouthdr_in = (struct internal_aouthdr *) in; struct internal_extra_pe_aouthdr *extra = &pe_data (abfd)->pe_opthdr; - PEAOUTHDR *aouthdr_out = (PEAOUTHDR *)out; + PEAOUTHDR *aouthdr_out = (PEAOUTHDR *) out; + bfd_vma sa, fa, ib; - bfd_vma sa = extra->SectionAlignment; - bfd_vma fa = extra->FileAlignment; - bfd_vma ib = extra->ImageBase ; + /* The following definitely is required for EFI applications. + Perhaps it's needed for other PEI targets as well, but I don't + know that for a fact, so we play it safe here and tweak the + alignments only if PEI_FORCE_MINIMUM_ALIGNMENT is + defined. --davidm */ +#ifdef PEI_FORCE_MINIMUM_ALIGNMENT + if (!extra->FileAlignment) + extra->FileAlignment = PE_DEF_FILE_ALIGNMENT; + if (!extra->SectionAlignment) + extra->SectionAlignment = PE_DEF_SECTION_ALIGNMENT; +#endif - if (aouthdr_in->tsize) +#ifdef PEI_DEFAULT_TARGET_SUBSYSTEM + if (extra->Subsystem == IMAGE_SUBSYSTEM_UNKNOWN) + extra->Subsystem = PEI_DEFAULT_TARGET_SUBSYSTEM; +#endif + + sa = extra->SectionAlignment; + fa = extra->FileAlignment; + ib = extra->ImageBase; + + if (aouthdr_in->tsize) { aouthdr_in->text_start -= ib; aouthdr_in->text_start &= 0xffffffff; } - if (aouthdr_in->dsize) + if (aouthdr_in->dsize) { aouthdr_in->data_start -= ib; aouthdr_in->data_start &= 0xffffffff; } - if (aouthdr_in->entry) + if (aouthdr_in->entry) { aouthdr_in->entry -= ib; aouthdr_in->entry &= 0xffffffff; } -#define FA(x) (((x) + fa -1 ) & (- fa)) -#define SA(x) (((x) + sa -1 ) & (- sa)) +#define FA(x) (((x) + fa -1 ) & (- fa)) +#define SA(x) (((x) + sa -1 ) & (- sa)) - /* We like to have the sizes aligned */ + /* We like to have the sizes aligned. */ aouthdr_in->bsize = FA (aouthdr_in->bsize); - extra->NumberOfRvaAndSizes = IMAGE_NUMBEROF_DIRECTORY_ENTRIES; - /* first null out all data directory entries .. */ + /* first null out all data directory entries .. */ memset (extra->DataDirectory, sizeof (extra->DataDirectory), 0); add_data_entry (abfd, extra, 0, ".edata", ib); @@ -574,9 +633,9 @@ _bfd_pei_swap_aouthdr_out (abfd, in, out) /* However, until other .idata fixes are made (pending patch), the entry for .idata is needed for backwards compatability. FIXME. */ - add_data_entry (abfd, extra, 1, ".idata" , ib); + add_data_entry (abfd, extra, 1, ".idata", ib); - add_data_entry (abfd, extra, 2, ".rsrc" , ib); + add_data_entry (abfd, extra, 2, ".rsrc", ib); add_data_entry (abfd, extra, 3, ".pdata", ib); @@ -590,9 +649,9 @@ _bfd_pei_swap_aouthdr_out (abfd, in, out) { asection *sec; - bfd_vma dsize= 0; + bfd_vma dsize = 0; bfd_vma isize = SA(abfd->sections->filepos); - bfd_vma tsize= 0; + bfd_vma tsize = 0; for (sec = abfd->sections; sec; sec = sec->next) { @@ -616,7 +675,7 @@ _bfd_pei_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); + bfd_h_put_16 (abfd, aouthdr_in->magic, (bfd_byte *) aouthdr_out->standard.magic); #define LINKER_VERSION 256 /* That is, 2.56 */ @@ -633,12 +692,14 @@ _bfd_pei_swap_aouthdr_out (abfd, in, out) PUT_AOUTHDR_TEXT_START (abfd, aouthdr_in->text_start, (bfd_byte *) aouthdr_out->standard.text_start); +#ifndef COFF_WITH_PEP64 + /* PE32+ does not have data_start member! */ PUT_AOUTHDR_DATA_START (abfd, aouthdr_in->data_start, (bfd_byte *) aouthdr_out->standard.data_start); +#endif - - bfd_h_put_32 (abfd, extra->ImageBase, - (bfd_byte *) aouthdr_out->ImageBase); + 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, @@ -667,21 +728,21 @@ _bfd_pei_swap_aouthdr_out (abfd, in, out) (bfd_byte *) aouthdr_out->Subsystem); bfd_h_put_16 (abfd, extra->DllCharacteristics, (bfd_byte *) aouthdr_out->DllCharacteristics); - bfd_h_put_32 (abfd, extra->SizeOfStackReserve, - (bfd_byte *) aouthdr_out->SizeOfStackReserve); - bfd_h_put_32 (abfd, extra->SizeOfStackCommit, - (bfd_byte *) aouthdr_out->SizeOfStackCommit); - bfd_h_put_32 (abfd, extra->SizeOfHeapReserve, - (bfd_byte *) aouthdr_out->SizeOfHeapReserve); - bfd_h_put_32 (abfd, extra->SizeOfHeapCommit, - (bfd_byte *) aouthdr_out->SizeOfHeapCommit); + PUT_OPTHDR_SIZE_OF_STACK_RESERVE (abfd, extra->SizeOfStackReserve, + (bfd_byte *) aouthdr_out->SizeOfStackReserve); + PUT_OPTHDR_SIZE_OF_STACK_COMMIT (abfd, extra->SizeOfStackCommit, + (bfd_byte *) aouthdr_out->SizeOfStackCommit); + PUT_OPTHDR_SIZE_OF_HEAP_RESERVE (abfd, extra->SizeOfHeapReserve, + (bfd_byte *) 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); { int idx; - for (idx=0; idx < 16; idx++) + for (idx = 0; idx < 16; idx++) { bfd_h_put_32 (abfd, extra->DataDirectory[idx].VirtualAddress, (bfd_byte *) aouthdr_out->DataDirectory[idx][0]); @@ -700,8 +761,8 @@ _bfd_pei_only_swap_filehdr_out (abfd, in, out) PTR out; { int idx; - struct internal_filehdr *filehdr_in = (struct internal_filehdr *)in; - struct external_PEI_filehdr *filehdr_out = (struct external_PEI_filehdr *)out; + struct internal_filehdr *filehdr_in = (struct internal_filehdr *) in; + struct external_PEI_filehdr *filehdr_out = (struct external_PEI_filehdr *) out; if (pe_data (abfd)->has_reloc_section) filehdr_in->f_flags &= ~F_RELFLG; @@ -724,19 +785,19 @@ _bfd_pei_only_swap_filehdr_out (abfd, in, out) filehdr_in->pe.e_lfarlc = 0x40; filehdr_in->pe.e_ovno = 0x0; - for (idx=0; idx < 4; idx++) + for (idx = 0; idx < 4; idx++) filehdr_in->pe.e_res[idx] = 0x0; filehdr_in->pe.e_oemid = 0x0; filehdr_in->pe.e_oeminfo = 0x0; - for (idx=0; idx < 10; idx++) + for (idx = 0; idx < 10; idx++) filehdr_in->pe.e_res2[idx] = 0x0; filehdr_in->pe.e_lfanew = 0x80; - /* this next collection of data are mostly just characters. It appears - to be constant within the headers put on NT exes */ + /* This next collection of data are mostly just characters. It + appears to be constant within the headers put on NT exes. */ filehdr_in->pe.dos_message[0] = 0x0eba1f0e; filehdr_in->pe.dos_message[1] = 0xcd09b400; filehdr_in->pe.dos_message[2] = 0x4c01b821; @@ -755,68 +816,63 @@ _bfd_pei_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); - - 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, time (0), (bfd_byte *) filehdr_out->f_timdat); + 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); + 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); /* 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_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_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_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); + 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]); + 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); + 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]); + 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); + bfd_h_put_32 (abfd, filehdr_in->pe.e_lfanew, (bfd_byte *) filehdr_out->e_lfanew); { 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 < 16; idx++) + bfd_h_put_32 (abfd, filehdr_in->pe.dos_message[idx], + (bfd_byte *) 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); - - - + /* Also put in the NT signature. */ + bfd_h_put_32 (abfd, filehdr_in->pe.nt_signature, + (bfd_byte *) filehdr_out->nt_signature); return FILHSZ; } @@ -827,17 +883,17 @@ _bfd_pe_only_swap_filehdr_out (abfd, in, out) 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; - 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); + 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); + 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); return FILHSZ; } @@ -848,17 +904,17 @@ _bfd_pei_swap_scnhdr_out (abfd, in, out) 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 = SCNHSZ; bfd_vma ps; bfd_vma ss; - memcpy(scnhdr_ext->s_name, scnhdr_int->s_name, sizeof(scnhdr_int->s_name)); + memcpy (scnhdr_ext->s_name, scnhdr_int->s_name, sizeof (scnhdr_int->s_name)); PUT_SCNHDR_VADDR (abfd, - ((scnhdr_int->s_vaddr - - pe_data(abfd)->pe_opthdr.ImageBase) + ((scnhdr_int->s_vaddr + - pe_data (abfd)->pe_opthdr.ImageBase) & 0xffffffff), (bfd_byte *) scnhdr_ext->s_vaddr); @@ -880,7 +936,6 @@ _bfd_pei_swap_scnhdr_out (abfd, in, out) PUT_SCNHDR_SIZE (abfd, ss, (bfd_byte *) scnhdr_ext->s_size); - /* s_paddr in PE is really the virtual size. */ PUT_SCNHDR_PADDR (abfd, ps, (bfd_byte *) scnhdr_ext->s_paddr); @@ -907,7 +962,7 @@ _bfd_pei_swap_scnhdr_out (abfd, in, out) { int flags = scnhdr_int->s_flags; - bfd_h_put_32(abfd, flags, (bfd_byte *) scnhdr_ext->s_flags); + bfd_h_put_32 (abfd, flags, (bfd_byte *) scnhdr_ext->s_flags); } if (coff_data (abfd)->link_info @@ -947,35 +1002,41 @@ _bfd_pei_swap_scnhdr_out (abfd, in, out) (bfd_byte *) scnhdr_ext->s_nreloc); else { - (*_bfd_error_handler) (_("%s: reloc overflow: 0x%lx > 0xffff"), + /* PE can deal with large #s of relocs, but not here */ + bfd_h_put_16 (abfd, 0xffff, (bfd_byte *) 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); +#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); ret = 0; +#endif } } 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") }; /**********************************************************************/ @@ -994,7 +1055,7 @@ pe_print_idata (abfd, vfile) PTR vfile; { FILE *file = (FILE *) vfile; - bfd_byte *data = 0; + bfd_byte *data; asection *section; bfd_signed_vma adj; @@ -1002,9 +1063,8 @@ pe_print_idata (abfd, vfile) asection *rel_section = bfd_get_section_by_name (abfd, ".reldata"); #endif - bfd_size_type datasize; + bfd_size_type datasize = 0; bfd_size_type dataoff; - bfd_size_type secsize; bfd_size_type i; int onaline = 20; @@ -1014,31 +1074,42 @@ pe_print_idata (abfd, vfile) bfd_vma addr; addr = extra->DataDirectory[1].VirtualAddress; - datasize = extra->DataDirectory[1].Size; - if (addr == 0 || datasize == 0) - return true; - - addr += extra->ImageBase; - - for (section = abfd->sections; section != NULL; section = section->next) + if (addr == 0 && extra->DataDirectory[1].Size == 0) { - if (addr >= section->vma - && addr < section->vma + bfd_section_size(abfd,section)) - break; + /* Maybe the extra header isn't there. Look for the section. */ + section = bfd_get_section_by_name (abfd, ".idata"); + if (section == NULL) + return true; + + addr = section->vma; + datasize = bfd_section_size (abfd, section); + if (datasize == 0) + return true; } - - if (section == NULL) + else { - fprintf (file, - _("\nThere is an import table, but the section containing it could not be found\n")); - return true; + 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; + } + + if (section == NULL) + { + fprintf (file, + _("\nThere is an import table, but the section containing it could not be found\n")); + return true; + } } fprintf (file, _("\nThere is an import table in %s at 0x%lx\n"), section->name, (unsigned long) addr); dataoff = addr - section->vma; + datasize -= dataoff; #ifdef POWERPC_LE_PE if (rel_section != 0 && bfd_section_size (abfd, rel_section) != 0) @@ -1068,38 +1139,39 @@ pe_print_idata (abfd, vfile) offset = abfd->start_address - rel_section->vma; - start_address = bfd_get_32(abfd, data+offset); - loadable_toc_address = bfd_get_32(abfd, data+offset+4); + start_address = bfd_get_32 (abfd, data + offset); + loadable_toc_address = bfd_get_32 (abfd, data + offset + 4); toc_address = loadable_toc_address - 32768; - fprintf(file, - _("\nFunction descriptor located at the start address: %04lx\n"), - (unsigned long int) (abfd->start_address)); + fprintf (file, + _("\nFunction descriptor located at the start address: %04lx\n"), + (unsigned long int) (abfd->start_address)); fprintf (file, _("\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n"), start_address, loadable_toc_address, toc_address); } else { - fprintf(file, - _("\nNo reldata section! Function descriptor not decoded.\n")); + fprintf (file, + _("\nNo reldata section! Function descriptor not decoded.\n")); } #endif - fprintf(file, - _("\nThe Import Tables (interpreted %s section contents)\n"), - section->name); - fprintf(file, - _(" vma: Hint Time Forward DLL First\n")); - fprintf(file, - _(" Table Stamp Chain Name Thunk\n")); + fprintf (file, + _("\nThe Import Tables (interpreted %s section contents)\n"), + section->name); + fprintf (file, + _(" vma: Hint Time Forward DLL First\n")); + fprintf (file, + _(" Table Stamp Chain Name Thunk\n")); - secsize = bfd_section_size (abfd, section); - data = (bfd_byte *) bfd_malloc (secsize); - if (data == NULL && secsize != 0) + data = (bfd_byte *) bfd_malloc (dataoff + datasize); + if (data == NULL) return false; - if (! bfd_get_section_contents (abfd, section, (PTR) data, 0, secsize)) + /* Read the whole section. Some of the fields might be before dataoff. */ + if (! bfd_get_section_contents (abfd, section, (PTR) data, + 0, dataoff + datasize)) return false; adj = section->vma - extra->ImageBase; @@ -1120,7 +1192,7 @@ pe_print_idata (abfd, vfile) if (i + 20 > datasize) { - /* check stuff */ + /* Check stuff. */ ; } @@ -1131,17 +1203,17 @@ pe_print_idata (abfd, vfile) first_thunk = bfd_get_32 (abfd, data + i + 16 + dataoff); fprintf (file, "%08lx %08lx %08lx %08lx %08lx\n", - hint_addr, - time_stamp, - forward_chain, - dll_name, - first_thunk); + (unsigned long) hint_addr, + (unsigned long) time_stamp, + (unsigned long) forward_chain, + (unsigned long) dll_name, + (unsigned long) first_thunk); if (hint_addr == 0 && first_thunk == 0) break; dll = (char *) data + dll_name - adj; - fprintf(file, _("\n\tDLL Name: %s\n"), dll); + fprintf (file, _("\n\tDLL Name: %s\n"), dll); if (hint_addr != 0) { @@ -1175,7 +1247,7 @@ pe_print_idata (abfd, vfile) && first_thunk != 0 && first_thunk != hint_addr) fprintf (file, "\t%04lx", - bfd_get_32 (abfd, data + first_thunk - adj + j)); + (long) bfd_get_32 (abfd, data + first_thunk - adj + j)); fprintf (file, "\n"); } @@ -1208,21 +1280,22 @@ pe_print_idata (abfd, vfile) { fprintf (file, _("\tThe Import Address Table (difference found)\n")); - fprintf(file, _("\tvma: Hint/Ord Member-Name\n")); + fprintf (file, _("\tvma: Hint/Ord Member-Name\n")); differ = 1; } if (iat_member == 0) { - fprintf(file, + fprintf (file, _("\t>>> Ran out of IAT members!\n")); } else { - ordinal = bfd_get_16(abfd, - data + iat_member - adj); + ordinal = bfd_get_16 (abfd, data + iat_member - adj); member_name = (char *) data + iat_member - adj + 2; - fprintf(file, "\t%04lx\t %4d %s\n", - iat_member, ordinal, member_name); + fprintf (file, "\t%04lx\t %4d %s\n", + (unsigned long) iat_member, + ordinal, + member_name); } } @@ -1231,12 +1304,12 @@ pe_print_idata (abfd, vfile) } if (differ == 0) { - fprintf(file, + fprintf (file, _("\tThe Import Address Table is identical\n")); } } - fprintf(file, "\n"); + fprintf (file, "\n"); } @@ -1251,28 +1324,27 @@ pe_print_edata (abfd, vfile) PTR vfile; { FILE *file = (FILE *) vfile; - bfd_byte *data = 0; + bfd_byte *data; asection *section; - bfd_size_type datasize; + 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 */ - 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 */ - } edt; + 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 */ + } edt; pe_data_type *pe = pe_data (abfd); struct internal_extra_pe_aouthdr *extra = &pe->pe_opthdr; @@ -1280,30 +1352,42 @@ pe_print_edata (abfd, vfile) bfd_vma addr; addr = extra->DataDirectory[0].VirtualAddress; - datasize = extra->DataDirectory[0].Size; - if (addr == 0 || datasize == 0) - return true; - - addr += extra->ImageBase; - for (section = abfd->sections; section != NULL; section = section->next) + if (addr == 0 && extra->DataDirectory[0].Size == 0) { - if (addr >= section->vma - && addr < section->vma + bfd_section_size (abfd, section)) - break; + /* Maybe the extra header isn't there. Look for the section. */ + section = bfd_get_section_by_name (abfd, ".edata"); + if (section == NULL) + return true; + + addr = section->vma; + datasize = bfd_section_size (abfd, section); + if (datasize == 0) + return true; } - - if (section == NULL) + else { - fprintf (file, - _("\nThere is an export table, but the section containing it could not be found\n")); - return true; + 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; + } + + if (section == NULL) + { + fprintf (file, + _("\nThere is an export table, but the section containing it could not be found\n")); + return true; + } } fprintf (file, _("\nThere is an export table in %s at 0x%lx\n"), section->name, (unsigned long) addr); dataoff = addr - section->vma; + datasize -= dataoff; data = (bfd_byte *) bfd_malloc (datasize); if (data == NULL) @@ -1313,34 +1397,34 @@ pe_print_edata (abfd, vfile) datasize)) return false; - /* Go get Export Directory Table */ - edt.export_flags = bfd_get_32(abfd, data+0); - edt.time_stamp = bfd_get_32(abfd, data+4); - edt.major_ver = bfd_get_16(abfd, data+8); - edt.minor_ver = bfd_get_16(abfd, data+10); - edt.name = bfd_get_32(abfd, data+12); - edt.base = bfd_get_32(abfd, data+16); - edt.num_functions = bfd_get_32(abfd, data+20); - edt.num_names = bfd_get_32(abfd, data+24); - edt.eat_addr = bfd_get_32(abfd, data+28); - edt.npt_addr = bfd_get_32(abfd, data+32); - edt.ot_addr = bfd_get_32(abfd, data+36); + /* Go get Export Directory Table. */ + edt.export_flags = bfd_get_32 (abfd, data + 0); + edt.time_stamp = bfd_get_32 (abfd, data + 4); + edt.major_ver = bfd_get_16 (abfd, data + 8); + edt.minor_ver = bfd_get_16 (abfd, data + 10); + edt.name = bfd_get_32 (abfd, data + 12); + edt.base = bfd_get_32 (abfd, data + 16); + edt.num_functions = bfd_get_32 (abfd, data + 20); + edt.num_names = bfd_get_32 (abfd, data + 24); + edt.eat_addr = bfd_get_32 (abfd, data + 28); + edt.npt_addr = bfd_get_32 (abfd, data + 32); + edt.ot_addr = bfd_get_32 (abfd, data + 36); adj = section->vma - extra->ImageBase + dataoff; /* Dump the EDT first first */ - fprintf(file, - _("\nThe Export Tables (interpreted %s section contents)\n\n"), - section->name); + fprintf (file, + _("\nThe Export Tables (interpreted %s section contents)\n\n"), + section->name); - fprintf(file, - _("Export Flags \t\t\t%lx\n"), (unsigned long) edt.export_flags); + fprintf (file, + _("Export Flags \t\t\t%lx\n"), (unsigned long) edt.export_flags); - fprintf(file, - _("Time/Date stamp \t\t%lx\n"), (unsigned long) edt.time_stamp); + fprintf (file, + _("Time/Date stamp \t\t%lx\n"), (unsigned long) edt.time_stamp); - fprintf(file, - _("Major/Minor \t\t\t%d/%d\n"), edt.major_ver, edt.minor_ver); + fprintf (file, + _("Major/Minor \t\t\t%d/%d\n"), edt.major_ver, edt.minor_ver); fprintf (file, _("Name \t\t\t\t")); @@ -1348,21 +1432,21 @@ pe_print_edata (abfd, vfile) fprintf (file, " %s\n", data + edt.name - adj); - fprintf(file, - _("Ordinal Base \t\t\t%ld\n"), edt.base); + fprintf (file, + _("Ordinal Base \t\t\t%ld\n"), edt.base); - fprintf(file, - _("Number in:\n")); + fprintf (file, + _("Number in:\n")); - fprintf(file, - _("\tExport Address Table \t\t%08lx\n"), - edt.num_functions); + fprintf (file, + _("\tExport Address Table \t\t%08lx\n"), + edt.num_functions); - fprintf(file, - _("\t[Name Pointer/Ordinal] Table\t%08lx\n"), edt.num_names); + fprintf (file, + _("\t[Name Pointer/Ordinal] Table\t%08lx\n"), edt.num_names); - fprintf(file, - _("Table Addresses\n")); + fprintf (file, + _("Table Addresses\n")); fprintf (file, _("\tExport Address Table \t\t")); @@ -1370,7 +1454,7 @@ pe_print_edata (abfd, vfile) fprintf (file, "\n"); fprintf (file, - _("\tName Pointer Table \t\t")); + _("\tName Pointer Table \t\t")); fprintf_vma (file, edt.npt_addr); fprintf (file, "\n"); @@ -1379,18 +1463,16 @@ pe_print_edata (abfd, vfile) fprintf_vma (file, edt.ot_addr); fprintf (file, "\n"); - /* 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; */ - fprintf(file, + fprintf (file, _("\nExport Address Table -- Ordinal Base %ld\n"), edt.base); @@ -1398,53 +1480,53 @@ pe_print_edata (abfd, vfile) { bfd_vma eat_member = bfd_get_32 (abfd, data + edt.eat_addr + (i * 4) - adj); - bfd_vma eat_actual = eat_member; - bfd_vma edata_start = bfd_get_section_vma (abfd, section); - bfd_vma edata_end = edata_start + datasize; - if (eat_member == 0) continue; - if (edata_start < eat_actual && eat_actual < edata_end) + if (eat_member - adj <= datasize) { - /* this rva is to a name (forwarding function) in our section */ - /* Should locate a function descriptor */ + /* This rva is to a name (forwarding function) in our section. */ + /* Should locate a function descriptor. */ fprintf (file, "\t[%4ld] +base[%4ld] %04lx %s -- %s\n", - (long) i, (long) (i + edt.base), eat_member, - _("Forwarder RVA"), data + eat_member - adj); + (long) i, + (long) (i + edt.base), + (unsigned long) eat_member, + _("Forwarder RVA"), + data + eat_member - adj); } else { - /* Should locate a function descriptor in the reldata section */ + /* Should locate a function descriptor in the reldata section. */ fprintf (file, "\t[%4ld] +base[%4ld] %04lx %s\n", - (long) i, (long) (i + edt.base), eat_member, + (long) i, + (long) (i + edt.base), + (unsigned long) eat_member, _("Export RVA")); } } - /* The Export Name Pointer Table is paired with the Export Ordinal Table */ - /* Dump them in parallel for clarity */ - fprintf(file, - _("\n[Ordinal/Name Pointer] Table\n")); + /* The Export Name Pointer Table is paired with the Export Ordinal Table. */ + /* Dump them in parallel for clarity. */ + fprintf (file, + _("\n[Ordinal/Name Pointer] Table\n")); for (i = 0; i < edt.num_names; ++i) { - bfd_vma name_ptr = bfd_get_32(abfd, + bfd_vma name_ptr = bfd_get_32 (abfd, data + edt.npt_addr + (i*4) - adj); - + char *name = (char *) data + name_ptr - adj; - bfd_vma ord = bfd_get_16(abfd, + bfd_vma ord = bfd_get_16 (abfd, data + edt.ot_addr + (i*2) - adj); - fprintf(file, + fprintf (file, "\t[%4ld] %s\n", (long) ord, name); - } free (data); @@ -1452,35 +1534,51 @@ pe_print_edata (abfd, vfile) return true; } +/* This really is architecture dependent. On IA-64, a .pdata entry + consists of three dwords containing relative virtual addresses that + specify the start and end address of the code range the entry + covers and the address of the corresponding unwind info data. */ + static boolean pe_print_pdata (abfd, vfile) - bfd *abfd; + bfd *abfd; PTR vfile; { +#ifdef COFF_WITH_PEP64 +# define PDATA_ROW_SIZE (3*8) +#else +# define PDATA_ROW_SIZE (5*4) +#endif FILE *file = (FILE *) vfile; bfd_byte *data = 0; asection *section = bfd_get_section_by_name (abfd, ".pdata"); bfd_size_type datasize = 0; bfd_size_type i; bfd_size_type start, stop; - int onaline = 20; + int onaline = PDATA_ROW_SIZE; if (section == NULL || coff_section_data (abfd, section) == NULL || pei_section_data (abfd, section) == NULL) - return true; + return true; stop = pei_section_data (abfd, section)->virt_size; if ((stop % onaline) != 0) - fprintf (file, _("Warning, .pdata section size (%ld) is not a multiple of %d\n"), - (long)stop, onaline); + fprintf (file, + _("Warning, .pdata section size (%ld) is not a multiple of %d\n"), + (long) stop, onaline); fprintf (file, _("\nThe Function Table (interpreted .pdata section contents)\n")); +#ifdef COFF_WITH_PEP64 + fprintf (file, + _(" vma:\t\t\tBegin Address End Address Unwind Info\n")); +#else fprintf (file, _(" vma:\t\tBegin End EH EH PrologEnd Exception\n")); fprintf (file, _(" \t\tAddress Address Handler Data Address Mask\n")); +#endif if (bfd_section_size (abfd, section) == 0) return true; @@ -1506,15 +1604,15 @@ pe_print_pdata (abfd, vfile) bfd_vma prolog_end_addr; int em_data; - if (i + 20 > stop) + if (i + PDATA_ROW_SIZE > stop) break; - begin_addr = bfd_get_32(abfd, data+i); - end_addr = bfd_get_32(abfd, data+i+4); - eh_handler = bfd_get_32(abfd, data+i+8); - eh_data = bfd_get_32(abfd, data+i+12); - prolog_end_addr = bfd_get_32(abfd, data+i+16); - + begin_addr = GET_PDATA_ENTRY (abfd, data + i ); + end_addr = GET_PDATA_ENTRY (abfd, data + i + 4); + eh_handler = GET_PDATA_ENTRY (abfd, data + i + 8); + eh_data = GET_PDATA_ENTRY (abfd, data + i + 12); + prolog_end_addr = GET_PDATA_ENTRY (abfd, data + i + 16); + if (begin_addr == 0 && end_addr == 0 && eh_handler == 0 && eh_data == 0 && prolog_end_addr == 0) { @@ -1522,28 +1620,27 @@ pe_print_pdata (abfd, vfile) break; } - fprintf (file, - " %08lx\t", - (unsigned long int) (i + section->vma)); - em_data = ((eh_handler & 0x1) << 2) | (prolog_end_addr & 0x3); - eh_handler &= 0xfffffffc; - prolog_end_addr &= 0xfffffffc; + eh_handler &= ~(bfd_vma) 0x3; + prolog_end_addr &= ~(bfd_vma) 0x3; - fprintf (file, "%08lx %08lx %08lx %08lx %08lx %x", - begin_addr, - end_addr, - eh_handler, - eh_data, - prolog_end_addr, - em_data); + fputc (' ', file); + fprintf_vma (file, i + section->vma); fputc ('\t', file); + fprintf_vma (file, begin_addr); fputc (' ', file); + fprintf_vma (file, end_addr); fputc (' ', file); + fprintf_vma (file, eh_handler); +#ifndef COFF_WITH_PEP64 + fputc (' ', file); + fprintf_vma (file, eh_data); fputc (' ', file); + fprintf_vma (file, prolog_end_addr); + fprintf (file, " %x", em_data); +#endif #ifdef POWERPC_LE_PE if (eh_handler == 0 && eh_data != 0) { - /* Special bits here, although the meaning may */ - /* be a little mysterious. The only one I know */ - /* for sure is 0x03. */ + /* Special bits here, although the meaning may be a little + mysterious. The only one I know for sure is 0x03. */ /* Code Significance */ /* 0x00 None */ /* 0x01 Register Save Millicode */ @@ -1552,20 +1649,20 @@ pe_print_pdata (abfd, vfile) switch (eh_data) { case 0x01: - fprintf(file, _(" Register save millicode")); + fprintf (file, _(" Register save millicode")); break; case 0x02: - fprintf(file, _(" Register restore millicode")); + fprintf (file, _(" Register restore millicode")); break; case 0x03: - fprintf(file, _(" Glue code sequence")); + fprintf (file, _(" Glue code sequence")); break; default: break; } } #endif - fprintf(file, "\n"); + fprintf (file, "\n"); } free (data); @@ -1574,15 +1671,20 @@ pe_print_pdata (abfd, vfile) } #define IMAGE_REL_BASED_HIGHADJ 4 -static const char * const tbl[] = -{ -"ABSOLUTE", -"HIGH", -"LOW", -"HIGHLOW", -"HIGHADJ", -"MIPS_JMPADDR", -"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 @@ -1629,8 +1731,8 @@ pe_print_reloc (abfd, vfile) /* 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 */ - virtual_address = bfd_get_32(abfd, data+i); - size = bfd_get_32(abfd, data+i+4); + virtual_address = bfd_get_32 (abfd, data+i); + size = bfd_get_32 (abfd, data+i+4); number = (size - 8) / 2; if (size == 0) @@ -1640,7 +1742,7 @@ pe_print_reloc (abfd, vfile) fprintf (file, _("\nVirtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n"), - virtual_address, size, size, number); + (unsigned long) virtual_address, size, size, number); for (j = 0; j < number; ++j) { @@ -1656,15 +1758,15 @@ pe_print_reloc (abfd, vfile) j, off, (long) (off + virtual_address), tbl[t]); /* HIGHADJ takes an argument, - the next record *is* the - low 16 bits of addend. */ + low 16 bits of addend. */ if (t == IMAGE_REL_BASED_HIGHADJ) { - fprintf (file, " (%4x)", - ((unsigned int) - bfd_get_16 (abfd, data + i + 8 + j * 2 + 2))); - j++; + fprintf (file, " (%4x)", + ((unsigned int) + bfd_get_16 (abfd, data + i + 8 + j * 2 + 2))); + j++; } - + fprintf (file, "\n"); } i += size; @@ -1686,13 +1788,14 @@ _bfd_pe_print_private_bfd_data_common (abfd, vfile) int j; pe_data_type *pe = pe_data (abfd); struct internal_extra_pe_aouthdr *i = &pe->pe_opthdr; + const char *subsystem_name = NULL; /* The MS dumpbin program reportedly ands with 0xff0f before printing the characteristics field. Not sure why. No reason to emulate it here. */ fprintf (file, _("\nCharacteristics 0x%x\n"), pe->real_flags); #undef PF -#define PF(x, y) if (pe->real_flags & x) { fprintf (file, "\t%s\n", y); } +#define PF(x, y) if (pe->real_flags & x) { fprintf (file, "\t%s\n", y); } PF (F_RELFLG, "relocations stripped"); PF (F_EXEC, "executable"); PF (F_LNNO, "line numbers stripped"); @@ -1707,36 +1810,68 @@ _bfd_pe_print_private_bfd_data_common (abfd, vfile) /* ctime implies '\n'. */ fprintf (file, "\nTime/Date\t\t%s", ctime (&pe->coff.timestamp)); - fprintf (file,"\nImageBase\t\t"); + fprintf (file, "\nImageBase\t\t"); fprintf_vma (file, i->ImageBase); - fprintf (file,"\nSectionAlignment\t"); + fprintf (file, "\nSectionAlignment\t"); fprintf_vma (file, i->SectionAlignment); - fprintf (file,"\nFileAlignment\t\t"); + fprintf (file, "\nFileAlignment\t\t"); fprintf_vma (file, i->FileAlignment); - fprintf (file,"\nMajorOSystemVersion\t%d\n", i->MajorOperatingSystemVersion); - fprintf (file,"MinorOSystemVersion\t%d\n", i->MinorOperatingSystemVersion); - fprintf (file,"MajorImageVersion\t%d\n", i->MajorImageVersion); - fprintf (file,"MinorImageVersion\t%d\n", i->MinorImageVersion); - fprintf (file,"MajorSubsystemVersion\t%d\n", i->MajorSubsystemVersion); - fprintf (file,"MinorSubsystemVersion\t%d\n", i->MinorSubsystemVersion); - fprintf (file,"Win32Version\t\t%08lx\n", i->Reserved1); - 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); - fprintf (file,"Subsystem\t\t%08x\n", i->Subsystem); - fprintf (file,"DllCharacteristics\t%08x\n", i->DllCharacteristics); - fprintf (file,"SizeOfStackReserve\t"); + fprintf (file, "\nMajorOSystemVersion\t%d\n", i->MajorOperatingSystemVersion); + fprintf (file, "MinorOSystemVersion\t%d\n", i->MinorOperatingSystemVersion); + fprintf (file, "MajorImageVersion\t%d\n", i->MajorImageVersion); + fprintf (file, "MinorImageVersion\t%d\n", i->MinorImageVersion); + fprintf (file, "MajorSubsystemVersion\t%d\n", i->MajorSubsystemVersion); + fprintf (file, "MinorSubsystemVersion\t%d\n", i->MinorSubsystemVersion); + fprintf (file, "Win32Version\t\t%08lx\n", i->Reserved1); + 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: + subsystem_name = "unspecified"; + break; + case IMAGE_SUBSYSTEM_NATIVE: + subsystem_name = "NT native"; + break; + case IMAGE_SUBSYSTEM_WINDOWS_GUI: + subsystem_name = "Windows GUI"; + break; + case IMAGE_SUBSYSTEM_WINDOWS_CUI: + subsystem_name = "Windows CUI"; + break; + case IMAGE_SUBSYSTEM_POSIX_CUI: + subsystem_name = "POSIX CUI"; + break; + case IMAGE_SUBSYSTEM_WINDOWS_CE_GUI: + subsystem_name = "Wince CUI"; + break; + case IMAGE_SUBSYSTEM_EFI_APPLICATION: + subsystem_name = "EFI application"; + break; + case IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER: + subsystem_name = "EFI boot service driver"; + break; + case IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER: + subsystem_name = "EFI runtime driver"; + break; + } + fprintf (file, "Subsystem\t\t%08x", i->Subsystem); + if (subsystem_name) + fprintf (file, "\t(%s)", subsystem_name); + fprintf (file, "\nDllCharacteristics\t%08x\n", i->DllCharacteristics); + fprintf (file, "SizeOfStackReserve\t"); fprintf_vma (file, i->SizeOfStackReserve); - fprintf (file,"\nSizeOfStackCommit\t"); + fprintf (file, "\nSizeOfStackCommit\t"); fprintf_vma (file, i->SizeOfStackCommit); - fprintf (file,"\nSizeOfHeapReserve\t"); + fprintf (file, "\nSizeOfHeapReserve\t"); fprintf_vma (file, i->SizeOfHeapReserve); - fprintf (file,"\nSizeOfHeapCommit\t"); + fprintf (file, "\nSizeOfHeapCommit\t"); fprintf_vma (file, i->SizeOfHeapCommit); - fprintf (file,"\nLoaderFlags\t\t%08lx\n", i->LoaderFlags); - fprintf (file,"NumberOfRvaAndSizes\t%08lx\n", i->NumberOfRvaAndSizes); + fprintf (file, "\nLoaderFlags\t\t%08lx\n", i->LoaderFlags); + fprintf (file, "NumberOfRvaAndSizes\t%08lx\n", i->NumberOfRvaAndSizes); - fprintf (file,"\nThe Data Directory\n"); + fprintf (file, "\nThe Data Directory\n"); for (j = 0; j < IMAGE_NUMBEROF_DIRECTORY_ENTRIES; j++) { fprintf (file, "Entry %1x ", j); @@ -1772,13 +1907,13 @@ _bfd_pe_bfd_copy_private_bfd_data_common (ibfd, obfd) if we don't remove this entry as well. */ if (! pe_data (obfd)->has_reloc_section) { - pe_data(obfd)->pe_opthdr.DataDirectory[5].VirtualAddress = 0; - pe_data(obfd)->pe_opthdr.DataDirectory[5].Size = 0; + pe_data (obfd)->pe_opthdr.DataDirectory[5].VirtualAddress = 0; + pe_data (obfd)->pe_opthdr.DataDirectory[5].Size = 0; } return true; } -/* Copy private section data. */ +/* Copy private section data. */ boolean _bfd_pe_bfd_copy_private_section_data (ibfd, isec, obfd, osec) bfd *ibfd; @@ -1810,7 +1945,7 @@ _bfd_pe_bfd_copy_private_section_data (ibfd, isec, obfd, osec) pei_section_data (obfd, osec)->virt_size = pei_section_data (ibfd, isec)->virt_size; pei_section_data (obfd, osec)->pe_flags = - pei_section_data (ibfd, isec)->pe_flags; + pei_section_data (ibfd, isec)->pe_flags; } return true; @@ -1854,7 +1989,7 @@ _bfd_pei_final_link_postscript (abfd, pfinfo) ".idata$2", false, false, true); if (h1 != NULL) { - pe_data(abfd)->pe_opthdr.DataDirectory[1].VirtualAddress = + pe_data (abfd)->pe_opthdr.DataDirectory[1].VirtualAddress = (h1->root.u.def.value + h1->root.u.def.section->output_section->vma + h1->root.u.def.section->output_offset); @@ -1864,7 +1999,7 @@ _bfd_pei_final_link_postscript (abfd, pfinfo) ((h1->root.u.def.value + h1->root.u.def.section->output_section->vma + h1->root.u.def.section->output_offset) - - pe_data(abfd)->pe_opthdr.DataDirectory[1].VirtualAddress); + - pe_data (abfd)->pe_opthdr.DataDirectory[1].VirtualAddress); /* The import address table. This is the size/address of .idata$5. */ @@ -1880,7 +2015,7 @@ _bfd_pei_final_link_postscript (abfd, pfinfo) ((h1->root.u.def.value + h1->root.u.def.section->output_section->vma + h1->root.u.def.section->output_offset) - - pe_data(abfd)->pe_opthdr.DataDirectory[12].VirtualAddress); + - pe_data (abfd)->pe_opthdr.DataDirectory[12].VirtualAddress); } /* If we couldn't find idata$2, we either have an excessively diff --git a/gnu/dist/toolchain/bfd/po/POTFILES.in b/gnu/dist/toolchain/bfd/po/POTFILES.in index 409bf1d7c9cf..f75b4caec898 100644 --- a/gnu/dist/toolchain/bfd/po/POTFILES.in +++ b/gnu/dist/toolchain/bfd/po/POTFILES.in @@ -4,6 +4,7 @@ aout32.c aout64.c aout-adobe.c aout-arm.c +aout-cris.c aoutf1.h aout-ns32k.c aout-sparcle.c @@ -21,6 +22,7 @@ cf-i386lynx.c cf-m68klynx.c cf-sparclynx.c cisco-core.c +coff64-rs6000.c coff-a29k.c coff-alpha.c coff-apollo.c @@ -46,6 +48,7 @@ coff-stgo32.c coff-svm68k.c coffswap.h coff-tic30.c +coff-tic54x.c coff-tic80.c coff-u68k.c coff-w65.c @@ -57,6 +60,7 @@ cpu-alpha.c cpu-arc.c cpu-arm.c cpu-avr.c +cpu-cris.c cpu-d10v.c cpu-d30v.c cpu-fr30.c @@ -67,9 +71,12 @@ cpu-i370.c cpu-i386.c cpu-i860.c cpu-i960.c +cpu-ia64.c cpu-m10200.c cpu-m10300.c cpu-m32r.c +cpu-m68hc11.c +cpu-m68hc12.c cpu-m68k.c cpu-m88k.c cpu-mcore.c @@ -81,6 +88,7 @@ cpu-rs6000.c cpu-sh.c cpu-sparc.c cpu-tic30.c +cpu-tic54x.c cpu-tic80.c cpu-v850.c cpu-vax.c @@ -93,19 +101,26 @@ dwarf2.c ecoff.c ecofflink.c ecoffswap.h +efi-app-ia32.c +efi-app-ia64.c elf32-arc.c elf32-arm.h elf32-avr.c elf32.c +elf32-cris.c elf32-d10v.c elf32-d30v.c elf32-fr30.c elf32-gen.c +elf32-hppa.c +elf32-hppa.h elf32-i370.c elf32-i386.c elf32-i860.c elf32-i960.c elf32-m32r.c +elf32-m68hc11.c +elf32-m68hc12.c elf32-m68k.c elf32-m88k.c elf32-mcore.c @@ -113,19 +128,24 @@ elf32-mips.c elf32-pj.c elf32-ppc.c elf32-sh.c +elf32-sh-lin.c elf32-sparc.c elf32-v850.c elf64-alpha.c elf64.c elf64-gen.c +elf64-hppa.c +elf64-hppa.h elf64-mips.c elf64-sparc.c +elf64-x86-64.c elfarm-nabi.c elfarm-oabi.c elf-bfd.h elf.c elfcode.h elfcore.h +elf-hppa.h elflink.c elflink.h elf-m10200.c @@ -232,3 +252,4 @@ vms-hdr.c vms-misc.c vms-tir.c xcofflink.c +xcoff-target.h diff --git a/gnu/dist/toolchain/bfd/po/bfd.pot b/gnu/dist/toolchain/bfd/po/bfd.pot index b08ec3649c97..e77b05d44f3c 100644 --- a/gnu/dist/toolchain/bfd/po/bfd.pot +++ b/gnu/dist/toolchain/bfd/po/bfd.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2000-04-04 22:10+0930\n" +"POT-Creation-Date: 2001-01-11 11:54-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -14,140 +14,155 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: ENCODING\n" -#: aout-adobe.c:183 +#: aout-adobe.c:189 #, c-format msgid "%s: Unknown section type in a.out.adobe file: %x\n" msgstr "" -#: aoutx.h:1244 aoutx.h:1658 +#: aout-cris.c:205 +#, c-format +msgid "%s: Invalid relocation type exported: %d" +msgstr "" + +#: aout-cris.c:249 +#, c-format +msgid "%s: Invalid relocation type imported: %d" +msgstr "" + +#: aout-cris.c:260 +#, c-format +msgid "%s: Bad relocation record imported: %d" +msgstr "" + +#: aoutx.h:1259 aoutx.h:1673 #, c-format msgid "%s: can not represent section `%s' in a.out object file format" msgstr "" -#: aoutx.h:1628 +#: aoutx.h:1643 #, c-format msgid "" "%s: can not represent section for symbol `%s' in a.out object file format" msgstr "" -#: aoutx.h:1630 +#: aoutx.h:1645 msgid "*unknown*" msgstr "" -#: aoutx.h:3674 +#: aoutx.h:3684 #, c-format msgid "%s: relocateable link from %s to %s not supported" msgstr "" -#: archive.c:1724 +#: archive.c:1820 msgid "Warning: writing archive was slow: rewriting timestamp\n" msgstr "" -#: archive.c:1990 +#: archive.c:2086 msgid "Reading archive file mod timestamp" msgstr "" #. FIXME: bfd can't call perror. -#: archive.c:2014 +#: archive.c:2113 msgid "Writing updated armap timestamp" msgstr "" -#: bfd.c:274 +#: bfd.c:273 msgid "No error" msgstr "" -#: bfd.c:275 +#: bfd.c:274 msgid "System call error" msgstr "" -#: bfd.c:276 +#: bfd.c:275 msgid "Invalid bfd target" msgstr "" -#: bfd.c:277 +#: bfd.c:276 msgid "File in wrong format" msgstr "" -#: bfd.c:278 +#: bfd.c:277 msgid "Invalid operation" msgstr "" -#: bfd.c:279 +#: bfd.c:278 msgid "Memory exhausted" msgstr "" -#: bfd.c:280 +#: bfd.c:279 msgid "No symbols" msgstr "" -#: bfd.c:281 +#: bfd.c:280 msgid "Archive has no index; run ranlib to add one" msgstr "" -#: bfd.c:282 +#: bfd.c:281 msgid "No more archived files" msgstr "" -#: bfd.c:283 +#: bfd.c:282 msgid "Malformed archive" msgstr "" -#: bfd.c:284 +#: bfd.c:283 msgid "File format not recognized" msgstr "" -#: bfd.c:285 +#: bfd.c:284 msgid "File format is ambiguous" msgstr "" -#: bfd.c:286 +#: bfd.c:285 msgid "Section has no contents" msgstr "" -#: bfd.c:287 +#: bfd.c:286 msgid "Nonrepresentable section on output" msgstr "" -#: bfd.c:288 +#: bfd.c:287 msgid "Symbol needs debug section which does not exist" msgstr "" -#: bfd.c:289 +#: bfd.c:288 msgid "Bad value" msgstr "" -#: bfd.c:290 +#: bfd.c:289 msgid "File truncated" msgstr "" -#: bfd.c:291 +#: bfd.c:290 msgid "File too big" msgstr "" -#: bfd.c:292 +#: bfd.c:291 msgid "#" msgstr "" -#: bfd.c:679 +#: bfd.c:675 #, c-format msgid "bfd assertion fail %s:%d" msgstr "" -#: bfd.c:697 +#: bfd.c:693 #, c-format msgid "BFD internal error, aborting at %s line %d in %s\n" msgstr "" -#: bfd.c:701 +#: bfd.c:697 #, c-format msgid "BFD internal error, aborting at %s line %d\n" msgstr "" -#: bfd.c:703 +#: bfd.c:699 msgid "Please report this bug.\n" msgstr "" -#: binary.c:298 +#: binary.c:303 #, c-format msgid "Warning: Writing section `%s' to huge (ie negative) file offset 0x%lx." msgstr "" @@ -156,19 +171,19 @@ msgstr "" msgid "Missing IHCONST" msgstr "" -#: coff-a29k.c:182 +#: coff-a29k.c:181 msgid "Missing IHIHALF" msgstr "" -#: coff-a29k.c:214 +#: coff-a29k.c:213 msgid "Unrecognized reloc" msgstr "" -#: coff-a29k.c:427 +#: coff-a29k.c:425 msgid "missing IHCONST reloc" msgstr "" -#: coff-a29k.c:518 +#: coff-a29k.c:516 msgid "missing IHIHALF reloc" msgstr "" @@ -176,126 +191,126 @@ msgstr "" msgid "GP relative relocation used when GP not defined" msgstr "" -#: coff-alpha.c:1486 elf64-alpha.c:3990 +#: coff-alpha.c:1486 elf64-alpha.c:4004 msgid "using multiple gp values" msgstr "" -#: coff-alpha.c:1992 coff-mips.c:1435 +#: coff-alpha.c:1992 coff-mips.c:1434 msgid "GP relative relocation when GP not defined" msgstr "" -#: coff-arm.c:1020 elf32-arm.h:258 +#: coff-arm.c:1018 elf32-arm.h:246 #, c-format msgid "%s: unable to find THUMB glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1049 elf32-arm.h:291 +#: coff-arm.c:1047 elf32-arm.h:281 #, c-format msgid "%s: unable to find ARM glue '%s' for `%s'" msgstr "" -#: coff-arm.c:1331 coff-arm.c:1426 elf32-arm.h:857 elf32-arm.h:955 +#: coff-arm.c:1335 coff-arm.c:1430 elf32-arm.h:841 elf32-arm.h:946 #, c-format msgid "%s(%s): warning: interworking not enabled." msgstr "" -#: coff-arm.c:1335 elf32-arm.h:958 +#: coff-arm.c:1339 elf32-arm.h:949 #, c-format msgid " first occurrence: %s: arm call to thumb" msgstr "" -#: coff-arm.c:1430 elf32-arm.h:860 +#: coff-arm.c:1434 elf32-arm.h:844 #, c-format msgid " first occurrence: %s: thumb call to arm" msgstr "" -#: coff-arm.c:1433 +#: coff-arm.c:1437 msgid " consider relinking with --support-old-code enabled" msgstr "" -#: coff-arm.c:1722 coff-tic80.c:682 cofflink.c:2980 +#: coff-arm.c:1726 coff-tic80.c:682 cofflink.c:2991 #, c-format msgid "%s: bad reloc address 0x%lx in section `%s'" msgstr "" -#: coff-arm.c:2060 +#: coff-arm.c:2063 #, c-format msgid "%s: illegal symbol index in reloc: %d" msgstr "" -#: coff-arm.c:2189 +#: coff-arm.c:2191 #, c-format msgid "%s: ERROR: compiled for APCS-%d whereas target %s uses APCS-%d" msgstr "" -#: coff-arm.c:2204 +#: coff-arm.c:2206 #, c-format msgid "" "%s: ERROR: passes floats in float registers whereas target %s uses integer " "registers" msgstr "" -#: coff-arm.c:2207 +#: coff-arm.c:2209 #, c-format msgid "" "%s: ERROR: passes floats in integer registers whereas target %s uses float " "registers" msgstr "" -#: coff-arm.c:2222 +#: coff-arm.c:2224 #, c-format msgid "" "%s: ERROR: compiled as position independent code, whereas target %s is " "absolute position" msgstr "" -#: coff-arm.c:2225 +#: coff-arm.c:2227 #, c-format msgid "" "%s: ERROR: compiled as absolute position code, whereas target %s is position " "independent" msgstr "" -#: coff-arm.c:2254 +#: coff-arm.c:2256 #, c-format msgid "Warning: input file %s supports interworking, whereas %s does not." msgstr "" -#: coff-arm.c:2257 +#: coff-arm.c:2259 #, c-format msgid "Warning: input file %s does not support interworking, whereas %s does." msgstr "" -#: coff-arm.c:2285 +#: coff-arm.c:2286 #, c-format msgid "private flags = %x:" msgstr "" -#: coff-arm.c:2293 elf32-arm.h:2089 +#: coff-arm.c:2294 elf32-arm.h:2210 msgid " [floats passed in float registers]" msgstr "" -#: coff-arm.c:2295 elf32-arm.h:2091 +#: coff-arm.c:2296 msgid " [floats passed in integer registers]" msgstr "" -#: coff-arm.c:2298 elf32-arm.h:2094 +#: coff-arm.c:2299 elf32-arm.h:2213 msgid " [position independent]" msgstr "" -#: coff-arm.c:2300 elf32-arm.h:2096 +#: coff-arm.c:2301 msgid " [absolute position]" msgstr "" -#: coff-arm.c:2304 +#: coff-arm.c:2305 msgid " [interworking flag not initialised]" msgstr "" -#: coff-arm.c:2306 +#: coff-arm.c:2307 msgid " [interworking supported]" msgstr "" -#: coff-arm.c:2308 +#: coff-arm.c:2309 msgid " [interworking not supported]" msgstr "" @@ -311,42 +326,47 @@ msgstr "" msgid "Warning: Clearing the interworking flag of %s due to outside request" msgstr "" -#: coffcode.h:3965 +#: coffcode.h:2136 +#, c-format +msgid "Unrecognized TI COFF target id '0x%x'" +msgstr "" + +#: coffcode.h:4194 #, c-format msgid "%s: warning: illegal symbol index %ld in line numbers" msgstr "" -#: coffcode.h:3979 +#: coffcode.h:4208 #, c-format msgid "%s: warning: duplicate line number information for `%s'" msgstr "" -#: coffcode.h:4334 +#: coffcode.h:4568 #, c-format msgid "%s: Unrecognized storage class %d for %s symbol `%s'" msgstr "" -#: coffcode.h:4465 +#: coffcode.h:4699 #, c-format msgid "warning: %s: local symbol `%s' has no section" msgstr "" -#: coffcode.h:4578 +#: coff-tic54x.c:376 coffcode.h:4810 #, c-format msgid "%s: warning: illegal symbol index %ld in relocs" msgstr "" -#: coffcode.h:4616 +#: coffcode.h:4848 #, c-format msgid "%s: illegal relocation type %d at address 0x%lx" msgstr "" -#: coffgen.c:1613 +#: coffgen.c:1631 #, c-format msgid "%s: bad string table size %lu" msgstr "" -#: coffgen.c:2076 +#: coffgen.c:2093 #, c-format msgid "AUX tagndx %ld ttlsiz 0x%lx lnnos %ld next %ld" msgstr "" @@ -355,296 +375,426 @@ msgstr "" msgid "uncertain calling convention for non-COFF symbol" msgstr "" -#: cofflink.c:518 elflink.h:1568 +#: cofflink.c:526 elflink.h:1648 #, c-format msgid "Warning: type of symbol `%s' changed from %d to %d in %s" msgstr "" -#: cofflink.c:2285 +#: cofflink.c:2289 #, c-format msgid "%s: relocs in section `%s', but it has no contents" msgstr "" -#: cofflink.c:2619 coffswap.h:904 +#: cofflink.c:2628 coffswap.h:894 #, c-format msgid "%s: %s: reloc overflow: 0x%lx > 0xffff" msgstr "" -#: cofflink.c:2628 coffswap.h:891 +#: cofflink.c:2637 coffswap.h:880 #, c-format msgid "%s: warning: %s: line number overflow: 0x%lx > 0xffff" msgstr "" -#: coff-mips.c:875 elf32-mips.c:1406 -msgid "GP relative relocation when _gp not defined" +#: coff-m68k.c:475 coff-mips.c:2432 elf32-m68k.c:2265 +msgid "unsupported reloc type" msgstr "" -#: coff-mips.c:2433 -msgid "unsupported reloc type" +#: coff-mips.c:875 elf32-mips.c:1417 +msgid "GP relative relocation when _gp not defined" msgstr "" #. No other sections should appear in -membedded-pic #. code. -#: coff-mips.c:2470 +#: coff-mips.c:2469 msgid "reloc against unsupported section" msgstr "" -#: coff-mips.c:2478 +#: coff-mips.c:2477 msgid "reloc not properly aligned" msgstr "" -#: coff-tic80.c:445 +#: coff-tic54x.c:263 coff-tic80.c:445 #, c-format msgid "Unrecognized reloc type 0x%x" msgstr "" -#: coff-w65.c:383 +#: coff-w65.c:369 #, c-format msgid "ignoring reloc %s\n" msgstr "" -#: dwarf2.c:429 +#: dwarf2.c:423 msgid "Dwarf Error: Can't find .debug_abbrev section." msgstr "" -#: dwarf2.c:447 +#: dwarf2.c:441 #, c-format msgid "Dwarf Error: Abbrev offset (%u) bigger than abbrev size (%u)." msgstr "" -#: dwarf2.c:627 +#: dwarf2.c:624 #, c-format msgid "Dwarf Error: Invalid or unhandled FORM value: %d." msgstr "" -#: dwarf2.c:700 +#: dwarf2.c:697 msgid "Dwarf Error: mangled line number section (bad file number)." msgstr "" -#: dwarf2.c:791 +#: dwarf2.c:782 msgid "Dwarf Error: Can't find .debug_line section." msgstr "" -#: dwarf2.c:963 +#: dwarf2.c:806 +#, c-format +msgid "Dwarf Error: Line offset (%u) bigger than line size (%u)." +msgstr "" + +#: dwarf2.c:973 msgid "Dwarf Error: mangled line number section." msgstr "" -#: dwarf2.c:1151 dwarf2.c:1307 +#: dwarf2.c:1152 dwarf2.c:1306 #, c-format msgid "Dwarf Error: Could not find abbrev number %d." msgstr "" -#: dwarf2.c:1268 +#: dwarf2.c:1267 #, c-format msgid "" "Dwarf Error: found dwarf version '%hu', this reader only handles version 2 " "information." msgstr "" -#: dwarf2.c:1275 +#: dwarf2.c:1274 #, c-format msgid "" "Dwarf Error: found address size '%u', this reader can not handle sizes " "greater than '%u'." msgstr "" -#: dwarf2.c:1298 +#: dwarf2.c:1297 #, c-format msgid "Dwarf Error: Bad abbrev number: %d." msgstr "" -#: ecoff.c:1325 +#: ecoff.c:1323 #, c-format msgid "Unknown basic type %d" msgstr "" -#: ecoff.c:1597 +#: ecoff.c:1592 #, c-format msgid "" "\n" " End+1 symbol: %ld" msgstr "" -#: ecoff.c:1604 ecoff.c:1607 +#: ecoff.c:1599 ecoff.c:1602 #, c-format msgid "" "\n" " First symbol: %ld" msgstr "" -#: ecoff.c:1619 +#: ecoff.c:1614 #, c-format msgid "" "\n" " End+1 symbol: %-7ld Type: %s" msgstr "" -#: ecoff.c:1626 +#: ecoff.c:1621 #, c-format msgid "" "\n" " Local symbol: %ld" msgstr "" -#: ecoff.c:1634 +#: ecoff.c:1629 #, c-format msgid "" "\n" " struct; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1639 +#: ecoff.c:1634 #, c-format msgid "" "\n" " union; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1644 +#: ecoff.c:1639 #, c-format msgid "" "\n" " enum; End+1 symbol: %ld" msgstr "" -#: ecoff.c:1650 +#: ecoff.c:1645 #, c-format msgid "" "\n" " Type: %s" msgstr "" -#: elf32-arm.h:1787 elf32-i386.c:1304 elf32-ppc.c:3092 +#: elf32-arm.h:1179 +#, c-format +msgid "%s: Warning: Arm BLX instruction targets Arm function '%s'." +msgstr "" + +#: elf32-arm.h:1375 +#, c-format +msgid "%s: Warning: Thumb BLX instruction targets thumb function '%s'." +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 #, c-format msgid "" "%s: warning: unresolvable relocation against symbol `%s' from %s section" msgstr "" -#: elf-m10200.c:455 elf-m10300.c:670 elf32-arm.h:1853 elf32-avr.c:844 -#: elf32-d10v.c:493 elf32-fr30.c:651 elf32-m32r.c:1265 elf32-v850.c:1677 +#: 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" msgstr "" -#: elf-m10200.c:459 elf-m10300.c:674 elf32-arm.h:1857 elf32-avr.c:848 -#: elf32-d10v.c:497 elf32-fr30.c:655 elf32-m32r.c:1269 elf32-v850.c:1681 +#: 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" msgstr "" -#: elf-m10200.c:463 elf-m10300.c:678 elf32-arm.h:1861 elf32-d10v.c:501 +#: 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" msgstr "" -#: elf-m10200.c:467 elf-m10300.c:682 elf32-arm.h:1865 elf32-avr.c:856 -#: elf32-d10v.c:505 elf32-fr30.c:663 elf32-m32r.c:1277 elf32-v850.c:1701 +#: 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" msgstr "" -#: elf32-arm.h:1891 +#: elf32-arm.h:1967 #, c-format msgid "" "Warning: Not setting interwork flag of %s since it has already been " "specified as non-interworking" msgstr "" -#: elf32-arm.h:1895 +#: elf32-arm.h:1971 #, c-format msgid "Warning: Clearing the interwork flag of %s due to outside request" msgstr "" -#: elf32-arm.h:1943 +#: elf32-arm.h:2019 #, c-format msgid "" "Warning: Clearing the interwork flag in %s because non-interworking code in " "%s has been linked with it" msgstr "" -#: elf32-arm.h:1977 +#: elf32-arm.h:2113 #, c-format -msgid "%s: compiled for a %s endian system and target is %s endian" +msgid "" +"Error: %s compiled for EABI version %d, whereas %s is compiled for version %d" msgstr "" -#: elf32-arm.h:2023 +#: elf32-arm.h:2127 #, c-format msgid "Error: %s compiled for APCS-%d, whereas %s is compiled for APCS-%d" msgstr "" -#: elf32-arm.h:2031 +#: elf32-arm.h:2138 #, c-format msgid "" "Error: %s passes floats in %s registers, whereas %s passes them in %s " "registers" msgstr "" -#: elf32-arm.h:2034 elf32-arm.h:2036 +#: elf32-arm.h:2141 elf32-arm.h:2143 msgid "float" msgstr "" -#: elf32-arm.h:2034 elf32-arm.h:2036 +#: elf32-arm.h:2141 elf32-arm.h:2143 msgid "integer" msgstr "" -#: elf32-arm.h:2039 +#: elf32-arm.h:2150 #, c-format -msgid "Error: %s is compiled as position %s code, whereas %s is not" +msgid "Error: %s uses %s floating point, whereas %s uses %s floating point" msgstr "" -#: elf32-arm.h:2042 -msgid "independent" +#: elf32-arm.h:2153 elf32-arm.h:2155 +msgid "soft" msgstr "" -#: elf32-arm.h:2042 -msgid "dependent" +#: elf32-arm.h:2153 elf32-arm.h:2155 +msgid "hard" msgstr "" -#: elf32-arm.h:2048 +#: elf32-arm.h:2162 #, c-format msgid "Warning: %s %s interworking, whereas %s %s" msgstr "" -#: elf32-arm.h:2051 +#: elf32-arm.h:2165 msgid "supports" msgstr "" -#: elf32-arm.h:2051 +#: elf32-arm.h:2165 msgid "does not support" msgstr "" -#: elf32-arm.h:2053 +#: elf32-arm.h:2167 msgid "does not" msgstr "" -#: elf32-arm.h:2053 +#: elf32-arm.h:2167 msgid "does" msgstr "" -#. Ignore init flag - it may not be set, despite the flags field containing valid data. -#: elf32-arm.h:2076 elf32-m68k.c:430 elf32-mips.c:2634 +#. 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 #, c-format msgid "private flags = %lx:" msgstr "" -#: elf32-arm.h:2079 +#: elf32-arm.h:2202 msgid " [interworking enabled]" msgstr "" -#: elf32-arm.h:2081 -msgid " [interworking not enabled]" -msgstr "" - -#: elf32-arm.h:2084 +#: elf32-arm.h:2205 msgid " [APCS-26]" msgstr "" -#: elf32-arm.h:2086 +#: elf32-arm.h:2207 msgid " [APCS-32]" msgstr "" -#: elf32-avr.c:852 elf32-fr30.c:659 elf32-v850.c:1685 +#: elf32-arm.h:2216 +msgid " [new ABI]" +msgstr "" + +#: elf32-arm.h:2219 +msgid " [old ABI]" +msgstr "" + +#: elf32-arm.h:2222 +msgid " [software FP]" +msgstr "" + +#: elf32-arm.h:2229 +msgid " [Version1 EABI]" +msgstr "" + +#: elf32-arm.h:2232 +msgid " [sorted symbol table]" +msgstr "" + +#: elf32-arm.h:2234 +msgid " [unsorted symbol table]" +msgstr "" + +#: elf32-arm.h:2240 +msgid " " +msgstr "" + +#: elf32-arm.h:2247 +msgid " [relocatable executable]" +msgstr "" + +#: elf32-arm.h:2250 +msgid " [has entry point]" +msgstr "" + +#: elf32-arm.h:2255 +msgid "" +msgstr "" + +#: elf32-avr.c:850 elf32-cris.c:439 elf32-fr30.c:659 elf32-i860.c:1059 +#: elf32-v850.c:1680 msgid "internal error: dangerous relocation" msgstr "" -#: elf32-i386.c:239 +#: elf32-cris.c:618 +msgid " [symbols have a _ prefix]" +msgstr "" + +#: elf32-cris.c:657 +#, c-format +msgid "%s: uses _-prefixed symbols, but writing file with non-prefixed symbols" +msgstr "" + +#: elf32-cris.c:658 +#, c-format +msgid "%s: uses non-prefixed symbols, but writing file with _-prefixed symbols" +msgstr "" + +#: elf32-hppa.c:606 +#, c-format +msgid "%s(%s+0x%lx): cannot find stub entry %s" +msgstr "" + +#: elf32-hppa.c:667 +#, c-format +msgid "%s: cannot create stub entry %s" +msgstr "" + +#: elf32-hppa.c:859 +#, c-format +msgid "%s(%s+0x%lx): cannot relocate %s, recompile with -ffunction-sections" +msgstr "" + +#: elf32-hppa.c:872 elf32-hppa.c:1568 +#, c-format +msgid "Could not find relocation section for %s" +msgstr "" + +#: elf32-hppa.c:1011 elf32-hppa.c:3362 +#, c-format +msgid "%s(%s+0x%lx): cannot reach %s, recompile with -ffunction-sections" +msgstr "" + +#: elf32-hppa.c:1323 +#, c-format +msgid "" +"%s: relocation %s can not be used when making a shared object; recompile " +"with -fPIC" +msgstr "" + +#: elf32-hppa.c:1343 +#, c-format +msgid "" +"%s: relocation %s should not be used when making a shared object; recompile " +"with -fPIC" +msgstr "" + +#: elf32-hppa.c:2755 +#, c-format +msgid "%s: duplicate export stub %s" +msgstr "" + +#: elf32-hppa.c:3253 +#, c-format +msgid "%s(%s+0x%lx): fixing %s" +msgstr "" + +#: elf32-hppa.c:3856 +#, c-format +msgid "%s(%s+0x%lx): cannot handle %s for %s" +msgstr "" + +#: elf32-hppa.c:4173 +msgid ".got section not immediately after .plt section" +msgstr "" + +#: elf32-i386.c:273 #, c-format msgid "%s: invalid relocation type %d" msgstr "" @@ -685,149 +835,151 @@ msgstr "" msgid " [cpu32]" msgstr "" -#: elf32-mcore.c:329 -#, c-format -msgid "%s: compiled for a %s endian system and target is %s endian.\n" -msgstr "" - -#: elf32-mcore.c:377 elf32-mcore.c:504 +#: elf32-mcore.c:366 elf32-mcore.c:493 #, c-format msgid "%s: Relocation %s (%d) is not currently supported.\n" msgstr "" -#: elf32-mcore.c:463 +#: elf32-mcore.c:452 #, c-format msgid "%s: Unknown relocation type %d\n" msgstr "" -#: elf32-mips.c:1565 +#: elf32-mips.c:1576 msgid "32bits gp relative relocation occurs for an external symbol" msgstr "" -#: elf32-mips.c:1714 +#: elf32-mips.c:1725 #, c-format msgid "Linking mips16 objects into %s format is not supported" msgstr "" -#: elf32-mips.c:2469 elf32-ppc.c:1408 -#, c-format -msgid "%s: compiled for a big endian system and target is little endian" -msgstr "" - -#: elf32-mips.c:2471 elf32-ppc.c:1410 -#, c-format -msgid "%s: compiled for a little endian system and target is big endian" -msgstr "" - -#: elf32-mips.c:2520 +#: elf32-mips.c:2582 #, c-format msgid "%s: linking PIC files with non-PIC files" msgstr "" -#: elf32-mips.c:2530 +#: elf32-mips.c:2592 #, c-format msgid "%s: linking abicalls files with non-abicalls files" msgstr "" -#: elf32-mips.c:2560 +#: elf32-mips.c:2621 #, c-format msgid "%s: ISA mismatch (-mips%d) with previous modules (-mips%d)" msgstr "" -#: elf32-mips.c:2569 +#: elf32-mips.c:2630 #, c-format msgid "%s: ISA mismatch (%d) with previous modules (%d)" msgstr "" -#: elf32-mips.c:2592 +#: elf32-mips.c:2653 #, c-format msgid "%s: ABI mismatch: linking %s module with previous %s modules" msgstr "" -#: elf32-mips.c:2606 elf32-ppc.c:1477 elf64-sparc.c:2844 +#: elf32-mips.c:2667 elf32-ppc.c:1477 elf64-sparc.c:2971 #, c-format msgid "%s: uses different e_flags (0x%lx) fields than previous modules (0x%lx)" msgstr "" -#: elf32-mips.c:2637 +#: elf32-mips.c:2698 msgid " [abi=O32]" msgstr "" -#: elf32-mips.c:2639 +#: elf32-mips.c:2700 msgid " [abi=O64]" msgstr "" -#: elf32-mips.c:2641 +#: elf32-mips.c:2702 msgid " [abi=EABI32]" msgstr "" -#: elf32-mips.c:2643 +#: elf32-mips.c:2704 msgid " [abi=EABI64]" msgstr "" -#: elf32-mips.c:2645 +#: elf32-mips.c:2706 msgid " [abi unknown]" msgstr "" -#: elf32-mips.c:2647 +#: elf32-mips.c:2708 msgid " [abi=N32]" msgstr "" -#: elf32-mips.c:2649 +#: elf32-mips.c:2710 msgid " [abi=64]" msgstr "" -#: elf32-mips.c:2651 +#: elf32-mips.c:2712 msgid " [no abi set]" msgstr "" -#: elf32-mips.c:2654 +#: elf32-mips.c:2715 msgid " [mips1]" msgstr "" -#: elf32-mips.c:2656 +#: elf32-mips.c:2717 msgid " [mips2]" msgstr "" -#: elf32-mips.c:2658 +#: elf32-mips.c:2719 msgid " [mips3]" msgstr "" -#: elf32-mips.c:2660 +#: elf32-mips.c:2721 msgid " [mips4]" msgstr "" -#: elf32-mips.c:2662 +#: elf32-mips.c:2723 +msgid " [mips5]" +msgstr "" + +#: elf32-mips.c:2725 +msgid " [mips32]" +msgstr "" + +#: elf32-mips.c:2727 +msgid " [mips64]" +msgstr "" + +#: elf32-mips.c:2729 msgid " [unknown ISA]" msgstr "" -#: elf32-mips.c:2665 +#: elf32-mips.c:2732 msgid " [32bitmode]" msgstr "" -#: elf32-mips.c:2667 +#: elf32-mips.c:2734 msgid " [not 32bitmode]" msgstr "" -#: elf32-mips.c:4270 +#: elf32-mips.c:4388 msgid "static procedure (no name)" msgstr "" -#: elf32-mips.c:4887 elf64-alpha.c:4364 +#: elf32-mips.c:5005 elf64-alpha.c:4377 #, c-format msgid "%s: illegal section name `%s'" msgstr "" -#: elf32-mips.c:5414 +#: elf32-mips.c:5570 msgid "not enough GOT space for local GOT entries" msgstr "" -#: elf32-mips.c:6493 +#: elf32-mips.c:6686 #, c-format msgid "%s: %s+0x%lx: jump to stub routine which is not jal" msgstr "" -#: elf32-mips.c:7521 +#: elf32-mips.c:7673 +#, c-format +msgid "Malformed reloc detected for section %s" +msgstr "" + +#: elf32-mips.c:7750 #, c-format msgid "%s: CALL16 reloc at 0x%lx not against global symbol" msgstr "" @@ -849,156 +1001,146 @@ msgstr "" msgid "%s: Unknown special linker type %d" msgstr "" -#: elf32-ppc.c:2251 elf32-ppc.c:2285 elf32-ppc.c:2320 +#: elf32-ppc.c:2245 elf32-ppc.c:2279 elf32-ppc.c:2314 #, c-format msgid "%s: relocation %s cannot be used when making a shared object" msgstr "" -#: elf32-ppc.c:3123 +#: elf32-ppc.c:3129 #, c-format msgid "%s: unknown relocation type %d for symbol %s" msgstr "" -#: elf32-ppc.c:3491 elf32-ppc.c:3513 elf32-ppc.c:3562 +#: elf32-ppc.c:3493 elf32-ppc.c:3514 elf32-ppc.c:3564 #, c-format msgid "" "%s: The target (%s) of a %s relocation is in the wrong output section (%s)" msgstr "" -#: elf32-ppc.c:3628 +#: elf32-ppc.c:3630 #, c-format msgid "%s: Relocation %s is not yet supported for symbol %s." msgstr "" -#: elf32-sh.c:681 +#: elf32-sh.c:1084 #, c-format msgid "%s: 0x%lx: warning: bad R_SH_USES offset" msgstr "" -#: elf32-sh.c:693 +#: elf32-sh.c:1096 #, c-format msgid "%s: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x" msgstr "" -#: elf32-sh.c:710 +#: elf32-sh.c:1113 #, c-format msgid "%s: 0x%lx: warning: bad R_SH_USES load offset" msgstr "" -#: elf32-sh.c:725 +#: elf32-sh.c:1128 #, c-format msgid "%s: 0x%lx: warning: could not find expected reloc" msgstr "" -#: elf32-sh.c:762 +#: elf32-sh.c:1165 #, c-format msgid "%s: 0x%lx: warning: symbol in unexpected section" msgstr "" -#: elf32-sh.c:884 +#: elf32-sh.c:1287 #, c-format msgid "%s: 0x%lx: warning: could not find expected COUNT reloc" msgstr "" -#: elf32-sh.c:893 +#: elf32-sh.c:1296 #, c-format msgid "%s: 0x%lx: warning: bad count" msgstr "" -#: elf32-sh.c:1279 elf32-sh.c:1666 +#: elf32-sh.c:1689 elf32-sh.c:2076 #, c-format msgid "%s: 0x%lx: fatal: reloc overflow while relaxing" msgstr "" -#: elf32-sparc.c:1486 elf64-sparc.c:2242 +#: elf32-sparc.c:1512 elf64-sparc.c:2262 #, c-format msgid "%s: probably compiled without -fPIC?" msgstr "" -#: elf32-sparc.c:1856 -#, c-format -msgid "%s: compiled for a v8plus system and target is v8" -msgstr "" - -#: elf32-sparc.c:1865 -#, c-format -msgid "%s: compiled for a v8plusa system and target is v8plus" -msgstr "" - -#: elf32-sparc.c:1873 +#: elf32-sparc.c:1962 #, c-format msgid "%s: compiled for a 64 bit system and target is 32 bit" msgstr "" -#: elf32-sparc.c:1888 +#: elf32-sparc.c:1976 #, c-format msgid "%s: linking little endian files with big endian files" msgstr "" -#: elf32-v850.c:680 +#: elf32-v850.c:677 #, c-format msgid "Variable `%s' cannot occupy in multiple small data regions" msgstr "" -#: elf32-v850.c:683 +#: elf32-v850.c:680 #, c-format msgid "" "Variable `%s' can only be in one of the small, zero, and tiny data regions" msgstr "" -#: elf32-v850.c:686 +#: elf32-v850.c:683 #, c-format msgid "" "Variable `%s' cannot be in both small and zero data regions simultaneously" msgstr "" -#: elf32-v850.c:689 +#: elf32-v850.c:686 #, c-format msgid "" "Variable `%s' cannot be in both small and tiny data regions simultaneously" msgstr "" -#: elf32-v850.c:692 +#: elf32-v850.c:689 #, c-format msgid "" "Variable `%s' cannot be in both zero and tiny data regions simultaneously" msgstr "" -#: elf32-v850.c:1070 +#: elf32-v850.c:1066 msgid "FAILED to find previous HI16 reloc\n" msgstr "" -#: elf32-v850.c:1689 +#: elf32-v850.c:1684 msgid "could not locate special linker symbol __gp" msgstr "" -#: elf32-v850.c:1693 +#: elf32-v850.c:1688 msgid "could not locate special linker symbol __ep" msgstr "" -#: elf32-v850.c:1697 +#: elf32-v850.c:1692 msgid "could not locate special linker symbol __ctbp" msgstr "" -#: elf32-v850.c:1886 +#: elf32-v850.c:1881 #, c-format msgid "%s: Architecture mismatch with previous modules" msgstr "" -#: elf32-v850.c:1905 +#: elf32-v850.c:1900 #, c-format msgid "private flags = %lx: " msgstr "" -#: elf32-v850.c:1910 +#: elf32-v850.c:1905 msgid "v850 architecture" msgstr "" -#: elf32-v850.c:1911 +#: elf32-v850.c:1906 msgid "v850e architecture" msgstr "" -#: elf32-v850.c:1912 +#: elf32-v850.c:1907 msgid "v850ea architecture" msgstr "" @@ -1006,175 +1148,175 @@ msgstr "" msgid "GPDISP relocation did not find ldah and lda instructions" msgstr "" -#: elf64-alpha.c:3004 +#: elf64-alpha.c:3014 #, c-format msgid "%s: .got subsegment exceeds 64K (size %d)" msgstr "" -#: elf64-sparc.c:1249 +#: elf64-sparc.c:1248 #, c-format msgid "%s: check_relocs: unhandled reloc type %d" msgstr "" -#: elf64-sparc.c:1286 +#: elf64-sparc.c:1285 msgid "%s: Only registers %%g[2367] can be declared using STT_REGISTER" msgstr "" -#: elf64-sparc.c:1306 +#: 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:1329 +#: elf64-sparc.c:1328 #, c-format msgid "Symbol `%s' has differing types: previously %s, REGISTER in %s" msgstr "" -#: elf64-sparc.c:1375 +#: elf64-sparc.c:1374 #, c-format msgid "Symbol `%s' has differing types: REGISTER in %s, %s in %s" msgstr "" -#: elf64-sparc.c:2825 +#: elf64-sparc.c:2952 #, c-format msgid "%s: linking UltraSPARC specific with HAL specific code" msgstr "" -#: elf.c:323 +#: elf.c:325 #, c-format msgid "%s: invalid string offset %u >= %lu for section `%s'" msgstr "" -#: elf.c:546 +#: elf.c:566 msgid "" "\n" "Program Header:\n" msgstr "" -#: elf.c:594 +#: elf.c:614 msgid "" "\n" "Dynamic Section:\n" msgstr "" -#: elf.c:696 +#: elf.c:743 msgid "" "\n" "Version definitions:\n" msgstr "" -#: elf.c:719 +#: elf.c:766 msgid "" "\n" "Version References:\n" msgstr "" -#: elf.c:724 +#: elf.c:771 #, c-format msgid " required from %s:\n" msgstr "" -#: elf.c:1286 +#: elf.c:1359 #, c-format msgid "%s: invalid link %lu for reloc section %s (index %u)" msgstr "" -#: elf.c:2045 +#: elf.c:2113 #, c-format msgid "" "creating section symbol, name = %s, value = 0x%.8lx, index = %d, section = " "0x%.8lx\n" msgstr "" -#: elf.c:2648 +#: elf.c:2716 #, c-format msgid "%s: Not enough room for program headers (allocated %u, need %u)" msgstr "" -#: elf.c:2747 +#: elf.c:2815 #, c-format msgid "%s: Not enough room for program headers, try linking with -N" msgstr "" -#: elf.c:2873 +#: elf.c:2941 #, c-format msgid "Error: First section in segment (%s) starts at 0x%x" msgstr "" -#: elf.c:2876 +#: elf.c:2944 #, c-format msgid " whereas segment starts at 0x%x" msgstr "" -#: elf.c:3146 +#: elf.c:3217 #, c-format msgid "%s: warning: allocated section `%s' not in segment" msgstr "" -#: elf.c:3528 +#: elf.c:3616 #, c-format msgid "%s: symbol `%s' required but not present" msgstr "" -#: elf.c:3537 +#: elf.c:3625 #, c-format msgid "" "elf_symbol_from_bfd_symbol 0x%.8lx, name = %s, sym num = %d, flags = " "0x%.8lx%s\n" msgstr "" -#: elf.c:3679 +#: elf.c:3866 #, c-format msgid "%s: warning: Empty loadable segment detected\n" msgstr "" -#: elf.c:4956 +#: elf.c:5213 #, c-format msgid "%s: unsupported relocation type %s" msgstr "" -#: elfcode.h:1061 +#: elfcode.h:1084 #, c-format msgid "%s: version count (%ld) does not match symbol count (%ld)" msgstr "" -#: elflink.c:423 +#: elflink.c:432 #, c-format msgid "%s: Section %s is already to large to put hole of %ld bytes in" msgstr "" -#: elflink.h:1388 +#: elflink.h:1465 #, c-format msgid "%s: %s: invalid version %u (max %d)" msgstr "" -#: elflink.h:1429 +#: elflink.h:1506 #, c-format msgid "%s: %s: invalid needed version %d" msgstr "" -#: elflink.h:1546 +#: elflink.h:1626 #, c-format msgid "Warning: size of symbol `%s' changed from %lu to %lu in %s" msgstr "" -#: elflink.h:1790 +#: elflink.h:1872 #, c-format msgid "%s: warning: unexpected redefinition of `%s'" msgstr "" -#: elflink.h:3480 +#: elflink.h:3659 #, c-format msgid "warning: type and size of dynamic symbol `%s' are not defined" msgstr "" -#: elflink.h:3752 +#: elflink.h:3931 #, c-format msgid "%s: undefined versioned symbol name %s" msgstr "" -#: elflink.h:4983 +#: elflink.h:5180 #, c-format msgid "%s: could not find output section %s for input section %s" msgstr "" @@ -1274,16 +1416,26 @@ msgstr "" msgid "%s: address 0x%s out of range for Intex Hex file" msgstr "" -#: libbfd.c:484 +#: libbfd.c:471 #, c-format msgid "not mapping: data=%lx mapped=%d\n" msgstr "" -#: libbfd.c:487 +#: libbfd.c:474 msgid "not mapping: env var not set\n" msgstr "" -#: linker.c:2679 +#: libbfd.c:1370 +#, c-format +msgid "%s: compiled for a big endian system and target is little endian" +msgstr "" + +#: libbfd.c:1372 +#, c-format +msgid "%s: compiled for a little endian system and target is big endian" +msgstr "" + +#: linker.c:2678 #, c-format msgid "Attempt to do relocateable link with %s input and %s output" msgstr "" @@ -1299,330 +1451,328 @@ msgid "Unhandled OSF/1 core file section type %d\n" msgstr "" #. XXX code yet to be written. -#: peicode.h:806 +#: peicode.h:807 #, c-format msgid "%s: Unhandled import type; %x" msgstr "" -#: peicode.h:811 +#: peicode.h:812 #, c-format msgid "%s: Unrecognised import type; %x" msgstr "" -#: peicode.h:825 +#: peicode.h:826 #, c-format msgid "%s: Unrecognised import name type; %x" msgstr "" -#: peicode.h:1182 +#: peicode.h:1183 #, c-format msgid "%s: Unrecognised machine type (0x%x) in Import Library Format archive" msgstr "" -#: peicode.h:1194 +#: peicode.h:1195 #, c-format msgid "" "%s: Recognised but unhandled machine type (0x%x) in Import Library Format " "archive" msgstr "" -#: peicode.h:1211 +#: peicode.h:1212 #, c-format msgid "%s: size field is zero in Import Library Format header" msgstr "" -#: peicode.h:1239 +#: peicode.h:1240 #, c-format msgid "%s: string not null terminated in ILF object file." msgstr "" -#: peigen.c:938 +#: peigen.c:993 #, c-format msgid "%s: line number overflow: 0x%lx > 0xffff" msgstr "" -#: peigen.c:950 +#: peigen.c:1011 #, c-format -msgid "%s: reloc overflow: 0x%lx > 0xffff" +msgid "%s: reloc overflow 1: 0x%lx > 0xffff" msgstr "" -#: peigen.c:963 +#: peigen.c:1024 msgid "Export Directory [.edata (or where ever we found it)]" msgstr "" -#: peigen.c:964 +#: peigen.c:1025 msgid "Import Directory [parts of .idata]" msgstr "" -#: peigen.c:965 +#: peigen.c:1026 msgid "Resource Directory [.rsrc]" msgstr "" -#: peigen.c:966 +#: peigen.c:1027 msgid "Exception Directory [.pdata]" msgstr "" -#: peigen.c:967 +#: peigen.c:1028 msgid "Security Directory" msgstr "" -#: peigen.c:968 +#: peigen.c:1029 msgid "Base Relocation Directory [.reloc]" msgstr "" -#: peigen.c:969 +#: peigen.c:1030 msgid "Debug Directory" msgstr "" -#: peigen.c:970 +#: peigen.c:1031 msgid "Description Directory" msgstr "" -#: peigen.c:971 +#: peigen.c:1032 msgid "Special Directory" msgstr "" -#: peigen.c:972 +#: peigen.c:1033 msgid "Thread Storage Directory [.tls]" msgstr "" -#: peigen.c:973 +#: peigen.c:1034 msgid "Load Configuration Directory" msgstr "" -#: peigen.c:974 +#: peigen.c:1035 msgid "Bound Import Directory" msgstr "" -#: peigen.c:975 +#: peigen.c:1036 msgid "Import Address Table Directory" msgstr "" -#: peigen.c:976 peigen.c:977 peigen.c:978 +#: peigen.c:1037 +msgid "Delay Import Directory" +msgstr "" + +#: peigen.c:1038 peigen.c:1039 msgid "Reserved" msgstr "" -#: peigen.c:1022 -msgid "" -"\n" -"The import table is the .idata section\n" -msgstr "" - -#: peigen.c:1044 +#: peigen.c:1103 msgid "" "\n" "There is an import table, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1048 +#: peigen.c:1108 #, c-format msgid "" "\n" "There is an import table in %s at 0x%lx\n" msgstr "" -#: peigen.c:1089 +#: peigen.c:1147 #, c-format msgid "" "\n" "Function descriptor located at the start address: %04lx\n" msgstr "" -#: peigen.c:1092 +#: peigen.c:1150 #, c-format msgid "\tcode-base %08lx toc (loadable/actual) %08lx/%08lx\n" msgstr "" -#: peigen.c:1098 +#: peigen.c:1156 msgid "" "\n" "No reldata section! Function descriptor not decoded.\n" msgstr "" -#: peigen.c:1103 +#: peigen.c:1161 +#, c-format msgid "" "\n" -"The Import Tables (interpreted .idata section contents)\n" +"The Import Tables (interpreted %s section contents)\n" msgstr "" -#: peigen.c:1105 +#: peigen.c:1164 msgid " vma: Hint Time Forward DLL First\n" msgstr "" -#: peigen.c:1107 +#: peigen.c:1166 msgid " Table Stamp Chain Name Thunk\n" msgstr "" -#: peigen.c:1157 +#: peigen.c:1216 #, c-format msgid "" "\n" "\tDLL Name: %s\n" msgstr "" -#: peigen.c:1161 peigen.c:1224 +#: peigen.c:1220 peigen.c:1283 msgid "\tvma: Hint/Ord Member-Name\n" msgstr "" -#: peigen.c:1223 +#: peigen.c:1282 msgid "\tThe Import Address Table (difference found)\n" msgstr "" -#: peigen.c:1230 +#: peigen.c:1289 msgid "\t>>> Ran out of IAT members!\n" msgstr "" -#: peigen.c:1248 +#: peigen.c:1308 msgid "\tThe Import Address Table is identical\n" msgstr "" -#: peigen.c:1297 -msgid "" -"\n" -"The export table is the .edata section\n" -msgstr "" - -#: peigen.c:1319 +#: peigen.c:1381 msgid "" "\n" "There is an export table, but the section containing it could not be found\n" msgstr "" -#: peigen.c:1323 +#: peigen.c:1386 #, c-format msgid "" "\n" "There is an export table in %s at 0x%lx\n" msgstr "" -#: peigen.c:1355 +#: peigen.c:1417 +#, c-format msgid "" "\n" -"The Export Tables (interpreted .edata section contents)\n" +"The Export Tables (interpreted %s section contents)\n" "\n" msgstr "" -#: peigen.c:1358 +#: peigen.c:1421 #, c-format msgid "Export Flags \t\t\t%lx\n" msgstr "" -#: peigen.c:1361 +#: peigen.c:1424 #, c-format msgid "Time/Date stamp \t\t%lx\n" msgstr "" -#: peigen.c:1364 +#: peigen.c:1427 #, c-format msgid "Major/Minor \t\t\t%d/%d\n" msgstr "" -#: peigen.c:1367 +#: peigen.c:1430 msgid "Name \t\t\t\t" msgstr "" -#: peigen.c:1373 +#: peigen.c:1436 #, c-format msgid "Ordinal Base \t\t\t%ld\n" msgstr "" -#: peigen.c:1376 +#: peigen.c:1439 msgid "Number in:\n" msgstr "" -#: peigen.c:1379 +#: peigen.c:1442 #, c-format -msgid "\tExport Address Table \t\t%lx\n" +msgid "\tExport Address Table \t\t%08lx\n" msgstr "" -#: peigen.c:1383 +#: peigen.c:1446 #, c-format -msgid "\t[Name Pointer/Ordinal] Table\t%lu\n" +msgid "\t[Name Pointer/Ordinal] Table\t%08lx\n" msgstr "" -#: peigen.c:1386 +#: peigen.c:1449 msgid "Table Addresses\n" msgstr "" -#: peigen.c:1389 +#: peigen.c:1452 msgid "\tExport Address Table \t\t" msgstr "" -#: peigen.c:1394 +#: peigen.c:1457 msgid "\tName Pointer Table \t\t" msgstr "" -#: peigen.c:1399 +#: peigen.c:1462 msgid "\tOrdinal Table \t\t\t" msgstr "" -#: peigen.c:1415 +#: peigen.c:1476 #, c-format msgid "" "\n" "Export Address Table -- Ordinal Base %ld\n" msgstr "" -#: peigen.c:1436 +#: peigen.c:1495 msgid "Forwarder RVA" msgstr "" -#: peigen.c:1444 +#: peigen.c:1506 msgid "Export RVA" msgstr "" -#: peigen.c:1451 +#: peigen.c:1513 msgid "" "\n" "[Ordinal/Name Pointer] Table\n" msgstr "" -#: peigen.c:1496 +#: peigen.c:1568 #, c-format msgid "Warning, .pdata section size (%ld) is not a multiple of %d\n" msgstr "" -#: peigen.c:1500 +#: peigen.c:1572 msgid "" "\n" "The Function Table (interpreted .pdata section contents)\n" msgstr "" -#: peigen.c:1502 +#: peigen.c:1575 +msgid " vma:\t\t\tBegin Address End Address Unwind Info\n" +msgstr "" + +#: peigen.c:1578 msgid " vma:\t\tBegin End EH EH PrologEnd Exception\n" msgstr "" -#: peigen.c:1504 +#: peigen.c:1580 msgid " \t\tAddress Address Handler Data Address Mask\n" msgstr "" -#: peigen.c:1576 +#: peigen.c:1652 msgid " Register save millicode" msgstr "" -#: peigen.c:1579 +#: peigen.c:1655 msgid " Register restore millicode" msgstr "" -#: peigen.c:1582 +#: peigen.c:1658 msgid " Glue code sequence" msgstr "" -#: peigen.c:1628 +#: peigen.c:1709 msgid "" "\n" "\n" "PE File Base Relocations (interpreted .reloc section contents)\n" msgstr "" -#: peigen.c:1663 +#: peigen.c:1744 #, c-format msgid "" "\n" "Virtual Address: %08lx Chunk size %ld (0x%lx) Number of fixups %ld\n" msgstr "" -#: peigen.c:1676 +#: peigen.c:1757 #, c-format msgid "\treloc %4d offset %4x [%4lx] %s" msgstr "" @@ -1630,232 +1780,242 @@ 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:1714 +#: peigen.c:1796 #, c-format msgid "" "\n" "Characteristics 0x%x\n" msgstr "" -#: pe-mips.c:657 +#: pe-mips.c:653 #, c-format msgid "%s: `ld -r' not supported with PE MIPS objects\n" msgstr "" -#: pe-mips.c:820 +#. 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:847 +#: pe-mips.c:842 #, c-format msgid "%s: bad pair/reflo after refhi\n" msgstr "" -#: ppcboot.c:418 +#: ppcboot.c:422 msgid "" "\n" "ppcboot header:\n" msgstr "" -#: ppcboot.c:419 +#: ppcboot.c:423 #, c-format msgid "Entry offset = 0x%.8lx (%ld)\n" msgstr "" -#: ppcboot.c:420 +#: ppcboot.c:424 #, c-format msgid "Length = 0x%.8lx (%ld)\n" msgstr "" -#: ppcboot.c:423 +#: ppcboot.c:427 #, c-format msgid "Flag field = 0x%.2x\n" msgstr "" -#: ppcboot.c:429 +#: ppcboot.c:433 #, c-format msgid "Partition name = \"%s\"\n" msgstr "" -#: ppcboot.c:448 +#: ppcboot.c:452 #, c-format msgid "" "\n" "Partition[%d] start = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" msgstr "" -#: ppcboot.c:454 +#: ppcboot.c:458 #, c-format msgid "Partition[%d] end = { 0x%.2x, 0x%.2x, 0x%.2x, 0x%.2x }\n" msgstr "" -#: ppcboot.c:460 +#: ppcboot.c:464 #, c-format msgid "Partition[%d] sector = 0x%.8lx (%ld)\n" msgstr "" -#: ppcboot.c:461 +#: ppcboot.c:465 #, c-format msgid "Partition[%d] length = 0x%.8lx (%ld)\n" msgstr "" -#: som.c:5335 +#: som.c:5355 msgid "som_sizeof_headers unimplemented" msgstr "" -#: srec.c:290 +#: srec.c:300 #, c-format msgid "%s:%d: Unexpected character `%s' in S-record file\n" msgstr "" -#: syms.c:974 +#: syms.c:968 msgid "Unsupported .stab relocation" msgstr "" -#: vms-gsd.c:357 +#: vms-gsd.c:354 #, c-format msgid "bfd_make_section (%s) failed" msgstr "" -#: vms-gsd.c:371 +#: vms-gsd.c:368 #, c-format msgid "bfd_set_section_flags (%s, %x) failed" msgstr "" -#: vms-gsd.c:407 +#: vms-gsd.c:404 #, c-format msgid "Size mismatch section %s=%lx, %s=%lx" msgstr "" -#: vms-gsd.c:702 +#: vms-gsd.c:699 #, c-format msgid "unknown gsd/egsd subtype %d" msgstr "" -#: vms-hdr.c:405 +#: vms-hdr.c:403 msgid "Object module NOT error-free !\n" msgstr "" -#: vms-misc.c:541 +#: vms-misc.c:539 #, c-format msgid "Stack overflow (%d) in _bfd_vms_push" msgstr "" -#: vms-misc.c:560 +#: vms-misc.c:557 msgid "Stack underflow in _bfd_vms_pop" msgstr "" -#: vms-misc.c:931 +#: vms-misc.c:915 msgid "_bfd_vms_output_counted called with zero bytes" msgstr "" -#: vms-misc.c:936 +#: vms-misc.c:920 msgid "_bfd_vms_output_counted called with too many bytes" msgstr "" -#: vms-misc.c:1069 +#: vms-misc.c:1051 #, c-format msgid "Symbol %s replaced by %s\n" msgstr "" -#: vms-misc.c:1133 +#: vms-misc.c:1113 #, c-format msgid "failed to enter %s" msgstr "" -#: vms-tir.c:69 +#: vms-tir.c:68 msgid "No Mem !" msgstr "" -#: vms-tir.c:309 +#: vms-tir.c:302 msgid "Bad section index in ETIR_S_C_STA_PQ" msgstr "" -#: vms-tir.c:324 +#: vms-tir.c:317 #, c-format msgid "Unsupported STA cmd %d" msgstr "" -#: vms-tir.c:329 vms-tir.c:1287 +#: vms-tir.c:322 vms-tir.c:1274 #, c-format msgid "Reserved STA cmd %d" msgstr "" -#: vms-tir.c:436 +#: vms-tir.c:428 #, c-format msgid "ETIR_S_C_STO_GBL: no symbol \"%s\"" msgstr "" -#: vms-tir.c:457 +#: vms-tir.c:449 #, c-format msgid "ETIR_S_C_STO_CA: no symbol \"%s\"" msgstr "" -#: vms-tir.c:470 +#: vms-tir.c:462 msgid "ETIR_S_C_STO_RB/AB: Not supported" msgstr "" -#: vms-tir.c:528 +#: vms-tir.c:520 msgid "ETIR_S_C_STO_LP_PSB: Not supported" msgstr "" -#: vms-tir.c:534 +#: vms-tir.c:526 msgid "ETIR_S_C_STO_HINT_GBL: not implemented" msgstr "" -#: vms-tir.c:540 +#: vms-tir.c:532 msgid "ETIR_S_C_STO_HINT_PS: not implemented" msgstr "" -#: vms-tir.c:544 vms-tir.c:1460 +#: vms-tir.c:536 vms-tir.c:1446 #, c-format msgid "Reserved STO cmd %d" msgstr "" -#: vms-tir.c:657 +#: vms-tir.c:649 msgid "ETIR_S_C_OPR_INSV: Not supported" msgstr "" -#: vms-tir.c:675 +#: vms-tir.c:667 msgid "ETIR_S_C_OPR_USH: Not supported" msgstr "" -#: vms-tir.c:681 +#: vms-tir.c:673 msgid "ETIR_S_C_OPR_ROT: Not supported" msgstr "" -#: vms-tir.c:700 +#: vms-tir.c:692 msgid "ETIR_S_C_OPR_REDEF: Not supported" msgstr "" -#: vms-tir.c:706 +#: vms-tir.c:698 msgid "ETIR_S_C_OPR_DFLIT: Not supported" msgstr "" -#: vms-tir.c:710 vms-tir.c:1656 +#: vms-tir.c:702 vms-tir.c:1641 #, c-format msgid "Reserved OPR cmd %d" msgstr "" -#: vms-tir.c:779 vms-tir.c:1726 +#: vms-tir.c:770 vms-tir.c:1710 #, c-format msgid "Reserved CTL cmd %d" msgstr "" -#: vms-tir.c:808 +#: vms-tir.c:798 msgid "ETIR_S_C_STC_LP: not supported" msgstr "" -#: vms-tir.c:826 +#: vms-tir.c:816 msgid "ETIR_S_C_STC_GBL: not supported" msgstr "" -#: vms-tir.c:834 +#: vms-tir.c:824 msgid "ETIR_S_C_STC_GCA: not supported" msgstr "" -#: vms-tir.c:843 +#: vms-tir.c:833 msgid "ETIR_S_C_STC_PS: not supported" msgstr "" @@ -1864,11 +2024,11 @@ msgstr "" #. * arg: - #. * #. -#: vms-tir.c:1187 +#: vms-tir.c:1174 msgid "Stack-from-image not implemented" msgstr "" -#: vms-tir.c:1207 +#: vms-tir.c:1194 msgid "Stack-entry-mask not fully implemented" msgstr "" @@ -1881,171 +2041,171 @@ msgstr "" #. * compare argument descriptor with symbol argument (ARG$V_PASSMECH) #. * and stack TRUE (args match) or FALSE (args dont match) value #. -#: vms-tir.c:1223 +#: vms-tir.c:1210 msgid "PASSMECH not fully implemented" msgstr "" -#: vms-tir.c:1243 +#: vms-tir.c:1230 msgid "Stack-local-symbol not fully implemented" msgstr "" -#: vms-tir.c:1258 +#: vms-tir.c:1245 msgid "Stack-literal not fully implemented" msgstr "" -#: vms-tir.c:1280 +#: vms-tir.c:1267 msgid "Stack-local-symbol-entry-point-mask not fully implemented" msgstr "" -#: vms-tir.c:1456 +#: vms-tir.c:1442 #, c-format msgid "Unimplemented STO cmd %d" msgstr "" -#: vms-tir.c:1596 +#: vms-tir.c:1581 msgid "TIR_S_C_OPR_ASH incomplete" msgstr "" -#: vms-tir.c:1610 +#: vms-tir.c:1595 msgid "TIR_S_C_OPR_USH incomplete" msgstr "" -#: vms-tir.c:1624 +#: vms-tir.c:1609 msgid "TIR_S_C_OPR_ROT incomplete" msgstr "" #. #. * redefine symbol to current location #. -#: vms-tir.c:1645 +#: vms-tir.c:1630 msgid "TIR_S_C_OPR_REDEF not supported" msgstr "" #. #. * define a literal #. -#: vms-tir.c:1652 +#: vms-tir.c:1637 msgid "TIR_S_C_OPR_DFLIT not supported" msgstr "" -#: vms-tir.c:1707 +#: vms-tir.c:1691 msgid "TIR_S_C_CTL_DFLOC not fully implemented" msgstr "" -#: vms-tir.c:1715 +#: vms-tir.c:1699 msgid "TIR_S_C_CTL_STLOC not fully implemented" msgstr "" -#: vms-tir.c:1723 +#: vms-tir.c:1707 msgid "TIR_S_C_CTL_STKDL not fully implemented" msgstr "" -#: vms-tir.c:1778 +#: vms-tir.c:1761 #, c-format msgid "Obj code %d not found" msgstr "" -#: vms-tir.c:2127 +#: vms-tir.c:2102 #, c-format msgid "SEC_RELOC with no relocs in section %s" msgstr "" -#: vms-tir.c:2401 +#: vms-tir.c:2376 #, c-format msgid "Unhandled relocation %s" msgstr "" -#: xcofflink.c:1661 +#: xcofflink.c:1634 #, c-format msgid "%s: `%s' has line numbers but no enclosing section" msgstr "" -#: xcofflink.c:1713 +#: xcofflink.c:1686 #, c-format msgid "%s: class %d symbol `%s' has no aux entries" msgstr "" -#: xcofflink.c:1736 +#: xcofflink.c:1709 #, c-format msgid "%s: symbol `%s' has unrecognized csect type %d" msgstr "" -#: xcofflink.c:1748 +#: xcofflink.c:1721 #, c-format msgid "%s: bad XTY_ER symbol `%s': class %d scnum %d scnlen %d" msgstr "" -#: xcofflink.c:1787 +#: xcofflink.c:1760 #, c-format msgid "%s: XMC_TC0 symbol `%s' is class %d scnlen %d" msgstr "" -#: xcofflink.c:1911 +#: xcofflink.c:1883 #, c-format msgid "%s: symbol `%s' has unrecognized smclas %d" msgstr "" -#: xcofflink.c:1930 +#: xcofflink.c:1902 #, c-format msgid "%s: csect `%s' not in enclosing section" msgstr "" -#: xcofflink.c:2034 +#: xcofflink.c:2006 #, c-format msgid "%s: misplaced XTY_LD `%s'" msgstr "" -#: xcofflink.c:2345 +#: xcofflink.c:2317 #, c-format msgid "%s: reloc %s:%d not in csect" msgstr "" -#: xcofflink.c:2480 +#: xcofflink.c:2452 #, c-format msgid "%s: XCOFF shared object when not producing XCOFF output" msgstr "" -#: xcofflink.c:2501 +#: xcofflink.c:2473 #, c-format msgid "%s: dynamic object with no .loader section" msgstr "" -#: xcofflink.c:3141 +#: xcofflink.c:3113 #, c-format msgid "%s: no such symbol" msgstr "" -#: xcofflink.c:3733 +#: xcofflink.c:3704 #, c-format msgid "warning: attempt to export undefined symbol `%s'" msgstr "" -#: xcofflink.c:4709 +#: xcofflink.c:4698 #, c-format msgid "TOC overflow: 0x%lx > 0x10000; try -mminimal-toc when compiling" msgstr "" -#: xcofflink.c:5534 xcofflink.c:5890 xcofflink.c:5927 xcofflink.c:6244 +#: xcofflink.c:5523 xcofflink.c:5879 xcofflink.c:5916 xcofflink.c:6233 #, c-format msgid "%s: loader reloc in unrecognized section `%s'" msgstr "" -#: xcofflink.c:5556 xcofflink.c:6255 +#: xcofflink.c:5545 xcofflink.c:6244 #, c-format msgid "%s: `%s' in loader reloc but not loader sym" msgstr "" -#: xcofflink.c:5571 +#: xcofflink.c:5560 #, c-format msgid "%s: loader reloc in read-only section %s" msgstr "" -#: xcofflink.c:6451 +#: xcofflink.c:6440 #, c-format msgid "%s: unsupported relocation type 0x%02x" msgstr "" -#: xcofflink.c:6497 +#: xcofflink.c:6486 #, c-format msgid "%s: TOC reloc at 0x%x to symbol `%s' with no TOC entry" msgstr "" diff --git a/gnu/dist/toolchain/bfd/ppcboot.c b/gnu/dist/toolchain/bfd/ppcboot.c index 9441848b3d37..d92a0a6f0d82 100644 --- a/gnu/dist/toolchain/bfd/ppcboot.c +++ b/gnu/dist/toolchain/bfd/ppcboot.c @@ -234,7 +234,7 @@ 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 + if (bfd_seek (abfd, offset + sizeof (ppcboot_hdr_t), SEEK_SET) != 0 || bfd_read (location, 1, count, abfd) != count) return false; return true; @@ -536,6 +536,6 @@ const bfd_target ppcboot_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + NULL }; diff --git a/gnu/dist/toolchain/bfd/ptrace-core.c b/gnu/dist/toolchain/bfd/ptrace-core.c index 0969dce4c054..2c19f6d058f1 100644 --- a/gnu/dist/toolchain/bfd/ptrace-core.c +++ b/gnu/dist/toolchain/bfd/ptrace-core.c @@ -32,7 +32,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include - struct trad_core_struct { asection *data_section; @@ -66,7 +65,7 @@ ptrace_unix_core_file_p (abfd) struct trad_core_struct *rawptr; val = bfd_read ((void *)&u, 1, sizeof u, abfd); - if (val != sizeof u || u.pt_magic != _BCS_PTRACE_MAGIC + if (val != sizeof u || u.pt_magic != _BCS_PTRACE_MAGIC || u.pt_rev != _BCS_PTRACE_REV) { /* Too small to be a core file */ @@ -83,7 +82,7 @@ ptrace_unix_core_file_p (abfd) if (rawptr == NULL) return 0; - + abfd->tdata.trad_core_data = rawptr; rawptr->u = u; /*Copy the uarea into the tdata part of the bfd */ @@ -107,8 +106,7 @@ ptrace_unix_core_file_p (abfd) /* 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 - system on which I am developing this for though. */ - + system on which I am developing this for though. */ core_stacksec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; core_datasec (abfd)->flags = SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS; @@ -116,11 +114,11 @@ ptrace_unix_core_file_p (abfd) core_datasec (abfd)->_raw_size = u.pt_dsize; core_stacksec (abfd)->_raw_size = u.pt_ssize; - core_regsec (abfd)->_raw_size = sizeof(u); + core_regsec (abfd)->_raw_size = sizeof (u); core_datasec (abfd)->vma = u.pt_o_data_start; core_stacksec (abfd)->vma = USRSTACK - u.pt_ssize; - core_regsec (abfd)->vma = 0 - sizeof(u); /* see trad-core.c */ + core_regsec (abfd)->vma = 0 - sizeof (u); /* see trad-core.c */ core_datasec (abfd)->filepos = (int) u.pt_dataptr; core_stacksec (abfd)->filepos = (int) (u.pt_dataptr + u.pt_dsize); @@ -163,16 +161,16 @@ boolean ptrace_unix_core_file_matches_executable_p (core_bfd, exec_bfd) bfd *core_bfd, *exec_bfd; { - /* FIXME: Use pt_timdat field of the ptrace_user structure to match + /* FIXME: Use pt_timdat field of the ptrace_user structure to match the date of the executable */ return true; } /* If somebody calls any byte-swapping routines, shoot them. */ static void -swap_abort() +swap_abort () { - abort(); /* This way doesn't require any declaration for ANSI to fuck up */ + abort (); /* This way doesn't require any declaration for ANSI to fuck up */ } #define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort ) #define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort ) @@ -213,7 +211,7 @@ const bfd_target ptrace_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 (ptrace_unix), @@ -225,7 +223,7 @@ const bfd_target ptrace_core_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 /* backend_data */ }; diff --git a/gnu/dist/toolchain/bfd/reloc.c b/gnu/dist/toolchain/bfd/reloc.c index ef2375a0d790..f37a6a96aff8 100644 --- a/gnu/dist/toolchain/bfd/reloc.c +++ b/gnu/dist/toolchain/bfd/reloc.c @@ -146,7 +146,6 @@ DESCRIPTION to the relocation offset. Its interpretation is dependent upon the howto. For example, on the 68k the code: - | char foo[]; | main() | { @@ -161,11 +160,9 @@ DESCRIPTION | unlk fp | rts - This could create a reloc pointing to <>, but leave the offset in the data, something like: - |RELOCATION RECORDS FOR [.text]: |offset type value |00000006 32 _foo @@ -176,21 +173,17 @@ DESCRIPTION |0000000c 4e5e ; unlk fp |0000000e 4e75 ; rts - Using coff and an 88k, some instructions don't have enough space in them to represent the full address range, and pointers have to be loaded in two parts. So you'd get something like: - | or.u r13,r0,hi16(_foo+0x12345678) | ld.b r2,r13,lo16(_foo+0x12345678) | jmp r1 - This should create two relocs, both pointing to <<_foo>>, and with 0x12340000 in their addend field. The data would consist of: - |RELOCATION RECORDS FOR [.text]: |offset type value |00000002 HVRT16 _foo+0x12340000 @@ -200,7 +193,6 @@ DESCRIPTION |00000004 1c4d5678 ; ld.b r2,r13,0x5678 |00000008 f400c001 ; jmp r1 - The relocation routine digs out the value from the data, adds it to the addend to get the original offset, and then adds the value of <<_foo>>. Note that all 32 bits have to be kept around @@ -223,7 +215,6 @@ DESCRIPTION Both relocs contain a pointer to <>, and the offsets contain junk. - |RELOCATION RECORDS FOR [.text]: |offset type value |00000004 HI22 _foo+0x12345678 @@ -235,7 +226,6 @@ DESCRIPTION |0000000c 81c7e008 ; ret |00000010 81e80000 ; restore - o <> The <> field can be imagined as a @@ -391,7 +381,6 @@ 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} @@ -399,7 +388,6 @@ 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) . @@ -589,7 +577,6 @@ DESCRIPTION */ - bfd_reloc_status_type bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, error_message) @@ -651,7 +638,6 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, else relocation = symbol->value; - reloc_target_output_section = symbol->section->output_section; /* Convert input-section-relative symbol value to absolute. */ @@ -728,8 +714,6 @@ bfd_perform_relocation (abfd, reloc_entry, data, input_section, output_bfd, /* WTF?? */ if (abfd->xvec->flavour == bfd_target_coff_flavour - && strcmp (abfd->xvec->name, "aixcoff-rs6000") != 0 - && strcmp (abfd->xvec->name, "xcoff-powermac") != 0 && strcmp (abfd->xvec->name, "coff-Intel-little") != 0 && strcmp (abfd->xvec->name, "coff-Intel-big") != 0) { @@ -992,7 +976,6 @@ DESCRIPTION */ - bfd_reloc_status_type bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, input_section, error_message) @@ -1124,8 +1107,6 @@ bfd_install_relocation (abfd, reloc_entry, data_start, data_start_offset, /* WTF?? */ if (abfd->xvec->flavour == bfd_target_coff_flavour - && strcmp (abfd->xvec->name, "aixcoff-rs6000") != 0 - && strcmp (abfd->xvec->name, "xcoff-powermac") != 0 && strcmp (abfd->xvec->name, "coff-Intel-little") != 0 && strcmp (abfd->xvec->name, "coff-Intel-big") != 0) { @@ -1784,7 +1765,6 @@ displacements off that register. These relocation types are handled specially, because the value the register will have is decided relatively late. - ENUM BFD_RELOC_I960_CALLJ ENUMDOC @@ -2081,6 +2061,25 @@ ENUMX ENUMDOC i386/elf relocations +ENUM + BFD_RELOC_X86_64_GOT32 +ENUMX + BFD_RELOC_X86_64_PLT32 +ENUMX + BFD_RELOC_X86_64_COPY +ENUMX + BFD_RELOC_X86_64_GLOB_DAT +ENUMX + BFD_RELOC_X86_64_JUMP_SLOT +ENUMX + BFD_RELOC_X86_64_RELATIVE +ENUMX + BFD_RELOC_X86_64_GOTPCREL +ENUMX + BFD_RELOC_X86_64_32S +ENUMDOC + x86-64/elf relocations + ENUM BFD_RELOC_NS32K_IMM_8 ENUMX @@ -2203,6 +2202,18 @@ ENUM ENUMDOC ARM 26 bit pc-relative branch. The lowest two bits must be zero and are not stored in the instruction. +ENUM + BFD_RELOC_ARM_PCREL_BLX +ENUMDOC + ARM 26 bit pc-relative branch. The lowest bit must be zero and is + not stored in the instruction. The 2nd lowest bit comes from a 1 bit + field in the instruction. +ENUM + BFD_RELOC_THUMB_PCREL_BLX +ENUMDOC + Thumb 22 bit pc-relative branch. The lowest bit must be zero and is + not stored in the instruction. The 2nd lowest bit comes from a 1 bit + field in the instruction. ENUM BFD_RELOC_ARM_IMMEDIATE ENUMX @@ -2295,6 +2306,20 @@ ENUMX BFD_RELOC_SH_DATA ENUMX BFD_RELOC_SH_LABEL +ENUMX + BFD_RELOC_SH_LOOP_START +ENUMX + BFD_RELOC_SH_LOOP_END +ENUMX + BFD_RELOC_SH_COPY +ENUMX + BFD_RELOC_SH_GLOB_DAT +ENUMX + BFD_RELOC_SH_JMP_SLOT +ENUMX + BFD_RELOC_SH_RELATIVE +ENUMX + BFD_RELOC_SH_GOTPC ENUMDOC Hitachi SH relocs. Not all of these appear in object files. @@ -2311,7 +2336,7 @@ ENUMDOC ENUM BFD_RELOC_ARC_B22_PCREL ENUMDOC - Argonaut RISC Core (ARC) relocs. + ARC Cores relocs. ARC 22 bit pc-relative branch. The lowest two bits must be zero and are not stored in the instruction. The high 20 bits are installed in bits 26 through 7 of the instruction. @@ -2537,6 +2562,39 @@ ENUMDOC significant 8 bits of a 24 bit word are placed into the least significant 8 bits of the opcode. +ENUM + BFD_RELOC_TIC54X_PARTLS7 +ENUMDOC + This is a 7bit reloc for the tms320c54x, where the least + significant 7 bits of a 16 bit word are placed into the least + significant 7 bits of the opcode. + +ENUM + BFD_RELOC_TIC54X_PARTMS9 +ENUMDOC + This is a 9bit DP reloc for the tms320c54x, where the most + significant 9 bits of a 16 bit word are placed into the least + significant 9 bits of the opcode. + +ENUM + BFD_RELOC_TIC54X_23 +ENUMDOC + This is an extended address 23-bit reloc for the tms320c54x. + +ENUM + BFD_RELOC_TIC54X_16_OF_23 +ENUMDOC + This is a 16-bit reloc for the tms320c54x, where the least + significant 16 bits of a 23-bit extended address are placed into + the opcode. + +ENUM + BFD_RELOC_TIC54X_MS7_OF_23 +ENUMDOC + This is a reloc for the tms320c54x, where the most + significant 7 bits of a 23-bit extended address are placed into + the opcode. + ENUM BFD_RELOC_FR30_48 ENUMDOC @@ -2606,7 +2664,7 @@ ENUM BFD_RELOC_AVR_16_PM ENUMDOC This is a 16 bit reloc for the AVR that stores 17 bit value (usually - program memory address) into 16 bits. + program memory address) into 16 bits. ENUM BFD_RELOC_AVR_LO8_LDI ENUMDOC @@ -2700,6 +2758,234 @@ ENUMDOC is stored in the reloc's addend. For Rel hosts, we are forced to put this offset in the reloc's section offset. +ENUM + BFD_RELOC_IA64_IMM14 +ENUMX + BFD_RELOC_IA64_IMM22 +ENUMX + BFD_RELOC_IA64_IMM64 +ENUMX + BFD_RELOC_IA64_DIR32MSB +ENUMX + BFD_RELOC_IA64_DIR32LSB +ENUMX + BFD_RELOC_IA64_DIR64MSB +ENUMX + BFD_RELOC_IA64_DIR64LSB +ENUMX + BFD_RELOC_IA64_GPREL22 +ENUMX + BFD_RELOC_IA64_GPREL64I +ENUMX + BFD_RELOC_IA64_GPREL32MSB +ENUMX + BFD_RELOC_IA64_GPREL32LSB +ENUMX + BFD_RELOC_IA64_GPREL64MSB +ENUMX + BFD_RELOC_IA64_GPREL64LSB +ENUMX + BFD_RELOC_IA64_LTOFF22 +ENUMX + BFD_RELOC_IA64_LTOFF64I +ENUMX + BFD_RELOC_IA64_PLTOFF22 +ENUMX + BFD_RELOC_IA64_PLTOFF64I +ENUMX + BFD_RELOC_IA64_PLTOFF64MSB +ENUMX + BFD_RELOC_IA64_PLTOFF64LSB +ENUMX + BFD_RELOC_IA64_FPTR64I +ENUMX + BFD_RELOC_IA64_FPTR32MSB +ENUMX + BFD_RELOC_IA64_FPTR32LSB +ENUMX + BFD_RELOC_IA64_FPTR64MSB +ENUMX + BFD_RELOC_IA64_FPTR64LSB +ENUMX + BFD_RELOC_IA64_PCREL21B +ENUMX + BFD_RELOC_IA64_PCREL21BI +ENUMX + BFD_RELOC_IA64_PCREL21M +ENUMX + BFD_RELOC_IA64_PCREL21F +ENUMX + BFD_RELOC_IA64_PCREL22 +ENUMX + BFD_RELOC_IA64_PCREL60B +ENUMX + BFD_RELOC_IA64_PCREL64I +ENUMX + BFD_RELOC_IA64_PCREL32MSB +ENUMX + BFD_RELOC_IA64_PCREL32LSB +ENUMX + BFD_RELOC_IA64_PCREL64MSB +ENUMX + BFD_RELOC_IA64_PCREL64LSB +ENUMX + BFD_RELOC_IA64_LTOFF_FPTR22 +ENUMX + BFD_RELOC_IA64_LTOFF_FPTR64I +ENUMX + BFD_RELOC_IA64_LTOFF_FPTR64MSB +ENUMX + BFD_RELOC_IA64_LTOFF_FPTR64LSB +ENUMX + BFD_RELOC_IA64_SEGREL32MSB +ENUMX + BFD_RELOC_IA64_SEGREL32LSB +ENUMX + BFD_RELOC_IA64_SEGREL64MSB +ENUMX + BFD_RELOC_IA64_SEGREL64LSB +ENUMX + BFD_RELOC_IA64_SECREL32MSB +ENUMX + BFD_RELOC_IA64_SECREL32LSB +ENUMX + BFD_RELOC_IA64_SECREL64MSB +ENUMX + BFD_RELOC_IA64_SECREL64LSB +ENUMX + BFD_RELOC_IA64_REL32MSB +ENUMX + BFD_RELOC_IA64_REL32LSB +ENUMX + BFD_RELOC_IA64_REL64MSB +ENUMX + BFD_RELOC_IA64_REL64LSB +ENUMX + BFD_RELOC_IA64_LTV32MSB +ENUMX + BFD_RELOC_IA64_LTV32LSB +ENUMX + BFD_RELOC_IA64_LTV64MSB +ENUMX + BFD_RELOC_IA64_LTV64LSB +ENUMX + BFD_RELOC_IA64_IPLTMSB +ENUMX + BFD_RELOC_IA64_IPLTLSB +ENUMX + BFD_RELOC_IA64_COPY +ENUMX + BFD_RELOC_IA64_TPREL22 +ENUMX + BFD_RELOC_IA64_TPREL64MSB +ENUMX + BFD_RELOC_IA64_TPREL64LSB +ENUMX + BFD_RELOC_IA64_LTOFF_TP22 +ENUMX + BFD_RELOC_IA64_LTOFF22X +ENUMX + BFD_RELOC_IA64_LDXMOV +ENUMDOC + Intel IA64 Relocations. + +ENUM + BFD_RELOC_M68HC11_HI8 +ENUMDOC + Motorola 68HC11 reloc. + This is the 8 bits high part of an absolute address. +ENUM + BFD_RELOC_M68HC11_LO8 +ENUMDOC + Motorola 68HC11 reloc. + This is the 8 bits low part of an absolute address. +ENUM + BFD_RELOC_M68HC11_3B +ENUMDOC + Motorola 68HC11 reloc. + This is the 3 bits of a value. + +ENUM + BFD_RELOC_CRIS_BDISP8 +ENUMX + BFD_RELOC_CRIS_UNSIGNED_5 +ENUMX + BFD_RELOC_CRIS_SIGNED_6 +ENUMX + BFD_RELOC_CRIS_UNSIGNED_6 +ENUMX + BFD_RELOC_CRIS_UNSIGNED_4 +ENUMDOC + These relocs are only used within the CRIS assembler. They are not + (at present) written to any object files. + +ENUM + BFD_RELOC_860_COPY +ENUMX + BFD_RELOC_860_GLOB_DAT +ENUMX + BFD_RELOC_860_JUMP_SLOT +ENUMX + BFD_RELOC_860_RELATIVE +ENUMX + BFD_RELOC_860_PC26 +ENUMX + BFD_RELOC_860_PLT26 +ENUMX + BFD_RELOC_860_PC16 +ENUMX + BFD_RELOC_860_LOW0 +ENUMX + BFD_RELOC_860_SPLIT0 +ENUMX + BFD_RELOC_860_LOW1 +ENUMX + BFD_RELOC_860_SPLIT1 +ENUMX + BFD_RELOC_860_LOW2 +ENUMX + BFD_RELOC_860_SPLIT2 +ENUMX + BFD_RELOC_860_LOW3 +ENUMX + BFD_RELOC_860_LOGOT0 +ENUMX + BFD_RELOC_860_SPGOT0 +ENUMX + BFD_RELOC_860_LOGOT1 +ENUMX + BFD_RELOC_860_SPGOT1 +ENUMX + BFD_RELOC_860_LOGOTOFF0 +ENUMX + BFD_RELOC_860_SPGOTOFF0 +ENUMX + BFD_RELOC_860_LOGOTOFF1 +ENUMX + BFD_RELOC_860_SPGOTOFF1 +ENUMX + BFD_RELOC_860_LOGOTOFF2 +ENUMX + BFD_RELOC_860_LOGOTOFF3 +ENUMX + BFD_RELOC_860_LOPC +ENUMX + BFD_RELOC_860_HIGHADJ +ENUMX + BFD_RELOC_860_HAGOT +ENUMX + BFD_RELOC_860_HAGOTOFF +ENUMX + BFD_RELOC_860_HAPC +ENUMX + BFD_RELOC_860_HIGH +ENUMX + BFD_RELOC_860_HIGOT +ENUMX + BFD_RELOC_860_HIGOTOFF +ENUMDOC + Intel i860 Relocations. + ENDSENUM BFD_RELOC_UNUSED CODE_FRAGMENT @@ -2707,7 +2993,6 @@ CODE_FRAGMENT .typedef enum bfd_reloc_code_real bfd_reloc_code_real_type; */ - /* FUNCTION bfd_reloc_type_lookup @@ -2723,7 +3008,6 @@ DESCRIPTION */ - reloc_howto_type * bfd_reloc_type_lookup (abfd, code) bfd *abfd; @@ -2735,7 +3019,6 @@ bfd_reloc_type_lookup (abfd, code) static reloc_howto_type bfd_howto_32 = HOWTO (0, 00, 2, 32, false, 0, complain_overflow_bitfield, 0, "VRT32", false, 0xffffffff, 0xffffffff, true); - /* INTERNAL_FUNCTION bfd_default_reloc_type_lookup @@ -2747,7 +3030,6 @@ SYNOPSIS DESCRIPTION Provides a default relocation lookup routine for any architecture. - */ reloc_howto_type * diff --git a/gnu/dist/toolchain/bfd/reloc16.c b/gnu/dist/toolchain/bfd/reloc16.c index 0e7c18abfd97..cb9636f8f106 100644 --- a/gnu/dist/toolchain/bfd/reloc16.c +++ b/gnu/dist/toolchain/bfd/reloc16.c @@ -1,5 +1,5 @@ /* 8 and 16 bit COFF relocation functions, for BFD. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 1998 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 2000 Free Software Foundation, Inc. Written by Cygnus Support. @@ -19,10 +19,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* -Most of this hacked by Steve Chamberlain, - sac@cygnus.com -*/ +/* Most of this hacked by Steve Chamberlain . */ /* These routines are used by coff-h8300 and coff-z8k to do relocation. @@ -53,7 +50,7 @@ bfd_coff_reloc16_get_value (reloc, link_info, input_section) asymbol *symbol = *(reloc->sym_ptr_ptr); /* A symbol holds a pointer to a section, and an offset from the base of the section. To relocate, we find where the section will - live in the output and add that in */ + live in the output and add that in. */ if (bfd_is_und_section (symbol->section) || bfd_is_com_section (symbol->section)) @@ -79,29 +76,29 @@ bfd_coff_reloc16_get_value (reloc, link_info, input_section) value = h->u.c.size; else { - if (! ((*link_info->callbacks->undefined_symbol) - (link_info, bfd_asymbol_name (symbol), - input_section->owner, input_section, reloc->address, - true))) + if (!((*link_info->callbacks->undefined_symbol) + (link_info, bfd_asymbol_name (symbol), + input_section->owner, input_section, reloc->address, + true))) abort (); value = 0; } } - else + else { - value = symbol->value + - symbol->section->output_offset + - symbol->section->output_section->vma; + value = symbol->value + + symbol->section->output_offset + + symbol->section->output_section->vma; } - - /* Add the value contained in the relocation */ + + /* Add the value contained in the relocation. */ value += reloc->addend; - + return value; } void -bfd_perform_slip(abfd, slip, input_section, value) +bfd_perform_slip (abfd, slip, input_section, value) bfd *abfd; unsigned int slip; asection *input_section; @@ -113,13 +110,13 @@ bfd_perform_slip(abfd, slip, input_section, value) BFD_ASSERT (s != (asymbol **) NULL); /* Find all symbols past this point, and make them know - what's happened */ - while (*s) + what's happened. */ + while (*s) { asymbol *p = *s; - if (p->section == input_section) + if (p->section == input_section) { - /* This was pointing into this section, so mangle it */ + /* This was pointing into this section, so mangle it. */ if (p->value > value) { p->value -= slip; @@ -136,17 +133,17 @@ bfd_perform_slip(abfd, slip, input_section, value) } } s++; - } + } } -boolean +boolean bfd_coff_reloc16_relax_section (abfd, i, link_info, again) bfd *abfd; asection *i; struct bfd_link_info *link_info; boolean *again; { - /* Get enough memory to hold the stuff */ + /* Get enough memory to hold the stuff. */ bfd *input_bfd = i->owner; asection *input_section = i; int *shrinks; @@ -166,7 +163,7 @@ bfd_coff_reloc16_relax_section (abfd, i, link_info, again) if (!reloc_vector && reloc_size > 0) return false; - /* Get the relocs and think about them */ + /* Get the relocs and think about them. */ reloc_count = bfd_canonicalize_reloc (input_bfd, input_section, reloc_vector, _bfd_generic_link_get_symbols (input_bfd)); @@ -190,7 +187,7 @@ bfd_coff_reloc16_relax_section (abfd, i, link_info, again) entire link, we could use the generic relaxing code in the linker and get better results, particularly for jsr->bsr and 24->16 bit memory reference relaxations. */ - + if (reloc_count > 0) { int another_pass = 0; @@ -208,7 +205,7 @@ bfd_coff_reloc16_relax_section (abfd, i, link_info, again) another_pass = 0; - for (i = 0, parent = reloc_vector; *parent; parent++, i++) + for (i = 0, parent = reloc_vector; *parent; parent++, i++) { /* Let the target/machine dependent code examine each reloc in this section and attempt to shrink it. */ @@ -224,15 +221,15 @@ bfd_coff_reloc16_relax_section (abfd, i, link_info, again) shrinks[j] += shrink - shrinks[i]; } } - - } while (another_pass); + } + while (another_pass); shrink = shrinks[reloc_count]; - free((char *)shrinks); + free ((char *) shrinks); } - input_section->_cooked_size -= shrink; - free((char *)reloc_vector); + input_section->_cooked_size -= shrink; + free ((char *) reloc_vector); return true; } @@ -250,7 +247,7 @@ bfd_coff_reloc16_get_relocated_section_contents(in_abfd, boolean relocateable; asymbol **symbols; { - /* Get enough memory to hold the stuff */ + /* Get enough memory to hold the stuff. */ bfd *input_bfd = link_order->u.indirect.section->owner; asection *input_section = link_order->u.indirect.section; long reloc_size = bfd_get_reloc_upper_bound (input_bfd, input_section); @@ -267,20 +264,19 @@ bfd_coff_reloc16_get_relocated_section_contents(in_abfd, data, relocateable, symbols); - /* read in the section */ - if (! bfd_get_section_contents(input_bfd, - input_section, - data, - 0, - input_section->_raw_size)) + /* Read in the section. */ + if (!bfd_get_section_contents(input_bfd, + input_section, + data, + 0, + input_section->_raw_size)) return NULL; - - - reloc_vector = (arelent **) bfd_malloc((size_t) reloc_size); + + reloc_vector = (arelent **) bfd_malloc ((size_t) reloc_size); if (!reloc_vector && reloc_size != 0) return NULL; - - reloc_count = bfd_canonicalize_reloc (input_bfd, + + reloc_count = bfd_canonicalize_reloc (input_bfd, input_section, reloc_vector, symbols); @@ -289,49 +285,46 @@ bfd_coff_reloc16_get_relocated_section_contents(in_abfd, free (reloc_vector); return NULL; } - + if (reloc_count > 0) { arelent **parent = reloc_vector; - arelent *reloc ; + arelent *reloc; unsigned int dst_address = 0; unsigned int src_address = 0; unsigned int run; unsigned int idx; - - /* Find how long a run we can do */ - while (dst_address < link_order->size) + + /* Find how long a run we can do. */ + while (dst_address < link_order->size) { reloc = *parent; - if (reloc) + if (reloc) { /* Note that the relaxing didn't tie up the addresses in the relocation, so we use the original address to work out the - run of non-relocated data */ + run of non-relocated data. */ run = reloc->address - src_address; parent++; } - else + else { run = link_order->size - dst_address; } - /* Copy the bytes */ + + /* Copy the bytes. */ for (idx = 0; idx < run; idx++) - { - data[dst_address++] = data[src_address++]; - } - - /* Now do the relocation */ - - if (reloc) + data[dst_address++] = data[src_address++]; + + /* Now do the relocation. */ + if (reloc) { bfd_coff_reloc16_extra_cases (input_bfd, link_info, link_order, reloc, data, &src_address, &dst_address); - } + } } } - free((char *)reloc_vector); + free ((char *) reloc_vector); return data; } - diff --git a/gnu/dist/toolchain/bfd/riscix.c b/gnu/dist/toolchain/bfd/riscix.c index b3eb18cc5345..9aa9a49a8a98 100644 --- a/gnu/dist/toolchain/bfd/riscix.c +++ b/gnu/dist/toolchain/bfd/riscix.c @@ -1,7 +1,8 @@ /* BFD back-end for RISC iX (Acorn, arm) binaries. - Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. + Copyright (C) 1994, 95, 96, 97, 98, 99, 2000 + Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) - + This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify @@ -18,7 +19,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. */ - /* RISC iX overloads the MAGIC field to indicate more than just the usual [ZNO]MAGIC values. Also included are squeezing information and shared library usage. */ @@ -36,17 +36,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define SPOMAGIC (MF_USES_SL|OMAGIC) /* OMAGIC with large header */ /* -- may contain a ref to a */ /* shared lib required by the */ - /* object. */ + /* object. */ #define SLOMAGIC (MF_IS_SL|OMAGIC) /* A reference to a shared library */ /* The text portion of the object */ /* contains "overflow text" from */ /* the shared library to be linked */ /* in with an object */ -#define QMAGIC (MF_SQUEEZED|ZMAGIC) /* Sqeezed demand paged. */ +#define QMAGIC (MF_SQUEEZED|ZMAGIC) /* Sqeezed demand paged. */ /* NOTE: This interpretation of */ /* QMAGIC seems to be at variance */ /* With that used on other */ - /* architectures. */ + /* architectures. */ #define SPZMAGIC (MF_USES_SL|ZMAGIC) /* program which uses sl */ #define SPQMAGIC (MF_USES_SL|QMAGIC) /* sqeezed ditto */ #define SLZMAGIC (MF_IS_SL|ZMAGIC) /* shared lib part of prog */ @@ -115,20 +115,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 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 (! riscix_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; \ } \ } @@ -162,7 +162,6 @@ static reloc_howto_type riscix_std_reloc_howto[] = { #define RISCIX_TABLE_SIZE \ (sizeof (riscix_std_reloc_howto) / sizeof (reloc_howto_type)) - static bfd_reloc_status_type riscix_fix_pcrel_26_done (abfd, reloc_entry, symbol, data, input_section, output_bfd, error_message) @@ -193,7 +192,7 @@ riscix_fix_pcrel_26 (abfd, reloc_entry, symbol, data, input_section, bfd_size_type addr = reloc_entry->address; 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 (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0) @@ -233,14 +232,14 @@ riscix_fix_pcrel_26 (abfd, reloc_entry, symbol, data, input_section, /* 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 = &riscix_std_reloc_howto[7]; - + return flag; } reloc_howto_type * -DEFUN(riscix_reloc_type_lookup,(abfd,code), - bfd *abfd AND - bfd_reloc_code_real_type code) +riscix_reloc_type_lookup (abfd, code) + bfd *abfd; + bfd_reloc_code_real_type code; { #define ASTD(i,j) case i: return &riscix_std_reloc_howto[j] if (code == BFD_RELOC_CTOR) @@ -303,10 +302,9 @@ riscix_swap_std_reloc_out (abfd, g, natptr) /* For RISC iX, in pc-relative relocs the r_pcrel bit means that the relocation has been done already (Only for the 26-bit one I think)???!!! */ - + if (r_length == 3) r_pcrel = r_pcrel ? 0 : 1; - #if 0 /* For a standard reloc, the addend is in the object file. */ @@ -381,7 +379,7 @@ riscix_squirt_out_relocs (abfd, section) arelent **generic; unsigned char *native, *natptr; size_t each_size; - + unsigned int count = section->reloc_count; size_t natsize; @@ -411,13 +409,12 @@ riscix_squirt_out_relocs (abfd, section) return true; } - /* * This is just like the standard aoutx.h version but we need to do our * own mapping of external reloc type values to howto entries. */ long -MY(canonicalize_reloc)(abfd, section, relptr, symbols) +MY(canonicalize_reloc) (abfd, section, relptr, symbols) bfd *abfd; sec_ptr section; arelent **relptr; @@ -427,7 +424,7 @@ MY(canonicalize_reloc)(abfd, section, relptr, symbols) unsigned int count, c; extern reloc_howto_type NAME(aout,std_howto_table)[]; - /* If we have already read in the relocation table, return the values. */ + /* If we have already read in the relocation table, return the values. */ if (section->flags & SEC_CONSTRUCTOR) { arelent_chain *chain = section->constructor_chain; @@ -445,7 +442,7 @@ MY(canonicalize_reloc)(abfd, section, relptr, symbols) return section->reloc_count; } - if (!NAME(aout,slurp_reloc_table)(abfd, section, symbols)) + if (!NAME(aout,slurp_reloc_table) (abfd, section, symbols)) return -1; tblptr = section->relocation; @@ -462,7 +459,7 @@ MY(canonicalize_reloc)(abfd, section, relptr, symbols) return section->reloc_count; } -/* This is the same as NAME(aout,some_aout_object_p), but has different +/* This is the same as NAME(aout,some_aout_object_p), but has different expansions of the macro definitions. */ const bfd_target * @@ -474,7 +471,7 @@ riscix_some_aout_object_p (abfd, execp, callback_to_real_object_p) struct aout_data_struct *rawptr, *oldrawptr; const bfd_target *result; - rawptr = ((struct aout_data_struct *) + rawptr = ((struct aout_data_struct *) bfd_zalloc (abfd, sizeof (struct aout_data_struct ))); if (rawptr == NULL) @@ -505,8 +502,7 @@ riscix_some_aout_object_p (abfd, execp, callback_to_real_object_p) if (N_DYNAMIC(*execp)) abfd->flags |= DYNAMIC; - - if ((execp->a_info & MF_SQUEEZED) != 0) /* Squeezed files aren't supported + if ((execp->a_info & MF_SQUEEZED) != 0) /* Squeezed files aren't supported (yet)! */ { bfd_set_error (bfd_error_wrong_format); @@ -544,7 +540,7 @@ riscix_some_aout_object_p (abfd, execp, callback_to_real_object_p) /* The default relocation entry size is that of traditional V7 Unix. */ obj_reloc_entry_size (abfd) = RELOC_STD_SIZE; - /* The default symbol entry size is that of traditional Unix. */ + /* The default symbol entry size is that of traditional Unix. */ obj_symbol_entry_size (abfd) = EXTERNAL_NLIST_SIZE; obj_aout_external_syms (abfd) = NULL; @@ -567,7 +563,7 @@ riscix_some_aout_object_p (abfd, execp, callback_to_real_object_p) : (SEC_ALLOC | SEC_LOAD | SEC_DATA | SEC_HAS_CONTENTS)); obj_bsssec (abfd)->flags = SEC_ALLOC; - result = (*callback_to_real_object_p)(abfd); + result = (*callback_to_real_object_p) (abfd); #if defined(MACH) || defined(STAT_FOR_EXEC) /* The original heuristic doesn't work in some important cases. The @@ -610,7 +606,6 @@ riscix_some_aout_object_p (abfd, execp, callback_to_real_object_p) return result; } - static const bfd_target * MY(object_p) (abfd) bfd *abfd; @@ -633,12 +628,11 @@ MY(object_p) (abfd) if (!(MACHTYPE_OK (N_MACHTYPE (exec)))) return 0; #endif - NAME(aout,swap_exec_header_in)(abfd, &exec_bytes, &exec); + NAME(aout,swap_exec_header_in) (abfd, &exec_bytes, &exec); target = riscix_some_aout_object_p (abfd, &exec, MY(callback)); return target; } - #include "aout-target.h" diff --git a/gnu/dist/toolchain/bfd/rs6000-core.c b/gnu/dist/toolchain/bfd/rs6000-core.c index 6de7441b3eb9..11cf9aa0d1af 100644 --- a/gnu/dist/toolchain/bfd/rs6000-core.c +++ b/gnu/dist/toolchain/bfd/rs6000-core.c @@ -5,7 +5,7 @@ Using the following chars caused a compiler warning on HIUX (so I replaced them with octal escapes), and isn't useful without an understanding of what character set it is. - Written by Metin G. Ozisik, Mimi Ph\373\364ng-Th\345o V\365, + Written by Metin G. Ozisik, Mimi Ph\373\364ng-Th\345o V\365, and John Gilmore. Archive support from Damon A. Permezel. Contributed by IBM Corporation and Cygnus Support. @@ -30,8 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ compiled on an RS/6000 host. -- no archive support, no core files. In all cases, it does not support writing. - FIXMEmgo comments are left from Metin Ozisik's original port. - This is in a separate file from coff-rs6000.c, because it includes system include files that conflict with coff/rs6000.h. */ @@ -62,70 +60,217 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #undef SCNHDR - /* ------------------------------------------------------------------------ */ -/* Support for core file stuff.. */ +/* Support for core file stuff.. */ /* ------------------------------------------------------------------------ */ #include +#define __LDINFO_PTRACE32__ /* for __ld_info32 */ +#define __LDINFO_PTRACE64__ /* for __ld_info64 */ #include #include +#include +#define core_hdr(bfd) ((CoreHdr *) bfd->tdata.any) -/* Number of special purpose registers supported by gdb. This value - should match `tm.h' in gdb directory. Clean this mess up and use - the macros in sys/reg.h. FIXMEmgo. */ +/* AIX 4.1 changed the names and locations of a few items in the core file. + AIX 4.3 defined an entirely new structure, core_dumpx, but kept support for + the previous 4.1 structure, core_dump. -#define NUM_OF_SPEC_REGS 7 + AIX_CORE_DUMPX_CORE is defined (by configure) on AIX 4.3+, and + CORE_VERSION_1 is defined (by AIX core.h) as 2 on AIX 4.3+ and as 1 on AIX + 4.1 and 4.2. AIX pre-4.1 (aka 3.x) either doesn't define CORE_VERSION_1 + or else defines it as 0. */ -#define core_hdr(bfd) (((Rs6kCorData*)(bfd->tdata.any))->hdr) +#if defined(CORE_VERSION_1) && !CORE_VERSION_1 +# undef CORE_VERSION_1 +#endif -/* AIX 4.1 Changed the names and locations of a few items in the core file, - this seems to be the quickest/easiest way to deal with it. +/* The following union and macros allow this module to compile on all AIX + versions and to handle both core_dumpx and core_dump on 4.3+. CNEW_*() + and COLD_*() macros respectively retrieve core_dumpx and core_dump + values. */ - Note however that encoding magic addresses (STACK_END_ADDR) is going - to be _very_ fragile. But I don't see any easy way to get that info - right now. - - AIX 4.3 defines an entirely new structure (core_dumpx). Yet the - basic logic stays the same and we can still use our macro - redefinition mechanism to effect the necessary changes. */ +/* Union of 32-bit and 64-bit versions of ld_info. */ + +typedef union { +#ifdef __ld_info32 + struct __ld_info32 l32; + struct __ld_info64 l64; +#else + struct ld_info l32; + struct ld_info l64; +#endif +} LdInfo; + +/* Union of old and new core dump structures. */ + +typedef union { +#ifdef AIX_CORE_DUMPX_CORE + struct core_dumpx new; /* new AIX 4.3+ core dump */ +#else + struct core_dump new; /* for simpler coding */ +#endif + struct core_dump old; /* old AIX 4.2- core dump, still used on + 4.3+ with appropriate SMIT config */ +} CoreHdr; + +/* Union of old and new vm_info structures. */ + +#ifdef CORE_VERSION_1 +typedef union { +#ifdef AIX_CORE_DUMPX_CORE + struct vm_infox new; +#else + struct vm_info new; +#endif + struct vm_info old; +} VmInfo; +#endif + +/* Return whether CoreHdr C is in new or old format. */ #ifdef AIX_CORE_DUMPX_CORE -#define CORE_DATA_SIZE_FIELD c_dataorg -#define CORE_COMM_FIELD c_u.U_proc.pi_comm -#define SAVE_FIELD c_flt.hctx.r32 -#define STACK_END_ADDR coredata.c_stackorg + coredata.c_size -#define LOADER_OFFSET_FIELD c_loader -#define LOADER_REGION_SIZE coredata.c_lsize -#define CORE_DUMP core_dumpx +# define CORE_NEW(c) (!(c).old.c_entries) #else +# define CORE_NEW(c) 0 +#endif + +/* Return the c_stackorg field from struct core_dumpx C. */ + +#ifdef AIX_CORE_DUMPX_CORE +# define CNEW_STACKORG(c) (c).c_stackorg +#else +# define CNEW_STACKORG(c) 0 +#endif + +/* Return the offset to the loader region from struct core_dump C. */ + +#ifdef AIX_CORE_DUMPX_CORE +# define CNEW_LOADER(c) (c).c_loader +#else +# define CNEW_LOADER(c) 0 +#endif + +/* Return the offset to the loader region from struct core_dump C. */ + +#define COLD_LOADER(c) (c).c_tab + +/* Return the c_lsize field from struct core_dumpx C. */ + +#ifdef AIX_CORE_DUMPX_CORE +# define CNEW_LSIZE(c) (c).c_lsize +#else +# define CNEW_LSIZE(c) 0 +#endif + +/* Return the c_dataorg field from struct core_dumpx C. */ + +#ifdef AIX_CORE_DUMPX_CORE +# define CNEW_DATAORG(c) (c).c_dataorg +#else +# define CNEW_DATAORG(c) 0 +#endif + +/* Return the c_datasize field from struct core_dumpx C. */ + +#ifdef AIX_CORE_DUMPX_CORE +# define CNEW_DATASIZE(c) (c).c_datasize +#else +# define CNEW_DATASIZE(c) 0 +#endif + +/* Return the c_impl field from struct core_dumpx C. */ + +#ifdef AIX_CORE_DUMPX_CORE +# define CNEW_IMPL(c) (c).c_impl +#else +# define CNEW_IMPL(c) 0 +#endif + +/* Return the command string from struct core_dumpx C. */ + +#ifdef AIX_CORE_DUMPX_CORE +# define CNEW_COMM(c) (c).c_u.U_proc.pi_comm +#else +# define CNEW_COMM(c) 0 +#endif + +/* Return the command string from struct core_dump C. */ + #ifdef CORE_VERSION_1 -#define CORE_DATA_SIZE_FIELD c_u.U_dsize -#define CORE_COMM_FIELD c_u.U_comm -#define SAVE_FIELD c_mst -#define STACK_END_ADDR 0x2ff23000 -#define LOADER_OFFSET_FIELD c_tab -#define LOADER_REGION_SIZE 0x7ffffff -#define CORE_DUMP core_dump +# define COLD_COMM(c) (c).c_u.U_comm #else -#define CORE_DATA_SIZE_FIELD c_u.u_dsize -#define CORE_COMM_FIELD c_u.u_comm -#define SAVE_FIELD c_u.u_save -#define STACK_END_ADDR 0x2ff80000 -#define LOADER_OFFSET_FIELD c_tab -#define LOADER_REGION_SIZE 0x7ffffff -#define CORE_DUMP core_dump -#endif +# define COLD_COMM(c) (c).c_u.u_comm #endif -/* These are stored in the bfd's tdata */ -typedef struct { - struct CORE_DUMP hdr; /* core file header */ -} Rs6kCorData; +/* Return the struct __context64 pointer from struct core_dumpx C. */ -static asection *make_bfd_asection PARAMS ((bfd *, CONST char *, flagword, - bfd_size_type, bfd_vma, file_ptr)); +#ifdef AIX_CORE_DUMPX_CORE +# define CNEW_CONTEXT64(c) (c).c_flt.hctx.r64 +#else +# define CNEW_CONTEXT64(c) c +#endif + +/* Return the struct mstsave pointer from struct core_dumpx C. */ + +#ifdef AIX_CORE_DUMPX_CORE +# define CNEW_MSTSAVE(c) (c).c_flt.hctx.r32 +#else +# define CNEW_MSTSAVE(c) c +#endif + +/* Return the struct mstsave pointer from struct core_dump C. */ + +#ifdef CORE_VERSION_1 +# define COLD_MSTSAVE(c) (c).c_mst +#else +# define COLD_MSTSAVE(c) (c).c_u.u_save +#endif + +/* Return whether struct core_dumpx is from a 64-bit process. */ + +#ifdef AIX_CORE_DUMPX_CORE +# define CNEW_PROC64(c) IS_PROC64(&(c).c_u.U_proc) +#else +# define CNEW_PROC64(c) 0 +#endif + +/* Magic end-of-stack addresses for old core dumps. This is _very_ fragile, + but I don't see any easy way to get that info right now. */ + +#ifdef CORE_VERSION_1 +# define COLD_STACKEND 0x2ff23000 +#else +# define COLD_STACKEND 0x2ff80000 +#endif + +/* Size of the leading portion that old and new core dump structures have in + common. */ +#define CORE_COMMONSZ ((int)&((struct core_dump *)0)->c_entries + \ + sizeof (((struct core_dump *)0)->c_entries)) + +/* Try to read into CORE the header from the core file associated with ABFD. + Return success. */ + +static boolean +read_hdr (bfd *abfd, CoreHdr *core) +{ + bfd_size_type size; + + if (bfd_seek (abfd, 0, SEEK_SET) != 0) + return false; + + /* Read the leading portion that old and new core dump structures have in + common. */ + if (bfd_read (core, CORE_COMMONSZ, 1, abfd) != CORE_COMMONSZ) + return false; + + /* Read the trailing portion of the structure. */ + size = CORE_NEW (*core) ? sizeof (core->new) : sizeof (core->old) + - CORE_COMMONSZ; + return bfd_read ((char *)core + CORE_COMMONSZ, size, 1, abfd) == size; +} static asection * make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos) @@ -152,28 +297,71 @@ make_bfd_asection (abfd, name, flags, _raw_size, vma, filepos) } /* Decide if a given bfd represents a `core' file or not. There really is no - magic number or anything like, in rs6000coff. */ + magic number or anything like, in rs6000coff. */ const bfd_target * rs6000coff_core_p (abfd) bfd *abfd; { - struct CORE_DUMP coredata; + CoreHdr core; struct stat statbuf; - bfd_size_type nread; + bfd_size_type size; char *tmpptr; - if (bfd_seek (abfd, 0, SEEK_SET) != 0) - return NULL; + /* Values from new and old core structures. */ + int c_flag; + file_ptr c_stack, c_regoff, c_loader; + bfd_size_type c_size, c_regsize, c_lsize; + bfd_vma c_stackend; + void *c_regptr; + int proc64; - nread = bfd_read (&coredata, 1, sizeof (struct CORE_DUMP), abfd); - if (nread != sizeof (struct CORE_DUMP)) + if (!read_hdr (abfd, &core)) { if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); return NULL; } + /* Copy fields from new or old core structure. */ + if (CORE_NEW (core)) + { + c_flag = core.new.c_flag; + c_stack = (file_ptr) core.new.c_stack; + c_size = core.new.c_size; + c_stackend = CNEW_STACKORG (core.new) + c_size; + c_lsize = CNEW_LSIZE (core.new); + c_loader = CNEW_LOADER (core.new); + proc64 = CNEW_PROC64 (core.new); + } + else + { + c_flag = core.old.c_flag; + c_stack = (file_ptr) core.old.c_stack; + c_size = core.old.c_size; + c_stackend = COLD_STACKEND; + c_lsize = 0x7ffffff; + c_loader = (file_ptr) COLD_LOADER (core.old); + proc64 = 0; + } + + if (proc64) + { + c_regsize = sizeof (CNEW_CONTEXT64 (core.new)); + c_regptr = &CNEW_CONTEXT64 (core.new); + } + else if (CORE_NEW (core)) + { + c_regsize = sizeof (CNEW_MSTSAVE (core.new)); + c_regptr = &CNEW_MSTSAVE (core.new); + } + else + { + c_regsize = sizeof (COLD_MSTSAVE (core.old)); + c_regptr = &COLD_MSTSAVE (core.old); + } + c_regoff = (char *)c_regptr - (char *)&core; + if (bfd_stat (abfd, &statbuf) < 0) { bfd_set_error (bfd_error_system_call); @@ -190,92 +378,92 @@ rs6000coff_core_p (abfd) For the data segment, we have no choice but to keep going if it's not there, since the default behavior is not to dump it (regardless - of the ulimit, it's based on SA_FULLDUMP). But for the stack segment, + of the ulimit, it's based on SA_FULLDUMP). But for the stack segment, if it's not there, we refuse to have anything to do with this core file. The usefulness of a core dump without a stack segment is pretty limited anyway. */ - - if (!(coredata.c_flag & UBLOCK_VALID) - || !(coredata.c_flag & LE_VALID)) + + if (!(c_flag & UBLOCK_VALID) + || !(c_flag & LE_VALID)) { bfd_set_error (bfd_error_wrong_format); return NULL; } - if (!(coredata.c_flag & USTACK_VALID)) + if (!(c_flag & USTACK_VALID)) { bfd_set_error (bfd_error_file_truncated); return NULL; } /* Don't check the core file size for a full core, AIX 4.1 includes - additional shared library sections in a full core. */ - if (!(coredata.c_flag & (FULL_CORE | CORE_TRUNC)) - && ((bfd_vma)coredata.c_stack + coredata.c_size) != statbuf.st_size) + additional shared library sections in a full core. */ + if (!(c_flag & (FULL_CORE | CORE_TRUNC))) { /* If the size is wrong, it means we're misinterpreting something. */ - bfd_set_error (bfd_error_wrong_format); - return NULL; + if (c_stack + (file_ptr) c_size != statbuf.st_size) + { + bfd_set_error (bfd_error_wrong_format); + return NULL; + } } -#ifdef AIX_CORE_DUMPX_CORE - /* For the core_dumpx format, make sure c_entries == 0 If it does - not, the core file uses the old format */ - if (coredata.c_entries != 0) - { - bfd_set_error (bfd_error_wrong_format); - return NULL; - } -#else /* Sanity check on the c_tab field. */ - if ((u_long) coredata.c_tab < sizeof coredata || - (u_long) coredata.c_tab >= statbuf.st_size || - (long) coredata.c_tab >= (long)coredata.c_stack) + if (!CORE_NEW (core) && (c_loader < (file_ptr) sizeof core.old || + c_loader >= statbuf.st_size || + c_loader >= c_stack)) { bfd_set_error (bfd_error_wrong_format); return NULL; } -#endif /* Issue warning if the core file was truncated during writing. */ - if (coredata.c_flag & CORE_TRUNC) + if (c_flag & CORE_TRUNC) (*_bfd_error_handler) (_("%s: warning core file truncated"), bfd_get_filename (abfd)); - /* Allocate core file header. */ - tmpptr = (char*) bfd_zalloc (abfd, sizeof (Rs6kCorData)); + /* Allocate core file header. */ + size = CORE_NEW (core) ? sizeof (core.new) : sizeof (core.old); + tmpptr = (char*) bfd_zalloc (abfd, size); if (!tmpptr) return NULL; - - set_tdata (abfd, tmpptr); /* Copy core file header. */ - core_hdr (abfd) = coredata; + memcpy (tmpptr, &core, size); + set_tdata (abfd, tmpptr); - /* .stack section. */ + /* Set architecture. */ + if (CORE_NEW (core)) + { + enum bfd_architecture arch; + unsigned long mach; + + switch (CNEW_IMPL (core.new)) + { + case POWER_RS1: + case POWER_RSC: + case POWER_RS2: + arch = bfd_arch_rs6000; + mach = bfd_mach_rs6k; + break; + default: + arch = bfd_arch_powerpc; + mach = bfd_mach_ppc; + break; + } + bfd_default_set_arch_mach (abfd, arch, mach); + } + + /* .stack section. */ if (!make_bfd_asection (abfd, ".stack", - SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS, - (bfd_size_type) coredata.c_size, - (bfd_vma) (STACK_END_ADDR - coredata.c_size), - (file_ptr) coredata.c_stack)) + SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS, + c_size, c_stackend - c_size, c_stack)) return NULL; - /* .reg section for GPRs and special registers. */ + /* .reg section for all registers. */ if (!make_bfd_asection (abfd, ".reg", - SEC_HAS_CONTENTS, - (bfd_size_type) ((32 + NUM_OF_SPEC_REGS) * 4), - (bfd_vma) 0, - (file_ptr) ((char *) &coredata.SAVE_FIELD - - (char *) &coredata))) - return NULL; - - /* .reg2 section for FPRs (floating point registers). */ - if (!make_bfd_asection (abfd, ".reg2", - SEC_HAS_CONTENTS, - (bfd_size_type) 8 * 32, /* 32 FPRs. */ - (bfd_vma) 0, - (file_ptr) ((char *) &coredata.SAVE_FIELD.fpr[0] - - (char *) &coredata))) + SEC_HAS_CONTENTS, + c_regsize, (bfd_vma) 0, c_regoff)) return NULL; /* .ldinfo section. @@ -283,10 +471,8 @@ rs6000coff_core_p (abfd) core dump would require going down the whole list of struct ld_info's. See if we can just fake it. */ if (!make_bfd_asection (abfd, ".ldinfo", - SEC_HAS_CONTENTS, - (bfd_size_type) LOADER_REGION_SIZE, - (bfd_vma) 0, - (file_ptr) coredata.LOADER_OFFSET_FIELD)) + SEC_HAS_CONTENTS, + c_lsize, (bfd_vma) 0, c_loader)) return NULL; #ifndef CORE_VERSION_1 @@ -294,16 +480,16 @@ rs6000coff_core_p (abfd) AIX 3 dumps the complete data section and sets FULL_CORE if the ulimit is large enough, otherwise the data section is omitted. AIX 4 sets FULL_CORE even if the core file is truncated, we have - to examine coredata.c_datasize below to find out the actual size of - the .data section. */ - if (coredata.c_flag & FULL_CORE) + to examine core.c_datasize below to find out the actual size of + the .data section. */ + if (c_flag & FULL_CORE) { if (!make_bfd_asection (abfd, ".data", SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS, - (bfd_size_type) coredata.CORE_DATA_SIZE_FIELD, + (bfd_size_type) core.old.c_u.u_dsize, (bfd_vma) - CDATA_ADDR (coredata.CORE_DATA_SIZE_FIELD), - (file_ptr) coredata.c_stack + coredata.c_size)) + CDATA_ADDR (core.old.c_u.u_dsize), + c_stack + c_size)) return NULL; } #endif @@ -313,101 +499,155 @@ rs6000coff_core_p (abfd) which can be found by examining ldinfo, and anonymously mmapped regions. */ { - struct ld_info ldinfo; - bfd_size_type ldinfo_size; - file_ptr ldinfo_offset = (file_ptr) coredata.LOADER_OFFSET_FIELD; + LdInfo ldinfo; + bfd_size_type ldi_datasize; + file_ptr ldi_core; + uint ldi_next; + bfd_vma ldi_dataorg; + + /* Fields from new and old core structures. */ + bfd_size_type c_datasize, c_vmregions; + file_ptr c_data, c_vmm; + + if (CORE_NEW (core)) + { + c_datasize = CNEW_DATASIZE (core.new); + c_data = (file_ptr) core.new.c_data; + c_vmregions = core.new.c_vmregions; + c_vmm = (file_ptr) core.new.c_vmm; + } + else + { + c_datasize = core.old.c_datasize; + c_data = (file_ptr) core.old.c_data; + c_vmregions = core.old.c_vmregions; + c_vmm = (file_ptr) core.old.c_vmm; + } /* .data section from executable. */ - if (coredata.c_datasize) + if (c_datasize) { if (!make_bfd_asection (abfd, ".data", SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS, - (bfd_size_type) coredata.c_datasize, - (bfd_vma) - CDATA_ADDR (coredata.CORE_DATA_SIZE_FIELD), - (file_ptr) coredata.c_data)) + c_datasize, + (bfd_vma) CDATA_ADDR (c_datasize), + c_data)) return NULL; } /* .data sections from loaded objects. */ - ldinfo_size = (char *) &ldinfo.ldinfo_filename[0] - - (char *) &ldinfo.ldinfo_next; + if (proc64) + size = (int) ((LdInfo *)0)->l64.ldinfo_filename; + else + size = (int) ((LdInfo *)0)->l32.ldinfo_filename; + while (1) { - if (bfd_seek (abfd, ldinfo_offset, SEEK_SET) != 0) + if (bfd_seek (abfd, c_loader, SEEK_SET) != 0) return NULL; - if (bfd_read (&ldinfo, ldinfo_size, 1, abfd) != ldinfo_size) + if (bfd_read (&ldinfo, size, 1, abfd) != size) return NULL; - if (ldinfo.ldinfo_core) + + if (proc64) { - if (!make_bfd_asection (abfd, ".data", - SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS, - (bfd_size_type) ldinfo.ldinfo_datasize, - (bfd_vma) ldinfo.ldinfo_dataorg, - (file_ptr) ldinfo.ldinfo_core)) - return NULL; + ldi_core = ldinfo.l64.ldinfo_core; + ldi_datasize = ldinfo.l64.ldinfo_datasize; + ldi_dataorg = (bfd_vma) ldinfo.l64.ldinfo_dataorg; + ldi_next = ldinfo.l64.ldinfo_next; } - if (ldinfo.ldinfo_next == 0) + else + { + ldi_core = ldinfo.l32.ldinfo_core; + ldi_datasize = ldinfo.l32.ldinfo_datasize; + ldi_dataorg = (bfd_vma) (long) ldinfo.l32.ldinfo_dataorg; + ldi_next = ldinfo.l32.ldinfo_next; + } + + if (ldi_core) + if (!make_bfd_asection (abfd, ".data", + SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS, + ldi_datasize, ldi_dataorg, ldi_core)) + return NULL; + + if (ldi_next == 0) break; - ldinfo_offset += ldinfo.ldinfo_next; + c_loader += ldi_next; } /* .vmdata sections from anonymously mmapped regions. */ - if (coredata.c_vmregions) + if (c_vmregions) { - int i; + bfd_size_type i; - if (bfd_seek (abfd, (file_ptr) coredata.c_vmm, SEEK_SET) != 0) + if (bfd_seek (abfd, c_vmm, SEEK_SET) != 0) return NULL; - for (i = 0; i < coredata.c_vmregions; i++) + for (i = 0; i < c_vmregions; i++) { - struct vm_info vminfo; + VmInfo vminfo; + bfd_size_type vminfo_size; + file_ptr vminfo_offset; + bfd_vma vminfo_addr; - if (bfd_read (&vminfo, sizeof (vminfo), 1, abfd) != sizeof (vminfo)) + size = CORE_NEW (core) ? sizeof (vminfo.new) : sizeof (vminfo.old); + if (bfd_read (&vminfo, size, 1, abfd) != size) return NULL; - if (vminfo.vminfo_offset) + + if (CORE_NEW (core)) { - if (!make_bfd_asection (abfd, ".vmdata", - SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS, - (bfd_size_type) vminfo.vminfo_size, - (bfd_vma) vminfo.vminfo_addr, - (file_ptr) vminfo.vminfo_offset)) - return NULL; + vminfo_addr = (bfd_vma) vminfo.new.vminfo_addr; + vminfo_size = vminfo.new.vminfo_size; + vminfo_offset = vminfo.new.vminfo_offset; } + else + { + vminfo_addr = (bfd_vma) (long) vminfo.old.vminfo_addr; + vminfo_size = vminfo.old.vminfo_size; + vminfo_offset = vminfo.old.vminfo_offset; + } + + if (vminfo_offset) + if (!make_bfd_asection (abfd, ".vmdata", + SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS, + vminfo_size, vminfo_addr, + vminfo_offset)) + return NULL; } } } #endif - return abfd->xvec; /* this is garbage for now. */ + return abfd->xvec; /* this is garbage for now. */ } - - -/* return `true' if given core is from the given executable.. */ +/* return `true' if given core is from the given executable.. */ boolean rs6000coff_core_file_matches_executable_p (core_bfd, exec_bfd) bfd *core_bfd; bfd *exec_bfd; { - struct CORE_DUMP coredata; - struct ld_info ldinfo; + CoreHdr core; bfd_size_type size; char *path, *s; size_t alloc; const char *str1, *str2; boolean ret; + file_ptr c_loader; - if (bfd_seek (core_bfd, 0, SEEK_SET) != 0 - || bfd_read (&coredata, sizeof coredata, 1, core_bfd) != sizeof coredata) + if (!read_hdr (core_bfd, &core)) return false; - if (bfd_seek (core_bfd, (long) coredata.LOADER_OFFSET_FIELD, SEEK_SET) != 0) - return false; + if (CORE_NEW (core)) + c_loader = CNEW_LOADER (core.new); + else + c_loader = (file_ptr) COLD_LOADER (core.old); - size = (char *) &ldinfo.ldinfo_filename[0] - (char *) &ldinfo.ldinfo_next; - if (bfd_read (&ldinfo, size, 1, core_bfd) != size) + if (CORE_NEW (core) && CNEW_PROC64 (core.new)) + size = (int) ((LdInfo *)0)->l64.ldinfo_filename; + else + size = (int) ((LdInfo *)0)->l32.ldinfo_filename; + + if (bfd_seek (core_bfd, c_loader + size, SEEK_SET) != 0) return false; alloc = 100; @@ -441,7 +681,7 @@ rs6000coff_core_file_matches_executable_p (core_bfd, exec_bfd) path = n; } } - + str1 = strrchr (path, '/'); str2 = strrchr (exec_bfd->filename, '/'); @@ -463,7 +703,10 @@ char * rs6000coff_core_file_failing_command (abfd) bfd *abfd; { - char *com = core_hdr (abfd).CORE_COMM_FIELD; + CoreHdr *core = core_hdr (abfd); + char *com = CORE_NEW (*core) ? + CNEW_COMM (core->new) : COLD_COMM (core->old); + if (*com) return com; else @@ -474,65 +717,8 @@ int rs6000coff_core_file_failing_signal (abfd) bfd *abfd; { - return core_hdr (abfd).c_signo; -} - - -boolean -rs6000coff_get_section_contents (abfd, section, location, offset, count) - bfd *abfd; - sec_ptr section; - PTR location; - file_ptr offset; - bfd_size_type count; -{ - if (count == 0) - return true; - - /* Reading a core file's sections will be slightly different. For the - rest of them we can use bfd_generic_get_section_contents () I suppose. */ - /* Make sure this routine works for any bfd and any section. FIXMEmgo. */ - - if (abfd->format == bfd_core && strcmp (section->name, ".reg") == 0) { - - struct mstsave mstatus; - int regoffset = (char*)&mstatus.gpr[0] - (char*)&mstatus; - - /* Assert that the only way this code will be executed is reading the - whole section. */ - if (offset || count != (sizeof(mstatus.gpr) + (4 * NUM_OF_SPEC_REGS))) - (*_bfd_error_handler) - (_("ERROR! in rs6000coff_get_section_contents()\n")); - - /* for `.reg' section, `filepos' is a pointer to the `mstsave' structure - in the core file. */ - - /* read GPR's into the location. */ - if ( bfd_seek(abfd, section->filepos + regoffset, SEEK_SET) == -1 - || bfd_read(location, sizeof (mstatus.gpr), 1, abfd) != sizeof (mstatus.gpr)) - return (false); /* on error */ - - /* increment location to the beginning of special registers in the section, - reset register offset value to the beginning of first special register - in mstsave structure, and read special registers. */ - - location = (PTR) ((char*)location + sizeof (mstatus.gpr)); - regoffset = (char*)&mstatus.iar - (char*)&mstatus; - - if ( bfd_seek(abfd, section->filepos + regoffset, SEEK_SET) == -1 - || bfd_read(location, 4 * NUM_OF_SPEC_REGS, 1, abfd) != - 4 * NUM_OF_SPEC_REGS) - return (false); /* on error */ - - /* increment location address, and read the special registers.. */ - /* FIXMEmgo */ - return (true); - } - - /* else, use default bfd section content transfer. */ - else - return _bfd_generic_get_section_contents - (abfd, section, location, offset, count); + CoreHdr *core = core_hdr (abfd); + return CORE_NEW (*core) ? core->new.c_signo : core->old.c_signo; } #endif /* AIX_CORE */ diff --git a/gnu/dist/toolchain/bfd/sco5-core.c b/gnu/dist/toolchain/bfd/sco5-core.c index 46c97d25889f..5d5677e30c43 100644 --- a/gnu/dist/toolchain/bfd/sco5-core.c +++ b/gnu/dist/toolchain/bfd/sco5-core.c @@ -84,7 +84,7 @@ sco5_core_make_empty_symbol (abfd) new->the_bfd = abfd; return new; } - + static struct user * read_uarea(abfd, filepos) bfd *abfd; @@ -109,7 +109,7 @@ read_uarea(abfd, filepos) } /* Sanity check perhaps??? */ - if (rawptr->u.u_dsize > 0x1000000) /* Remember, it's in pages... */ + if (rawptr->u.u_dsize > 0x1000000) /* Remember, it's in pages... */ { bfd_set_error (bfd_error_wrong_format); return NULL; @@ -154,7 +154,7 @@ sco5_core_file_p (abfd) || (bfd_read ((void *)&coffset_siz, 1, sizeof coffset_siz, abfd) != sizeof coffset_siz) ) { - bfd_set_error (bfd_error_wrong_format); + bfd_set_error (bfd_error_wrong_format); return NULL; } @@ -165,50 +165,49 @@ sco5_core_file_p (abfd) != sizeof coffsets) || ((coffsets.u_info != 1) && (coffsets.u_info != C_VERSION))) { - bfd_set_error (bfd_error_wrong_format); + bfd_set_error (bfd_error_wrong_format); return NULL; } - - if (coffsets.u_info == 1) - { + if (coffsets.u_info == 1) + { /* Old version, no section heads, read info from user struct */ u = read_uarea(abfd, coffsets.u_user); if (! u) return NULL; - if (!make_bfd_asection (abfd, ".reg", SEC_HAS_CONTENTS, + 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; - - if (!make_bfd_asection (abfd, ".data", + + if (!make_bfd_asection (abfd, ".data", SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS, ((bfd_size_type) u->u_exdata.ux_dsize + u->u_exdata.ux_bsize), (bfd_vma) u->u_exdata.ux_datorg, (file_ptr) coffsets.u_data)) return NULL; - - if (!make_bfd_asection (abfd, ".stack", - SEC_ALLOC + SEC_LOAD + SEC_HAS_CONTENTS, + + 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; return abfd->xvec; /* Done for version 1 */ - } + } /* Immediately before coreoffsets region is a long with offset in core to first coresecthead (CORES_OFFSETS), the long before this is the number of section heads in the list. Read both longs and read the coresecthead and check its validity */ - - if ((bfd_seek (abfd, - coresize - coffset_siz - 2 * sizeof coffset_siz, + + if ((bfd_seek (abfd, + 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) @@ -226,16 +225,16 @@ sco5_core_file_p (abfd) /* Now loop over all regions and map them */ nsecs--; /* We've seen CORES_OFFSETS already */ - for (; nsecs; nsecs--) + for (; nsecs; nsecs--) { if ((bfd_seek (abfd, chead.cs_hseek, SEEK_SET) != 0) || bfd_read ((void *)&chead, 1, sizeof chead, abfd) != sizeof chead) { - bfd_set_error (bfd_error_wrong_format); + bfd_set_error (bfd_error_wrong_format); return NULL; } - switch (chead.cs_stype) + switch (chead.cs_stype) { case CORES_MAGIC: /* Core header, check magic */ if (chead.cs_x.csx_magic != COREMAGIC_NUMBER) @@ -259,7 +258,7 @@ sco5_core_file_p (abfd) *u_ar0. The other is that u_ar0 is sometimes an absolute address in kernel memory, and on other systems it is an offset from the beginning of the `struct user'. - + As a practical matter, we don't know where the registers actually are, so we have to pass the whole area to GDB. We encode the value of u_ar0 by setting the .regs section @@ -267,11 +266,10 @@ sco5_core_file_p (abfd) pointed to by u_ar0 (by setting the vma of the start of the section to -u_ar0). GDB uses this info to locate the regs, using minor trickery to get around the - offset-or-absolute-addr problem. */ + offset-or-absolute-addr problem. */ chead.cs_vaddr = 0 - (bfd_vma) u->u_ar0; - secname = ".reg"; flags = SEC_HAS_CONTENTS; @@ -345,8 +343,8 @@ int sco5_core_file_failing_signal (ignore_abfd) bfd *ignore_abfd; { - return ((ignore_abfd->tdata.sco5_core_data->u.u_sysabort != 0) - ? ignore_abfd->tdata.sco5_core_data->u.u_sysabort + return ((ignore_abfd->tdata.sco5_core_data->u.u_sysabort != 0) + ? ignore_abfd->tdata.sco5_core_data->u.u_sysabort : -1); } @@ -371,9 +369,9 @@ sco5_core_file_matches_executable_p (core_bfd, exec_bfd) /* If somebody calls any byte-swapping routines, shoot them. */ static void -swap_abort() +swap_abort () { - abort(); /* This way doesn't require any declaration for ANSI to fuck up */ + abort (); /* This way doesn't require any declaration for ANSI to fuck up */ } #define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort ) #define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort ) @@ -426,6 +424,6 @@ const bfd_target sco5_core_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 /* backend_data */ }; diff --git a/gnu/dist/toolchain/bfd/section.c b/gnu/dist/toolchain/bfd/section.c index b3b760802d3e..13e10d30f675 100644 --- a/gnu/dist/toolchain/bfd/section.c +++ b/gnu/dist/toolchain/bfd/section.c @@ -1,5 +1,5 @@ /* Object file "section" support for the BFD library. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Cygnus Support. @@ -111,7 +111,6 @@ SUBSECTION | size 0x103 | | output_section --------| - SUBSECTION Link orders @@ -133,7 +132,6 @@ SUBSECTION */ - #include "bfd.h" #include "sysdep.h" #include "libbfd.h" @@ -150,10 +148,10 @@ SUBSECTION CODE_FRAGMENT . -. {* This structure is used for a comdat section, as in PE. A comdat -. section is associated with a particular symbol. When the linker -. sees a comdat section, it keeps only one of the sections with a -. given name and associated with a given symbol. *} +.{* This structure is used for a comdat section, as in PE. A comdat +. section is associated with a particular symbol. When the linker +. sees a comdat section, it keeps only one of the sections with a +. given name and associated with a given symbol. *} . .struct bfd_comdat_info .{ @@ -165,340 +163,362 @@ CODE_FRAGMENT . specific code; it is not an index into the list returned by . bfd_canonicalize_symtab. *} . long symbol; -. -. {* If this section is being discarded, the linker uses this field -. to point to the input section which is being kept. *} -. struct sec *sec; .}; . .typedef struct sec .{ -. {* The name of the section; the name isn't a copy, the pointer is -. the same as that passed to bfd_make_section. *} +. {* The name of the section; the name isn't a copy, the pointer is +. the same as that passed to bfd_make_section. *} . -. CONST char *name; +. const char *name; . -. {* Which section is it; 0..nth. *} +. {* A unique sequence number. *} . -. int index; +. int id; . -. {* The next section in the list belonging to the BFD, or NULL. *} +. {* Which section is it; 0..nth. *} . -. struct sec *next; +. int index; . -. {* The field flags contains attributes of the section. Some -. flags are read in from the object file, and some are -. synthesized from other information. *} +. {* The next section in the list belonging to the BFD, or NULL. *} . -. flagword flags; +. struct sec *next; +. +. {* The field flags contains attributes of the section. Some +. flags are read in from the object file, and some are +. synthesized from other information. *} +. +. flagword flags; . .#define SEC_NO_FLAGS 0x000 . -. {* Tells the OS to allocate space for this section when loading. -. This is clear for a section containing debug information -. only. *} +. {* Tells the OS to allocate space for this section when loading. +. This is clear for a section containing debug information only. *} .#define SEC_ALLOC 0x001 . -. {* Tells the OS to load the section from the file when loading. -. This is clear for a .bss section. *} +. {* Tells the OS to load the section from the file when loading. +. This is clear for a .bss section. *} .#define SEC_LOAD 0x002 . -. {* The section contains data still to be relocated, so there is -. some relocation information too. *} +. {* The section contains data still to be relocated, so there is +. some relocation information too. *} .#define SEC_RELOC 0x004 . .#if 0 {* Obsolete ? *} .#define SEC_BALIGN 0x008 .#endif . -. {* A signal to the OS that the section contains read only -. data. *} +. {* A signal to the OS that the section contains read only data. *} .#define SEC_READONLY 0x010 . -. {* The section contains code only. *} +. {* The section contains code only. *} .#define SEC_CODE 0x020 . -. {* The section contains data only. *} +. {* The section contains data only. *} .#define SEC_DATA 0x040 . -. {* The section will reside in ROM. *} +. {* The section will reside in ROM. *} .#define SEC_ROM 0x080 . -. {* The section contains constructor information. This section -. type is used by the linker to create lists of constructors and -. destructors used by <>. When a back end sees a symbol -. which should be used in a constructor list, it creates a new -. section for the type of name (e.g., <<__CTOR_LIST__>>), attaches -. the symbol to it, and builds a relocation. To build the lists -. of constructors, all the linker has to do is catenate all the -. sections called <<__CTOR_LIST__>> and relocate the data -. contained within - exactly the operations it would peform on -. standard data. *} +. {* The section contains constructor information. This section +. type is used by the linker to create lists of constructors and +. destructors used by <>. When a back end sees a symbol +. which should be used in a constructor list, it creates a new +. section for the type of name (e.g., <<__CTOR_LIST__>>), attaches +. the symbol to it, and builds a relocation. To build the lists +. of constructors, all the linker has to do is catenate all the +. sections called <<__CTOR_LIST__>> and relocate the data +. contained within - exactly the operations it would peform on +. standard data. *} .#define SEC_CONSTRUCTOR 0x100 . -. {* The section is a constructor, and should be placed at the -. end of the text, data, or bss section(?). *} +. {* The section is a constructor, and should be placed at the +. end of the text, data, or bss section(?). *} .#define SEC_CONSTRUCTOR_TEXT 0x1100 .#define SEC_CONSTRUCTOR_DATA 0x2100 .#define SEC_CONSTRUCTOR_BSS 0x3100 . -. {* The section has contents - a data section could be -. <> | <>; a debug section could be -. <> *} +. {* The section has contents - a data section could be +. <> | <>; a debug section could be +. <> *} .#define SEC_HAS_CONTENTS 0x200 . -. {* An instruction to the linker to not output the section -. even if it has information which would normally be written. *} +. {* An instruction to the linker to not output the section +. even if it has information which would normally be written. *} .#define SEC_NEVER_LOAD 0x400 . -. {* The section is a COFF shared library section. This flag is -. only for the linker. If this type of section appears in -. the input file, the linker must copy it to the output file -. without changing the vma or size. FIXME: Although this -. was originally intended to be general, it really is COFF -. specific (and the flag was renamed to indicate this). It -. might be cleaner to have some more general mechanism to -. allow the back end to control what the linker does with -. sections. *} +. {* The section is a COFF shared library section. This flag is +. only for the linker. If this type of section appears in +. the input file, the linker must copy it to the output file +. without changing the vma or size. FIXME: Although this +. was originally intended to be general, it really is COFF +. specific (and the flag was renamed to indicate this). It +. might be cleaner to have some more general mechanism to +. allow the back end to control what the linker does with +. sections. *} .#define SEC_COFF_SHARED_LIBRARY 0x800 . -. {* The section contains common symbols (symbols may be defined -. multiple times, the value of a symbol is the amount of -. space it requires, and the largest symbol value is the one -. used). Most targets have exactly one of these (which we -. translate to bfd_com_section_ptr), but ECOFF has two. *} +. {* The section has GOT references. This flag is only for the +. linker, and is currently only used by the elf32-hppa back end. +. It will be set if global offset table references were detected +. in this section, which indicate to the linker that the section +. contains PIC code, and must be handled specially when doing a +. static link. *} +.#define SEC_HAS_GOT_REF 0x4000 +. +. {* The section contains common symbols (symbols may be defined +. multiple times, the value of a symbol is the amount of +. space it requires, and the largest symbol value is the one +. used). Most targets have exactly one of these (which we +. translate to bfd_com_section_ptr), but ECOFF has two. *} .#define SEC_IS_COMMON 0x8000 . -. {* The section contains only debugging information. For -. example, this is set for ELF .debug and .stab sections. -. strip tests this flag to see if a section can be -. discarded. *} +. {* The section contains only debugging information. For +. example, this is set for ELF .debug and .stab sections. +. strip tests this flag to see if a section can be +. discarded. *} .#define SEC_DEBUGGING 0x10000 . -. {* The contents of this section are held in memory pointed to -. by the contents field. This is checked by -. bfd_get_section_contents, and the data is retrieved from -. memory if appropriate. *} +. {* The contents of this section are held in memory pointed to +. by the contents field. This is checked by bfd_get_section_contents, +. and the data is retrieved from memory if appropriate. *} .#define SEC_IN_MEMORY 0x20000 . -. {* The contents of this section are to be excluded by the -. linker for executable and shared objects unless those -. objects are to be further relocated. *} +. {* The contents of this section are to be excluded by the +. linker for executable and shared objects unless those +. objects are to be further relocated. *} .#define SEC_EXCLUDE 0x40000 . -. {* The contents of this section are to be sorted by the -. based on the address specified in the associated symbol -. table. *} +. {* The contents of this section are to be sorted by the +. based on the address specified in the associated symbol +. table. *} .#define SEC_SORT_ENTRIES 0x80000 . -. {* When linking, duplicate sections of the same name should be -. discarded, rather than being combined into a single section as -. is usually done. This is similar to how common symbols are -. handled. See SEC_LINK_DUPLICATES below. *} +. {* When linking, duplicate sections of the same name should be +. discarded, rather than being combined into a single section as +. is usually done. This is similar to how common symbols are +. handled. See SEC_LINK_DUPLICATES below. *} .#define SEC_LINK_ONCE 0x100000 . -. {* If SEC_LINK_ONCE is set, this bitfield describes how the linker -. should handle duplicate sections. *} +. {* If SEC_LINK_ONCE is set, this bitfield describes how the linker +. should handle duplicate sections. *} .#define SEC_LINK_DUPLICATES 0x600000 . -. {* This value for SEC_LINK_DUPLICATES means that duplicate -. sections with the same name should simply be discarded. *} +. {* This value for SEC_LINK_DUPLICATES means that duplicate +. sections with the same name should simply be discarded. *} .#define SEC_LINK_DUPLICATES_DISCARD 0x0 . -. {* This value for SEC_LINK_DUPLICATES means that the linker -. should warn if there are any duplicate sections, although -. it should still only link one copy. *} +. {* This value for SEC_LINK_DUPLICATES means that the linker +. should warn if there are any duplicate sections, although +. it should still only link one copy. *} .#define SEC_LINK_DUPLICATES_ONE_ONLY 0x200000 . -. {* This value for SEC_LINK_DUPLICATES means that the linker -. should warn if any duplicate sections are a different size. *} +. {* This value for SEC_LINK_DUPLICATES means that the linker +. should warn if any duplicate sections are a different size. *} .#define SEC_LINK_DUPLICATES_SAME_SIZE 0x400000 . -. {* This value for SEC_LINK_DUPLICATES means that the linker -. should warn if any duplicate sections contain different -. contents. *} +. {* This value for SEC_LINK_DUPLICATES means that the linker +. should warn if any duplicate sections contain different +. contents. *} .#define SEC_LINK_DUPLICATES_SAME_CONTENTS 0x600000 . -. {* This section was created by the linker as part of dynamic -. relocation or other arcane processing. It is skipped when -. going through the first-pass output, trusting that someone -. else up the line will take care of it later. *} +. {* This section was created by the linker as part of dynamic +. relocation or other arcane processing. It is skipped when +. going through the first-pass output, trusting that someone +. else up the line will take care of it later. *} .#define SEC_LINKER_CREATED 0x800000 . -. {* This section should not be subject to garbage collection. *} +. {* This section should not be subject to garbage collection. *} .#define SEC_KEEP 0x1000000 . -. {* This section contains "short" data, and should be placed -. "near" the GP. *} +. {* This section contains "short" data, and should be placed +. "near" the GP. *} .#define SEC_SMALL_DATA 0x2000000 . -. {* This section contains data which may be shared with other -. executables or shared objects. *} +. {* This section contains data which may be shared with other +. executables or shared objects. *} .#define SEC_SHARED 0x4000000 . -. {* End of section flags. *} +. {* When a section with this flag is being linked, then if the size of +. the input section is less than a page, it should not cross a page +. boundary. If the size of the input section is one page or more, it +. should be aligned on a page boundary. *} +.#define SEC_BLOCK 0x8000000 . -. {* Some internal packed boolean fields. *} +. {* Conditionally link this section; do not link if there are no +. references found to any symbol in the section. *} +.#define SEC_CLINK 0x10000000 . -. {* See the vma field. *} -. unsigned int user_set_vma : 1; +. {* End of section flags. *} . -. {* Whether relocations have been processed. *} -. unsigned int reloc_done : 1; +. {* Some internal packed boolean fields. *} . -. {* A mark flag used by some of the linker backends. *} -. unsigned int linker_mark : 1; +. {* See the vma field. *} +. unsigned int user_set_vma : 1; . -. {* A mark flag used by some linker backends for garbage collection. *} -. unsigned int gc_mark : 1; +. {* Whether relocations have been processed. *} +. unsigned int reloc_done : 1; . -. {* End of internal packed boolean fields. *} +. {* A mark flag used by some of the linker backends. *} +. unsigned int linker_mark : 1; . -. {* The virtual memory address of the section - where it will be -. at run time. The symbols are relocated against this. The -. user_set_vma flag is maintained by bfd; if it's not set, the -. backend can assign addresses (for example, in <>, where -. the default address for <<.data>> is dependent on the specific -. target and various flags). *} +. {* A mark flag used by some linker backends for garbage collection. *} +. unsigned int gc_mark : 1; . -. bfd_vma vma; +. {* Used by the ELF code to mark sections which have been allocated to segments. *} +. unsigned int segment_mark : 1; . -. {* The load address of the section - where it would be in a -. rom image; really only used for writing section header -. information. *} +. {* End of internal packed boolean fields. *} . -. bfd_vma lma; +. {* The virtual memory address of the section - where it will be +. at run time. The symbols are relocated against this. The +. user_set_vma flag is maintained by bfd; if it's not set, the +. backend can assign addresses (for example, in <>, where +. the default address for <<.data>> is dependent on the specific +. target and various flags). *} . -. {* The size of the section in octets, as it will be output. -. Contains a value even if the section has no contents (e.g., the -. size of <<.bss>>). This will be filled in after relocation. *} +. bfd_vma vma; . -. bfd_size_type _cooked_size; +. {* The load address of the section - where it would be in a +. rom image; really only used for writing section header +. information. *} . -. {* The original size on disk of the section, in octets. Normally this -. value is the same as the size, but if some relaxing has -. been done, then this value will be bigger. *} +. bfd_vma lma; . -. bfd_size_type _raw_size; +. {* The size of the section in octets, as it will be output. +. Contains a value even if the section has no contents (e.g., the +. size of <<.bss>>). This will be filled in after relocation. *} . -. {* If this section is going to be output, then this value is the -. offset in *bytes* into the output section of the first byte in the -. input section (byte ==> smallest addressable unit on the -. target). In most cases, if this was going to start at the -. 100th octet (8-bit quantity) in the output section, this value -. would be 100. However, if the target byte size is 16 bits -. (bfd_octets_per_byte is "2"), this value would be 50. *} +. bfd_size_type _cooked_size; . -. bfd_vma output_offset; +. {* The original size on disk of the section, in octets. Normally this +. value is the same as the size, but if some relaxing has +. been done, then this value will be bigger. *} . -. {* The output section through which to map on output. *} +. bfd_size_type _raw_size; . -. struct sec *output_section; +. {* If this section is going to be output, then this value is the +. offset in *bytes* into the output section of the first byte in the +. input section (byte ==> smallest addressable unit on the +. target). In most cases, if this was going to start at the +. 100th octet (8-bit quantity) in the output section, this value +. would be 100. However, if the target byte size is 16 bits +. (bfd_octets_per_byte is "2"), this value would be 50. *} . -. {* The alignment requirement of the section, as an exponent of 2 - -. e.g., 3 aligns to 2^3 (or 8). *} +. bfd_vma output_offset; . -. unsigned int alignment_power; +. {* The output section through which to map on output. *} . -. {* If an input section, a pointer to a vector of relocation -. records for the data in this section. *} +. struct sec *output_section; . -. struct reloc_cache_entry *relocation; +. {* The alignment requirement of the section, as an exponent of 2 - +. e.g., 3 aligns to 2^3 (or 8). *} . -. {* If an output section, a pointer to a vector of pointers to -. relocation records for the data in this section. *} +. unsigned int alignment_power; . -. struct reloc_cache_entry **orelocation; +. {* If an input section, a pointer to a vector of relocation +. records for the data in this section. *} . -. {* The number of relocation records in one of the above *} +. struct reloc_cache_entry *relocation; . -. unsigned reloc_count; +. {* If an output section, a pointer to a vector of pointers to +. relocation records for the data in this section. *} . -. {* Information below is back end specific - and not always used -. or updated. *} +. struct reloc_cache_entry **orelocation; . -. {* File position of section data *} +. {* The number of relocation records in one of the above *} . -. file_ptr filepos; +. unsigned reloc_count; . -. {* File position of relocation info *} +. {* Information below is back end specific - and not always used +. or updated. *} . -. file_ptr rel_filepos; +. {* File position of section data. *} . -. {* File position of line data *} +. file_ptr filepos; . -. file_ptr line_filepos; +. {* File position of relocation info. *} . -. {* Pointer to data for applications *} +. file_ptr rel_filepos; . -. PTR userdata; +. {* File position of line data. *} . -. {* If the SEC_IN_MEMORY flag is set, this points to the actual -. contents. *} -. unsigned char *contents; +. file_ptr line_filepos; . -. {* Attached line number information *} +. {* Pointer to data for applications. *} . -. alent *lineno; +. PTR userdata; . -. {* Number of line number records *} +. {* If the SEC_IN_MEMORY flag is set, this points to the actual +. contents. *} +. unsigned char *contents; . -. unsigned int lineno_count; +. {* Attached line number information. *} . -. {* Optional information about a COMDAT entry; NULL if not COMDAT *} +. alent *lineno; . -. struct bfd_comdat_info *comdat; +. {* Number of line number records. *} . -. {* When a section is being output, this value changes as more -. linenumbers are written out *} +. unsigned int lineno_count; . -. file_ptr moving_line_filepos; +. {* Optional information about a COMDAT entry; NULL if not COMDAT. *} . -. {* What the section number is in the target world *} +. struct bfd_comdat_info *comdat; . -. int target_index; +. {* Points to the kept section if this section is a link-once section, +. and is discarded. *} +. struct sec *kept_section; . -. PTR used_by_bfd; +. {* When a section is being output, this value changes as more +. linenumbers are written out. *} . -. {* If this is a constructor section then here is a list of the -. relocations created to relocate items within it. *} +. file_ptr moving_line_filepos; . -. struct relent_chain *constructor_chain; +. {* What the section number is in the target world. *} . -. {* The BFD which owns the section. *} +. int target_index; . -. bfd *owner; +. PTR used_by_bfd; . -. {* A symbol which points at this section only *} -. struct symbol_cache_entry *symbol; -. struct symbol_cache_entry **symbol_ptr_ptr; +. {* If this is a constructor section then here is a list of the +. relocations created to relocate items within it. *} . -. struct bfd_link_order *link_order_head; -. struct bfd_link_order *link_order_tail; +. struct relent_chain *constructor_chain; +. +. {* The BFD which owns the section. *} +. +. bfd *owner; +. +. {* A symbol which points at this section only *} +. struct symbol_cache_entry *symbol; +. struct symbol_cache_entry **symbol_ptr_ptr; +. +. struct bfd_link_order *link_order_head; +. struct bfd_link_order *link_order_tail; .} asection ; . -. {* These sections are global, and are managed by BFD. The application -. and target back end are not permitted to change the values in -. these sections. New code should use the section_ptr macros rather -. than referring directly to the const sections. The const sections -. may eventually vanish. *} +.{* These sections are global, and are managed by BFD. The application +. and target back end are not permitted to change the values in +. these sections. New code should use the section_ptr macros rather +. than referring directly to the const sections. The const sections +. may eventually vanish. *} .#define BFD_ABS_SECTION_NAME "*ABS*" .#define BFD_UND_SECTION_NAME "*UND*" .#define BFD_COM_SECTION_NAME "*COM*" .#define BFD_IND_SECTION_NAME "*IND*" . -. {* the absolute section *} +.{* the absolute section *} .extern const asection bfd_abs_section; .#define bfd_abs_section_ptr ((asection *) &bfd_abs_section) .#define bfd_is_abs_section(sec) ((sec) == bfd_abs_section_ptr) -. {* Pointer to the undefined section *} +.{* Pointer to the undefined section *} .extern const asection bfd_und_section; .#define bfd_und_section_ptr ((asection *) &bfd_und_section) .#define bfd_is_und_section(sec) ((sec) == bfd_und_section_ptr) -. {* Pointer to the common section *} +.{* Pointer to the common section *} .extern const asection bfd_com_section; .#define bfd_com_section_ptr ((asection *) &bfd_com_section) -. {* Pointer to the indirect section *} +.{* Pointer to the indirect section *} .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) @@ -538,29 +558,38 @@ static const asymbol global_syms[] = GLOBAL_SYM_INIT (BFD_IND_SECTION_NAME, &bfd_ind_section) }; -#define STD_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ - const asymbol * const SYM = (asymbol *) &global_syms[IDX]; \ - const asection SEC = \ - /* name, index, next, flags, set_vma, reloc_done, linker_mark, gc_mark */ \ - { NAME, 0, 0, FLAGS, 0, 0, 0, 0, \ - \ - /* vma, lma, _cooked_size, _raw_size, output_offset, output_section, */ \ - 0, 0, 0, 0, 0, (struct sec *) &SEC, \ - \ - /* alig..., reloc..., orel..., reloc_count, filepos, rel_..., line_... */ \ - 0, 0, 0, 0, 0, 0, 0, \ - \ - /* userdata, contents, lineno, lineno_count */ \ - 0, 0, 0, 0, \ - \ - /* comdat_info, moving_line_filepos, target_index, used_by_bfd, */ \ - NULL, 0, 0, 0, \ - \ - /* cons..., owner, symbol */ \ - 0, 0, (struct symbol_cache_entry *) &global_syms[IDX], \ - \ - /* symbol_ptr_ptr, link_order_head, ..._tail */ \ - (struct symbol_cache_entry **) &SYM, 0, 0 \ +#define STD_SECTION(SEC, FLAGS, SYM, NAME, IDX) \ + const asymbol * const SYM = (asymbol *) &global_syms[IDX]; \ + const asection SEC = \ + /* name, id, index, next, flags, user_set_vma, reloc_done, */ \ + { NAME, IDX, 0, NULL, FLAGS, 0, 0, \ + \ + /* linker_mark, gc_mark, segment_mark, vma, lma, _cooked_size, */ \ + 0, 1, 0, 0, 0, 0, \ + \ + /* _raw_size, output_offset, output_section, alignment_power, */ \ + 0, 0, (struct sec *) &SEC, 0, \ + \ + /* relocation, orelocation, reloc_count, filepos, rel_filepos, */ \ + NULL, NULL, 0, 0, 0, \ + \ + /* line_filepos, userdata, contents, lineno, lineno_count, */ \ + 0, NULL, NULL, NULL, 0, \ + \ + /* comdat, kept_section, moving_line_filepos, target_index, */ \ + NULL, NULL, 0, 0, \ + \ + /* used_by_bfd, constructor_chain, owner, */ \ + NULL, NULL, NULL, \ + \ + /* symbol, */ \ + (struct symbol_cache_entry *) &global_syms[IDX], \ + \ + /* symbol_ptr_ptr, */ \ + (struct symbol_cache_entry **) &SYM, \ + \ + /* link_order_head, link_order_tail */ \ + NULL, NULL \ } STD_SECTION (bfd_com_section, SEC_IS_COMMON, bfd_com_symbol, @@ -585,7 +614,7 @@ FUNCTION bfd_get_section_by_name SYNOPSIS - asection *bfd_get_section_by_name(bfd *abfd, CONST char *name); + asection *bfd_get_section_by_name(bfd *abfd, const char *name); DESCRIPTION Run through @var{abfd} and return the one of the @@ -601,7 +630,7 @@ DESCRIPTION asection * bfd_get_section_by_name (abfd, name) bfd *abfd; - CONST char *name; + const char *name; { asection *sect; @@ -611,13 +640,62 @@ bfd_get_section_by_name (abfd, name) return NULL; } +/* +FUNCTION + bfd_get_unique_section_name + +SYNOPSIS + char *bfd_get_unique_section_name(bfd *abfd, + const char *templat, + int *count); + +DESCRIPTION + Invent a section name that is unique in @var{abfd} by tacking + a dot and a digit suffix onto the original @var{templat}. If + @var{count} is non-NULL, then it specifies the first number + tried as a suffix to generate a unique name. The value + pointed to by @var{count} will be incremented in this case. +*/ + +char * +bfd_get_unique_section_name (abfd, templat, count) + bfd *abfd; + const char *templat; + int *count; +{ + int num; + unsigned int len; + char *sname; + + len = strlen (templat); + sname = bfd_malloc (len + 8); + if (sname == NULL) + return NULL; + strcpy (sname, templat); + num = 1; + if (count != NULL) + num = *count; + + do + { + /* If we have a million sections, something is badly wrong. */ + if (num > 999999) + abort (); + sprintf (sname + len, ".%d", num++); + } + while (bfd_get_section_by_name (abfd, sname) != NULL); + + if (count != NULL) + *count = num; + return sname; +} /* FUNCTION bfd_make_section_old_way SYNOPSIS - asection *bfd_make_section_old_way(bfd *abfd, CONST char *name); + asection *bfd_make_section_old_way(bfd *abfd, const char *name); DESCRIPTION Create a new empty section called @var{name} @@ -637,11 +715,10 @@ DESCRIPTION */ - asection * bfd_make_section_old_way (abfd, name) bfd *abfd; - CONST char *name; + const char *name; { asection *sec = bfd_get_section_by_name (abfd, name); if (sec == (asection *) NULL) @@ -656,7 +733,7 @@ FUNCTION bfd_make_section_anyway SYNOPSIS - asection *bfd_make_section_anyway(bfd *abfd, CONST char *name); + asection *bfd_make_section_anyway(bfd *abfd, const char *name); DESCRIPTION Create a new empty section called @var{name} and attach it to the end of @@ -671,8 +748,9 @@ DESCRIPTION sec_ptr bfd_make_section_anyway (abfd, name) bfd *abfd; - CONST char *name; + const char *name; { + static int section_id = 0x10; /* id 0 to 3 used by STD_SECTION. */ asection *newsect; asection **prev = &abfd->sections; asection *sect = abfd->sections; @@ -694,6 +772,7 @@ bfd_make_section_anyway (abfd, name) return NULL; newsect->name = name; + newsect->id = section_id++; newsect->index = abfd->section_count++; newsect->flags = SEC_NO_FLAGS; @@ -705,13 +784,17 @@ bfd_make_section_anyway (abfd, name) 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) - return NULL; + { + bfd_release (abfd, newsect); + return NULL; + } newsect->symbol->name = name; newsect->symbol->value = 0; newsect->symbol->section = newsect; @@ -721,7 +804,7 @@ bfd_make_section_anyway (abfd, name) if (BFD_SEND (abfd, _new_section_hook, (abfd, newsect)) != true) { - free (newsect); + bfd_release (abfd, newsect); return NULL; } @@ -734,7 +817,7 @@ FUNCTION bfd_make_section SYNOPSIS - asection *bfd_make_section(bfd *, CONST char *name); + asection *bfd_make_section(bfd *, const char *name); DESCRIPTION Like <>, but return <> (without calling @@ -746,7 +829,7 @@ DESCRIPTION asection * bfd_make_section (abfd, name) bfd *abfd; - CONST char *name; + const char *name; { asection *sect = abfd->sections; @@ -779,7 +862,6 @@ bfd_make_section (abfd, name) return bfd_make_section_anyway (abfd, name); } - /* FUNCTION bfd_set_section_flags @@ -823,14 +905,13 @@ bfd_set_section_flags (abfd, section, flags) return true; } - /* FUNCTION bfd_map_over_sections SYNOPSIS void bfd_map_over_sections(bfd *abfd, - void (*func)(bfd *abfd, + void (*func) (bfd *abfd, asection *sect, PTR obj), PTR obj); @@ -849,7 +930,6 @@ DESCRIPTION | for (p = abfd->sections; p != NULL; p = p->next) | func(abfd, p, ...) - */ /*VARARGS2*/ @@ -869,7 +949,6 @@ bfd_map_over_sections (abfd, operation, user_storage) abort (); } - /* FUNCTION bfd_set_section_size @@ -894,7 +973,7 @@ bfd_set_section_size (abfd, ptr, val) bfd_size_type val; { /* Once you've started writing to any section you cannot create or change - the size of any others. */ + the size of any others. */ if (abfd->output_has_begun) { @@ -920,15 +999,12 @@ SYNOPSIS file_ptr offset, bfd_size_type count); - DESCRIPTION Sets the contents of the section @var{section} in BFD @var{abfd} to the data starting in memory at @var{data}. The data is written to the output section starting at offset @var{offset} for @var{count} octets. - - Normally <> is returned, else <>. Possible error returns are: o <> - @@ -939,7 +1015,6 @@ DESCRIPTION This routine is front end to the back end function <<_bfd_set_section_contents>>. - */ #define bfd_get_section_size_now(abfd,sec) \ @@ -993,6 +1068,11 @@ bfd_set_section_contents (abfd, section, location, offset, count) break; } + /* Record a copy of the data in memory if desired. */ + if (section->contents + && location != section->contents + offset) + memcpy (section->contents + offset, location, count); + if (BFD_SEND (abfd, _bfd_set_section_contents, (abfd, section, location, offset, count))) { @@ -1024,8 +1104,6 @@ DESCRIPTION with zeroes. If no errors occur, <> is returned, else <>. - - */ boolean bfd_get_section_contents (abfd, section, location, offset, count) @@ -1159,7 +1237,7 @@ _bfd_strip_section_from_output (info, s) } /* If the output section is empty, remove it too. Careful about sections - that have been discarded in the link script -- they are mapped to + that have been discarded in the link script -- they are mapped to bfd_abs_section, which has no owner. */ if (!keep_os && os->owner != NULL) { diff --git a/gnu/dist/toolchain/bfd/som.c b/gnu/dist/toolchain/bfd/som.c index cd61cc6c4bb0..e4c4b09eaf6a 100644 --- a/gnu/dist/toolchain/bfd/som.c +++ b/gnu/dist/toolchain/bfd/som.c @@ -1,9 +1,9 @@ /* bfd back-end for HP PA-RISC SOM objects. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998 + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 1998, 2000 Free Software Foundation, Inc. Contributed by the Center for Software Science at the - University of Utah (pa-gdb-bugs@cs.utah.edu). + University of Utah. This file is part of BFD, the Binary File Descriptor library. @@ -22,6 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "alloca-conf.h" #include "bfd.h" #include "sysdep.h" @@ -72,7 +73,6 @@ ((__m_num) >= _PA_RISC1_1_ID && (__m_num) <= _PA_RISC_MAXID)) #endif /* _PA_RISC_ID */ - /* HIUX in it's infinite stupidity changed the names for several "well known" constants. Work around such braindamage. Try the HPUX version first, then the HIUX version, and finally provide a default. */ @@ -90,7 +90,7 @@ /* Size (in chars) of the temporary buffers used during fixup and string table writes. */ - + #define SOM_TMP_BUFSIZE 8192 /* Size of the hash table in archives. */ @@ -106,21 +106,19 @@ /* SOM allows any one of the four previous relocations to be reused with a "R_PREV_FIXUP" relocation entry. Since R_PREV_FIXUP relocations are always a single byte, using a R_PREV_FIXUP instead - of some multi-byte relocation makes object files smaller. + of some multi-byte relocation makes object files smaller. Note one side effect of using a R_PREV_FIXUP is the relocation that is being repeated moves to the front of the queue. */ -struct reloc_queue - { - unsigned char *reloc; - unsigned int size; - } reloc_queue[4]; +struct reloc_queue { + unsigned char *reloc; + unsigned int size; +} reloc_queue[4]; /* This fully describes the symbol types which may be attached to an EXPORT or IMPORT directive. Only SOM uses this formation (ELF has no need for it). */ -typedef enum -{ +typedef enum { SYMBOL_TYPE_UNKNOWN, SYMBOL_TYPE_ABSOLUTE, SYMBOL_TYPE_CODE, @@ -132,16 +130,14 @@ typedef enum SYMBOL_TYPE_SEC_PROG, } pa_symbol_type; -struct section_to_type -{ +struct section_to_type { char *section; char type; }; /* Assorted symbol information that needs to be derived from the BFD symbol and/or the BFD backend private symbol data. */ -struct som_misc_symbol_info -{ +struct som_misc_symbol_info { unsigned int symbol_type; unsigned int symbol_scope; unsigned int arg_reloc; @@ -197,7 +193,7 @@ static boolean som_find_nearest_line PARAMS ((bfd *, asection *, CONST char **, unsigned int *)); static void som_get_symbol_info PARAMS ((bfd *, asymbol *, symbol_info *)); -static asection * bfd_section_from_som_symbol PARAMS ((bfd *, +static asection * bfd_section_from_som_symbol PARAMS ((bfd *, struct symbol_dictionary_record *)); static int log2 PARAMS ((unsigned int)); static bfd_reloc_status_type hppa_som_reloc PARAMS ((bfd *, arelent *, @@ -268,11 +264,11 @@ static boolean som_is_subspace PARAMS ((asection *)); static boolean som_is_container PARAMS ((asection *, asection *)); static boolean som_bfd_free_cached_info PARAMS ((bfd *)); static boolean som_bfd_link_split_section PARAMS ((bfd *, asection *)); - + /* Map SOM section names to POSIX/BSD single-character symbol types. - This table includes all the standard subspaces as defined in the - current "PRO ABI for PA-RISC Systems", $UNWIND$ which for + This table includes all the standard subspaces as defined in the + current "PRO ABI for PA-RISC Systems", $UNWIND$ which for some reason was left out, and sections specific to embedded stabs. */ static const struct section_to_type stt[] = { @@ -306,7 +302,7 @@ static const struct section_to_type stt[] = { Right now this table is only used to count and perform minimal processing on relocation streams so that they can be internalized - into BFD and symbolically printed by utilities. To make actual use + into BFD and symbolically printed by utilities. To make actual use of them would be much more difficult, BFD's concept of relocations is far too simple to handle SOM relocations. The basic assumption that a relocation can be completely processed independent of other @@ -314,7 +310,7 @@ static const struct section_to_type stt[] = { The SOM relocations are meant to be processed as a stream, they specify copying of data from the input section to the output section - while possibly modifying the data in some manner. They also can + while possibly modifying the data in some manner. They also can specify that a variable number of zeros or uninitialized data be inserted on in the output segment at the current offset. Some relocations specify that some previous relocation be re-applied at @@ -324,7 +320,7 @@ static const struct section_to_type stt[] = { in the BFD relocation data structure to store enough information to perform all the relocations. - Each entry in the table has three fields. + Each entry in the table has three fields. The first entry is an index into this "class" of relocations. This index can then be used as a variable within the relocation itself. @@ -332,14 +328,14 @@ static const struct section_to_type stt[] = { The second field is a format string which actually controls processing of the relocation. It uses a simple postfix machine to do calculations based on variables/constants found in the string and the relocation - stream. + stream. - The third field specifys whether or not this relocation may use + The third field specifys whether or not this relocation may use a constant (V) from the previous R_DATA_OVERRIDE rather than a constant stored in the instruction. - Variables: - + Variables: + L = input space byte count D = index into class of relocations M = output space byte count @@ -351,25 +347,25 @@ static const struct section_to_type stt[] = { U = second 32 bits of stack unwind information V = a literal constant (usually used in the next relocation) P = a previous relocation - - Lower case letters (starting with 'b') refer to following + + Lower case letters (starting with 'b') refer to following bytes in the relocation stream. 'b' is the next 1 byte, - c is the next 2 bytes, d is the next 3 bytes, etc... + c is the next 2 bytes, d is the next 3 bytes, etc... This is the variable part of the relocation entries that makes our life a living hell. numerical constants are also used in the format string. Note - the constants are represented in decimal. + the constants are represented in decimal. '+', "*" and "=" represents the obvious postfix operators. - '<' represents a left shift. + '<' represents a left shift. Stack Operations: Parameter Relocation Bits: - Unwind Entries: - + Unwind Entries: + Previous Relocations: The index field represents which in the queue of 4 previous fixups should be re-applied. @@ -379,14 +375,12 @@ static const struct section_to_type stt[] = { addil foo-$global$-0x1234 would use an override for "0x1234" rather than storing it into the addil itself. */ -struct fixup_format -{ +struct fixup_format { int D; - char *format; + const char *format; }; -static const struct fixup_format som_fixup_formats[256] = -{ +static const struct fixup_format som_fixup_formats[256] = { /* R_NO_RELOCATION */ 0, "LD1+4*=", /* 0x00 */ 1, "LD1+4*=", /* 0x01 */ @@ -699,8 +693,7 @@ static const struct fixup_format som_fixup_formats[256] = 0, "", /* 0xff */ }; -static const int comp1_opcodes[] = -{ +static const int comp1_opcodes[] = { 0x00, 0x40, 0x41, @@ -721,8 +714,7 @@ static const int comp1_opcodes[] = -1 }; -static const int comp2_opcodes[] = -{ +static const int comp2_opcodes[] = { 0x00, 0x80, 0x82, @@ -730,8 +722,7 @@ static const int comp2_opcodes[] = -1 }; -static const int comp3_opcodes[] = -{ +static const int comp3_opcodes[] = { 0x00, 0x02, -1 @@ -787,268 +778,268 @@ static const int comp3_opcodes[] = #define SOM_HOWTO(TYPE, NAME) \ HOWTO(TYPE, 0, 0, 32, false, 0, 0, hppa_som_reloc, NAME, false, 0, 0, false) -static reloc_howto_type som_hppa_howto_table[] = -{ - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_NO_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_NO_RELOCATION"}, - {R_ZEROES, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ZEROES"}, - {R_ZEROES, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ZEROES"}, - {R_UNINIT, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_UNINIT"}, - {R_UNINIT, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_UNINIT"}, - {R_RELOCATION, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RELOCATION"}, - {R_DATA_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DATA_ONE_SYMBOL"}, - {R_DATA_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DATA_ONE_SYMBOL"}, - {R_DATA_PLABEL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DATA_PLABEL"}, - {R_DATA_PLABEL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DATA_PLABEL"}, - {R_SPACE_REF, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_SPACE_REF"}, - {R_REPEATED_INIT, 0, 0, 32, false, 0, 0, hppa_som_reloc, "REPEATED_INIT"}, - {R_REPEATED_INIT, 0, 0, 32, false, 0, 0, hppa_som_reloc, "REPEATED_INIT"}, - {R_REPEATED_INIT, 0, 0, 32, false, 0, 0, hppa_som_reloc, "REPEATED_INIT"}, - {R_REPEATED_INIT, 0, 0, 32, false, 0, 0, hppa_som_reloc, "REPEATED_INIT"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_PCREL_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PCREL_CALL"}, - {R_PCREL_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PCREL_CALL"}, - {R_PCREL_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PCREL_CALL"}, - {R_PCREL_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PCREL_CALL"}, - {R_PCREL_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PCREL_CALL"}, - {R_PCREL_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PCREL_CALL"}, - {R_PCREL_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PCREL_CALL"}, - {R_PCREL_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PCREL_CALL"}, - {R_PCREL_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PCREL_CALL"}, - {R_PCREL_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PCREL_CALL"}, - {R_PCREL_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PCREL_CALL"}, - {R_PCREL_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PCREL_CALL"}, - {R_PCREL_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PCREL_CALL"}, - {R_PCREL_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PCREL_CALL"}, - {R_SHORT_PCREL_MODE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_SHORT_PCREL_MODE"}, - {R_LONG_PCREL_MODE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_LONG_PCREL_MODE"}, - {R_ABS_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ABS_CALL"}, - {R_ABS_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ABS_CALL"}, - {R_ABS_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ABS_CALL"}, - {R_ABS_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ABS_CALL"}, - {R_ABS_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ABS_CALL"}, - {R_ABS_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ABS_CALL"}, - {R_ABS_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ABS_CALL"}, - {R_ABS_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ABS_CALL"}, - {R_ABS_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ABS_CALL"}, - {R_ABS_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ABS_CALL"}, - {R_ABS_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ABS_CALL"}, - {R_ABS_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ABS_CALL"}, - {R_ABS_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ABS_CALL"}, - {R_ABS_CALL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ABS_CALL"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_DP_RELATIVE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DP_RELATIVE"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_DLT_REL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DLT_REL"}, - {R_DLT_REL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DLT_REL"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_CODE_ONE_SYMBOL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_ONE_SYMBOL"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_MILLI_REL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_MILLI_REL"}, - {R_MILLI_REL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_MILLI_REL"}, - {R_CODE_PLABEL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_PLABEL"}, - {R_CODE_PLABEL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_PLABEL"}, - {R_BREAKPOINT, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_BREAKPOINT"}, - {R_ENTRY, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ENTRY"}, - {R_ENTRY, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ENTRY"}, - {R_ALT_ENTRY, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_ALT_ENTRY"}, - {R_EXIT, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_EXIT"}, - {R_BEGIN_TRY, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_BEGIN_TRY"}, - {R_END_TRY, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_END_TRY"}, - {R_END_TRY, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_END_TRY"}, - {R_END_TRY, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_END_TRY"}, - {R_BEGIN_BRTAB, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_BEGIN_BRTAB"}, - {R_END_BRTAB, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_END_BRTAB"}, - {R_STATEMENT, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_STATEMENT"}, - {R_STATEMENT, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_STATEMENT"}, - {R_STATEMENT, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_STATEMENT"}, - {R_DATA_EXPR, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DATA_EXPR"}, - {R_CODE_EXPR, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_CODE_EXPR"}, - {R_FSEL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_FSEL"}, - {R_LSEL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_LSEL"}, - {R_RSEL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RSEL"}, - {R_N_MODE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_N_MODE"}, - {R_S_MODE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_S_MODE"}, - {R_D_MODE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_D_MODE"}, - {R_R_MODE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_R_MODE"}, - {R_DATA_OVERRIDE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DATA_OVERRIDE"}, - {R_DATA_OVERRIDE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DATA_OVERRIDE"}, - {R_DATA_OVERRIDE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DATA_OVERRIDE"}, - {R_DATA_OVERRIDE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DATA_OVERRIDE"}, - {R_DATA_OVERRIDE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_DATA_OVERRIDE"}, - {R_TRANSLATED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_TRANSLATED"}, - {R_AUX_UNWIND, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_AUX_UNWIND"}, - {R_COMP1, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_COMP1"}, - {R_COMP2, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_COMP2"}, - {R_COMP3, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_COMP3"}, - {R_PREV_FIXUP, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PREV_FIXUP"}, - {R_PREV_FIXUP, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PREV_FIXUP"}, - {R_PREV_FIXUP, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PREV_FIXUP"}, - {R_PREV_FIXUP, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_PREV_FIXUP"}, - {R_SEC_STMT, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_SEC_STMT"}, - {R_N0SEL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_N0SEL"}, - {R_N1SEL, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_N1SEL"}, - {R_LINETAB, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_LINETAB"}, - {R_LINETAB_ESC, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_LINETAB_ESC"}, - {R_LTP_OVERRIDE, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_LTP_OVERRIDE"}, - {R_COMMENT, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_COMMENT"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}, - {R_RESERVED, 0, 0, 32, false, 0, 0, hppa_som_reloc, "R_RESERVED"}}; - +static reloc_howto_type som_hppa_howto_table[] = { + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_NO_RELOCATION, "R_NO_RELOCATION"), + SOM_HOWTO (R_ZEROES, "R_ZEROES"), + SOM_HOWTO (R_ZEROES, "R_ZEROES"), + SOM_HOWTO (R_UNINIT, "R_UNINIT"), + SOM_HOWTO (R_UNINIT, "R_UNINIT"), + SOM_HOWTO (R_RELOCATION, "R_RELOCATION"), + SOM_HOWTO (R_DATA_ONE_SYMBOL, "R_DATA_ONE_SYMBOL"), + SOM_HOWTO (R_DATA_ONE_SYMBOL, "R_DATA_ONE_SYMBOL"), + SOM_HOWTO (R_DATA_PLABEL, "R_DATA_PLABEL"), + SOM_HOWTO (R_DATA_PLABEL, "R_DATA_PLABEL"), + SOM_HOWTO (R_SPACE_REF, "R_SPACE_REF"), + SOM_HOWTO (R_REPEATED_INIT, "REPEATED_INIT"), + SOM_HOWTO (R_REPEATED_INIT, "REPEATED_INIT"), + SOM_HOWTO (R_REPEATED_INIT, "REPEATED_INIT"), + SOM_HOWTO (R_REPEATED_INIT, "REPEATED_INIT"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_PCREL_CALL, "R_PCREL_CALL"), + SOM_HOWTO (R_PCREL_CALL, "R_PCREL_CALL"), + SOM_HOWTO (R_PCREL_CALL, "R_PCREL_CALL"), + SOM_HOWTO (R_PCREL_CALL, "R_PCREL_CALL"), + SOM_HOWTO (R_PCREL_CALL, "R_PCREL_CALL"), + SOM_HOWTO (R_PCREL_CALL, "R_PCREL_CALL"), + SOM_HOWTO (R_PCREL_CALL, "R_PCREL_CALL"), + SOM_HOWTO (R_PCREL_CALL, "R_PCREL_CALL"), + SOM_HOWTO (R_PCREL_CALL, "R_PCREL_CALL"), + SOM_HOWTO (R_PCREL_CALL, "R_PCREL_CALL"), + SOM_HOWTO (R_PCREL_CALL, "R_PCREL_CALL"), + SOM_HOWTO (R_PCREL_CALL, "R_PCREL_CALL"), + SOM_HOWTO (R_PCREL_CALL, "R_PCREL_CALL"), + SOM_HOWTO (R_PCREL_CALL, "R_PCREL_CALL"), + SOM_HOWTO (R_SHORT_PCREL_MODE, "R_SHORT_PCREL_MODE"), + SOM_HOWTO (R_LONG_PCREL_MODE, "R_LONG_PCREL_MODE"), + SOM_HOWTO (R_ABS_CALL, "R_ABS_CALL"), + SOM_HOWTO (R_ABS_CALL, "R_ABS_CALL"), + SOM_HOWTO (R_ABS_CALL, "R_ABS_CALL"), + SOM_HOWTO (R_ABS_CALL, "R_ABS_CALL"), + SOM_HOWTO (R_ABS_CALL, "R_ABS_CALL"), + SOM_HOWTO (R_ABS_CALL, "R_ABS_CALL"), + SOM_HOWTO (R_ABS_CALL, "R_ABS_CALL"), + SOM_HOWTO (R_ABS_CALL, "R_ABS_CALL"), + SOM_HOWTO (R_ABS_CALL, "R_ABS_CALL"), + SOM_HOWTO (R_ABS_CALL, "R_ABS_CALL"), + SOM_HOWTO (R_ABS_CALL, "R_ABS_CALL"), + SOM_HOWTO (R_ABS_CALL, "R_ABS_CALL"), + SOM_HOWTO (R_ABS_CALL, "R_ABS_CALL"), + SOM_HOWTO (R_ABS_CALL, "R_ABS_CALL"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_DP_RELATIVE, "R_DP_RELATIVE"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_DLT_REL, "R_DLT_REL"), + SOM_HOWTO (R_DLT_REL, "R_DLT_REL"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_CODE_ONE_SYMBOL, "R_CODE_ONE_SYMBOL"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_MILLI_REL, "R_MILLI_REL"), + SOM_HOWTO (R_MILLI_REL, "R_MILLI_REL"), + SOM_HOWTO (R_CODE_PLABEL, "R_CODE_PLABEL"), + SOM_HOWTO (R_CODE_PLABEL, "R_CODE_PLABEL"), + SOM_HOWTO (R_BREAKPOINT, "R_BREAKPOINT"), + SOM_HOWTO (R_ENTRY, "R_ENTRY"), + SOM_HOWTO (R_ENTRY, "R_ENTRY"), + SOM_HOWTO (R_ALT_ENTRY, "R_ALT_ENTRY"), + SOM_HOWTO (R_EXIT, "R_EXIT"), + SOM_HOWTO (R_BEGIN_TRY, "R_BEGIN_TRY"), + SOM_HOWTO (R_END_TRY, "R_END_TRY"), + SOM_HOWTO (R_END_TRY, "R_END_TRY"), + SOM_HOWTO (R_END_TRY, "R_END_TRY"), + SOM_HOWTO (R_BEGIN_BRTAB, "R_BEGIN_BRTAB"), + SOM_HOWTO (R_END_BRTAB, "R_END_BRTAB"), + SOM_HOWTO (R_STATEMENT, "R_STATEMENT"), + SOM_HOWTO (R_STATEMENT, "R_STATEMENT"), + SOM_HOWTO (R_STATEMENT, "R_STATEMENT"), + SOM_HOWTO (R_DATA_EXPR, "R_DATA_EXPR"), + SOM_HOWTO (R_CODE_EXPR, "R_CODE_EXPR"), + SOM_HOWTO (R_FSEL, "R_FSEL"), + SOM_HOWTO (R_LSEL, "R_LSEL"), + SOM_HOWTO (R_RSEL, "R_RSEL"), + SOM_HOWTO (R_N_MODE, "R_N_MODE"), + SOM_HOWTO (R_S_MODE, "R_S_MODE"), + SOM_HOWTO (R_D_MODE, "R_D_MODE"), + SOM_HOWTO (R_R_MODE, "R_R_MODE"), + SOM_HOWTO (R_DATA_OVERRIDE, "R_DATA_OVERRIDE"), + SOM_HOWTO (R_DATA_OVERRIDE, "R_DATA_OVERRIDE"), + SOM_HOWTO (R_DATA_OVERRIDE, "R_DATA_OVERRIDE"), + SOM_HOWTO (R_DATA_OVERRIDE, "R_DATA_OVERRIDE"), + SOM_HOWTO (R_DATA_OVERRIDE, "R_DATA_OVERRIDE"), + SOM_HOWTO (R_TRANSLATED, "R_TRANSLATED"), + SOM_HOWTO (R_AUX_UNWIND, "R_AUX_UNWIND"), + SOM_HOWTO (R_COMP1, "R_COMP1"), + SOM_HOWTO (R_COMP2, "R_COMP2"), + SOM_HOWTO (R_COMP3, "R_COMP3"), + SOM_HOWTO (R_PREV_FIXUP, "R_PREV_FIXUP"), + SOM_HOWTO (R_PREV_FIXUP, "R_PREV_FIXUP"), + SOM_HOWTO (R_PREV_FIXUP, "R_PREV_FIXUP"), + SOM_HOWTO (R_PREV_FIXUP, "R_PREV_FIXUP"), + SOM_HOWTO (R_SEC_STMT, "R_SEC_STMT"), + SOM_HOWTO (R_N0SEL, "R_N0SEL"), + SOM_HOWTO (R_N1SEL, "R_N1SEL"), + SOM_HOWTO (R_LINETAB, "R_LINETAB"), + SOM_HOWTO (R_LINETAB_ESC, "R_LINETAB_ESC"), + SOM_HOWTO (R_LTP_OVERRIDE, "R_LTP_OVERRIDE"), + SOM_HOWTO (R_COMMENT, "R_COMMENT"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED"), + SOM_HOWTO (R_RESERVED, "R_RESERVED") +}; + /* Initialize the SOM relocation queue. By definition the queue holds the last four multibyte fixups. */ - + static void som_initialize_reloc_queue (queue) struct reloc_queue *queue; @@ -1130,7 +1121,7 @@ som_reloc_queue_fix (queue, index) queue[1].size = tmp2; return; } - abort(); + abort (); } /* Search for a particular relocation in the relocation queue. */ @@ -1158,7 +1149,7 @@ som_reloc_queue_find (p, size, queue) static unsigned char * try_prev_fixup (abfd, subspace_reloc_sizep, p, size, queue) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; int *subspace_reloc_sizep; unsigned char *p; unsigned int size; @@ -1169,7 +1160,7 @@ try_prev_fixup (abfd, subspace_reloc_sizep, p, size, queue) if (queue_index != -1) { /* Found this in a previous fixup. Undo the fixup we - just built and use R_PREV_FIXUP instead. We saved + just built and use R_PREV_FIXUP instead. We saved a total of size - 1 bytes in the fixup stream. */ bfd_put_8 (abfd, R_PREV_FIXUP + queue_index, p); p += 1; @@ -1187,7 +1178,7 @@ try_prev_fixup (abfd, subspace_reloc_sizep, p, size, queue) /* Emit the proper R_NO_RELOCATION fixups to map the next SKIP bytes without any relocation. Update the size of the subspace - relocation stream via SUBSPACE_RELOC_SIZE_P; also return the + relocation stream via SUBSPACE_RELOC_SIZE_P; also return the current pointer into the relocation stream. */ static unsigned char * @@ -1218,8 +1209,8 @@ som_reloc_skip (abfd, skip, p, subspace_reloc_sizep, queue) most recent fixup. */ } } - - /* The difference must be less than 0x1000000. Use one + + /* The difference must be less than 0x1000000. Use one more R_NO_RELOCATION entry to get to the right difference. */ if ((skip & 3) == 0 && skip <= 0xc0000 && skip > 0) { @@ -1270,11 +1261,11 @@ som_reloc_addend (abfd, addend, p, subspace_reloc_sizep, queue) unsigned int *subspace_reloc_sizep; struct reloc_queue *queue; { - if ((unsigned)(addend) + 0x80 < 0x100) + if ((unsigned) (addend) + 0x80 < 0x100) { bfd_put_8 (abfd, R_DATA_OVERRIDE + 1, p); bfd_put_8 (abfd, addend, p + 1); - p = try_prev_fixup (abfd, subspace_reloc_sizep, p, 2, queue); + p = try_prev_fixup (abfd, subspace_reloc_sizep, p, 2, queue); } else if ((unsigned) (addend) + 0x8000 < 0x10000) { @@ -1312,11 +1303,11 @@ som_reloc_call (abfd, p, subspace_reloc_sizep, bfd_reloc, sym_num, queue) int arg_bits = HPPA_R_ARG_RELOC (bfd_reloc->addend); int rtn_bits = arg_bits & 0x3; int type, done = 0; - + /* You'll never believe all this is necessary to handle relocations for function calls. Having to compute and pack the argument relocation bits is the real nightmare. - + If you're interested in how this works, just forget it. You really do not want to know about this braindamage. */ @@ -1368,7 +1359,7 @@ som_reloc_call (abfd, p, subspace_reloc_sizep, bfd_reloc, sym_num, queue) done = 1; } } - + /* If this could not be handled with a simple relocation, then do a hard one. Hard relocations occur if the symbol number was too high or if the encoding of argument relocation bits is too complex. */ @@ -1385,14 +1376,14 @@ som_reloc_call (abfd, p, subspace_reloc_sizep, bfd_reloc, sym_num, queue) type += 9 * 4; else type += (3 * (arg_bits >> 4 & 3) + (arg_bits >> 2 & 3)) * 4; - + /* Output the first two bytes of the relocation. These describe the length of the relocation and encoding style. */ bfd_put_8 (abfd, bfd_reloc->howto->type + 10 + 2 * (sym_num >= 0x100) + (type >= 0x100), p); bfd_put_8 (abfd, type, p + 1); - + /* Now output the symbol index and see if this bizarre relocation just happened to be in the relocation queue. */ if (sym_num < 0x100) @@ -1410,8 +1401,7 @@ som_reloc_call (abfd, p, subspace_reloc_sizep, bfd_reloc, sym_num, queue) return p; } - -/* Return the logarithm of X, base 2, considering X unsigned. +/* Return the logarithm of X, base 2, considering X unsigned. Abort -1 if X is not a power or two or is zero. */ static int @@ -1432,13 +1422,13 @@ log2 (x) static bfd_reloc_status_type hppa_som_reloc (abfd, reloc_entry, symbol_in, data, input_section, output_bfd, error_message) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; arelent *reloc_entry; - asymbol *symbol_in; - PTR data; + asymbol *symbol_in ATTRIBUTE_UNUSED; + PTR data ATTRIBUTE_UNUSED; asection *input_section; bfd *output_bfd; - char **error_message; + char **error_message ATTRIBUTE_UNUSED; { if (output_bfd) { @@ -1467,125 +1457,125 @@ hppa_som_gen_reloc_type (abfd, base_type, format, field, sym_diff, sym) if (!final_types || !final_type) return NULL; - /* The field selector may require additional relocations to be + /* The field selector may require additional relocations to be generated. It's impossible to know at this moment if additional relocations will be needed, so we make them. The code to actually write the relocation/fixup stream is responsible for removing any redundant relocations. */ switch (field) { - case e_fsel: - case e_psel: - case e_lpsel: - case e_rpsel: - final_types[0] = final_type; - final_types[1] = NULL; - final_types[2] = NULL; - *final_type = base_type; - break; + case e_fsel: + case e_psel: + case e_lpsel: + case e_rpsel: + final_types[0] = final_type; + final_types[1] = NULL; + final_types[2] = NULL; + *final_type = base_type; + break; - case e_tsel: - case e_ltsel: - case e_rtsel: - final_types[0] = (int *) bfd_alloc (abfd, sizeof (int)); - if (!final_types[0]) - return NULL; - if (field == e_tsel) - *final_types[0] = R_FSEL; - else if (field == e_ltsel) - *final_types[0] = R_LSEL; - else - *final_types[0] = R_RSEL; - final_types[1] = final_type; - final_types[2] = NULL; - *final_type = base_type; - break; + case e_tsel: + case e_ltsel: + case e_rtsel: + final_types[0] = (int *) bfd_alloc (abfd, sizeof (int)); + if (!final_types[0]) + return NULL; + if (field == e_tsel) + *final_types[0] = R_FSEL; + else if (field == e_ltsel) + *final_types[0] = R_LSEL; + else + *final_types[0] = R_RSEL; + final_types[1] = final_type; + final_types[2] = NULL; + *final_type = base_type; + break; - case e_lssel: - case e_rssel: - final_types[0] = (int *) bfd_alloc (abfd, sizeof (int)); - if (!final_types[0]) - return NULL; - *final_types[0] = R_S_MODE; - final_types[1] = final_type; - final_types[2] = NULL; - *final_type = base_type; - break; + case e_lssel: + case e_rssel: + final_types[0] = (int *) bfd_alloc (abfd, sizeof (int)); + if (!final_types[0]) + return NULL; + *final_types[0] = R_S_MODE; + final_types[1] = final_type; + final_types[2] = NULL; + *final_type = base_type; + break; - case e_lsel: - case e_rsel: - final_types[0] = (int *) bfd_alloc (abfd, sizeof (int)); - if (!final_types[0]) - return NULL; - *final_types[0] = R_N_MODE; - final_types[1] = final_type; - final_types[2] = NULL; - *final_type = base_type; - break; + case e_lsel: + case e_rsel: + final_types[0] = (int *) bfd_alloc (abfd, sizeof (int)); + if (!final_types[0]) + return NULL; + *final_types[0] = R_N_MODE; + final_types[1] = final_type; + final_types[2] = NULL; + *final_type = base_type; + break; - case e_ldsel: - case e_rdsel: - final_types[0] = (int *) bfd_alloc (abfd, sizeof (int)); - if (!final_types[0]) - return NULL; - *final_types[0] = R_D_MODE; - final_types[1] = final_type; - final_types[2] = NULL; - *final_type = base_type; - break; + case e_ldsel: + case e_rdsel: + final_types[0] = (int *) bfd_alloc (abfd, sizeof (int)); + if (!final_types[0]) + return NULL; + *final_types[0] = R_D_MODE; + final_types[1] = final_type; + final_types[2] = NULL; + *final_type = base_type; + break; - case e_lrsel: - case e_rrsel: - final_types[0] = (int *) bfd_alloc (abfd, sizeof (int)); - if (!final_types[0]) - return NULL; - *final_types[0] = R_R_MODE; - final_types[1] = final_type; - final_types[2] = NULL; - *final_type = base_type; - break; + case e_lrsel: + case e_rrsel: + final_types[0] = (int *) bfd_alloc (abfd, sizeof (int)); + if (!final_types[0]) + return NULL; + *final_types[0] = R_R_MODE; + final_types[1] = final_type; + final_types[2] = NULL; + *final_type = base_type; + break; - case e_nsel: - final_types[0] = (int *) bfd_alloc (abfd, sizeof (int)); - if (!final_types[0]) - return NULL; - *final_types[0] = R_N1SEL; - final_types[1] = final_type; - final_types[2] = NULL; - *final_type = base_type; - break; + case e_nsel: + final_types[0] = (int *) bfd_alloc (abfd, sizeof (int)); + if (!final_types[0]) + return NULL; + *final_types[0] = R_N1SEL; + final_types[1] = final_type; + final_types[2] = NULL; + *final_type = base_type; + break; - case e_nlsel: - case e_nlrsel: - final_types[0] = (int *) bfd_alloc (abfd, sizeof (int)); - if (!final_types[0]) - return NULL; - *final_types[0] = R_N0SEL; - final_types[1] = (int *) bfd_alloc (abfd, sizeof (int)); - if (!final_types[1]) - return NULL; - if (field == e_nlsel) - *final_types[1] = R_N_MODE; - else - *final_types[1] = R_R_MODE; - final_types[2] = final_type; - final_types[3] = NULL; - *final_type = base_type; - break; + case e_nlsel: + case e_nlrsel: + final_types[0] = (int *) bfd_alloc (abfd, sizeof (int)); + if (!final_types[0]) + return NULL; + *final_types[0] = R_N0SEL; + final_types[1] = (int *) bfd_alloc (abfd, sizeof (int)); + if (!final_types[1]) + return NULL; + if (field == e_nlsel) + *final_types[1] = R_N_MODE; + else + *final_types[1] = R_R_MODE; + final_types[2] = final_type; + final_types[3] = NULL; + *final_type = base_type; + break; } - + switch (base_type) { case R_HPPA: /* The difference of two symbols needs *very* special handling. */ if (sym_diff) { - final_types[0] = (int *)bfd_alloc (abfd, sizeof (int)); - final_types[1] = (int *)bfd_alloc (abfd, sizeof (int)); - final_types[2] = (int *)bfd_alloc (abfd, sizeof (int)); - final_types[3] = (int *)bfd_alloc (abfd, sizeof (int)); + final_types[0] = (int *) bfd_alloc (abfd, sizeof (int)); + final_types[1] = (int *) bfd_alloc (abfd, sizeof (int)); + final_types[2] = (int *) bfd_alloc (abfd, sizeof (int)); + final_types[3] = (int *) bfd_alloc (abfd, sizeof (int)); if (!final_types[0] || !final_types[1] || !final_types[2]) - return NULL; + return NULL; if (field == e_fsel) *final_types[0] = R_FSEL; else if (field == e_rsel) @@ -1605,8 +1595,8 @@ hppa_som_gen_reloc_type (abfd, base_type, format, field, sym_diff, sym) } /* PLABELs get their own relocation type. */ else if (field == e_psel - || field == e_lpsel - || field == e_rpsel) + || field == e_lpsel + || field == e_rpsel) { /* A PLABEL relocation that has a size of 32 bits must be a R_DATA_PLABEL. All others are R_CODE_PLABELs. */ @@ -1617,8 +1607,8 @@ hppa_som_gen_reloc_type (abfd, base_type, format, field, sym_diff, sym) } /* PIC stuff. */ else if (field == e_tsel - || field == e_ltsel - || field == e_rtsel) + || field == e_ltsel + || field == e_rtsel) *final_type = R_DLT_REL; /* A relocation in the data space is always a full 32bits. */ else if (format == 32) @@ -1648,7 +1638,6 @@ hppa_som_gen_reloc_type (abfd, base_type, format, field, sym_diff, sym) } break; - case R_HPPA_GOTOFF: /* More PLABEL special cases. */ if (field == e_psel @@ -1661,12 +1650,12 @@ hppa_som_gen_reloc_type (abfd, base_type, format, field, sym_diff, sym) /* The difference of two symbols needs *very* special handling. */ if (sym_diff) { - final_types[0] = (int *)bfd_alloc (abfd, sizeof (int)); - final_types[1] = (int *)bfd_alloc (abfd, sizeof (int)); - final_types[2] = (int *)bfd_alloc (abfd, sizeof (int)); - final_types[3] = (int *)bfd_alloc (abfd, sizeof (int)); + final_types[0] = (int *) bfd_alloc (abfd, sizeof (int)); + final_types[1] = (int *) bfd_alloc (abfd, sizeof (int)); + final_types[2] = (int *) bfd_alloc (abfd, sizeof (int)); + final_types[3] = (int *) bfd_alloc (abfd, sizeof (int)); if (!final_types[0] || !final_types[1] || !final_types[2]) - return NULL; + return NULL; if (field == e_fsel) *final_types[0] = R_FSEL; else if (field == e_rsel) @@ -1718,10 +1707,9 @@ hppa_som_gen_reloc_type (abfd, base_type, format, field, sym_diff, sym) /* Return the address of the correct entry in the PA SOM relocation howto table. */ -/*ARGSUSED*/ static reloc_howto_type * som_bfd_reloc_type_lookup (abfd, code) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; bfd_reloc_code_real_type code; { if ((int) code < (int) R_NO_RELOCATION + 255) @@ -1784,7 +1772,7 @@ som_object_setup (abfd, file_hdrp, aux_hdrp, current_offset) /* Allocate space to hold the saved exec header information. */ obj_som_exec_data (abfd) = (struct som_exec_data *) - bfd_zalloc (abfd, sizeof (struct som_exec_data )); + bfd_zalloc (abfd, sizeof (struct som_exec_data)); if (obj_som_exec_data (abfd) == NULL) return NULL; @@ -1795,7 +1783,7 @@ som_object_setup (abfd, file_hdrp, aux_hdrp, current_offset) It's about time, OSF has used the new id since at least 1992; HPUX didn't start till nearly 1995!. - + The new approach examines the entry field. If it's zero or not 4 byte aligned then it's not a proper code address and we guess it's really the executable flags. */ @@ -1824,10 +1812,10 @@ som_object_setup (abfd, file_hdrp, aux_hdrp, current_offset) bfd_default_set_arch_mach (abfd, bfd_arch_hppa, pa10); bfd_get_symcount (abfd) = file_hdrp->symbol_total; - /* Initialize the saved symbol table and string table to NULL. + /* Initialize the saved symbol table and string table to NULL. Save important offsets and sizes from the SOM header into the BFD. */ - obj_som_stringtab (abfd) = (char *) NULL; + obj_som_stringtab (abfd) = (char *) NULL; obj_som_symtab (abfd) = (som_symbol_type *) NULL; obj_som_sorted_syms (abfd) = NULL; obj_som_stringtab_size (abfd) = file_hdrp->symbol_strings_size; @@ -1858,20 +1846,20 @@ setup_sections (abfd, file_hdr, current_offset) unsigned int total_subspaces = 0; asection **subspace_sections, *section; - /* First, read in space names */ + /* First, read in space names. */ space_strings = bfd_malloc (file_hdr->space_strings_size); if (!space_strings && file_hdr->space_strings_size != 0) goto error_return; - if (bfd_seek (abfd, current_offset + file_hdr->space_strings_location, - SEEK_SET) < 0) + if (bfd_seek (abfd, current_offset + file_hdr->space_strings_location, + SEEK_SET) < 0) goto error_return; if (bfd_read (space_strings, 1, file_hdr->space_strings_size, abfd) != file_hdr->space_strings_size) goto error_return; - /* Loop over all of the space dictionaries, building up sections */ + /* Loop over all of the space dictionaries, building up sections. */ for (space_index = 0; space_index < file_hdr->space_total; space_index++) { struct space_dictionary_record space; @@ -1880,7 +1868,7 @@ setup_sections (abfd, file_hdr, current_offset) asection *space_asect; char *newname; - /* Read the space dictionary element */ + /* Read the space dictionary element. */ if (bfd_seek (abfd, (current_offset + file_hdr->space_location + space_index * sizeof space), @@ -1889,20 +1877,20 @@ setup_sections (abfd, file_hdr, current_offset) if (bfd_read (&space, 1, sizeof space, abfd) != sizeof space) goto error_return; - /* Setup the space name string */ + /* Setup the space name string. */ space.name.n_name = space.name.n_strx + space_strings; - /* Make a section out of it */ + /* Make a section out of it. */ newname = bfd_alloc (abfd, strlen (space.name.n_name) + 1); if (!newname) goto error_return; strcpy (newname, space.name.n_name); - + space_asect = bfd_make_section_anyway (abfd, newname); if (!space_asect) goto error_return; - if (space.is_loadable == 0) + if (space.is_loadable == 0) space_asect->flags |= SEC_DEBUGGING; /* Set up all the attributes for the space. */ @@ -1915,7 +1903,7 @@ setup_sections (abfd, file_hdr, current_offset) if (space.subspace_quantity == 0) continue; - /* Now, read in the first subspace for this space */ + /* Now, read in the first subspace for this space. */ if (bfd_seek (abfd, (current_offset + file_hdr->subspace_location + space.subspace_index * sizeof subspace), @@ -1923,14 +1911,15 @@ setup_sections (abfd, file_hdr, current_offset) goto error_return; if (bfd_read (&subspace, 1, sizeof subspace, abfd) != sizeof subspace) goto error_return; - /* Seek back to the start of the subspaces for loop below */ + /* Seek back to the start of the subspaces for loop below. */ if (bfd_seek (abfd, (current_offset + file_hdr->subspace_location + space.subspace_index * sizeof subspace), SEEK_SET) < 0) goto error_return; - /* Setup the start address and file loc from the first subspace record */ + /* Setup the start address and file loc from the first subspace + record. */ space_asect->vma = subspace.subspace_start; space_asect->filepos = subspace.file_loc_init_value + current_offset; space_asect->alignment_power = log2 (subspace.alignment); @@ -1941,18 +1930,18 @@ setup_sections (abfd, file_hdr, current_offset) loop placed any useful values into it. */ memset (&save_subspace, 0, sizeof (struct subspace_dictionary_record)); - /* Loop over the rest of the subspaces, building up more sections */ + /* Loop over the rest of the subspaces, building up more sections. */ for (subspace_index = 0; subspace_index < space.subspace_quantity; subspace_index++) { asection *subspace_asect; - /* Read in the next subspace */ + /* Read in the next subspace. */ if (bfd_read (&subspace, 1, sizeof subspace, abfd) != sizeof subspace) goto error_return; - /* Setup the subspace name string */ + /* Setup the subspace name string. */ subspace.name.n_name = subspace.name.n_strx + space_strings; newname = bfd_alloc (abfd, strlen (subspace.name.n_name) + 1); @@ -1960,7 +1949,7 @@ setup_sections (abfd, file_hdr, current_offset) goto error_return; strcpy (newname, subspace.name.n_name); - /* Make a section out of this subspace */ + /* Make a section out of this subspace. */ subspace_asect = bfd_make_section_anyway (abfd, newname); if (!subspace_asect) goto error_return; @@ -1972,7 +1961,7 @@ setup_sections (abfd, file_hdr, current_offset) subspace.quadrant) == false) goto error_return; - /* Keep an easy mapping between subspaces and sections. + /* Keep an easy mapping between subspaces and sections. Note we do not necessarily read the subspaces in the same order in which they appear in the object file. @@ -1988,12 +1977,12 @@ setup_sections (abfd, file_hdr, current_offset) by the access_control_bits in the subspace header. */ switch (subspace.access_control_bits >> 4) { - /* Readonly data. */ + /* Readonly data. */ case 0x0: subspace_asect->flags |= SEC_DATA | SEC_READONLY; break; - /* Normal data. */ + /* Normal data. */ case 0x1: subspace_asect->flags |= SEC_DATA; break; @@ -2014,8 +2003,8 @@ setup_sections (abfd, file_hdr, current_offset) subspace_asect->flags |= SEC_CODE; break; } - - if (subspace.dup_common || subspace.is_common) + + if (subspace.dup_common || subspace.is_common) subspace_asect->flags |= SEC_IS_COMMON; else if (subspace.subspace_length > 0) subspace_asect->flags |= SEC_HAS_CONTENTS; @@ -2044,7 +2033,7 @@ setup_sections (abfd, file_hdr, current_offset) subspace_asect->rel_filepos = subspace.fixup_request_index; som_section_data (subspace_asect)->reloc_size = subspace.fixup_request_quantity; - /* We can not determine this yet. When we read in the + /* We can not determine this yet. When we read in the relocation table the correct value will be filled in. */ subspace_asect->reloc_count = -1; } @@ -2099,7 +2088,7 @@ setup_sections (abfd, file_hdr, current_offset) } qsort (subspace_sections, total_subspaces, sizeof (asection *), compare_subspaces); - + /* subspace_sections is now sorted in the order in which the subspaces appear in the object file. Assign an index to each one now. */ for (i = 0; i < total_subspaces; i++) @@ -2133,7 +2122,7 @@ som_object_p (abfd) unsigned long current_offset = 0; struct lst_header lst_header; struct som_entry som_entry; -#define ENTRY_SIZE sizeof(struct som_entry) +#define ENTRY_SIZE sizeof (struct som_entry) if (bfd_read ((PTR) & file_hdr, 1, FILE_HDR_SIZE, abfd) != FILE_HDR_SIZE) { @@ -2167,57 +2156,57 @@ som_object_p (abfd) #ifdef EXECLIBMAGIC case EXECLIBMAGIC: - /* Read the lst header and determine where the SOM directory begins */ + /* Read the lst header and determine where the SOM directory begins. */ if (bfd_seek (abfd, (file_ptr) 0, SEEK_SET) < 0) - { - if (bfd_get_error () != bfd_error_system_call) + { + if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); - return 0; - } + return 0; + } if (bfd_read ((PTR) & lst_header, 1, SLSTHDR, abfd) != SLSTHDR) - { - if (bfd_get_error () != bfd_error_system_call) + { + if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); - return 0; - } + return 0; + } - /* Position to and read the first directory entry */ + /* Position to and read the first directory entry. */ if (bfd_seek (abfd, lst_header.dir_loc, SEEK_SET) < 0) - { - if (bfd_get_error () != bfd_error_system_call) + { + if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); - return 0; - } + return 0; + } if (bfd_read ((PTR) & som_entry, 1, ENTRY_SIZE, abfd) != ENTRY_SIZE) - { - if (bfd_get_error () != bfd_error_system_call) + { + if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); - return 0; - } + return 0; + } - /* Now position to the first SOM */ + /* Now position to the first SOM. */ if (bfd_seek (abfd, som_entry.location, SEEK_SET) < 0) - { - if (bfd_get_error () != bfd_error_system_call) + { + if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); - return 0; - } + return 0; + } current_offset = som_entry.location; - /* And finally, re-read the som header */ + /* And finally, re-read the som header. */ if (bfd_read ((PTR) & file_hdr, 1, FILE_HDR_SIZE, abfd) != FILE_HDR_SIZE) - { - if (bfd_get_error () != bfd_error_system_call) + { + if (bfd_get_error () != bfd_error_system_call) bfd_set_error (bfd_error_wrong_format); - return 0; - } + return 0; + } break; #endif @@ -2320,7 +2309,7 @@ som_prep_headers (abfd) a wise thing to do, it makes comparing objects during a multi-stage bootstrap difficult. */ file_hdr->file_time.secs = 0; - file_hdr->file_time.nanosecs = 0; + file_hdr->file_time.nanosecs = 0; file_hdr->entry_space = 0; file_hdr->entry_subspace = 0; @@ -2336,13 +2325,13 @@ som_prep_headers (abfd) subspace. */ if (!som_is_space (section) && !som_is_subspace (section)) continue; - + if (som_is_space (section)) { /* Allocate space for the space dictionary. */ - som_section_data (section)->space_dict - = (struct space_dictionary_record *) - bfd_zalloc (abfd, sizeof (struct space_dictionary_record)); + som_section_data (section)->space_dict = + (struct space_dictionary_record *) + bfd_zalloc (abfd, sizeof (struct space_dictionary_record)); if (som_section_data (section)->space_dict == NULL) return false; /* Set space attributes. Note most attributes of SOM spaces @@ -2351,11 +2340,11 @@ som_prep_headers (abfd) som_section_data (section)->space_dict->init_pointer_index = -1; /* Set more attributes that were stuffed away in private data. */ - som_section_data (section)->space_dict->sort_key = + som_section_data (section)->space_dict->sort_key = som_section_data (section)->copy_data->sort_key; - som_section_data (section)->space_dict->is_defined = + som_section_data (section)->space_dict->is_defined = som_section_data (section)->copy_data->is_defined; - som_section_data (section)->space_dict->is_private = + som_section_data (section)->space_dict->is_private = som_section_data (section)->copy_data->is_private; som_section_data (section)->space_dict->space_number = som_section_data (section)->copy_data->space_number; @@ -2384,13 +2373,13 @@ som_prep_headers (abfd) if (section->flags & SEC_CODE) som_section_data (section)->subspace_dict->code_only = 1; - som_section_data (section)->subspace_dict->subspace_start = + som_section_data (section)->subspace_dict->subspace_start = section->vma; som_section_data (section)->subspace_dict->subspace_length = bfd_section_size (abfd, section); som_section_data (section)->subspace_dict->initialization_length = bfd_section_size (abfd, section); - som_section_data (section)->subspace_dict->alignment = + som_section_data (section)->subspace_dict->alignment = 1 << section->alignment_power; /* Set more attributes that were stuffed away in private data. */ @@ -2472,7 +2461,7 @@ som_count_spaces (abfd) asection *section; for (section = abfd->sections; section != NULL; section = section->next) - count += som_is_space (section); + count += som_is_space (section); return count; } @@ -2507,7 +2496,7 @@ compare_syms (arg1, arg2) asymbol **sym1 = (asymbol **) arg1; asymbol **sym2 = (asymbol **) arg2; unsigned int count1, count2; - + /* Get relocation count for each symbol. Note that the count is stored in the udata pointer for section symbols! */ if ((*sym1)->flags & BSF_SECTION_SYM) @@ -2539,8 +2528,7 @@ compare_subspaces (arg1, arg2) { asection **subspace1 = (asection **) arg1; asection **subspace2 = (asection **) arg2; - unsigned int count1, count2; - + if ((*subspace1)->target_index < (*subspace2)->target_index) return -1; else if ((*subspace2)->target_index < (*subspace1)->target_index) @@ -2604,7 +2592,7 @@ som_prep_for_fixups (abfd, syms, num_syms) || bfd_is_abs_section ((*reloc->sym_ptr_ptr)->section)) continue; - /* Scaling to encourage symbols involved in R_DP_RELATIVE + /* Scaling to encourage symbols involved in R_DP_RELATIVE and R_CODE_ONE_SYMBOL relocations to come first. These two relocations have single byte versions if the symbol index is very small. */ @@ -2645,7 +2633,7 @@ som_prep_for_fixups (abfd, syms, num_syms) if (sorted_syms[i]->flags & BSF_SECTION_SYM) sorted_syms[i]->udata.i = i; else - som_symbol_data (sorted_syms[i])->index = i; + som_symbol_data (sorted_syms[i])->index = i; } } @@ -2690,7 +2678,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) { int reloc_offset, current_rounding_mode; #ifndef NO_PCREL_MODES - int current_call_mode; + int current_call_mode; #endif /* Find a subspace of this space. */ @@ -2712,7 +2700,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) som_section_data (subsection)->subspace_dict->fixup_request_index = total_reloc_size; - /* To make life easier start over with a clean slate for + /* To make life easier start over with a clean slate for each subspace. Seek to the start of the relocation stream for this subspace in preparation for writing out its fixup stream. */ @@ -2730,7 +2718,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) current_call_mode = R_SHORT_PCREL_MODE; #endif - /* Translate each BFD relocation into one or more SOM + /* Translate each BFD relocation into one or more SOM relocations. */ for (j = 0; j < subsection->reloc_count; j++) { @@ -2738,16 +2726,16 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) unsigned int skip; int sym_num; - /* Get the symbol number. Remember it's stored in a + /* Get the symbol number. Remember it's stored in a special place for section symbols. */ if ((*bfd_reloc->sym_ptr_ptr)->flags & BSF_SECTION_SYM) sym_num = (*bfd_reloc->sym_ptr_ptr)->udata.i; else sym_num = som_symbol_data (*bfd_reloc->sym_ptr_ptr)->index; - + /* If there is not enough room for the next couple relocations, then dump the current buffer contents now. Also reinitialize - the relocation queue. + the relocation queue. No single BFD relocation could ever translate into more than 100 bytes of SOM relocations (20bytes is probably the @@ -2818,7 +2806,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) case R_DP_RELATIVE: /* Account for any addend. */ if (bfd_reloc->addend) - p = som_reloc_addend (abfd, bfd_reloc->addend, p, + p = som_reloc_addend (abfd, bfd_reloc->addend, p, &subspace_reloc_size, reloc_queue); if (sym_num < 0x20) @@ -2838,7 +2826,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) { bfd_put_8 (abfd, bfd_reloc->howto->type + 33, p); bfd_put_8 (abfd, sym_num >> 16, p + 1); - bfd_put_16 (abfd, sym_num, p + 2); + bfd_put_16 (abfd, sym_num, p + 2); p = try_prev_fixup (abfd, &subspace_reloc_size, p, 4, reloc_queue); } @@ -2853,7 +2841,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) /* Account for any addend using R_DATA_OVERRIDE. */ if (bfd_reloc->howto->type != R_DATA_ONE_SYMBOL && bfd_reloc->addend) - p = som_reloc_addend (abfd, bfd_reloc->addend, p, + p = som_reloc_addend (abfd, bfd_reloc->addend, p, &subspace_reloc_size, reloc_queue); if (sym_num < 0x100) @@ -2867,7 +2855,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) { bfd_put_8 (abfd, bfd_reloc->howto->type + 1, p); bfd_put_8 (abfd, sym_num >> 16, p + 1); - bfd_put_16 (abfd, sym_num, p + 2); + bfd_put_16 (abfd, sym_num, p + 2); p = try_prev_fixup (abfd, &subspace_reloc_size, p, 4, reloc_queue); } @@ -2888,11 +2876,11 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) the R_ENTRY relocation, and the rest in the R_EXIT relocation. */ bfd_put_32 (abfd, bfd_reloc->addend, p + 1); - + /* Find the next R_EXIT relocation. */ for (tmp = j; tmp < subsection->reloc_count; tmp++) { - tmp_reloc = subsection->orelocation[tmp]; + tmp_reloc = subsection->orelocation[tmp]; if (tmp_reloc->howto->type == R_EXIT) break; } @@ -2905,7 +2893,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) p, 9, reloc_queue); break; } - + case R_N_MODE: case R_S_MODE: case R_D_MODE: @@ -2971,9 +2959,9 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) p, 4, reloc_queue); } break; - + case R_COMP1: - /* The only time we generate R_COMP1, R_COMP2 and + /* The only time we generate R_COMP1, R_COMP2 and R_CODE_EXPR relocs is for the difference of two symbols. Hence we can cheat here. */ bfd_put_8 (abfd, bfd_reloc->howto->type, p); @@ -2983,7 +2971,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) break; case R_COMP2: - /* The only time we generate R_COMP1, R_COMP2 and + /* The only time we generate R_COMP1, R_COMP2 and R_CODE_EXPR relocs is for the difference of two symbols. Hence we can cheat here. */ bfd_put_8 (abfd, bfd_reloc->howto->type, p); @@ -2996,7 +2984,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) case R_CODE_EXPR: case R_DATA_EXPR: - /* The only time we generate R_COMP1, R_COMP2 and + /* The only time we generate R_COMP1, R_COMP2 and R_CODE_EXPR relocs is for the difference of two symbols. Hence we can cheat here. */ bfd_put_8 (abfd, bfd_reloc->howto->type, p); @@ -3017,7 +3005,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep) /* Last BFD relocation for a subspace has been processed. Map the rest of the subspace with R_NO_RELOCATION fixups. */ - p = som_reloc_skip (abfd, bfd_section_size (abfd, subsection) + p = som_reloc_skip (abfd, bfd_section_size (abfd, subsection) - reloc_offset, p, &subspace_reloc_size, reloc_queue); @@ -3047,14 +3035,12 @@ som_write_space_strings (abfd, current_offset, string_sizep) { /* Chunk of memory that we can use as buffer space, then throw away. */ - unsigned char tmp_space[SOM_TMP_BUFSIZE]; - unsigned char *p; + size_t tmp_space_size = SOM_TMP_BUFSIZE; + unsigned char *tmp_space = alloca (tmp_space_size); + unsigned char *p = tmp_space; unsigned int strings_size = 0; asection *section; - memset (tmp_space, 0, SOM_TMP_BUFSIZE); - p = tmp_space; - /* Seek to the start of the space strings in preparation for writing them out. */ if (bfd_seek (abfd, current_offset, SEEK_SET) < 0) @@ -3064,7 +3050,7 @@ som_write_space_strings (abfd, current_offset, string_sizep) building up and writing string table entries for their names. */ for (section = abfd->sections; section != NULL; section = section->next) { - int length; + size_t length; /* Only work with space/subspaces; avoid any other sections which might have been made (.text for example). */ @@ -3075,14 +3061,32 @@ som_write_space_strings (abfd, current_offset, string_sizep) length = strlen (section->name); /* If there is not enough room for the next entry, then dump the - current buffer contents now. Each entry will take 4 bytes to - hold the string length + the string itself + null terminator. */ - if (p - tmp_space + 5 + length > SOM_TMP_BUFSIZE) + current buffer contents now and maybe allocate a larger + buffer. Each entry will take 4 bytes to hold the string + length + the string itself + null terminator. */ + if (p - tmp_space + 5 + length > tmp_space_size) { + /* Flush buffer before refilling or reallocating. */ if (bfd_write ((PTR) &tmp_space[0], p - tmp_space, 1, abfd) - != p - tmp_space) + != p - tmp_space) return false; - /* Reset to beginning of the buffer space. */ + + /* Reallocate if now empty buffer still too small. */ + if (5 + length > tmp_space_size) + { + /* Ensure a minimum growth factor to avoid O(n**2) space + consumption for n strings. The optimal minimum + factor seems to be 2, as no other value can guarantee + wasting less then 50% space. (Note that we cannot + deallocate space allocated by `alloca' without + returning from this function.) The same technique is + used a few more times below when a buffer is + reallocated. */ + tmp_space_size = MAX (2 * tmp_space_size, 5 + length); + tmp_space = alloca (tmp_space_size); + } + + /* Reset to beginning of the (possibly new) buffer space. */ p = tmp_space; } @@ -3133,11 +3137,13 @@ som_write_symbol_strings (abfd, current_offset, syms, num_syms, string_sizep, COMPUNIT *compilation_unit; { unsigned int i; - + /* Chunk of memory that we can use as buffer space, then throw away. */ - unsigned char tmp_space[SOM_TMP_BUFSIZE]; - unsigned char *p; + size_t tmp_space_size = SOM_TMP_BUFSIZE; + unsigned char *tmp_space = alloca (tmp_space_size); + unsigned char *p = tmp_space; + unsigned int strings_size = 0; unsigned char *comp[4]; @@ -3155,9 +3161,6 @@ som_write_symbol_strings (abfd, current_offset, syms, num_syms, string_sizep, comp[3] = compilation_unit->version_id.n_name; } - memset (tmp_space, 0, SOM_TMP_BUFSIZE); - p = tmp_space; - /* Seek to the start of the space strings in preparation for writing them out. */ if (bfd_seek (abfd, current_offset, SEEK_SET) < 0) @@ -3167,16 +3170,28 @@ som_write_symbol_strings (abfd, current_offset, syms, num_syms, string_sizep, { for (i = 0; i < 4; i++) { - int length = strlen (comp[i]); + size_t length = strlen (comp[i]); /* If there is not enough room for the next entry, then dump - the current buffer contents now. */ - if (p - tmp_space + 5 + length > SOM_TMP_BUFSIZE) + the current buffer contents now and maybe allocate a + larger buffer. */ + if (p - tmp_space + 5 + length > tmp_space_size) { + /* Flush buffer before refilling or reallocating. */ if (bfd_write ((PTR) &tmp_space[0], p - tmp_space, 1, abfd) != p - tmp_space) return false; - /* Reset to beginning of the buffer space. */ + + /* Reallocate if now empty buffer still too small. */ + if (5 + length > tmp_space_size) + { + /* See alloca above for discussion of new size. */ + tmp_space_size = MAX (2 * tmp_space_size, 5 + length); + tmp_space = alloca (tmp_space_size); + } + + /* Reset to beginning of the (possibly new) buffer + space. */ p = tmp_space; } @@ -3193,19 +3208,19 @@ som_write_symbol_strings (abfd, current_offset, syms, num_syms, string_sizep, switch (i) { - case 0: + case 0: obj_som_compilation_unit (abfd)->name.n_strx = strings_size; break; case 1: - obj_som_compilation_unit (abfd)->language_name.n_strx = + obj_som_compilation_unit (abfd)->language_name.n_strx = strings_size; break; case 2: - obj_som_compilation_unit (abfd)->product_id.n_strx = + obj_som_compilation_unit (abfd)->product_id.n_strx = strings_size; break; case 3: - obj_som_compilation_unit (abfd)->version_id.n_strx = + obj_som_compilation_unit (abfd)->version_id.n_strx = strings_size; break; } @@ -3225,16 +3240,26 @@ som_write_symbol_strings (abfd, current_offset, syms, num_syms, string_sizep, for (i = 0; i < num_syms; i++) { - int length = strlen (syms[i]->name); + size_t length = strlen (syms[i]->name); /* If there is not enough room for the next entry, then dump the - current buffer contents now. */ - if (p - tmp_space + 5 + length > SOM_TMP_BUFSIZE) + current buffer contents now and maybe allocate a larger buffer. */ + if (p - tmp_space + 5 + length > tmp_space_size) { + /* Flush buffer before refilling or reallocating. */ if (bfd_write ((PTR) &tmp_space[0], p - tmp_space, 1, abfd) != p - tmp_space) return false; - /* Reset to beginning of the buffer space. */ + + /* Reallocate if now empty buffer still too small. */ + if (5 + length > tmp_space_size) + { + /* See alloca above for discussion of new size. */ + tmp_space_size = MAX (2 * tmp_space_size, 5 + length); + tmp_space = alloca (tmp_space_size); + } + + /* Reset to beginning of the (possibly new) buffer space. */ p = tmp_space; } @@ -3249,17 +3274,17 @@ som_write_symbol_strings (abfd, current_offset, syms, num_syms, string_sizep, /* Next comes the string itself + a null terminator. */ strcpy (p, syms[i]->name); - som_symbol_data(syms[i])->stringtab_offset = strings_size; + som_symbol_data (syms[i])->stringtab_offset = strings_size; p += length + 1; strings_size += length + 1; /* Always align up to the next word boundary. */ while (strings_size % 4) - { + { bfd_put_8 (abfd, 0, p); strings_size++; p++; - } + } } /* Scribble out any partial block. */ @@ -3270,23 +3295,22 @@ som_write_symbol_strings (abfd, current_offset, syms, num_syms, string_sizep, return true; } -/* Compute variable information to be placed in the SOM headers, +/* Compute variable information to be placed in the SOM headers, space/subspace dictionaries, relocation streams, etc. Begin writing parts of the object file. */ -static boolean +static boolean som_begin_writing (abfd) bfd *abfd; { unsigned long current_offset = 0; int strings_size = 0; - unsigned int total_reloc_size = 0; unsigned long num_spaces, num_subspaces, i; asection *section; unsigned int total_subspaces = 0; struct som_exec_auxhdr *exec_header = NULL; - /* The file header will always be first in an object file, + /* The file header will always be first in an object file, everything else can be in random locations. To keep things "simple" BFD will lay out the object file in the manner suggested by the PRO ABI for PA-RISC Systems. */ @@ -3298,7 +3322,7 @@ som_begin_writing (abfd) /* Make room for the file header, it's contents are not complete yet, so it can not be written at this time. */ - current_offset += sizeof (struct header); + current_offset += sizeof (struct header); /* Any auxiliary headers will follow the file header. Right now we support only the copyright and version headers. */ @@ -3401,7 +3425,7 @@ som_begin_writing (abfd) if (current_offset % 4) current_offset += (4 - (current_offset % 4)); - /* Mark the offset of the space/subspace string table in the + /* Mark the offset of the space/subspace string table in the file header. */ obj_som_file_hdr (abfd)->space_strings_location = current_offset; @@ -3414,13 +3438,13 @@ som_begin_writing (abfd) obj_som_file_hdr (abfd)->space_strings_size = strings_size; current_offset += strings_size; - /* Next is the compilation unit. */ + /* Next is the compilation unit. */ obj_som_file_hdr (abfd)->compiler_location = current_offset; obj_som_file_hdr (abfd)->compiler_total = 0; - if (obj_som_compilation_unit (abfd)) + if (obj_som_compilation_unit (abfd)) { obj_som_file_hdr (abfd)->compiler_total = 1; - current_offset += COMPUNITSZ; + current_offset += COMPUNITSZ; } /* Now compute the file positions for the loadable subspaces, taking @@ -3482,7 +3506,7 @@ som_begin_writing (abfd) /* Keep track of exactly where we are within a particular space. This is necessary as the braindamaged HPUX - loader will create holes between subspaces *and* + loader will create holes between subspaces *and* subspace alignments are *NOT* preserved. What a crock. */ subspace_offset = subsection->vma; @@ -3511,7 +3535,6 @@ som_begin_writing (abfd) subspace_offset += subsection->vma - subspace_offset; } - subsection->target_index = total_subspaces++; /* This is real data to be loaded from the file. */ if (subsection->flags & SEC_LOAD) @@ -3526,7 +3549,7 @@ som_begin_writing (abfd) som_section_data (subsection)->subspace_dict->file_loc_init_value = current_offset; subsection->filepos = current_offset; - current_offset += bfd_section_size (abfd, subsection); + current_offset += bfd_section_size (abfd, subsection); subspace_offset += bfd_section_size (abfd, subsection); } /* Looks like uninitialized data. */ @@ -3543,7 +3566,7 @@ som_begin_writing (abfd) } } /* Goto the next section. */ - section = section->next; + section = section->next; } /* Finally compute the file positions for unloadable subspaces. @@ -3571,7 +3594,7 @@ som_begin_writing (abfd) subsection != NULL; subsection = subsection->next) { - + if (!som_is_subspace (subsection) || !som_is_container (section, subsection) || (subsection->flags & SEC_ALLOC) != 0) @@ -3584,7 +3607,7 @@ som_begin_writing (abfd) som_section_data (subsection)->subspace_dict->file_loc_init_value = current_offset; subsection->filepos = current_offset; - current_offset += bfd_section_size (abfd, subsection); + current_offset += bfd_section_size (abfd, subsection); } /* Looks like uninitialized data. */ else @@ -3596,7 +3619,7 @@ som_begin_writing (abfd) } } /* Goto the next section. */ - section = section->next; + section = section->next; } /* If building an executable, then make sure to seek to and write @@ -3645,7 +3668,7 @@ som_finish_writing (abfd) The names of the symbols are stored in a separate string table, and the index for each symbol name into the string table is computed below. Therefore, it is not possible to write the symbol table - at this time. + at this time. These used to be output before the subspace contents, but they were moved here to work around a stupid bug in the hpux linker @@ -3654,7 +3677,7 @@ som_finish_writing (abfd) /* Make sure we're on a word boundary. */ if (current_offset % 4) - current_offset += (4 - (current_offset % 4)); + current_offset += (4 - (current_offset % 4)); num_syms = bfd_get_symcount (abfd); obj_som_file_hdr (abfd)->symbol_location = current_offset; @@ -3687,7 +3710,7 @@ som_finish_writing (abfd) /* At the end of the file is the fixup stream which starts on a word boundary. */ if (current_offset % 4) - current_offset += (4 - (current_offset % 4)); + current_offset += (4 - (current_offset % 4)); obj_som_file_hdr (abfd)->fixup_request_location = current_offset; /* Write the fixups and update fields in subspace headers which @@ -3700,7 +3723,7 @@ som_finish_writing (abfd) /* Done. Store the total size of the SOM. */ obj_som_file_hdr (abfd)->som_length = current_offset + total_reloc_size; - + /* Now that the symbol table information is complete, build and write the symbol table. */ if (som_build_and_write_symbol_table (abfd) == false) @@ -3729,7 +3752,7 @@ som_finish_writing (abfd) subsection != NULL; subsection = subsection->next) { - + /* Skip any section which does not correspond to a space or subspace. Or does not have SEC_ALLOC set (and therefore has no real bits on the disk). */ @@ -3757,7 +3780,7 @@ som_finish_writing (abfd) /* Mark the index of the current space within the subspace's dictionary record. */ som_section_data (subsection)->subspace_dict->space_index = i; - + /* Dump the current subspace header. */ if (bfd_write ((PTR) som_section_data (subsection)->subspace_dict, sizeof (struct subspace_dictionary_record), 1, abfd) @@ -3765,7 +3788,7 @@ som_finish_writing (abfd) return false; } /* Goto the next section. */ - section = section->next; + section = section->next; } /* Now repeat the process for unloadable subspaces. */ @@ -3784,7 +3807,7 @@ som_finish_writing (abfd) subsection != NULL; subsection = subsection->next) { - + /* Skip any section which does not correspond to a space or subspace, or which SEC_ALLOC set (and therefore handled in the loadable spaces/subspaces code above). */ @@ -3808,12 +3831,12 @@ som_finish_writing (abfd) /* Increment the number of subspaces seen and the number of subspaces contained within the current space. */ som_section_data (section)->space_dict->subspace_quantity++; - subspace_index++; + subspace_index++; /* Mark the index of the current space within the subspace's dictionary record. */ som_section_data (subsection)->subspace_dict->space_index = i; - + /* Dump this subspace header. */ if (bfd_write ((PTR) som_section_data (subsection)->subspace_dict, sizeof (struct subspace_dictionary_record), 1, abfd) @@ -3821,7 +3844,7 @@ som_finish_writing (abfd) return false; } /* Goto the next section. */ - section = section->next; + section = section->next; } /* All the subspace dictiondary records are written, and all the @@ -3836,12 +3859,11 @@ som_finish_writing (abfd) section = abfd->sections; for (i = 0; i < num_spaces; i++) { - /* Find a space. */ while (!som_is_space (section)) section = section->next; - /* Dump its header */ + /* Dump its header. */ if (bfd_write ((PTR) som_section_data (section)->space_dict, sizeof (struct space_dictionary_record), 1, abfd) != sizeof (struct space_dictionary_record)) @@ -3856,23 +3878,23 @@ som_finish_writing (abfd) { location = obj_som_file_hdr (abfd)->compiler_location; if (bfd_seek (abfd, location, SEEK_SET) < 0) - return false; + return false; if (bfd_write ((PTR) obj_som_compilation_unit (abfd), COMPUNITSZ, 1, abfd) != COMPUNITSZ) - return false; + return false; } /* Setting of the system_id has to happen very late now that copying of BFD private data happens *after* section contents are set. */ if (abfd->flags & (EXEC_P | DYNAMIC)) - obj_som_file_hdr(abfd)->system_id = obj_som_exec_data (abfd)->system_id; + obj_som_file_hdr (abfd)->system_id = obj_som_exec_data (abfd)->system_id; else if (bfd_get_mach (abfd) == pa20) - obj_som_file_hdr(abfd)->system_id = CPU_PA_RISC2_0; + obj_som_file_hdr (abfd)->system_id = CPU_PA_RISC2_0; else if (bfd_get_mach (abfd) == pa11) - obj_som_file_hdr(abfd)->system_id = CPU_PA_RISC1_1; + obj_som_file_hdr (abfd)->system_id = CPU_PA_RISC1_1; else - obj_som_file_hdr(abfd)->system_id = CPU_PA_RISC1_0; + obj_som_file_hdr (abfd)->system_id = CPU_PA_RISC1_0; /* Compute the checksum for the file header just before writing the header to disk. */ @@ -3947,7 +3969,7 @@ som_compute_checksum (abfd) static void som_bfd_derive_misc_symbol_info (abfd, sym, info) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; asymbol *sym; struct som_misc_symbol_info *info; { @@ -3958,7 +3980,7 @@ som_bfd_derive_misc_symbol_info (abfd, sym, info) all symbols (including undefined symbols!). Unfortunately, the type specified in an import/export statement does not always match what the linker wants. Severe braindamage. */ - + /* Section symbols will not have a SOM symbol type assigned to them yet. Assign all section symbols type ST_DATA. */ if (sym->flags & BSF_SECTION_SYM) @@ -4008,7 +4030,7 @@ som_bfd_derive_misc_symbol_info (abfd, sym, info) else info->symbol_type = ST_DATA; } - + else if (som_symbol_data (sym)->som_type == SYMBOL_TYPE_UNKNOWN) info->symbol_type = ST_DATA; @@ -4028,13 +4050,14 @@ som_bfd_derive_misc_symbol_info (abfd, sym, info) else if (som_symbol_data (sym)->som_type == SYMBOL_TYPE_SEC_PROG) info->symbol_type = ST_SEC_PROG; } - + /* Now handle the symbol's scope. Exported data which is not in the common section has scope SS_UNIVERSAL. Note scope of common symbols was handled earlier! */ if (bfd_is_und_section (sym->section)) info->symbol_scope = SS_UNSAT; - else if (sym->flags & BSF_EXPORT && ! bfd_is_com_section (sym->section)) + else if (sym->flags & (BSF_EXPORT | BSF_WEAK) + && ! bfd_is_com_section (sym->section)) info->symbol_scope = SS_UNIVERSAL; /* Anything else which is not in the common section has scope SS_LOCAL. */ @@ -4049,7 +4072,7 @@ som_bfd_derive_misc_symbol_info (abfd, sym, info) || bfd_is_und_section (sym->section) || bfd_is_abs_section (sym->section)) info->symbol_info = 0; - /* For all other symbols, the symbol_info field contains the + /* For all other symbols, the symbol_info field contains the subspace index of the space this symbol is contained in. */ else info->symbol_info = sym->section->target_index; @@ -4091,8 +4114,8 @@ som_build_and_write_symbol_table (abfd) { struct som_misc_symbol_info info; - /* This is really an index into the symbol strings table. - By the time we get here, the index has already been + /* This is really an index into the symbol strings table. + By the time we get here, the index has already been computed and stored into the name field in the BFD symbol. */ som_symtab[i].name.n_strx = som_symbol_data(bfd_syms[i])->stringtab_offset; @@ -4126,7 +4149,7 @@ som_build_and_write_symbol_table (abfd) return false; } -/* Write an object in SOM format. */ +/* Write an object in SOM format. */ static boolean som_write_object_contents (abfd) @@ -4145,7 +4168,6 @@ som_write_object_contents (abfd) return (som_finish_writing (abfd)); } - /* Read and save the string table associated with the given BFD. */ @@ -4176,12 +4198,12 @@ som_slurp_string_table (abfd) if (bfd_seek (abfd, obj_som_str_filepos (abfd), SEEK_SET) < 0) return false; - + if (bfd_read (stringtab, obj_som_stringtab_size (abfd), 1, abfd) != obj_som_stringtab_size (abfd)) return false; - /* Save our results and return success. */ + /* Save our results and return success. */ obj_som_stringtab (abfd) = stringtab; return true; } @@ -4285,7 +4307,7 @@ som_slurp_symbol_table (abfd) goto error_return; if (bfd_seek (abfd, obj_som_sym_filepos (abfd), SEEK_SET) < 0) goto error_return; - if (bfd_read (buf, symbol_count * symsize, 1, abfd) + if (bfd_read (buf, symbol_count * symsize, 1, abfd) != symbol_count * symsize) goto error_return; @@ -4350,7 +4372,6 @@ som_slurp_symbol_table (abfd) undefined function symbols. */ if (bufp->symbol_scope == SS_UNSAT) sym->symbol.flags |= BSF_FUNCTION; - default: break; @@ -4396,7 +4417,7 @@ som_slurp_symbol_table (abfd) /* Check for a weak symbol. */ if (bufp->secondary_def) - sym->symbol.flags |= BSF_WEAK; + sym->symbol.flags |= BSF_WEAK; /* Mark section symbols and symbols used by the debugger. Note $START$ is a magic code symbol, NOT a section symbol. */ @@ -4466,7 +4487,7 @@ som_make_empty_symbol (abfd) bfd *abfd; { som_symbol_type *new = - (som_symbol_type *) bfd_zalloc (abfd, sizeof (som_symbol_type)); + (som_symbol_type *) bfd_zalloc (abfd, sizeof (som_symbol_type)); if (new == NULL) return 0; new->symbol.the_bfd = abfd; @@ -4478,7 +4499,7 @@ som_make_empty_symbol (abfd) static void som_print_symbol (ignore_abfd, afile, symbol, how) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; PTR afile; asymbol *symbol; bfd_print_symbol_type how; @@ -4507,7 +4528,7 @@ som_print_symbol (ignore_abfd, afile, symbol, how) static boolean som_bfd_is_local_label_name (abfd, name) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; const char *name; { return (name[0] == 'L' && name[1] == '$'); @@ -4522,7 +4543,7 @@ som_bfd_is_local_label_name (abfd, name) variables rptr, section, and symbols have no meaning. Return the number of relocations requested by the fixup stream. When - not just counting + not just counting This needs at least two or three more passes to get it cleaned up. */ @@ -4538,11 +4559,11 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count) unsigned int op, varname, deallocate_contents = 0; unsigned char *end_fixups = &fixup[end]; const struct fixup_format *fp; - char *cp; + const char *cp; unsigned char *save_fixup; int variables[26], stack[20], c, v, count, prev_fixup, *sp, saved_unwind_bits; const int *subop; - arelent *rptr= internal_relocs; + arelent *rptr = internal_relocs; unsigned int offset = 0; #define var(c) variables[(c) - 'A'] @@ -4605,7 +4626,7 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count) cp = fp->format; /* Process the format string. Parsing happens in two phases, - parse RHS, then assign to LHS. Repeat until no more + parse RHS, then assign to LHS. Repeat until no more characters in the format string. */ while (*cp) { @@ -4643,7 +4664,6 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count) push (v); } else - /* An operator. Pop two two values from the stack and use them as operands to the given operation. Push the result of the operation back on the stack. */ @@ -4799,7 +4819,7 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count) else if (fixup > save_fixup + 1) som_reloc_queue_insert (save_fixup, fixup - save_fixup, reloc_queue); - /* We do not pass R_DATA_OVERRIDE or R_NO_RELOCATION + /* We do not pass R_DATA_OVERRIDE or R_NO_RELOCATION fixups to BFD. */ if (som_hppa_howto_table[op].type != R_DATA_OVERRIDE && som_hppa_howto_table[op].type != R_NO_RELOCATION) @@ -4816,8 +4836,6 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count) ; else if (som_hppa_howto_table[op].type == R_DATA_ONE_SYMBOL) { - unsigned addend = var ('V'); - /* Try what was specified in R_DATA_OVERRIDE first (if anything). Then the hard way using the section contents. */ @@ -4843,7 +4861,7 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count) rptr->addend = bfd_get_32 (section->owner, (section->contents + offset - var ('L'))); - + } else rptr->addend = var ('V'); @@ -4867,9 +4885,9 @@ som_set_reloc_info (fixup, end, internal_relocs, section, symbols, just_count) #undef emptystack } -/* Read in the relocs (aka fixups in SOM terms) for a section. +/* Read in the relocs (aka fixups in SOM terms) for a section. - som_get_reloc_upper_bound calls this routine with JUST_COUNT + som_get_reloc_upper_bound calls this routine with JUST_COUNT set to true to indicate it only needs a count of the number of actual relocations. */ @@ -4890,14 +4908,14 @@ som_slurp_reloc_table (abfd, section, symbols, just_count) if (section->reloc_count == 0) return true; - /* If reloc_count is -1, then the relocation stream has not been + /* If reloc_count is -1, then the relocation stream has not been parsed. We must do so now to know how many relocations exist. */ if (section->reloc_count == -1) { external_relocs = (char *) bfd_malloc (fixup_stream_size); if (external_relocs == (char *) NULL) return false; - /* Read in the external forms. */ + /* Read in the external forms. */ if (bfd_seek (abfd, obj_som_reloc_filepos (abfd) + section->rel_filepos, SEEK_SET) @@ -4927,7 +4945,7 @@ som_slurp_reloc_table (abfd, section, symbols, just_count) if (section->relocation != (arelent *) NULL) return true; - internal_relocs = (arelent *) + internal_relocs = (arelent *) bfd_zalloc (abfd, (num_relocs * sizeof (arelent))); if (internal_relocs == (arelent *) NULL) return false; @@ -4946,7 +4964,7 @@ som_slurp_reloc_table (abfd, section, symbols, just_count) } /* Return the number of bytes required to store the relocation - information associated with the given section. */ + information associated with the given section. */ static long som_get_reloc_upper_bound (abfd, asect) @@ -5006,7 +5024,7 @@ som_new_section_hook (abfd, newsect) return false; newsect->alignment_power = 3; - /* We allow more than three sections internally */ + /* We allow more than three sections internally. */ return true; } @@ -5038,6 +5056,7 @@ som_bfd_copy_private_symbol_data (ibfd, isymbol, obfd, osymbol) /* Copy any private info we understand from the input section to the output section. */ + static boolean som_bfd_copy_private_section_data (ibfd, isection, obfd, osection) bfd *ibfd; @@ -5051,9 +5070,9 @@ som_bfd_copy_private_section_data (ibfd, isection, obfd, osection) || (!som_is_space (isection) && !som_is_subspace (isection))) return true; - som_section_data (osection)->copy_data - = (struct som_copyable_section_data_struct *) - bfd_zalloc (obfd, sizeof (struct som_copyable_section_data_struct)); + som_section_data (osection)->copy_data = + (struct som_copyable_section_data_struct *) + bfd_zalloc (obfd, sizeof (struct som_copyable_section_data_struct)); if (som_section_data (osection)->copy_data == NULL) return false; @@ -5108,10 +5127,10 @@ bfd_som_set_section_attributes (section, defined, private, sort_key, spnum) /* Allocate memory to hold the magic information. */ if (som_section_data (section)->copy_data == NULL) { - som_section_data (section)->copy_data - = (struct som_copyable_section_data_struct *) - bfd_zalloc (section->owner, - sizeof (struct som_copyable_section_data_struct)); + som_section_data (section)->copy_data = + (struct som_copyable_section_data_struct *) + bfd_zalloc (section->owner, + sizeof (struct som_copyable_section_data_struct)); if (som_section_data (section)->copy_data == NULL) return false; } @@ -5123,7 +5142,7 @@ bfd_som_set_section_attributes (section, defined, private, sort_key, spnum) return true; } -/* Set backend info for subsections which can not be described +/* Set backend info for subsections which can not be described in the BFD data structures. */ boolean @@ -5138,10 +5157,10 @@ bfd_som_set_subsection_attributes (section, container, access, /* Allocate memory to hold the magic information. */ if (som_section_data (section)->copy_data == NULL) { - som_section_data (section)->copy_data - = (struct som_copyable_section_data_struct *) - bfd_zalloc (section->owner, - sizeof (struct som_copyable_section_data_struct)); + som_section_data (section)->copy_data = + (struct som_copyable_section_data_struct *) + bfd_zalloc (section->owner, + sizeof (struct som_copyable_section_data_struct)); if (som_section_data (section)->copy_data == NULL) return false; } @@ -5168,6 +5187,7 @@ bfd_som_set_symbol_type (symbol, type) /* Attach an auxiliary header to the BFD backend so that it may be written into the object file. */ + boolean bfd_som_attach_aux_hdr (abfd, type, string) bfd *abfd; @@ -5218,7 +5238,7 @@ bfd_som_attach_aux_hdr (abfd, type, string) boolean bfd_som_attach_compilation_unit (abfd, name, language_name, product_id, - version_id) + version_id) bfd *abfd; const char *name; const char *language_name; @@ -5260,9 +5280,9 @@ som_get_section_contents (abfd, section, location, offset, count) { if (count == 0 || ((section->flags & SEC_HAS_CONTENTS) == 0)) return true; - if ((bfd_size_type)(offset+count) > section->_raw_size - || bfd_seek (abfd, (file_ptr)(section->filepos + offset), SEEK_SET) == -1 - || bfd_read (location, (bfd_size_type)1, count, abfd) != count) + if ((bfd_size_type) (offset+count) > section->_raw_size + || bfd_seek (abfd, (file_ptr) (section->filepos + offset), SEEK_SET) == -1 + || bfd_read (location, (bfd_size_type) 1, count, abfd) != count) return (false); /* on error */ return (true); } @@ -5294,7 +5314,7 @@ som_set_section_contents (abfd, section, location, offset, count) /* Seek to the proper offset within the object file and write the data. */ - offset += som_section_data (section)->subspace_dict->file_loc_init_value; + offset += som_section_data (section)->subspace_dict->file_loc_init_value; if (bfd_seek (abfd, offset, SEEK_SET) == -1) return false; @@ -5309,28 +5329,28 @@ som_set_arch_mach (abfd, arch, machine) enum bfd_architecture arch; unsigned long machine; { - /* Allow any architecture to be supported by the SOM backend */ + /* Allow any architecture to be supported by the SOM backend. */ return bfd_default_set_arch_mach (abfd, arch, machine); } static boolean som_find_nearest_line (abfd, section, symbols, offset, filename_ptr, - functionname_ptr, line_ptr) - bfd *abfd; - asection *section; - asymbol **symbols; - bfd_vma offset; - CONST char **filename_ptr; - CONST char **functionname_ptr; - unsigned int *line_ptr; + functionname_ptr, line_ptr) + bfd *abfd ATTRIBUTE_UNUSED; + asection *section ATTRIBUTE_UNUSED; + asymbol **symbols ATTRIBUTE_UNUSED; + bfd_vma offset ATTRIBUTE_UNUSED; + CONST char **filename_ptr ATTRIBUTE_UNUSED; + CONST char **functionname_ptr ATTRIBUTE_UNUSED; + unsigned int *line_ptr ATTRIBUTE_UNUSED; { return (false); } static int som_sizeof_headers (abfd, reloc) - bfd *abfd; - boolean reloc; + bfd *abfd ATTRIBUTE_UNUSED; + boolean reloc ATTRIBUTE_UNUSED; { (*_bfd_error_handler) (_("som_sizeof_headers unimplemented")); fflush (stderr); @@ -5365,7 +5385,9 @@ som_decode_symclass (symbol) return 'U'; if (bfd_is_ind_section (symbol->section)) return 'I'; - if (!(symbol->flags & (BSF_GLOBAL|BSF_LOCAL))) + if (symbol->flags & BSF_WEAK) + return 'W'; + if (!(symbol->flags & (BSF_GLOBAL | BSF_LOCAL))) return '?'; if (bfd_is_abs_section (symbol->section) @@ -5385,13 +5407,13 @@ som_decode_symclass (symbol) static void som_get_symbol_info (ignore_abfd, symbol, ret) - bfd *ignore_abfd; + bfd *ignore_abfd ATTRIBUTE_UNUSED; asymbol *symbol; symbol_info *ret; { ret->type = som_decode_symclass (symbol); if (ret->type != 'U') - ret->value = symbol->value+symbol->section->vma; + ret->value = symbol->value + symbol->section->vma; else ret->value = 0; ret->name = symbol->name; @@ -5410,7 +5432,7 @@ som_bfd_count_ar_symbols (abfd, lst_header, count) unsigned int *hash_table = NULL; file_ptr lst_filepos = bfd_tell (abfd) - sizeof (struct lst_header); - hash_table = + hash_table = (unsigned int *) bfd_malloc (lst_header->hash_size * sizeof (unsigned int)); if (hash_table == NULL && lst_header->hash_size != 0) @@ -5488,7 +5510,7 @@ som_bfd_fill_in_ar_symbols (abfd, lst_header, syms) struct som_entry *som_dict = NULL; file_ptr lst_filepos = bfd_tell (abfd) - sizeof (struct lst_header); - hash_table = + hash_table = (unsigned int *) bfd_malloc (lst_header->hash_size * sizeof (unsigned int)); if (hash_table == NULL && lst_header->hash_size != 0) @@ -5511,7 +5533,7 @@ som_bfd_fill_in_ar_symbols (abfd, lst_header, syms) if (bfd_seek (abfd, lst_filepos + lst_header->dir_loc, SEEK_SET) < 0) goto error_return; - if (bfd_read ((PTR) som_dict, lst_header->module_count, + if (bfd_read ((PTR) som_dict, lst_header->module_count, sizeof (struct som_entry), abfd) != lst_header->module_count * sizeof (struct som_entry)) goto error_return; @@ -5576,7 +5598,7 @@ som_bfd_fill_in_ar_symbols (abfd, lst_header, syms) goto error_return; /* Seek to the name length & string and read them in. */ - if (bfd_seek (abfd, lst_filepos + lst_header->string_loc + if (bfd_seek (abfd, lst_filepos + lst_header->string_loc + lst_symbol.name.n_strx - 4, SEEK_SET) < 0) goto error_return; @@ -5601,7 +5623,7 @@ som_bfd_fill_in_ar_symbols (abfd, lst_header, syms) set++; } } - /* If we haven't died by now, then we successfully read the entire + /* If we haven't died by now, then we successfully read the entire archive symbol table. */ if (hash_table != NULL) free (hash_table); @@ -5618,6 +5640,7 @@ som_bfd_fill_in_ar_symbols (abfd, lst_header, syms) } /* Read in the LST from the archive. */ + static boolean som_slurp_armap (abfd) bfd *abfd; @@ -5687,7 +5710,7 @@ som_slurp_armap (abfd) return false; /* Get back to the start of the library symbol table. */ - if (bfd_seek (abfd, ardata->first_file_filepos - parsed_size + if (bfd_seek (abfd, ardata->first_file_filepos - parsed_size + sizeof (struct lst_header), SEEK_SET) < 0) return false; @@ -5792,6 +5815,7 @@ som_bfd_prep_for_ar_write (abfd, num_syms, stringsize) /* Hash a symbol name based on the hashing algorithm presented in the SOM ABI. */ + static unsigned int som_bfd_ar_symbol_hash (symbol) asymbol *symbol; @@ -5803,12 +5827,12 @@ som_bfd_ar_symbol_hash (symbol) return 0x1000100 | (symbol->name[0] << 16) | symbol->name[0]; return ((len & 0x7f) << 24) | (symbol->name[1] << 16) - | (symbol->name[len-2] << 8) | symbol->name[len-1]; + | (symbol->name[len - 2] << 8) | symbol->name[len - 1]; } /* Do the bulk of the work required to write the SOM library symbol table. */ - + static boolean som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst, elength) bfd *abfd; @@ -5848,7 +5872,7 @@ som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst, elength) /* Some initialization. */ memset (hash_table, 0, 4 * lst.hash_size); memset (som_dict, 0, lst.module_count * sizeof (struct som_entry)); - memset (last_hash_entry, 0, + memset (last_hash_entry, 0, lst.hash_size * sizeof (struct lst_symbol_record *)); /* Symbols have som_index fields, so we have to keep track of the @@ -5874,7 +5898,7 @@ som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst, elength) /* Make sure we're properly aligned. */ curr_som_offset = (curr_som_offset + 0x1) & ~0x1; - /* FIXME should be done with buffers just like everything else... */ + /* FIXME should be done with buffers just like everything else... */ lst_syms = bfd_malloc (nsyms * sizeof (struct lst_symbol_record)); if (lst_syms == NULL && nsyms != 0) goto error_return; @@ -5971,7 +5995,7 @@ som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst, elength) tmp = last_hash_entry[curr_lst_sym->symbol_key % lst.hash_size]; tmp->next_entry = (curr_lst_sym - lst_syms) * sizeof (struct lst_symbol_record) - + lst.hash_size * 4 + + lst.hash_size * 4 + lst.module_count * sizeof (struct som_entry) + sizeof (struct lst_header); } @@ -5980,7 +6004,7 @@ som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst, elength) /* First entry in this hash chain. */ hash_table[curr_lst_sym->symbol_key % lst.hash_size] = (curr_lst_sym - lst_syms) * sizeof (struct lst_symbol_record) - + lst.hash_size * 4 + + lst.hash_size * 4 + lst.module_count * sizeof (struct som_entry) + sizeof (struct lst_header); } @@ -5990,13 +6014,12 @@ som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst, elength) last_hash_entry[curr_lst_sym->symbol_key % lst.hash_size] = curr_lst_sym; - /* Update the string table. */ bfd_put_32 (abfd, strlen (sym->symbol.name), p); p += 4; strcpy (p, sym->symbol.name); p += strlen (sym->symbol.name) + 1; - while ((int)p % 4) + while ((int) p % 4) { bfd_put_8 (abfd, 0, p); p++; @@ -6009,7 +6032,7 @@ som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst, elength) /* Keep track of where each SOM will finally reside; then look at the next BFD. */ curr_som_offset += arelt_size (curr_bfd) + sizeof (struct ar_hdr); - + /* A particular object in the archive may have an odd length; the linker requires objects begin on an even boundary. So round up the current offset as necessary. */ @@ -6069,14 +6092,13 @@ som_bfd_ar_write_symbol_stuff (abfd, nsyms, string_size, lst, elength) You'll never believe this is really how armaps are handled in SOM... */ -/*ARGSUSED*/ static boolean som_write_armap (abfd, elength, map, orl_count, stridx) bfd *abfd; unsigned int elength; - struct orl *map; - unsigned int orl_count; - int stridx; + struct orl *map ATTRIBUTE_UNUSED; + unsigned int orl_count ATTRIBUTE_UNUSED; + int stridx ATTRIBUTE_UNUSED; { bfd *curr_bfd; struct stat statbuf; @@ -6084,7 +6106,7 @@ som_write_armap (abfd, elength, map, orl_count, stridx) struct ar_hdr hdr; struct lst_header lst; int *p; - + /* We'll use this for the archive's date and mode later. */ if (stat (abfd->filename, &statbuf) != 0) { @@ -6156,9 +6178,9 @@ som_write_armap (abfd, elength, map, orl_count, stridx) /* Compute the checksum. Must happen after the entire lst header has filled in. */ - p = (int *)&lst; + p = (int *) &lst; lst.checksum = 0; - for (i = 0; i < sizeof (struct lst_header)/sizeof (int) - 1; i++) + for (i = 0; i < sizeof (struct lst_header) / sizeof (int) - 1; i++) lst.checksum ^= *p++; sprintf (hdr.ar_name, "/ "); @@ -6189,7 +6211,7 @@ som_write_armap (abfd, elength, map, orl_count, stridx) if (som_bfd_ar_write_symbol_stuff (abfd, nsyms, stringsize, lst, elength) == false) return false; - + /* Done. */ return true; } @@ -6223,12 +6245,13 @@ som_bfd_free_cached_info (abfd) return true; } -/* End of miscellaneous support functions. */ +/* End of miscellaneous support functions. */ /* Linker support functions. */ + static boolean som_bfd_link_split_section (abfd, sec) - bfd *abfd; + bfd *abfd ATTRIBUTE_UNUSED; asection *sec; { return (som_is_subspace (sec) && sec->_raw_size > 240000); @@ -6263,9 +6286,7 @@ som_bfd_link_split_section (abfd, sec) #define som_bfd_gc_sections bfd_generic_gc_sections - -const bfd_target som_vec = -{ +const bfd_target som_vec = { "som", /* name */ bfd_target_som_flavour, BFD_ENDIAN_BIG, /* target byte order */ @@ -6317,7 +6338,7 @@ const bfd_target som_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 }; diff --git a/gnu/dist/toolchain/bfd/som.h b/gnu/dist/toolchain/bfd/som.h index af378042189c..eedef8c8a33e 100644 --- a/gnu/dist/toolchain/bfd/som.h +++ b/gnu/dist/toolchain/bfd/som.h @@ -46,8 +46,8 @@ #define _PA_RISC_ID(__m_num) 1 #endif /* HOST_HPPABSD */ -#define FILE_HDR_SIZE sizeof(struct header) -#define AUX_HDR_SIZE sizeof(struct som_exec_auxhdr) +#define FILE_HDR_SIZE sizeof (struct header) +#define AUX_HDR_SIZE sizeof (struct som_exec_auxhdr) typedef struct som_symbol { @@ -77,7 +77,7 @@ typedef struct som_symbol int reloc_count; /* During object file writing, the offset of the name of this symbol - in the SOM string table. */ + in the SOM string table. */ int stringtab_offset; } som_symbol_type; @@ -159,7 +159,7 @@ struct som_copyable_section_data_struct int space_number; /* Add more stuff here as needed. Good examples of information - we might want to pass would be initialization pointers, + we might want to pass would be initialization pointers, and the many subspace flags we do not represent yet. */ }; @@ -167,7 +167,7 @@ struct som_copyable_section_data_struct reloc_size holds the size of the relocation stream, note this is very different from the number of relocations as SOM relocations - are variable length. + are variable length. reloc_stream is the actual stream of relocation entries. */ @@ -198,14 +198,13 @@ struct som_section_data_struct ((struct som_section_data_struct *)sec->used_by_bfd) #define som_symbol_data(symbol) ((som_symbol_type *) symbol) - /* Defines groups of basic relocations. FIXME: These should be the only basic relocations created by GAS. The rest should be internal to the BFD backend. The idea is both SOM and ELF define these basic relocation types so they map into a SOM or ELF specific reloation as - appropriate. This allows GAS to share much more code + appropriate. This allows GAS to share much more code between the two object formats. */ #define R_HPPA_NONE R_NO_RELOCATION diff --git a/gnu/dist/toolchain/bfd/sparclinux.c b/gnu/dist/toolchain/bfd/sparclinux.c index 73a29b39b262..57bf6c69b337 100644 --- a/gnu/dist/toolchain/bfd/sparclinux.c +++ b/gnu/dist/toolchain/bfd/sparclinux.c @@ -95,7 +95,7 @@ sparclinux_write_object_contents (abfd) #define IS_GOT_SYM(name) \ (strncmp (name, GOT_REF_PREFIX, sizeof GOT_REF_PREFIX - 1) == 0) -/* See if a symbol name is a reference to the procedure linkage table. */ +/* See if a symbol name is a reference to the procedure linkage table. */ #ifndef PLT_REF_PREFIX #define PLT_REF_PREFIX "__PLT_" @@ -478,7 +478,7 @@ linux_tally_symbols (h, data) (h->root.root.root.string + sizeof PLT_REF_PREFIX - 1), false, false, true); - /* h2 does not follow indirect symbols. */ + /* h2 does not follow indirect symbols. */ h2 = linux_link_hash_lookup (linux_hash_table (info), (h->root.root.root.string + sizeof PLT_REF_PREFIX - 1), @@ -535,7 +535,7 @@ linux_tally_symbols (h, data) } /* Quick and dirty way of stripping these symbols from the - symtab. */ + symtab. */ if (bfd_is_abs_section (h->root.root.u.def.section)) h->root.written = true; } @@ -560,7 +560,7 @@ bfd_sparclinux_size_dynamic_sections (output_bfd, info) if (output_bfd->xvec != &MY(vec)) return true; - /* First find the fixups... */ + /* First find the fixups... */ linux_link_hash_traverse (linux_hash_table (info), linux_tally_symbols, (PTR) info); diff --git a/gnu/dist/toolchain/bfd/sparclynx.c b/gnu/dist/toolchain/bfd/sparclynx.c index dbfcae55cbef..92454dcc5c8d 100644 --- a/gnu/dist/toolchain/bfd/sparclynx.c +++ b/gnu/dist/toolchain/bfd/sparclynx.c @@ -46,7 +46,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* This is needed to reject a NewsOS file, e.g. in gdb/testsuite/gdb.t10/crossload.exp. I needed to add M_UNKNOWN to recognize a 68000 object, so this will - probably no longer reject a NewsOS object. . */ + probably no longer reject a NewsOS object. . */ #define MACHTYPE_OK(mtype) ((mtype) == M_UNKNOWN \ || (mtype) == M_68010 \ || (mtype) == M_68020 \ @@ -90,7 +90,7 @@ NAME(lynx,set_arch_mach) (abfd, machtype) case M_UNKNOWN: /* Some Sun3s make magic numbers without cpu types in them, so - we'll default to the 68000. */ + we'll default to the 68000. */ arch = bfd_arch_m68k; machine = bfd_mach_m68000; break; @@ -137,7 +137,7 @@ NAME(lynx,set_arch_mach) (abfd, machtype) } #define SET_ARCH_MACH(ABFD, EXEC) \ - NAME(lynx,set_arch_mach)(ABFD, N_MACHTYPE (EXEC)); \ + NAME(lynx,set_arch_mach) (ABFD, N_MACHTYPE (EXEC)); \ choose_reloc_size(ABFD); /* Determine the size of a relocation entry, based on the architecture */ diff --git a/gnu/dist/toolchain/bfd/srec.c b/gnu/dist/toolchain/bfd/srec.c index 31f69b04cf0c..560223924215 100644 --- a/gnu/dist/toolchain/bfd/srec.c +++ b/gnu/dist/toolchain/bfd/srec.c @@ -1,5 +1,5 @@ /* BFD back-end for s-record objects. - Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Steve Chamberlain of Cygnus Support . @@ -24,7 +24,7 @@ SUBSECTION S-Record handling DESCRIPTION - + Ordinary S-Records cannot hold anything but addresses and data, so that's all that we implement. @@ -42,10 +42,10 @@ DESCRIPTION up and output them when it's time to close the bfd. An s record looks like: - + EXAMPLE S
- + DESCRIPTION Where o length @@ -61,7 +61,7 @@ DESCRIPTION 7) four byte address termination record 8) three byte address termination record 9) two byte address termination record - + o address is the start address of the data following, or in the case of a termination record, the start address of the image @@ -71,7 +71,6 @@ DESCRIPTION is the sum of all the raw byte data in the record, from the length upwards, modulo 256 and subtracted from 255. - SUBSECTION Symbol S-Record handling @@ -101,7 +100,7 @@ EXAMPLE DESCRIPTION We allow symbols to be anywhere in the data stream - the module names are always ignored. - + */ #include "bfd.h" @@ -142,7 +141,7 @@ 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. */ +/* Macros for converting between hex and binary. */ static CONST char digs[] = "0123456789ABCDEF"; @@ -154,7 +153,7 @@ static CONST char digs[] = "0123456789ABCDEF"; ch += ((x) & 0xff); #define ISHEX(x) hex_p(x) -/* Initialize by filling in the hex conversion array. */ +/* Initialize by filling in the hex conversion array. */ static void srec_init () @@ -168,10 +167,21 @@ srec_init () } } -/* The maximum number of bytes on a line is FF */ +/* The maximum number of bytes on a line is FF. */ #define MAXCHUNK 0xff -/* The number of bytes we fit onto a line on output */ -#define CHUNK 16 + +/* Default size for a CHUNK. */ +#define DEFAULT_CHUNK 16 + +/* The number of bytes we actually fit onto a line on output. + This variable can be modified by objcopy's --srec-len parameter. + For a 0x75 byte record you should set --srec-len=0x70. */ +unsigned int Chunk = DEFAULT_CHUNK; + +/* The type of srec output (free or forced to S3). + This variable can be modified by objcopy's --srec-forceS3 + parameter. */ +boolean S3Forced = 0; /* When writing an S-record file, the S-records can not be output as they are seen. This structure is used to hold them in memory. */ @@ -467,7 +477,8 @@ srec_scan (abfd) if (! srec_new_symbol (abfd, symname, symval)) goto error_return; } - while (c == ' ' || c == '\t'); + while (c == ' ' || c == '\t') + ; if (c == '\n') ++lineno; @@ -478,7 +489,7 @@ srec_scan (abfd) } break; - + case 'S': { file_ptr pos; @@ -839,7 +850,7 @@ srec_set_arch_mach (abfd, arch, mach) return bfd_default_set_arch_mach (abfd, arch, mach); } -/* we have to save up all the Srecords for a splurge before output */ +/* We have to save up all the Srecords for a splurge before output. */ static boolean srec_set_section_contents (abfd, section, location, offset, bytes_to_do) @@ -866,19 +877,17 @@ srec_set_section_contents (abfd, section, location, offset, bytes_to_do) return false; memcpy ((PTR) data, location, (size_t) bytes_to_do); - if ((section->lma + offset + bytes_to_do - 1) <= 0xffff) - { - - } + /* Ff S3Forced is true then always select S3 records, + regardless of the siez of the addresses. */ + if (S3Forced) + tdata->type = 3; + else if ((section->lma + offset + bytes_to_do - 1) <= 0xffff) + ; /* The default, S1, is OK. */ else if ((section->lma + offset + bytes_to_do - 1) <= 0xffffff && tdata->type <= 2) - { - tdata->type = 2; - } + tdata->type = 2; else - { - tdata->type = 3; - } + tdata->type = 3; entry->data = data; entry->where = section->lma + offset; @@ -912,8 +921,8 @@ srec_set_section_contents (abfd, section, location, offset, bytes_to_do) /* Write a record of type, of the supplied number of bytes. The supplied bytes and length don't have a checksum. That's worked out - here -*/ + here. */ + static boolean srec_write_record (abfd, type, address, data, end) bfd *abfd; @@ -933,7 +942,7 @@ srec_write_record (abfd, type, address, data, end) *dst++ = '0' + type; length = dst; - dst += 2; /* leave room for dst*/ + dst += 2; /* Leave room for dst. */ switch (type) { @@ -961,7 +970,7 @@ srec_write_record (abfd, type, address, data, end) dst += 2; } - /* Fill in the length */ + /* Fill in the length. */ TOHEX (length, (dst - length) / 2, check_sum); check_sum &= 0xff; check_sum = 255 - check_sum; @@ -976,8 +985,6 @@ srec_write_record (abfd, type, address, data, end) return true; } - - static boolean srec_write_header (abfd) bfd *abfd; @@ -986,11 +993,10 @@ srec_write_header (abfd) bfd_byte *dst = buffer; unsigned int i; - /* I'll put an arbitary 40 char limit on header size */ + /* I'll put an arbitary 40 char limit on header size. */ for (i = 0; i < 40 && abfd->filename[i]; i++) - { - *dst++ = abfd->filename[i]; - } + *dst++ = abfd->filename[i]; + return srec_write_record (abfd, 0, 0, buffer, dst); } @@ -1008,8 +1014,8 @@ srec_write_section (abfd, tdata, list) bfd_vma address; unsigned int octets_this_chunk = list->size - octets_written; - if (octets_this_chunk > CHUNK) - octets_this_chunk = CHUNK; + if (octets_this_chunk > Chunk) + octets_this_chunk = Chunk; address = list->where + octets_written / bfd_octets_per_byte (abfd); @@ -1038,14 +1044,12 @@ srec_write_terminator (abfd, tdata) abfd->start_address, buffer, buffer); } - - static boolean srec_write_symbols (abfd) bfd *abfd; { char buffer[MAXCHUNK]; - /* Dump out the symbols of a bfd */ + /* Dump out the symbols of a bfd. */ int i; int count = bfd_get_symcount (abfd); @@ -1065,7 +1069,7 @@ srec_write_symbols (abfd) if (! bfd_is_local_label (abfd, s) && (s->flags & BSF_DEBUGGING) == 0) { - /* Just dump out non debug symbols */ + /* Just dump out non debug symbols. */ bfd_size_type l; char buf2[40], *p; @@ -1107,7 +1111,7 @@ internal_srec_write_object_contents (abfd, symbols) if (! srec_write_header (abfd)) return false; - /* Now wander though all the sections provided and output them */ + /* Now wander though all the sections provided and output them. */ list = tdata->head; while (list != (srec_data_list_type *) NULL) @@ -1133,7 +1137,6 @@ symbolsrec_write_object_contents (abfd) return internal_srec_write_object_contents (abfd, 1); } -/*ARGSUSED*/ static int srec_sizeof_headers (abfd, exec) bfd *abfd ATTRIBUTE_UNUSED; @@ -1195,7 +1198,7 @@ srec_get_symtab (abfd, alocation) c->udata.p = NULL; } } - + for (i = 0; i < symcount; i++) *alocation++ = csymbols++; *alocation = NULL; @@ -1203,7 +1206,6 @@ srec_get_symtab (abfd, alocation) return symcount; } -/*ARGSUSED*/ static void srec_get_symbol_info (ignore_abfd, symbol, ret) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -1213,7 +1215,6 @@ srec_get_symbol_info (ignore_abfd, symbol, ret) bfd_symbol_info (symbol, ret); } -/*ARGSUSED*/ static void srec_print_symbol (ignore_abfd, afile, symbol, how) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -1316,12 +1317,10 @@ const bfd_target srec_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 }; - - const bfd_target symbolsrec_vec = { "symbolsrec", /* name */ @@ -1373,6 +1372,6 @@ const bfd_target symbolsrec_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 }; diff --git a/gnu/dist/toolchain/bfd/stab-syms.c b/gnu/dist/toolchain/bfd/stab-syms.c index f4fe6c8ba3cf..4b0827f236de 100644 --- a/gnu/dist/toolchain/bfd/stab-syms.c +++ b/gnu/dist/toolchain/bfd/stab-syms.c @@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "bfd.h" -#define ARCH_SIZE 32 /* Value doesn't matter. */ +#define ARCH_SIZE 32 /* Value doesn't matter. */ #include "libaout.h" #include "aout/aout64.h" @@ -32,13 +32,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* These are not really stab symbols, but it is convenient to have them here for the sake of nm. For completeness, we could also add N_TEXT etc, but those - are never needed, since nm treats those specially. */ + are never needed, since nm treats those specially. */ #define EXTRA_SYMBOLS \ __define_name (N_SETA, "SETA")/* Absolute set element symbol */ \ __define_name (N_SETT, "SETT")/* Text set element symbol */ \ __define_name (N_SETD, "SETD")/* Data set element symbol */ \ __define_name (N_SETB, "SETB")/* Bss set element symbol */ \ - __define_name (N_SETV, "SETV")/* Pointer to set vector in data area. */ \ + __define_name (N_SETV, "SETV")/* Pointer to set vector in data area. */ \ __define_name (N_INDR, "INDR") \ __define_name (N_WARNING, "WARNING") diff --git a/gnu/dist/toolchain/bfd/stabs.c b/gnu/dist/toolchain/bfd/stabs.c index e9ac167628d2..eb9ce8a86788 100644 --- a/gnu/dist/toolchain/bfd/stabs.c +++ b/gnu/dist/toolchain/bfd/stabs.c @@ -108,7 +108,7 @@ struct stab_section_info as the input offsets, because no stabs have been deleted from this section. Otherwise the i'th entry is the number of bytes of stabs that have been deleted prior to the i'th - stab. */ + stab. */ bfd_size_type *cumulative_skips; /* This is an array of string indices. For each stab symbol, we @@ -464,7 +464,7 @@ _bfd_link_section_stabs (abfd, psinfo, stabsec, stabstrsec, psecinfo) sinfo->stabstr->_cooked_size = _bfd_stringtab_size (sinfo->strings); /* Calculate the `cumulative_skips' array now that stabs have been - deleted for this section. */ + deleted for this section. */ if (skip != 0) { diff --git a/gnu/dist/toolchain/bfd/syms.c b/gnu/dist/toolchain/bfd/syms.c index 6546f585054a..8f4c92f14364 100644 --- a/gnu/dist/toolchain/bfd/syms.c +++ b/gnu/dist/toolchain/bfd/syms.c @@ -1,5 +1,5 @@ /* Generic symbol-table support for the BFD library. - Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Cygnus Support. @@ -91,7 +91,6 @@ SUBSECTION All storage for the symbols themselves is in an objalloc connected to the BFD; it is freed when the BFD is closed. - INODE Writing Symbols, Mini Symbols, Reading Symbols, Symbols SUBSECTION @@ -163,8 +162,6 @@ SUBSECTION */ - - /* DOCDD INODE @@ -390,14 +387,12 @@ DESCRIPTION Return the actual number of symbol pointers, not including the NULL. - .#define bfd_canonicalize_symtab(abfd, location) \ . BFD_SEND (abfd, _bfd_canonicalize_symtab,\ . (abfd, location)) */ - /* FUNCTION bfd_set_symtab @@ -474,7 +469,6 @@ bfd_print_symbol_vandf (arg, symbol) : ((type & BSF_OBJECT) ? 'O' : ' ')))); } - /* FUNCTION bfd_make_empty_symbol @@ -537,7 +531,7 @@ static CONST struct section_to_type stt[] = }; /* Return the single-character symbol type corresponding to - section S, or '?' for an unknown COFF section. + section S, or '?' for an unknown COFF section. Check for any leading string which matches, so .text5 returns 't' as well as .text */ @@ -548,7 +542,7 @@ coff_section_type (s) { CONST struct section_to_type *t; - for (t = &stt[0]; t->section; t++) + for (t = &stt[0]; t->section; t++) if (!strncmp (s, t->section, strlen (t->section))) return t->type; @@ -631,7 +625,7 @@ bfd_decode_symclass (symbol) /* FUNCTION - bfd_is_undefined_symclass + bfd_is_undefined_symclass DESCRIPTION Returns non-zero if the class symbol returned by @@ -668,12 +662,12 @@ bfd_symbol_info (symbol, ret) symbol_info *ret; { ret->type = bfd_decode_symclass (symbol); - + if (bfd_is_undefined_symclass (ret->type)) ret->value = 0; else ret->value = symbol->value + symbol->section->vma; - + ret->name = symbol->name; } @@ -788,8 +782,8 @@ struct indexentry static int cmpindexentry (a, b) - const PTR *a; - const PTR *b; + const PTR a; + const PTR b; { const struct indexentry *contestantA = (const struct indexentry *) a; const struct indexentry *contestantB = (const struct indexentry *) b; @@ -1005,7 +999,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, if (bfd_get_32 (abfd, stab + STRDXOFF) == 0) continue; - /* if we did not see a function def, leave space for one. */ + /* if we did not see a function def, leave space for one. */ if (saw_fun == 0) ++info->indextablesize; @@ -1027,7 +1021,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, if (saw_fun == 0) ++info->indextablesize; - + if (info->indextablesize == 0) return true; ++info->indextablesize; @@ -1063,8 +1057,8 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, /* The following code creates a new indextable entry with a NULL function name if there were no N_FUNs in a file. Note that a N_SO without a file name is an EOF and - there could be 2 N_SO following it with the new filename - and directory. */ + there could be 2 N_SO following it with the new filename + and directory. */ if (saw_fun == 0) { info->indextable[i].val = bfd_get_32 (abfd, last_stab + VALOFF); @@ -1076,7 +1070,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, ++i; } saw_fun = 0; - + file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF); if (*file_name == '\0') { @@ -1262,7 +1256,7 @@ _bfd_stab_section_find_nearest_line (abfd, symbols, section, offset, pfound, *pfound = true; - if (file_name[0] == '/' || directory_name == NULL) + if (IS_ABSOLUTE_PATH(file_name) || directory_name == NULL) *pfilename = file_name; else { diff --git a/gnu/dist/toolchain/bfd/sysdep.h b/gnu/dist/toolchain/bfd/sysdep.h index 77b5e50a9c3e..e344eaf50cad 100644 --- a/gnu/dist/toolchain/bfd/sysdep.h +++ b/gnu/dist/toolchain/bfd/sysdep.h @@ -126,6 +126,18 @@ extern char *getenv (); #ifdef ENABLE_NLS #include +/* Note the use of dgetext() and PACKAGE here, rather than gettext(). + + This is because the code in this directory is used to build a library which + will be linked with code in other directories to form programs. We want to + maintain a seperate translation file for this directory however, rather + than being forced to merge it with that of any program linked to libbfd. + This is a library, so it cannot depend on the catalog currently loaded. + + In order to do this, we have to make sure that when we extract messages we + use the OPCODES domain rather than the domain of the program that included + the bfd library, (eg OBJDUMP). Hence we use dgettext (PACKAGE, String) + and define PACKAGE to be 'bfd'. (See the code in configure). */ #define _(String) dgettext (PACKAGE, String) #ifdef gettext_noop #define N_(String) gettext_noop (String) diff --git a/gnu/dist/toolchain/bfd/tekhex.c b/gnu/dist/toolchain/bfd/tekhex.c index b1ffe75e0731..e5fa95a7b1a6 100644 --- a/gnu/dist/toolchain/bfd/tekhex.c +++ b/gnu/dist/toolchain/bfd/tekhex.c @@ -24,11 +24,11 @@ SUBSECTION Tektronix Hex Format handling DESCRIPTION - + Tek Hex records can hold symbols and data, but not relocations. Their main application is communication with devices like PROM programmers and ICE equipment. - + It seems that the sections are descibed as being really big, the example I have says that the text section is 0..ffffffff. BFD would barf with this, many apps would try to alloc 4GB to @@ -49,11 +49,10 @@ DESCRIPTION Any number of sections may be created for output, we save them up and output them when it's time to close the bfd. - A TekHex record looks like: EXAMPLE % - + DESCRIPTION Where o length @@ -63,7 +62,6 @@ DESCRIPTION 3) symbol record 6) data record 8) termination record - The data can come out of order, and may be discontigous. This is a serial protocol, so big files are unlikely, so we keep a list of 8k chunks @@ -123,7 +121,7 @@ static const bfd_target *tekhex_object_p PARAMS ((bfd *)); static boolean tekhex_mkobject PARAMS ((bfd *)); static long tekhex_get_symtab_upper_bound PARAMS ((bfd *)); static long tekhex_get_symtab PARAMS ((bfd *, asymbol **)); -static void pass_over PARAMS ((bfd *, void (*)(bfd*, int, char *))); +static void pass_over PARAMS ((bfd *, void (*) (bfd*, int, char *))); static void first_phase PARAMS ((bfd *, int, char *)); static void insert_byte PARAMS ((bfd *, int, bfd_vma)); static struct data_struct *find_chunk PARAMS ((bfd *, bfd_vma)); @@ -216,7 +214,6 @@ fcffffff g T_SEGMENT i$1 00000000 g T_SEGMENT $ 00000010 g T_SEGMENT $ - RELOCATION RECORDS FOR [D00000000]: (none) RELOCATION RECORDS FOR [D00008000]: (none) @@ -425,7 +422,7 @@ first_phase (abfd, type, src) char *n = bfd_alloc (abfd, len + 1); if (!n) - abort(); /* FIXME */ + abort (); /* FIXME */ memcpy (n, sym, len + 1); section = bfd_make_section (abfd, n); } @@ -454,7 +451,7 @@ first_phase (abfd, type, src) char type = (*src); if (!new) - abort(); /* FIXME */ + abort (); /* FIXME */ new->symbol.the_bfd = abfd; src++; abfd->symcount++; @@ -464,7 +461,7 @@ first_phase (abfd, type, src) len = getsym (sym, &src); new->symbol.name = bfd_alloc (abfd, len + 1); if (!new->symbol.name) - abort(); /* FIXME */ + abort (); /* FIXME */ memcpy ((char *) (new->symbol.name), sym, len + 1); new->symbol.section = section; if (type <= '4') @@ -1063,6 +1060,6 @@ const bfd_target tekhex_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 }; diff --git a/gnu/dist/toolchain/bfd/trad-core.c b/gnu/dist/toolchain/bfd/trad-core.c index aea6366795b4..194da154a0cb 100644 --- a/gnu/dist/toolchain/bfd/trad-core.c +++ b/gnu/dist/toolchain/bfd/trad-core.c @@ -25,7 +25,19 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "libaout.h" /* BFD a.out internal data structures */ #include -#include +#ifdef HAVE_DIRENT_H +# include +#else +# ifdef HAVE_SYS_NDIR_H +# include +# endif +# ifdef HAVE_SYS_DIR_H +# include +# endif +# ifdef HAVE_NDIR_H +# include +# endif +#endif #include #include /* After a.out.h */ @@ -34,7 +46,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include TRAD_HEADER #endif - struct trad_core_struct + struct trad_core_struct { asection *data_section; asection *stack_section; @@ -73,7 +85,7 @@ trad_unix_core_file_p (abfd) if (bfd_seek (abfd, TRAD_CORE_USER_OFFSET, SEEK_SET) != 0) return 0; #endif - + val = bfd_read ((void *)&u, 1, sizeof u, abfd); if (val != sizeof u) { @@ -83,7 +95,7 @@ trad_unix_core_file_p (abfd) } /* Sanity check perhaps??? */ - if (u.u_dsize > 0x1000000) /* Remember, it's in pages... */ + if (u.u_dsize > 0x1000000) /* Remember, it's in pages... */ { bfd_set_error (bfd_error_wrong_format); return 0; @@ -140,7 +152,7 @@ trad_unix_core_file_p (abfd) bfd_zmalloc (sizeof (struct trad_core_struct)); if (rawptr == NULL) return 0; - + abfd->tdata.trad_core_data = rawptr; rawptr->u = u; /*Copy the uarea into the tdata part of the bfd */ @@ -195,13 +207,13 @@ trad_unix_core_file_p (abfd) from *u_ar0. The other is that u_ar0 is sometimes an absolute address in kernel memory, and on other systems it is an offset from the beginning of the `struct user'. - + As a practical matter, we don't know where the registers actually are, so we have to pass the whole area to GDB. We encode the value of u_ar0 by setting the .regs section up so that its virtual memory address 0 is at the place pointed to by u_ar0 (by setting the vma of the start of the section to -u_ar0). GDB uses this info to locate the regs, - using minor trickery to get around the offset-or-absolute-addr problem. */ + using minor trickery to get around the offset-or-absolute-addr problem. */ core_regsec (abfd)->vma = - (bfd_vma) u.u_ar0; core_datasec (abfd)->filepos = NBPG * UPAGES; @@ -261,9 +273,9 @@ trad_unix_core_file_matches_executable_p (core_bfd, exec_bfd) /* If somebody calls any byte-swapping routines, shoot them. */ static void -swap_abort() +swap_abort () { - abort(); /* This way doesn't require any declaration for ANSI to fuck up */ + abort (); /* This way doesn't require any declaration for ANSI to fuck up */ } #define NO_GET ((bfd_vma (*) PARAMS (( const bfd_byte *))) swap_abort ) #define NO_PUT ((void (*) PARAMS ((bfd_vma, bfd_byte *))) swap_abort ) @@ -304,7 +316,7 @@ const bfd_target trad_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 (trad_unix), @@ -316,6 +328,6 @@ const bfd_target trad_core_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 /* backend_data */ }; diff --git a/gnu/dist/toolchain/bfd/versados.c b/gnu/dist/toolchain/bfd/versados.c index d3ebda4c595e..28c3dd27ef8f 100644 --- a/gnu/dist/toolchain/bfd/versados.c +++ b/gnu/dist/toolchain/bfd/versados.c @@ -36,7 +36,6 @@ o Object Text Recrod o End Record - */ #include "bfd.h" @@ -44,18 +43,15 @@ #include "libbfd.h" #include "libiberty.h" - static boolean versados_mkobject PARAMS ((bfd *)); static boolean versados_scan PARAMS ((bfd *)); static const bfd_target *versados_object_p PARAMS ((bfd *)); - #define VHEADER '1' #define VESTDEF '2' #define VOTR '3' #define VEND '4' - #define ES_BASE 17 /* first symbol has esdid 17 */ /* Per file target dependent information */ @@ -145,11 +141,7 @@ union ext_any struct ext_otr otr; }; -/* Initialize by filling in the hex conversion array. */ - - - - +/* Initialize by filling in the hex conversion array. */ /* Set up the tdata information. */ @@ -171,13 +163,10 @@ versados_mkobject (abfd) return true; } - /* Report a problem in an S record file. FIXME: This probably should not call fprintf, but we really do need some mechanism for printing error messages. */ - - static asymbol * versados_new_symbol (abfd, snum, name, val, sec) bfd *abfd; @@ -195,7 +184,6 @@ versados_new_symbol (abfd, snum, name, val, sec) return n; } - static int get_record (abfd, ptr) bfd *abfd; @@ -244,7 +232,6 @@ new_symbol_string (abfd, name) return n; } - static void process_esd (abfd, esd, pass) bfd *abfd; @@ -296,7 +283,6 @@ process_esd (abfd, esd, pass) } break; - case ESD_ABS: size = get_4 (&ptr); start = get_4 (&ptr); @@ -356,7 +342,6 @@ reloc_howto_type versados_howto_table[] = "-v32", true, 0xffffffff, 0xffffffff, false), }; - static int get_offset (len, ptr) int len; @@ -405,7 +390,6 @@ process_otr (abfd, otr, pass) int offsetlen = flag & 0x7; int j; - if (esdids == 0) { /* A zero esdid means the new pc is the offset given */ @@ -433,7 +417,7 @@ process_otr (abfd, otr, pass) int rn = EDATA (abfd, otr->esdid - 1).relocs++; if (pass == 1) { - /* this is the first pass over the data, + /* this is the first pass over the data, just remember that we need a reloc */ } else @@ -471,7 +455,6 @@ process_otr (abfd, otr, pass) if (!contents && need_contents) esdid->contents = (unsigned char *) bfd_alloc (abfd, esdid->section->_raw_size); - } static boolean @@ -586,8 +569,6 @@ versados_scan (abfd) return 1; } - - /* Check whether an existing file is a versados file. */ static const bfd_target * @@ -633,7 +614,6 @@ versados_object_p (abfd) return abfd->xvec; } - static boolean versados_pass_2 (abfd) bfd *abfd; @@ -648,7 +628,6 @@ versados_pass_2 (abfd) VDATA (abfd)->es_done = ES_BASE; - /* read records till we get to where we want to be */ while (1) @@ -701,8 +680,6 @@ versados_set_section_contents (abfd, section, location, offset, bytes_to_do) return false; } - -/*ARGSUSED */ static int versados_sizeof_headers (abfd, exec) bfd *abfd ATTRIBUTE_UNUSED; @@ -755,7 +732,6 @@ versados_get_symtab (abfd, alocation) return symcount; } -/*ARGSUSED */ void versados_get_symbol_info (ignore_abfd, symbol, ret) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -765,7 +741,6 @@ versados_get_symbol_info (ignore_abfd, symbol, ret) bfd_symbol_info (symbol, ret); } -/*ARGSUSED */ void versados_print_symbol (ignore_abfd, afile, symbol, how) bfd *ignore_abfd ATTRIBUTE_UNUSED; @@ -796,7 +771,6 @@ versados_get_reloc_upper_bound (abfd, asect) return (asect->reloc_count + 1) * sizeof (arelent *); } - long versados_canonicalize_reloc (abfd, section, relptr, symbols) bfd *abfd; @@ -922,6 +896,6 @@ const bfd_target versados_vec = BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, - + (PTR) 0 }; diff --git a/gnu/dist/toolchain/bfd/vms-gsd.c b/gnu/dist/toolchain/bfd/vms-gsd.c index ac3fe6986cc1..769c0a54ccf6 100644 --- a/gnu/dist/toolchain/bfd/vms-gsd.c +++ b/gnu/dist/toolchain/bfd/vms-gsd.c @@ -21,7 +21,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. */ - #include #include "bfd.h" @@ -85,7 +84,6 @@ static struct sec_flags_struct vax_section_flags[] = { (SEC_IN_MEMORY|SEC_DATA|SEC_HAS_CONTENTS|SEC_ALLOC|SEC_LOAD) } }; - /* These flags are deccrtl/vaxcrtl (openVMS 6.2 Alpha) compatible */ static struct sec_flags_struct evax_section_flags[] = { @@ -170,7 +168,6 @@ vms_secflag_by_name (abfd, section_flags, name, size) return section_flags[i].flags_always; } - /* Retrieve vms section flags by name and size */ static flagword @@ -653,7 +650,7 @@ _bfd_vms_slurp_gsd (abfd, objtype) new_flags |= BSF_FUNCTION; } symbol->value = bfd_getl64 (vms_rec+8); - symbol->section = (asection *)((unsigned long) bfd_getl32 (vms_rec+28)); + symbol->section = (asection *) ((unsigned long) bfd_getl32 (vms_rec+28)); #if VMS_DEBUG vms_debug(4, "egsd sym def #%d (%s, %d, %04x=%s)\n", abfd->symcount, symbol->name, (int)symbol->section, old_flags, flag2str(gsyflagdesc, old_flags)); @@ -899,9 +896,9 @@ _bfd_vms_write_gsd (abfd, objtype) { _bfd_vms_output_quad (abfd, symbol->value); _bfd_vms_output_quad (abfd, - ((asymbol *)(symbol->udata.p))->value); + ((asymbol *) (symbol->udata.p))->value); _bfd_vms_output_long (abfd, - (((asymbol *)(symbol->udata.p)) + (((asymbol *) (symbol->udata.p)) ->section->index)); _bfd_vms_output_long (abfd, symbol->section->index); } @@ -921,7 +918,7 @@ _bfd_vms_write_gsd (abfd, objtype) _bfd_vms_output_alignment (abfd, 8); _bfd_vms_output_pop (abfd); - _bfd_vms_output_end (abfd); + _bfd_vms_output_end (abfd); return 0; } diff --git a/gnu/dist/toolchain/bfd/vms-hdr.c b/gnu/dist/toolchain/bfd/vms-hdr.c index 3b36b3278c58..d5477535e701 100644 --- a/gnu/dist/toolchain/bfd/vms-hdr.c +++ b/gnu/dist/toolchain/bfd/vms-hdr.c @@ -33,9 +33,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "vms.h" +#ifdef HAVE_ALLOCA_H +#include +#endif /*---------------------------------------------------------------------------*/ - /* Read & process emh record return 0 on success, -1 on error */ @@ -196,11 +198,9 @@ _bfd_vms_slurp_hdr (abfd, objtype) return 0; } - /*-----------------------------------------------------------------------------*/ /* Output routines. */ - /* Manufacure a VMS like time on a unix based system. stolen from obj-vms.c */ @@ -240,7 +240,6 @@ get_vms_time_string () return tbuf; } - /* write object header for bfd abfd */ int @@ -253,7 +252,6 @@ _bfd_vms_write_hdr (abfd, objtype) int had_case = 0; int had_file = 0; - #if VMS_DEBUG vms_debug (2, "vms_write_hdr (%p)\n", abfd); #endif @@ -392,7 +390,7 @@ _bfd_vms_slurp_eom (abfd, objtype) vms_rec = PRIV(vms_rec); - if ((objtype == OBJ_S_C_EOM) + if ((objtype == OBJ_S_C_EOM) || (objtype == OBJ_S_C_EOMW)) { } @@ -420,7 +418,6 @@ _bfd_vms_slurp_eom (abfd, objtype) return 0; } - /* Write eom record for bfd abfd */ int @@ -433,7 +430,7 @@ _bfd_vms_write_eom (abfd, objtype) #endif _bfd_vms_output_begin (abfd, objtype, -1); - _bfd_vms_output_long (abfd, (unsigned long)(PRIV(vms_linkage_index) >> 1)); + _bfd_vms_output_long (abfd, (unsigned long) (PRIV(vms_linkage_index) >> 1)); _bfd_vms_output_byte (abfd, 0); /* completion code */ _bfd_vms_output_byte (abfd, 0); /* fill byte */ @@ -448,7 +445,7 @@ _bfd_vms_write_eom (abfd, objtype) return -1; } _bfd_vms_output_short (abfd, 0); - _bfd_vms_output_long (abfd, (unsigned long)(section->index)); + _bfd_vms_output_long (abfd, (unsigned long) (section->index)); _bfd_vms_output_long (abfd, (unsigned long) bfd_get_start_address (abfd)); _bfd_vms_output_long (abfd, 0); diff --git a/gnu/dist/toolchain/bfd/vms-misc.c b/gnu/dist/toolchain/bfd/vms-misc.c index 311192c8b917..89d39dbd3196 100644 --- a/gnu/dist/toolchain/bfd/vms-misc.c +++ b/gnu/dist/toolchain/bfd/vms-misc.c @@ -18,7 +18,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. */ - #if __STDC__ #include #endif @@ -38,7 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ evaluates environment variable VMS_DEBUG for a numerical value on the first call all error levels below this value are printed - + levels: 1 toplevel bfd calls (functions from the bfd vector) 2 functions called by bfd calls @@ -74,10 +73,10 @@ _bfd_vms_debug (int level, char *format, ...) if (abslvl > min_level) return; - while(--level>0) - fprintf(output, " "); + while (--level>0) + fprintf (output, " "); va_start(args, format); - vfprintf(output, format, args); + vfprintf (output, format, args); fflush(output); va_end(args); @@ -112,16 +111,15 @@ _bfd_vms_debug (level, format, a1, a2, a3, a4, a5, a6) if (level > min_level) return; - while(--level>0) - fprintf(output, " "); - fprintf(output, format, a1, a2, a3, a4, a5, a6); + while (--level>0) + fprintf (output, " "); + fprintf (output, format, a1, a2, a3, a4, a5, a6); fflush(output); return; } #endif /* __STDC__ */ - /* a debug function hex dump 'size' bytes starting at 'ptr' */ @@ -235,43 +233,41 @@ _bfd_vms_get_header_values (abfd, buf, type, length) vms_debug (10, "_bfd_vms_get_header_values type %x, length %x\n", (type?*type:0), (length?*length:0)); #endif - return; } - /* Get next record from object file to vms_buf set PRIV(buf_size) and return it - + this is a little tricky since it should be portable. - + the openVMS object file has 'variable length' which means that read() returns data in chunks of (hopefully) correct and expected size. The linker (and other tools on vms) depend on that. Unix doesn't know about 'formatted' files, so reading and writing such an object file in a unix environment is not trivial. - + With the tool 'file' (available on all vms ftp sites), one can view and change the attributes of a file. Changing from 'variable length' to 'fixed length, 512 bytes' reveals the record length at the first 2 bytes of every record. The same happens during the transfer of object files from vms to unix, at least with ucx, dec's implementation of tcp/ip. - + The vms format repeats the length at bytes 2 & 3 of every record. - + On the first call (file_format == FF_UNKNOWN) we check if the first and the third byte pair (!) of the record match. If they do it's an object file in an unix environment or with wrong attributes (FF_FOREIGN), else we should be in a vms environment where read() returns the record size (FF_NATIVE). - + reading is always done in 2 steps. first just the record header is read and the length extracted by get_header_values then the read buffer is adjusted and the remaining bytes are read in. - + all file i/o is always done on even file positions */ int @@ -313,22 +309,23 @@ _bfd_vms_get_record (abfd) switch (PRIV(file_format)) { - case FF_UNKNOWN: - case FF_FOREIGN: - test_len = 6; /* probe 6 bytes */ - test_start = 2; /* where the record starts */ + case FF_UNKNOWN: + case FF_FOREIGN: + test_len = 6; /* probe 6 bytes */ + test_start = 2; /* where the record starts */ break; - case FF_NATIVE: - test_len = 4; - test_start = 0; + case FF_NATIVE: + test_len = 4; + test_start = 0; break; - case FF_VAX: - test_len = 0; - test_start = 0; + default: + case FF_VAX: + test_len = 0; + test_start = 0; break; - } + } /* skip odd alignment byte */ @@ -436,7 +433,6 @@ _bfd_vms_get_record (abfd) return PRIV(rec_length); } - /* get next vms record from file update vms_rec and rec_length to new (remaining) values */ @@ -459,6 +455,10 @@ _bfd_vms_next_record (abfd) return -1; } + if (!PRIV(vms_rec) || !PRIV(vms_buf) + || PRIV(vms_rec) >= (PRIV(vms_buf) + PRIV(buf_size))) + return -1; + if (PRIV(is_vax)) { PRIV(rec_type) = *(PRIV(vms_rec)); @@ -480,7 +480,6 @@ _bfd_vms_next_record (abfd) return PRIV(rec_type); } - /* Copy sized string (string with fixed length) to new allocated area size is string length (size of record) */ @@ -544,7 +543,6 @@ _bfd_vms_push (abfd, val, psect) return; } - /* Pop value and section index */ uquad @@ -606,7 +604,6 @@ add_new_contents (abfd, section) return newptr; } - /* Save section data & offset to an vms_section structure vms_section_table[] holds the vms_section chain */ @@ -635,7 +632,6 @@ _bfd_save_vms_section (abfd, section, data, offset, count) return true; } - /* Get vms_section pointer to saved contents for section # index */ vms_section * @@ -690,7 +686,6 @@ _bfd_vms_output_begin (abfd, rectype, rechead) return; } - /* Set record/subrecord alignment */ void @@ -706,7 +701,6 @@ _bfd_vms_output_alignment (abfd, alignto) return; } - /* Prepare for subrecord fields */ void @@ -722,7 +716,6 @@ _bfd_vms_output_push (abfd) return; } - /* End of subrecord fields */ void @@ -745,7 +738,6 @@ _bfd_vms_output_pop (abfd) return; } - /* Flush unwritten output, ends current record */ void @@ -775,7 +767,7 @@ _bfd_vms_output_flush (abfd) vms_debug (6, "align: adding %d bytes\n", aligncount); #endif - while(aligncount-- > 0) + while (aligncount-- > 0) { PRIV(output_buf)[real_size++] = 0; #if 0 @@ -810,7 +802,6 @@ _bfd_vms_output_flush (abfd) return; } - /* End record output */ void @@ -826,7 +817,6 @@ _bfd_vms_output_end (abfd) return; } - /* check remaining buffer size return what's left. */ @@ -843,7 +833,6 @@ _bfd_vms_output_check (abfd, size) return (MAX_OUTREC_SIZE - (PRIV(output_size) + size + MIN_OUTREC_LUFT)); } - /* Output byte (8 bit) value */ void @@ -860,7 +849,6 @@ _bfd_vms_output_byte (abfd, value) return; } - /* Output short (16 bit) value */ void @@ -877,7 +865,6 @@ _bfd_vms_output_short (abfd, value) return; } - /* Output long (32 bit) value */ void @@ -894,7 +881,6 @@ _bfd_vms_output_long (abfd, value) return; } - /* Output quad (64 bit) value */ void @@ -911,7 +897,6 @@ _bfd_vms_output_quad (abfd, value) return; } - /* Output c-string as counted string */ void @@ -940,7 +925,6 @@ int len; _bfd_vms_output_dump (abfd, (unsigned char *)value, len); } - /* Output character area */ void @@ -962,7 +946,6 @@ _bfd_vms_output_dump (abfd, data, length) return; } - /* Output count bytes of value */ void @@ -1071,7 +1054,6 @@ _bfd_vms_length_hash_symbol (abfd, in, maxlen) return outbuf; } - /* Allocate and initialize a new symbol. */ static asymbol * @@ -1094,7 +1076,6 @@ new_symbol (abfd, name) return symbol; } - /* Allocate and enter a new private symbol. */ vms_symbol_entry * diff --git a/gnu/dist/toolchain/bfd/vms-tir.c b/gnu/dist/toolchain/bfd/vms-tir.c index 124b1b39d893..cf91180a544d 100644 --- a/gnu/dist/toolchain/bfd/vms-tir.c +++ b/gnu/dist/toolchain/bfd/vms-tir.c @@ -24,7 +24,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. */ - /* The following type abbreviations are used: cs counted string (ascii string with length byte) @@ -96,7 +95,6 @@ image_set_ptr (abfd, psect, offset) return; } - /* Increment image buffer pointer by offset */ static void @@ -113,7 +111,6 @@ image_inc_ptr (abfd, offset) return; } - /* Dump multiple bytes to section image */ static void @@ -136,7 +133,6 @@ image_dump (abfd, ptr, size, offset) return; } - /* Write byte to section image */ static void @@ -155,7 +151,6 @@ image_write_b (abfd, value) return; } - /* Write 2-byte word to image */ static void @@ -176,7 +171,6 @@ image_write_w (abfd, value) return; } - /* Write 4-byte long to image */ static void @@ -197,7 +191,6 @@ image_write_l (abfd, value) return; } - /* Write 8-byte quad to image */ static void @@ -222,12 +215,12 @@ image_write_q (abfd, value) #define HIGHBIT(op) ((op & 0x80000000L) == 0x80000000L) /* etir_sta - + vms stack commands - + handle sta_xxx commands in etir section ptr points to data area in record - + see table B-8 of the openVMS linker manual */ static boolean @@ -268,7 +261,7 @@ etir_sta (abfd, cmd, ptr) } else { - _bfd_vms_push (abfd, (uquad)(entry->symbol->value), -1); + _bfd_vms_push (abfd, (uquad) (entry->symbol->value), -1); } } break; @@ -336,15 +329,14 @@ etir_sta (abfd, cmd, ptr) return true; } - /* etir_sto - + vms store commands - + handle sto_xxx commands in etir section ptr points to data area in record - + see table B-9 of the openVMS linker manual */ static boolean @@ -438,7 +430,7 @@ etir_sto (abfd, cmd, ptr) return false; } else - image_write_q (abfd, (uquad)(entry->symbol->value)); /* FIXME, reloc */ + image_write_q (abfd, (uquad) (entry->symbol->value)); /* FIXME, reloc */ } break; @@ -459,7 +451,7 @@ etir_sto (abfd, cmd, ptr) return false; } else - image_write_q (abfd, (uquad)(entry->symbol->value)); /* FIXME, reloc */ + image_write_q (abfd, (uquad) (entry->symbol->value)); /* FIXME, reloc */ } break; @@ -518,7 +510,7 @@ etir_sto (abfd, cmd, ptr) image_write_l (abfd, (unsigned long)0); /* FIXME, reloc */ } else - image_write_l (abfd, (unsigned long)(entry->symbol->value)); /* FIXME, reloc */ + image_write_l (abfd, (unsigned long) (entry->symbol->value)); /* FIXME, reloc */ } break; @@ -552,7 +544,7 @@ etir_sto (abfd, cmd, ptr) all 32 bit signed arithmetic all word just like a stack calculator arguments are popped from stack, results are pushed on stack - + see table B-10 of the openVMS linker manual */ static boolean @@ -582,7 +574,7 @@ etir_opr (abfd, cmd, ptr) case ETIR_S_C_OPR_ADD: op1 = (long)_bfd_vms_pop (abfd, NULL); op2 = (long)_bfd_vms_pop (abfd, NULL); - _bfd_vms_push (abfd, (uquad)(op1 + op2), -1); + _bfd_vms_push (abfd, (uquad) (op1 + op2), -1); break; /* subtract */ @@ -590,7 +582,7 @@ etir_opr (abfd, cmd, ptr) case ETIR_S_C_OPR_SUB: op1 = (long)_bfd_vms_pop (abfd, NULL); op2 = (long)_bfd_vms_pop (abfd, NULL); - _bfd_vms_push (abfd, (uquad)(op2 - op1), -1); + _bfd_vms_push (abfd, (uquad) (op2 - op1), -1); break; /* multiply */ @@ -598,7 +590,7 @@ etir_opr (abfd, cmd, ptr) case ETIR_S_C_OPR_MUL: op1 = (long)_bfd_vms_pop (abfd, NULL); op2 = (long)_bfd_vms_pop (abfd, NULL); - _bfd_vms_push (abfd, (uquad)(op1 * op2), -1); + _bfd_vms_push (abfd, (uquad) (op1 * op2), -1); break; /* divide */ @@ -609,7 +601,7 @@ etir_opr (abfd, cmd, ptr) if (op2 == 0) _bfd_vms_push (abfd, (uquad)0L, -1); else - _bfd_vms_push (abfd, (uquad)(op2 / op1), -1); + _bfd_vms_push (abfd, (uquad) (op2 / op1), -1); break; /* logical and */ @@ -617,7 +609,7 @@ etir_opr (abfd, cmd, ptr) case ETIR_S_C_OPR_AND: op1 = (long)_bfd_vms_pop (abfd, NULL); op2 = (long)_bfd_vms_pop (abfd, NULL); - _bfd_vms_push (abfd, (uquad)(op1 & op2), -1); + _bfd_vms_push (abfd, (uquad) (op1 & op2), -1); break; /* logical inclusive or */ @@ -625,7 +617,7 @@ etir_opr (abfd, cmd, ptr) case ETIR_S_C_OPR_IOR: op1 = (long)_bfd_vms_pop (abfd, NULL); op2 = (long)_bfd_vms_pop (abfd, NULL); - _bfd_vms_push (abfd, (uquad)(op1 | op2), -1); + _bfd_vms_push (abfd, (uquad) (op1 | op2), -1); break; /* logical exclusive or */ @@ -633,21 +625,21 @@ etir_opr (abfd, cmd, ptr) case ETIR_S_C_OPR_EOR: op1 = (long)_bfd_vms_pop (abfd, NULL); op2 = (long)_bfd_vms_pop (abfd, NULL); - _bfd_vms_push (abfd, (uquad)(op1 ^ op2), -1); + _bfd_vms_push (abfd, (uquad) (op1 ^ op2), -1); break; /* negate */ case ETIR_S_C_OPR_NEG: op1 = (long)_bfd_vms_pop (abfd, NULL); - _bfd_vms_push (abfd, (uquad)(-op1), -1); + _bfd_vms_push (abfd, (uquad) (-op1), -1); break; /* complement */ case ETIR_S_C_OPR_COM: op1 = (long)_bfd_vms_pop (abfd, NULL); - _bfd_vms_push (abfd, (uquad)(op1 ^ -1L), -1); + _bfd_vms_push (abfd, (uquad) (op1 ^ -1L), -1); break; /* insert field */ @@ -714,9 +706,8 @@ etir_opr (abfd, cmd, ptr) return true; } - /* control commands - + see table B-11 of the openVMS linker manual */ static boolean @@ -782,9 +773,8 @@ etir_ctl (abfd, cmd, ptr) return true; } - /* store conditional commands - + see table B-12 and B-13 of the openVMS linker manual */ static boolean @@ -904,7 +894,6 @@ etir_stc (abfd, cmd, ptr) return true; } - static asection * new_section (abfd, idx) bfd *abfd ATTRIBUTE_UNUSED; @@ -943,7 +932,6 @@ new_section (abfd, idx) return section; } - static int alloc_section (abfd, idx) bfd *abfd; @@ -969,7 +957,6 @@ alloc_section (abfd, idx) return 0; } - /* * tir_sta * @@ -1010,7 +997,7 @@ tir_sta (bfd *abfd, unsigned char *ptr) if (entry == (vms_symbol_entry *)NULL) return 0; - _bfd_vms_push (abfd, (unsigned long)(entry->symbol->value), -1); + _bfd_vms_push (abfd, (unsigned long) (entry->symbol->value), -1); ptr += *ptr + 1; } break; @@ -1292,7 +1279,6 @@ tir_sta (bfd *abfd, unsigned char *ptr) return ptr; } - /* * tir_sto * @@ -1464,7 +1450,6 @@ tir_sto (bfd *abfd, unsigned char *ptr) return ptr; } - /* * stack operator commands * all 32 bit signed arithmetic @@ -1498,7 +1483,7 @@ tir_opr (bfd *abfd, unsigned char *ptr) */ op1 = (long)_bfd_vms_pop (abfd, NULL); op2 = (long)_bfd_vms_pop (abfd, NULL); - _bfd_vms_push (abfd, (unsigned long)(op1 + op2), -1); + _bfd_vms_push (abfd, (unsigned long) (op1 + op2), -1); break; case TIR_S_C_OPR_SUB: @@ -1507,7 +1492,7 @@ tir_opr (bfd *abfd, unsigned char *ptr) */ op1 = (long)_bfd_vms_pop (abfd, NULL); op2 = (long)_bfd_vms_pop (abfd, NULL); - _bfd_vms_push (abfd, (unsigned long)(op2 - op1), -1); + _bfd_vms_push (abfd, (unsigned long) (op2 - op1), -1); break; case TIR_S_C_OPR_MUL: @@ -1516,7 +1501,7 @@ tir_opr (bfd *abfd, unsigned char *ptr) */ op1 = (long)_bfd_vms_pop (abfd, NULL); op2 = (long)_bfd_vms_pop (abfd, NULL); - _bfd_vms_push (abfd, (unsigned long)(op1 * op2), -1); + _bfd_vms_push (abfd, (unsigned long) (op1 * op2), -1); break; case TIR_S_C_OPR_DIV: @@ -1528,7 +1513,7 @@ tir_opr (bfd *abfd, unsigned char *ptr) if (op2 == 0) _bfd_vms_push (abfd, (unsigned long)0L, -1); else - _bfd_vms_push (abfd, (unsigned long)(op2 / op1), -1); + _bfd_vms_push (abfd, (unsigned long) (op2 / op1), -1); break; case TIR_S_C_OPR_AND: @@ -1537,7 +1522,7 @@ tir_opr (bfd *abfd, unsigned char *ptr) */ op1 = (long)_bfd_vms_pop (abfd, NULL); op2 = (long)_bfd_vms_pop (abfd, NULL); - _bfd_vms_push (abfd, (unsigned long)(op1 & op2), -1); + _bfd_vms_push (abfd, (unsigned long) (op1 & op2), -1); break; case TIR_S_C_OPR_IOR: @@ -1546,7 +1531,7 @@ tir_opr (bfd *abfd, unsigned char *ptr) * logical inclusive or */ op2 = (long)_bfd_vms_pop (abfd, NULL); - _bfd_vms_push (abfd, (unsigned long)(op1 | op2), -1); + _bfd_vms_push (abfd, (unsigned long) (op1 | op2), -1); break; case TIR_S_C_OPR_EOR: @@ -1555,7 +1540,7 @@ tir_opr (bfd *abfd, unsigned char *ptr) */ op1 = (long)_bfd_vms_pop (abfd, NULL); op2 = (long)_bfd_vms_pop (abfd, NULL); - _bfd_vms_push (abfd, (unsigned long)(op1 ^ op2), -1); + _bfd_vms_push (abfd, (unsigned long) (op1 ^ op2), -1); break; case TIR_S_C_OPR_NEG: @@ -1563,7 +1548,7 @@ tir_opr (bfd *abfd, unsigned char *ptr) * negate */ op1 = (long)_bfd_vms_pop (abfd, NULL); - _bfd_vms_push (abfd, (unsigned long)(-op1), -1); + _bfd_vms_push (abfd, (unsigned long) (-op1), -1); break; case TIR_S_C_OPR_COM: @@ -1571,7 +1556,7 @@ tir_opr (bfd *abfd, unsigned char *ptr) * complement */ op1 = (long)_bfd_vms_pop (abfd, NULL); - _bfd_vms_push (abfd, (unsigned long)(op1 ^ -1L), -1); + _bfd_vms_push (abfd, (unsigned long) (op1 ^ -1L), -1); break; case TIR_S_C_OPR_INSV: @@ -1660,7 +1645,6 @@ tir_opr (bfd *abfd, unsigned char *ptr) return ptr; } - static unsigned char * tir_ctl (bfd *abfd, unsigned char *ptr) /* @@ -1729,7 +1713,6 @@ tir_ctl (bfd *abfd, unsigned char *ptr) return ptr; } - /* * handle command from TIR section */ @@ -1740,7 +1723,7 @@ tir_cmd (bfd *abfd, unsigned char *ptr) struct { int mincod; int maxcod; - unsigned char * (*explain)(bfd *, unsigned char *); + unsigned char * (*explain) (bfd *, unsigned char *); } tir_table[] = { { 0, TIR_S_C_MAXSTACOD, tir_sta } ,{ TIR_S_C_MINSTOCOD, TIR_S_C_MAXSTOCOD, tir_sto } @@ -1765,7 +1748,7 @@ tir_cmd (bfd *abfd, unsigned char *ptr) { while (tir_table[i].mincod >= 0) { - if ( (tir_table[i].mincod <= *ptr) + if ( (tir_table[i].mincod <= *ptr) && (*ptr <= tir_table[i].maxcod)) { ptr = tir_table[i].explain (abfd, ptr); @@ -1783,7 +1766,6 @@ tir_cmd (bfd *abfd, unsigned char *ptr) return ptr; } - /* handle command from ETIR section */ static int @@ -1814,7 +1796,7 @@ etir_cmd (abfd, cmd, ptr) while (etir_table[i].mincod >= 0) { - if ( (etir_table[i].mincod <= cmd) + if ( (etir_table[i].mincod <= cmd) && (cmd <= etir_table[i].maxcod)) { if (!etir_table[i].explain (abfd, cmd, ptr)) @@ -1830,7 +1812,6 @@ etir_cmd (abfd, cmd, ptr) return 0; } - /* Text Information and Relocation Records (OBJ$C_TIR) handle tir record */ @@ -1858,7 +1839,6 @@ analyze_tir (abfd, ptr, length) return 0; } - /* Text Information and Relocation Records (EOBJ$C_ETIR) handle etir record */ @@ -1895,9 +1875,8 @@ analyze_etir (abfd, ptr, length) return result; } - /* process ETIR record - + return 0 on success, -1 on error */ int @@ -1931,10 +1910,9 @@ _bfd_vms_slurp_tir (abfd, objtype) return result; } - /* process EDBG record return 0 on success, -1 on error - + not implemented yet */ int @@ -1950,10 +1928,9 @@ _bfd_vms_slurp_dbg (abfd, objtype) return 0; } - /* process ETBT record return 0 on success, -1 on error - + not implemented yet */ int @@ -1968,10 +1945,9 @@ _bfd_vms_slurp_tbt (abfd, objtype) return 0; } - /* process LNK record return 0 on success, -1 on error - + not implemented yet */ int @@ -2032,7 +2008,7 @@ sto_imm (abfd, sptr, vaddr, index) } _bfd_vms_output_begin (abfd, ETIR_S_C_STO_IMM, -1); - _bfd_vms_output_long (abfd, (unsigned long)(size)); + _bfd_vms_output_long (abfd, (unsigned long) (size)); _bfd_vms_output_dump (abfd, cptr, size); _bfd_vms_output_flush (abfd); @@ -2077,14 +2053,13 @@ start_etir_record (abfd, index, offset, justoffset) return; } - /* end etir record */ static void end_etir_record (abfd) bfd *abfd; { _bfd_vms_output_pop (abfd); - _bfd_vms_output_end (abfd); + _bfd_vms_output_end (abfd); } /* write section contents for bfd abfd */ @@ -2115,7 +2090,7 @@ _bfd_vms_write_tir (abfd, objtype) { #if VMS_DEBUG - _bfd_vms_debug (4, "writing %d. section '%s' (%d bytes)\n", section->index, section->name, (int)(section->_raw_size)); + _bfd_vms_debug (4, "writing %d. section '%s' (%d bytes)\n", section->index, section->name, (int) (section->_raw_size)); #endif if (section->flags & SEC_RELOC) @@ -2138,7 +2113,7 @@ _bfd_vms_write_tir (abfd, objtype) _bfd_vms_debug (4, "sym %s in sec %s, value %08lx, addr %08lx, off %08lx, len %d: %s\n", (*(*rptr)->sym_ptr_ptr)->name, (*(*rptr)->sym_ptr_ptr)->section->name, - (long)(*(*rptr)->sym_ptr_ptr)->value, + (long) (*(*rptr)->sym_ptr_ptr)->value, (*rptr)->address, (*rptr)->addend, bfd_get_reloc_size((*rptr)->howto), (*rptr)->howto->name); @@ -2160,7 +2135,7 @@ _bfd_vms_write_tir (abfd, objtype) return -1; } - vaddr = (bfd_vma)(sptr->offset); + vaddr = (bfd_vma) (sptr->offset); start_etir_record (abfd, section->index, (uquad) sptr->offset, false); @@ -2259,9 +2234,9 @@ _bfd_vms_write_tir (abfd, objtype) ETIR_S_C_STA_PQ, -1); _bfd_vms_output_long (abfd, - (unsigned long)(sec->index)); + (unsigned long) (sec->index)); _bfd_vms_output_quad (abfd, - ((uquad)(*rptr)->addend + ((uquad) (*rptr)->addend + (uquad)sym->value)); _bfd_vms_output_flush (abfd); _bfd_vms_output_begin (abfd, @@ -2325,9 +2300,9 @@ _bfd_vms_write_tir (abfd, objtype) ETIR_S_C_STA_PQ, -1); _bfd_vms_output_long (abfd, - (unsigned long)(sec->index)); + (unsigned long) (sec->index)); _bfd_vms_output_quad (abfd, - ((uquad)(*rptr)->addend + ((uquad) (*rptr)->addend + (uquad)sym->value)); _bfd_vms_output_flush (abfd); _bfd_vms_output_begin (abfd, @@ -2348,7 +2323,7 @@ _bfd_vms_write_tir (abfd, objtype) sptr->size = hint_size; #if 0 vms_output_begin(abfd, ETIR_S_C_STO_HINT_GBL, -1); - vms_output_long(abfd, (unsigned long)(sec->index)); + vms_output_long(abfd, (unsigned long) (sec->index)); vms_output_quad(abfd, (uquad)addr); vms_output_counted(abfd, _bfd_vms_length_hash_symbol (abfd, sym->name, EOBJ_S_C_SYMSIZ)); @@ -2456,7 +2431,6 @@ _bfd_vms_write_tir (abfd, objtype) return 0; } - /* write traceback data for bfd abfd */ int @@ -2471,7 +2445,6 @@ _bfd_vms_write_tbt (abfd, objtype) return 0; } - /* write debug info for bfd abfd */ int diff --git a/gnu/dist/toolchain/bfd/vms.c b/gnu/dist/toolchain/bfd/vms.c index f0ea63ff92d3..b52d81709b97 100644 --- a/gnu/dist/toolchain/bfd/vms.c +++ b/gnu/dist/toolchain/bfd/vms.c @@ -1,6 +1,6 @@ /* vms.c -- BFD back-end for VAX (openVMS/VAX) and EVAX (openVMS/Alpha) files. - Copyright 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright 1996, 97, 98, 99, 2000 Free Software Foundation, Inc. Written by Klaus K"ampf (kkaempf@rmi.de) @@ -170,7 +170,7 @@ const bfd_target vms_alpha_vec = BFD_JUMP_TABLE_DYNAMIC (vms), NULL, - + (PTR) 0 }; @@ -216,7 +216,7 @@ const bfd_target vms_vax_vec = BFD_JUMP_TABLE_DYNAMIC (vms), NULL, - + (PTR) 0 }; @@ -306,7 +306,6 @@ vms_initialize (abfd) return true; } - /* Fill symbol->section with section ptr symbol->section is filled with the section index for defined symbols during reading the GSD/EGSD section. But we need the pointer to the @@ -345,7 +344,6 @@ fill_section_ptr (entry, sections) return true; } - /* Fixup sections set up all pointers and arrays, counters and sizes are fixed now @@ -369,7 +367,7 @@ vms_fixup_sections (abfd) /* can't provide section count as argument to fill_section_ptr(). */ priv_section_count = PRIV(section_count); bfd_hash_traverse (PRIV(vms_symbol_table), fill_section_ptr, - (PTR)(PRIV(sections))); + (PTR) (PRIV(sections))); PRIV(fixup_done) = true; @@ -416,7 +414,7 @@ vms_object_p (abfd) if (_bfd_vms_next_record (abfd) < 0) { #if VMS_DEBUG - vms_debug (2, "next_record failed\n"); + vms_debug (2, "next_record failed\n"); #endif bfd_set_error (bfd_error_wrong_format); return 0; @@ -501,7 +499,7 @@ vms_object_p (abfd) } /* set arch_info to vax */ - + arch = bfd_scan_arch ("vax"); PRIV (is_vax) = 1; #if VMS_DEBUG @@ -511,7 +509,7 @@ vms_object_p (abfd) else if (target_vector == &vms_alpha_vec) { /* set arch_info to alpha */ - + arch = bfd_scan_arch ("alpha"); PRIV (is_vax) = 0; #if VMS_DEBUG @@ -532,7 +530,6 @@ vms_object_p (abfd) return target_vector; } - /* Check the format for a file being read. Return a (bfd_target *) if it's an archive file or zero. */ @@ -547,7 +544,6 @@ vms_archive_p (abfd) return 0; } - /* Set the format of a file being written. */ static boolean @@ -581,7 +577,6 @@ vms_mkobject (abfd) return true; } - /* Write cached information into a file being written, at bfd_close. */ static boolean @@ -717,7 +712,6 @@ vms_close_and_cleanup (abfd) return true; } - /* Ask the BFD to free all cached information. */ static boolean vms_bfd_free_cached_info (abfd) @@ -729,7 +723,6 @@ vms_bfd_free_cached_info (abfd) return true; } - /* Called when a new section is created. */ static boolean @@ -761,7 +754,6 @@ vms_new_section_hook (abfd, section) return true; } - /* Read the contents of a section. buf points to a buffer of buf_size bytes to be filled with section data (starting at offset into section) */ @@ -822,7 +814,6 @@ vms_bfd_copy_private_bfd_data (src, dest) return true; } - /* Merge private BFD information from the BFD @var{ibfd} to the the output file BFD @var{obfd} when linking. Return <> on success, <> on error. Possible error returns are: @@ -841,7 +832,6 @@ vms_bfd_merge_private_bfd_data (ibfd, obfd) return true; } - /* Set private BFD flag information in the BFD @var{abfd}. Return <> on success, <> on error. Possible error returns are: @@ -860,7 +850,6 @@ vms_bfd_set_private_flags (abfd, flags) return true; } - /* Called to copy BFD private section data from one object file to another. */ @@ -881,7 +870,7 @@ vms_bfd_copy_private_section_data (srcbfd, srcsec, dstbfd, dstsec) /* Called to copy BFD private symbol data from one object file to another. */ -static boolean +static boolean vms_bfd_copy_private_symbol_data (ibfd, isym, obfd, osym) bfd *ibfd ATTRIBUTE_UNUSED; asymbol *isym ATTRIBUTE_UNUSED; @@ -910,7 +899,6 @@ vms_core_file_failing_command (abfd) return 0; } - /* Returns the signal number which caused the core dump which generated the file the BFD abfd is attached to. */ @@ -924,7 +912,6 @@ vms_core_file_failing_signal (abfd) return 0; } - /* Return true if the core file attached to core_bfd was generated by a run of the executable file attached to exec_bfd, false otherwise. */ @@ -954,7 +941,6 @@ vms_slurp_armap (abfd) return false; } - /* ??? do something with an extended name table. Return false on error, true otherwise. */ @@ -968,7 +954,6 @@ vms_slurp_extended_name_table (abfd) return false; } - /* ??? do something with an extended name table. Return false on error, true otherwise. */ @@ -985,7 +970,6 @@ vms_construct_extended_name_table (abfd, tabloc, tablen, name) return false; } - /* Truncate the name of an archive to match system-dependent restrictions */ static void @@ -1000,7 +984,6 @@ vms_truncate_arname (abfd, pathname, arhdr) return; } - /* ??? write archive map */ static boolean @@ -1030,7 +1013,6 @@ vms_read_ar_hdr (abfd) return (PTR)0; } - /* Provided a BFD, @var{archive}, containing an archive and NULL, open an input BFD on the first contained element and returns that. Subsequent calls should pass the archive and the previous return value @@ -1045,10 +1027,9 @@ vms_openr_next_archived_file (arch, prev) #if VMS_DEBUG vms_debug (1, "vms_openr_next_archived_file(%p, %p)\n", arch, prev); #endif - return false; + return NULL; } - /* Return the BFD which is referenced by the symbol in ABFD indexed by INDEX. INDEX should have been returned by bfd_get_next_mapent. */ @@ -1063,7 +1044,6 @@ vms_get_elt_at_index (abfd, index) return _bfd_generic_get_elt_at_index(abfd, index); } - /* ??? -> bfd_generic_stat_arch_elt */ @@ -1078,7 +1058,6 @@ vms_generic_stat_arch_elt (abfd, stat) return bfd_generic_stat_arch_elt(abfd, stat); } - /* This is a new function in bfd 2.5 */ static boolean @@ -1105,10 +1084,9 @@ vms_get_symtab_upper_bound (abfd) #if VMS_DEBUG vms_debug (1, "vms_get_symtab_upper_bound(%p), %d symbols\n", abfd, PRIV(gsd_sym_count)); #endif - return (PRIV(gsd_sym_count)+1) * sizeof(asymbol *); + return (PRIV(gsd_sym_count)+1) * sizeof (asymbol *); } - /* Copy symbols from hash table to symbol vector called from bfd_hash_traverse in vms_get_symtab @@ -1129,7 +1107,6 @@ copy_symbols (entry, arg) return true; } - /* Read the symbols from the BFD abfd, and fills in the vector location with pointers to the symbols and a trailing NULL. @@ -1157,7 +1134,6 @@ vms_get_symtab (abfd, symbols) return PRIV(gsd_sym_count); } - /* Create a new asymbol structure for the BFD abfd and return a pointer to it. This routine is necessary because each back end has private information @@ -1168,7 +1144,7 @@ asymbol * _bfd_vms_make_empty_symbol (abfd) bfd *abfd; { - asymbol *symbol = (asymbol *)bfd_zalloc(abfd, sizeof(asymbol)); + asymbol *symbol = (asymbol *)bfd_zalloc(abfd, sizeof (asymbol)); #if VMS_DEBUG vms_debug (1, "_bfd_vms_make_empty_symbol(%p)\n", abfd); @@ -1184,7 +1160,6 @@ _bfd_vms_make_empty_symbol (abfd) return symbol; } - /* Print symbol to file according to how. how is one of bfd_print_symbol_name just print the name bfd_print_symbol_more print more (???) @@ -1205,7 +1180,7 @@ vms_print_symbol (abfd, file, symbol, how) { case bfd_print_symbol_name: case bfd_print_symbol_more: - fprintf((FILE *)file," %s", symbol->name); + fprintf ((FILE *)file," %s", symbol->name); break; break; @@ -1216,14 +1191,13 @@ vms_print_symbol (abfd, file, symbol, how) bfd_print_symbol_vandf((PTR)file,symbol); - fprintf((FILE *)file," %-8s %s", section_name, symbol->name); + fprintf ((FILE *)file," %-8s %s", section_name, symbol->name); } break; } return; } - /* Return information about symbol in ret. fill type, value and name @@ -1281,7 +1255,6 @@ vms_get_symbol_info (abfd, symbol, ret) return; } - /* Return true if the given symbol sym in the BFD abfd is a compiler generated local label, else return false. */ @@ -1296,7 +1269,6 @@ vms_bfd_is_local_label_name (abfd, name) return name[0] == '$'; } - /* Get source line number for symbol */ static alent * @@ -1310,7 +1282,6 @@ vms_get_lineno (abfd, symbol) return 0; } - /* Provided a BFD, a section and an offset into the section, calculate and return the name of the source file and the line nearest to the wanted location. */ @@ -1332,7 +1303,6 @@ vms_find_nearest_line (abfd, section, symbols, offset, file, func, line) return false; } - /* Back-door to allow format-aware applications to create debug symbols while using BFD for everything else. Currently used by the assembler when creating COFF files. */ @@ -1349,7 +1319,6 @@ vms_bfd_make_debug_symbol (abfd, ptr, size) return 0; } - /* Read minisymbols. For minisymbols, we use the unmodified a.out symbols. The minisymbol_to_symbol function translates these into BFD asymbol structures. */ @@ -1401,7 +1370,6 @@ vms_get_reloc_upper_bound (abfd, section) return -1L; } - /* Call the back end associated with the open BFD abfd and translate the external form of the relocation information attached to sec into the internal canonical form. Place the table into memory at loc, which has @@ -1710,7 +1678,6 @@ vms_bfd_reloc_type_lookup (abfd, code) return &alpha_howto_table[alpha_type]; } - /*-- Part 4.7, writing an object file ---------------------------------------*/ /* Set the architecture and machine type in BFD abfd to arch and mach. @@ -1731,7 +1698,6 @@ vms_set_arch_mach (abfd, arch, mach) return true; } - /* Sets the contents of the section section in BFD abfd to the data starting in memory at data. The data is written to the output section starting at offset offset for count bytes. @@ -1757,7 +1723,6 @@ vms_set_section_contents (abfd, section, location, offset, count) return _bfd_save_vms_section(abfd, section, location, offset, count); } - /*-- Part 4.8, linker -------------------------------------------------------*/ /* Get the size of the section headers. */ @@ -1773,7 +1738,6 @@ vms_sizeof_headers (abfd, reloc) return 0; } - /* Provides default handling of relocation effort for back ends which can't be bothered to do it efficiently. */ @@ -1794,7 +1758,6 @@ vms_bfd_get_relocated_section_contents (abfd, link_info, link_order, data, return 0; } - /* ??? */ static boolean @@ -1822,7 +1785,6 @@ vms_bfd_gc_sections (abfd, link_info) return true; } - /* Create a hash table for the linker. Different backends store different information in this table. */ @@ -1836,7 +1798,6 @@ vms_bfd_link_hash_table_create (abfd) return 0; } - /* Add symbols from this object file into the hash table. */ static boolean @@ -1850,7 +1811,6 @@ vms_bfd_link_add_symbols (abfd, link_info) return false; } - /* Do a link based on the link_order structures attached to each section of the BFD. */ @@ -1903,7 +1863,6 @@ vms_bfd_print_private_bfd_data (abfd, file) return 0; } - /* Read in the dynamic symbols. */ static long @@ -1917,7 +1876,6 @@ vms_canonicalize_dynamic_symtab (abfd, symbols) return 0L; } - /* Get the amount of memory required to hold the dynamic relocs. */ static long @@ -1930,7 +1888,6 @@ vms_get_dynamic_reloc_upper_bound (abfd) return 0L; } - /* Read in the dynamic relocs. */ static long diff --git a/gnu/dist/toolchain/bfd/vms.h b/gnu/dist/toolchain/bfd/vms.h index 714398699de3..943b4eadd8bb 100644 --- a/gnu/dist/toolchain/bfd/vms.h +++ b/gnu/dist/toolchain/bfd/vms.h @@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef VMS_H #define VMS_H - /* Constants starting with 'Exxx_' are for openVMS/Alpha (EVAX object language) */ /* VMS Text, information and relocation record (TIR/ETIR) definitions. */ @@ -531,7 +530,6 @@ struct hdr_struc { char *hdr_c_ttl; }; - /* vms end of module */ struct eom_struc { diff --git a/gnu/dist/toolchain/bfd/xcoff-target.h b/gnu/dist/toolchain/bfd/xcoff-target.h new file mode 100644 index 000000000000..22bd80807892 --- /dev/null +++ b/gnu/dist/toolchain/bfd/xcoff-target.h @@ -0,0 +1,194 @@ +/* Common definitions for backends based on IBM RS/6000 "XCOFF64" files. + Copyright 2000 + Free Software Foundation, Inc. + Contributed by Cygnus Support. + +This file is part of BFD, the Binary File Descriptor library. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +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. */ + +/* Internalcoff.h and coffcode.h modify themselves based on this flag. */ +#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 +#define coff_relocate_section _bfd_ppc_xcoff_relocate_section + +#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 + +#ifdef AIX_CORE +#undef CORE_FILE_P +#define CORE_FILE_P rs6000coff_core_p +extern const bfd_target * rs6000coff_core_p (); +extern boolean rs6000coff_core_file_matches_executable_p (); + +#undef coff_core_file_matches_executable_p +#define coff_core_file_matches_executable_p \ + rs6000coff_core_file_matches_executable_p + +extern char *rs6000coff_core_file_failing_command PARAMS ((bfd *abfd)); +#undef coff_core_file_failing_command +#define coff_core_file_failing_command rs6000coff_core_file_failing_command + +extern int rs6000coff_core_file_failing_signal PARAMS ((bfd *abfd)); +#undef coff_core_file_failing_signal +#define coff_core_file_failing_signal rs6000coff_core_file_failing_signal +#endif /* AIX_CORE */ + +#ifdef LYNX_CORE + +#undef CORE_FILE_P +#define CORE_FILE_P lynx_core_file_p +extern const bfd_target *lynx_core_file_p PARAMS ((bfd *abfd)); + +extern boolean lynx_core_file_matches_executable_p PARAMS ((bfd *core_bfd, + bfd *exec_bfd)); +#undef coff_core_file_matches_executable_p +#define coff_core_file_matches_executable_p lynx_core_file_matches_executable_p + +extern char *lynx_core_file_failing_command PARAMS ((bfd *abfd)); +#undef coff_core_file_failing_command +#define coff_core_file_failing_command lynx_core_file_failing_command + +extern int lynx_core_file_failing_signal PARAMS ((bfd *abfd)); +#undef coff_core_file_failing_signal +#define coff_core_file_failing_signal lynx_core_file_failing_signal + +#endif /* LYNX_CORE */ + +#define _bfd_xcoff_bfd_get_relocated_section_contents \ + coff_bfd_get_relocated_section_contents +#define _bfd_xcoff_bfd_relax_section coff_bfd_relax_section +#define _bfd_xcoff_bfd_gc_sections coff_bfd_gc_sections +#define _bfd_xcoff_bfd_link_split_section coff_bfd_link_split_section + +/* XCOFF archives do not have anything which corresponds to an + extended name table. */ + +#define _bfd_xcoff_slurp_extended_name_table bfd_false +#define _bfd_xcoff_construct_extended_name_table \ + ((boolean (*) PARAMS ((bfd *, char **, bfd_size_type *, const char **))) \ + bfd_false) +#define _bfd_xcoff_truncate_arname bfd_dont_truncate_arname + +/* We can use the standard get_elt_at_index routine. */ + +#define _bfd_xcoff_get_elt_at_index _bfd_generic_get_elt_at_index + +/* XCOFF archives do not have a timestamp. */ + +#define _bfd_xcoff_update_armap_timestamp bfd_true + +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 void _bfd_xcoff_rtype2howto + PARAMS ((arelent *, struct internal_reloc *)); +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)); + +#ifndef coff_SWAP_sym_in +#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 +#endif + +#include "coffcode.h" + +/* The transfer vector that leads the outside world to all of the above. */ + +const bfd_target TARGET_SYM = +{ + TARGET_NAME, + 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 */ + + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* data */ + bfd_getb64, bfd_getb_signed_64, bfd_putb64, + bfd_getb32, bfd_getb_signed_32, bfd_putb32, + bfd_getb16, bfd_getb_signed_16, bfd_putb16, /* hdrs */ + + {_bfd_dummy_target, coff_object_p, /* bfd_check_format */ + _bfd_xcoff_archive_p, CORE_FILE_P}, + {bfd_false, coff_mkobject, /* bfd_set_format */ + _bfd_generic_mkarchive, bfd_false}, + {bfd_false, coff_write_object_contents, /* bfd_write_contents */ + _bfd_xcoff_write_archive_contents, bfd_false}, + + BFD_JUMP_TABLE_GENERIC (coff), + BFD_JUMP_TABLE_COPY (coff), + BFD_JUMP_TABLE_CORE (coff), + BFD_JUMP_TABLE_ARCHIVE (_bfd_xcoff), + BFD_JUMP_TABLE_SYMBOLS (coff), + BFD_JUMP_TABLE_RELOCS (coff), + BFD_JUMP_TABLE_WRITE (coff), + BFD_JUMP_TABLE_LINK (_bfd_xcoff), + BFD_JUMP_TABLE_DYNAMIC (_bfd_xcoff), + + NULL, + + COFF_SWAP_TABLE +}; diff --git a/gnu/dist/toolchain/bfd/xcofflink.c b/gnu/dist/toolchain/bfd/xcofflink.c index 3f488d7f3820..3ab7dfc1079d 100644 --- a/gnu/dist/toolchain/bfd/xcofflink.c +++ b/gnu/dist/toolchain/bfd/xcofflink.c @@ -29,14 +29,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #define STRING_SIZE_SIZE (4) -/* In order to support linking different object file formats into an - XCOFF format, we need to be able to determine whether a particular - bfd_target is an XCOFF vector. FIXME: We need to rethink this - whole approach. */ -#define XCOFF_XVECP(xv) \ - (strcmp ((xv)->name, "aixcoff-rs6000") == 0 \ - || strcmp ((xv)->name, "xcoff-powermac") == 0) - /* Get the XCOFF hash table entries for a BFD. */ #define obj_xcoff_sym_hashes(bfd) \ ((struct xcoff_link_hash_entry **) obj_coff_sym_hashes (bfd)) @@ -75,8 +67,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* The remaining words of global linkage code. */ -static unsigned long xcoff_glink_code[] = -{ +static unsigned long xcoff_glink_code[] = { 0x90410014, /* stw r2,20(r1) */ 0x800c0000, /* lwz r0,0(r12) */ 0x804c0004, /* lwz r2,4(r12) */ @@ -98,8 +89,7 @@ static unsigned long xcoff_glink_code[] = /* The ldhdr structure. This appears at the start of the .loader section. */ -struct internal_ldhdr -{ +struct internal_ldhdr { /* The version number: currently always 1. */ unsigned long l_version; /* The number of symbol table entries. */ @@ -120,8 +110,7 @@ struct internal_ldhdr bfd_size_type l_stoff; }; -struct external_ldhdr -{ +struct external_ldhdr { bfd_byte l_version[4]; bfd_byte l_nsyms[4]; bfd_byte l_nreloc[4]; @@ -137,21 +126,18 @@ struct external_ldhdr /* The ldsym structure. This is used to represent a symbol in the .loader section. */ -struct internal_ldsym -{ - union - { - /* The symbol name if <= SYMNMLEN characters. */ - char _l_name[SYMNMLEN]; - struct - { - /* Zero if the symbol name is more than SYMNMLEN characters. */ - long _l_zeroes; - /* The offset in the string table if the symbol name is more - than SYMNMLEN characters. */ - long _l_offset; - } _l_l; - } _l; +struct internal_ldsym { + union { + /* The symbol name if <= SYMNMLEN characters. */ + char _l_name[SYMNMLEN]; + struct { + /* Zero if the symbol name is more than SYMNMLEN characters. */ + long _l_zeroes; + /* The offset in the string table if the symbol name is more + than SYMNMLEN characters. */ + long _l_offset; + } _l_l; + } _l; /* The symbol value. */ bfd_vma l_value; /* The symbol section number. */ @@ -166,17 +152,14 @@ struct internal_ldsym bfd_size_type l_parm; }; -struct external_ldsym -{ - union - { - bfd_byte _l_name[SYMNMLEN]; - struct - { - bfd_byte _l_zeroes[4]; - bfd_byte _l_offset[4]; - } _l_l; - } _l; +struct external_ldsym { + union { + bfd_byte _l_name[SYMNMLEN]; + struct { + bfd_byte _l_zeroes[4]; + bfd_byte _l_offset[4]; + } _l_l; + } _l; bfd_byte l_value[4]; bfd_byte l_scnum[2]; bfd_byte l_smtype[1]; @@ -200,8 +183,7 @@ struct external_ldsym /* The ldrel structure. This is used to represent a reloc in the .loader section. */ -struct internal_ldrel -{ +struct internal_ldrel { /* The reloc address. */ bfd_vma l_vaddr; /* The symbol table index in the .loader section symbol table. */ @@ -212,8 +194,7 @@ struct internal_ldrel short l_rsecnm; }; -struct external_ldrel -{ +struct external_ldrel { bfd_byte l_vaddr[4]; bfd_byte l_symndx[4]; bfd_byte l_rtype[2]; @@ -224,8 +205,7 @@ struct external_ldrel /* The list of import files. */ -struct xcoff_import_file -{ +struct xcoff_import_file { /* The next entry in the list. */ struct xcoff_import_file *next; /* The path. */ @@ -238,8 +218,7 @@ struct xcoff_import_file /* An entry in the XCOFF linker hash table. */ -struct xcoff_link_hash_entry -{ +struct xcoff_link_hash_entry { struct bfd_link_hash_entry root; /* Symbol index in output file. Set to -1 initially. Set to -2 if @@ -250,15 +229,14 @@ struct xcoff_link_hash_entry section which holds it. */ asection *toc_section; - union - { - /* If we have created a TOC entry (the XCOFF_SET_TOC flag is - set), this is the offset in toc_section. */ - bfd_vma toc_offset; - /* If the TOC entry comes from an input file, this is set to the - symbol index of the C_HIDEXT XMC_TC or XMC_TD symbol. */ - long toc_indx; - } u; + union { + /* If we have created a TOC entry (the XCOFF_SET_TOC flag is set), + this is the offset in toc_section. */ + bfd_vma toc_offset; + /* If the TOC entry comes from an input file, this is set to the + symbol index of the C_HIDEXT XMC_TC or XMC_TD symbol. */ + long toc_indx; + } u; /* If this symbol is a function entry point which is called, this field holds a pointer to the function descriptor. If this symbol @@ -311,8 +289,7 @@ struct xcoff_link_hash_entry /* The XCOFF linker hash table. */ -struct xcoff_link_hash_table -{ +struct xcoff_link_hash_table { struct bfd_link_hash_table root; /* The .debug string hash table. We need to compute this while @@ -357,12 +334,11 @@ struct xcoff_link_hash_table boolean gc; /* A linked list of symbols for which we have size information. */ - struct xcoff_link_size_list - { - struct xcoff_link_size_list *next; - struct xcoff_link_hash_entry *h; - bfd_size_type size; - } *size_list; + struct xcoff_link_size_list { + struct xcoff_link_size_list *next; + struct xcoff_link_hash_entry *h; + bfd_size_type size; + } *size_list; /* Magic sections: _text, _etext, _data, _edata, _end, end. */ asection *special_sections[6]; @@ -371,8 +347,7 @@ struct xcoff_link_hash_table /* Information we keep for each section in the output file during the final link phase. */ -struct xcoff_link_section_info -{ +struct xcoff_link_section_info { /* The relocs to be output. */ struct internal_reloc *relocs; /* For each reloc against a global symbol whose index was not known @@ -382,18 +357,16 @@ struct xcoff_link_section_info index of the TOC symbol is not known when the reloc was handled, an entry is added to this linked list. This is not an array, like rel_hashes, because this case is quite uncommon. */ - struct xcoff_toc_rel_hash - { - struct xcoff_toc_rel_hash *next; - struct xcoff_link_hash_entry *h; - struct internal_reloc *rel; - } *toc_rel_hashes; + struct xcoff_toc_rel_hash { + struct xcoff_toc_rel_hash *next; + struct xcoff_link_hash_entry *h; + struct internal_reloc *rel; + } *toc_rel_hashes; }; /* Information that we pass around while doing the final link step. */ -struct xcoff_final_link_info -{ +struct xcoff_final_link_info { /* General link information. */ struct bfd_link_info *info; /* Output BFD. */ @@ -792,18 +765,18 @@ _bfd_xcoff_get_dynamic_reloc_upper_bound (abfd) /* The typical dynamic reloc. */ 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 */ + 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 */ + 0, /* special_function */ + "R_POS", /* name */ + true, /* partial_inplace */ + 0xffffffff, /* src_mask */ + 0xffffffff, /* dst_mask */ false); /* pcrel_offset */ /* Get the dynamic relocs. */ @@ -1894,12 +1867,11 @@ xcoff_link_add_symbols (abfd, info) the csect storage mapping class, so that the linker can accumulate similar csects together. */ { - static const char *csect_name_by_class[] = - { - ".pr", ".ro", ".db", ".tc", ".ua", ".rw", ".gl", ".xo", - ".sv", ".bs", ".ds", ".uc", ".ti", ".tb", NULL, ".tc0", - ".td" - }; + static const char *csect_name_by_class[] = { + ".pr", ".ro", ".db", ".tc", ".ua", ".rw", ".gl", ".xo", + ".sv", ".bs", ".ds", ".uc", ".ti", ".tb", NULL, ".tc0", + ".td" + }; const char *csect_name; asection *enclosing; @@ -2289,7 +2261,7 @@ xcoff_link_add_symbols (abfd, info) else { (*sym_hash)->root.u.c.p->alignment_power - = csect->alignment_power; + = csect->alignment_power; } } @@ -2404,7 +2376,7 @@ xcoff_link_add_symbols (abfd, info) /* Reset SEC_RELOC and the reloc_count, since the reloc information is now attached to the csects. */ - o->flags &=~ SEC_RELOC; + o->flags &= ~SEC_RELOC; o->reloc_count = 0; /* If we are not keeping memory, free the reloc information. */ @@ -2915,7 +2887,7 @@ bfd_xcoff_link_record_set (output_bfd, info, harg, size) struct xcoff_link_hash_entry *h = (struct xcoff_link_hash_entry *) harg; struct xcoff_link_size_list *n; - if (! XCOFF_XVECP (output_bfd->xvec)) + if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) return true; /* This will hardly ever be called. I don't want to burn four bytes @@ -2951,7 +2923,7 @@ bfd_xcoff_import_symbol (output_bfd, info, harg, val, imppath, impfile, { struct xcoff_link_hash_entry *h = (struct xcoff_link_hash_entry *) harg; - if (! XCOFF_XVECP (output_bfd->xvec)) + if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) return true; /* A symbol name which starts with a period is the code for a @@ -3065,7 +3037,7 @@ bfd_xcoff_export_symbol (output_bfd, info, harg, syscall) { struct xcoff_link_hash_entry *h = (struct xcoff_link_hash_entry *) harg; - if (! XCOFF_XVECP (output_bfd->xvec)) + if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) return true; h->flags |= XCOFF_EXPORT; @@ -3130,7 +3102,7 @@ bfd_xcoff_link_count_reloc (output_bfd, info, name) { struct xcoff_link_hash_entry *h; - if (! XCOFF_XVECP (output_bfd->xvec)) + if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) return true; h = ((struct xcoff_link_hash_entry *) @@ -3145,7 +3117,7 @@ bfd_xcoff_link_count_reloc (output_bfd, info, name) h->flags |= XCOFF_REF_REGULAR | XCOFF_LDREL; ++xcoff_hash_table (info)->ldrel_count; - + /* Mark the symbol to avoid garbage collection. */ if (! xcoff_mark_symbol (info, h)) return false; @@ -3164,7 +3136,7 @@ bfd_xcoff_record_link_assignment (output_bfd, info, name) { struct xcoff_link_hash_entry *h; - if (! XCOFF_XVECP (output_bfd->xvec)) + if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) return true; h = xcoff_link_hash_lookup (xcoff_hash_table (info), name, true, true, @@ -3180,8 +3152,7 @@ bfd_xcoff_record_link_assignment (output_bfd, info, name) /* This structure is used to pass information through xcoff_link_hash_traverse. */ -struct xcoff_loader_info -{ +struct xcoff_loader_info { /* Set if a problem occurred. */ boolean failed; /* Output BFD. */ @@ -3249,7 +3220,7 @@ bfd_xcoff_size_dynamic_sections (output_bfd, info, libpath, entry, struct bfd_strtab_hash *debug_strtab; bfd_byte *debug_contents = NULL; - if (! XCOFF_XVECP (output_bfd->xvec)) + if (bfd_get_flavour (output_bfd) != bfd_target_xcoff_flavour) { for (i = 0; i < 6; i++) special_sections[i] = NULL; @@ -4101,7 +4072,7 @@ _bfd_xcoff_bfd_final_link (abfd, info) finfo.section_info[o->target_index].rel_hashes = ((struct xcoff_link_hash_entry **) bfd_malloc (o->reloc_count - * sizeof (struct xcoff_link_hash_entry *))); + * sizeof (struct xcoff_link_hash_entry *))); if (finfo.section_info[o->target_index].relocs == NULL || finfo.section_info[o->target_index].rel_hashes == NULL) goto error_return; @@ -4687,21 +4658,39 @@ xcoff_link_input_bfd (finfo, input_bfd) else { bfd_vma tocval, tocend; + bfd *inp; tocval = ((*csectpp)->output_section->vma + (*csectpp)->output_offset + isym.n_value - (*csectpp)->vma); + /* We want to find out if tocval is a good value to use as the TOC anchor--that is, whether we can access all of the TOC using a 16 bit offset from tocval. This test assumes that the TOC comes at the end of the output section, as it does in the default linker - script. FIXME: This doesn't handle .tocbss sections - created from XMC_TD common symbols correctly. */ - + script. */ tocend = ((*csectpp)->output_section->vma + (*csectpp)->output_section->_raw_size); + for (inp = finfo->info->input_bfds; + inp != NULL; + inp = inp->link_next) + { + asection *o; + + for (o = inp->sections; o != NULL; o = o->next) + if (strcmp (o->name, ".tocbss") == 0) + { + bfd_vma new_toc_end; + new_toc_end = (o->output_section->vma + + o->output_offset + + o->_cooked_size); + if (new_toc_end > tocend) + tocend = new_toc_end; + } + + } if (tocval + 0x10000 < tocend) { @@ -6334,7 +6323,7 @@ _bfd_ppc_xcoff_relocate_section (output_bfd, info, input_bfd, addend = 0; } else - { + { h = obj_xcoff_sym_hashes (input_bfd)[symndx]; sym = syms + symndx; addend = - sym->n_value; @@ -6585,13 +6574,14 @@ _bfd_ppc_xcoff_relocate_section (output_bfd, info, input_bfd, || strcmp (h->root.root.string, "._ptrgl") == 0) { if (next == 0x4def7b82 /* cror 15,15,15 */ - || next == 0x4ffffb82) /* cror 31,31,31 */ + || next == 0x4ffffb82 /* cror 31,31,31 */ + || next == 0x60000000) /* ori r0,r0,0 */ bfd_put_32 (input_bfd, 0x80410014, pnext); /* lwz r1,20(r1) */ } else { if (next == 0x80410014) /* lwz r1,20(r1) */ - bfd_put_32 (input_bfd, 0x4ffffb82, pnext); /* cror 31,31,31 */ + bfd_put_32 (input_bfd, 0x60000000, pnext); /* ori r0,r0,0 */ } } diff --git a/gnu/dist/toolchain/binutils/ChangeLog b/gnu/dist/toolchain/binutils/ChangeLog index 77775a81c3e6..37b784aced13 100644 --- a/gnu/dist/toolchain/binutils/ChangeLog +++ b/gnu/dist/toolchain/binutils/ChangeLog @@ -1,50 +1,402 @@ -2000-11-01 Philip Blundell +2001-03-16 Philip Blundell - From 2000-06-15 H.J. Lu - * dyn-string.c: Removed. Not needed with dyn-string.c in - libiberty. - * dyn-string.h: Likewise. - * Makefile.am: Remove references to dyn-string.c and - dyn-string.h. Rebuild dependency. - * Makefile.in: Rebuild. - -2000-10-16 Philip Blundell - - * configure.in: Set version number to 2.10.1. * configure: Regenerate. -2000-10-14 Philip Blundell +2001-03-11 Philip Blundell - * config.sub, config.guess: Update from mainline sources. + * configure.in: Set version to 2.11. - From 2000-09-07 H.J. Lu +2001-02-13 Hans-Peter Nilsson + + * acinclude.m4 (AM_PROG_LEX): Override installed definition. + * aclocal.m4: Regenerate. + * configure: Regenerate. + +2001-02-10 Alan Modra + + * nm.c (print_symbol_info_bsd): Don't #ifdef inside printf in case + printf is a macro. + +2001-02-04 Philip Blundell + + * configure.in (OBJDUMP_DEFS): Match `arm*-*', not just `arm-*'. + * configure: Regenerate. + +2001-01-31 Steve deRosier + + * ieee.c (ieee_add_bb11): Don't check for backslashes + unless HAVE_DOS_BASED_FILE_SYSTEM is defined. + +2001-01-24 Mark Elbrecht + + * ieee.c: Update copyright. + (ieee_start_compilation_unit): Don't check for backslashes + unless HAVE_DOS_BASED_FILE_SYSTEM is defined. + + * stabs.c: Update copyright. Include "filenames.h". + (parse_stab): Use IS_ABSOLUTE_PATH. Ignore N_WARNING stabs. + +2001-01-23 Jakub Jelinek + + * readelf.c (process_version_sections): Check if VERDEF or VERNEED + sections are present before using them. Remove code duplication. + (process_symbol_table): Check if VERDEF or VERNEED sections are + present before using them. + +2001-01-17 Nick Clifton + + * objcopy.c (copy_object): Fail if attempting to convert the + endianness of the input object file. + + * binutils.texi: Explain that objcopy cannot convert endianness. + +2001-01-16 Nick Clifton + + * readelf.c (string_table_length): New variable. + (SECTION_NAME): Catch out of range indices and missing section + pointers. + (process_section_headers): Delete useless local variable + string_table_offset. Set the value of string_table_length + after loading the string table. + (process_mips_specific): Use SECTION_NAME macro. + (process_file): Set string_table_length to 0 when it is freed. + +2001-01-12 Nick Clifton + + * version.c (print_version): Update copyright date. + +2001-01-11 Peter Targett + + * readelf.c (dump_relocations): Include selection with EM_ARC. + (get_machine_name) Update name to "ARC". + +2001-01-09 Nick Clifton + + * Makefile.am: Add rule to build objdump.o from objdump.c and + using OBJDUMP_DEFS. + * Makefile.in: Regenerate. + + * configure.in: Define OBJDUMP_DEFS. Default to empty. + (arm, xscale, d10v): For these targets define OBJDUMP_DEFS to + -DDISASSEMBLER_NEEDS_RELOCS. + * configure: Regenerate. + + * objdump.c (disassemble_bytes): If DISASSEMBLER_NEEDS_RELOCS + is defined read in the relocs even if dump_reloc_info is + false. + +2001-01-07 Philip Blundell + + * binutils.texi (Bug Reporting): Replace `bug-gnu-utils' with + `bug-binutils'. + * README: Likewise. + +2000-12-19 Nick Clifton + + * dlltool.c: Add missing support for arm-epoc-pe. + * configure.in: Add missing support for arm-epoc-pe. + * configure: Regenerate. + +2000-12-15 Nick Clifton + + * MAINTAINERS: Add Diego Novillo as a maintainer for the Intel + Mode parts of the x86 port. + +2000-12-04 Andreas Jaeger + + * readelf.c (guess_is_rela): Add EM_X86_64. + (dump_relocations): Add EM_X86_64. + (get_machine_name): Add EM_X86_64. + Include "elf/x86-64.h". + +2000-12-12 Nick Clifton + + * readelf.c: Fix formatting. + +Mon Dec 11 14:30:21 MET 2000 Jan Hubicka + + * MAINTAINERS: Add myself and Andreas Jaeger as x86_64 maintainer. + +2000-12-07 Andrew Haley + + * readelf.c (display_debug_frames): Only display columns that are + referenced by the frame debug info. + +2000-12-05 Nick Clifton + + * MAINTAINERS: Add Jason Merrill as DWARF2 maintainer. + +2000-12-04 Jason Merrill + + * readelf.c (process_section_headers): Handle linkonce.wi sections. + (display_debug_section): Likewise. + (display_debug_info): Display CU header before bailing. + +2000-12-01 Chris Demetriou + + * readelf.c (get_machine_flags): Recognize MIPS32 ISA in + EF_MIPS_ARCH. Replace use of E_MIPS_MACH_MIPS32 with + E_MIPS_MACH_MIPS32_4K and adjust printed CPU name similarly. + + * readelf.c (get_machine_flags): Add cases for E_MIPS_ARCH_5, + and E_MIPS_ARCH_64. + + * readelf.c (get_machine_flags): Add case for + E_MIPS_MACH_SB1. + +2000-11-30 Richard Earnshaw + + * readelf.c (frame_display_row): Output 's' for DW_CFA_same_value. + +2000-11-28 Hans-Peter Nilsson + + * MAINTAINERS: Add Jörn Rennecke and self as SH maintainers. + Change sourceware.cygnus.com to sources.redhat.com. + Fix typo for "amongst". + +2000-11-28 Nick Clifton + + * strip.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. + * strings.1: Ditto. + * size.1: Ditto. + * ranlib.1: Ditto. + * objdump.1: Ditto. + * objcopy.1: Ditto. + * nm.1: Ditto. + * nlmconv.1: Ditto. + * ar.1: Ditto. + * addr2line.1: Ditto. + +2000-11-27 DJ Delorie + + * readelf.c (usage): Add -wf (--debug-dump=frames) option. + (parse_args): Support -wf option. + (process_section_headers): Ditto. + (debug_displays): Ditto. + (display_debug_frames): New, dump *_frame sections. + (frame_need_space): Support for above. + (frame_display_row): Ditto. + * binutils.texi: Document it. + +2000-11-24 Nick Clifton + + * NEWS: Announce support for v5t, v5te and XScale. + +2000-11-22 Nick Clifton + + * readelf.c (get_machine_name): Add EM_JAVELIN, EM_FIREPATH, + EM_ZSP, EM_MMIX, EM_HUANY, EM_PRISM. + (get_section_type_name): Add SHT_GROUP and SHT_SYMTAB_SHNDX. + (get_elf_section_flags: Add SHF_GROUP. + (process_section_headers): Adjust output for 32-bit binaries + to look nice on an 80 column terminal. + +2000-11-20 H.J. Lu + + * readelf.c (get_osabi_name): Change ELFOSABI_MONTEREY to + ELFOSABI_AIX. + +2000-11-17 Richard Henderson + + * readelf.c (display_debug_lines): Adjust last change to + use sizeof (external->li_length). + +2000-11-17 Richard Henderson + + * readelf.c (display_debug_lines): Fix section length check + and end_of_sequence computation. + +2000-11-06 Nick Clifton + + * binutils.texi: Add GNU Free Documentation License. + * objcopy.1: Add GNU Free Documentation License. + * objdump.1: Add GNU Free Documentation License. + * addr2line.1: Add GNU Free Documentation License. + * ar.1: Add GNU Free Documentation License. + * nlmconv.1: Add GNU Free Documentation License. + * nm.1: Add GNU Free Documentation License. + * ranlib.1: Add GNU Free Documentation License. + * size.1: Add GNU Free Documentation License. + * strings.1: Add GNU Free Documentation License. + * strip.1: Add GNU Free Documentation License. + +2000-10-06 Luciano Gemme + + * objcopy.c (--srec-len=nn): New parameter to set the + maximum length of generated Srecords. + (--srec-forceS3): New parameter that restricts the generation of + Srecords to type S3 only. + * binutils.texi: Document new command line switches. + * objcopy.1: Docuemnt the new command line switches. + * NEWS: Announce the existence of the new command line switches. + +2000-10-31 Nick Clifton + + * MAINTAINERS: Add Jim Wilson as the maintainer for the IA64 + code. Add Eric Chrisopher as maintainer of MN10300 port. + +2000-10-12 Roger Sayle + + * Make comma after string after icon/control optional. + +2000-09-13 Anders Norlander + + * readelf.c (get_machine_flags): Also print EF_MIPS_MACH field. + + * NEWS: Mention support for MIPS32. + +2000-09-08 Nick Clifton + + * MAINTAINERS: Add Stephane Carrez as maintainer for 68HC[11|12]. + +2000-09-07 H.J. Lu * configure.in (AC_ISC_POSIX): Put after AC_CANONICAL_SYSTEM. * configure: Rebuild. - From 2000-08-17 Nick Clifton +2000-09-06 Alexandre Oliva + + * configure: Rebuilt with new libtool.m4. + +2000-09-05 Nick Clifton + + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * configure: Regenerate. + +2000-09-04 Todd Vierling + + * strip.1: Fix stray '\' in -o formatting. + +2000-09-02 Nick Clifton + + * configure.in: Increase version number to 2.10.91. + * configure: Regenerate. + * aclocal.m4: Regenerate. + * config.in: Regenerate. + * po/binutils.pot: Regenerate. + +2000-08-31 Alexandre Oliva + + * acinclude.m4: Include libtool and gettext macros from the + top level. + * aclocal.m4, configure: Rebuilt. + +2000-08-30 Jamie Guinan + + * resrc.c (close_input_stream): Delete extraneous logic + +2000-08-24 Hans-Peter Nilsson + + * NEWS: Mention support for CRIS. + +2000-08-21 Nick Clifton + + * addr2line.c: Changed email address for Ulrich Lauther. + +2000-08-17 Christopher C. Chimelis + + * objdump.c (LONGEST_ARCH): Set to sizeof("powerpc:common"). + +2000-08-17 Nick Clifton * readelf.c (display_debug_pubnames): Only issue warning message once. Terminate message with a new line. (display_debug_aranges): Only display version 2 debug info. - - From 2000-07-19 H.J. Lu + +2000-08-14 Todd Vierling + + * objcopy.c (strip_main): Silently accept -d as an alias for -g + for compatability with old BSD systems. + +2000-08-14 Jason Eckhardt + + * NEWS: Mention i860 support. + +2000-08-11 Carlo Wood + + * addr2line.c (main): Add const to char *. + +2000-08-11 Geoff Keating + + * ar.c (main): Don't crash if called with no arguments + or only '-X32_64' as an argument. + +2000-08-08 DJ Delorie + + * resrc.c: use "gcc -xc" instead of -xc-header + +2000-08-05 Jason Eckhardt + + * readelf.c (elf/i860.h): Include. + (dump_relocations): Add recognition of i860 architecture. + (guess_is_rela): Add recognition of i860 architecture. + +2000-08-03 Nick Clifton + + * MAINTAINERS: Add information about CGEN maintainers. + +2000-07-26 Geoff Keating + + * nm.c (main): Ignore '-X32_64' as an option. + * ar.c (main): Likewise. + * binutils.texi (nm): Document new option. + (ar): Likewise. + +2000-07-23 Michael Sokolov + + * rdcoff.c (external_coff_symbol_p): K&R-ise. + +2000-07-20 H.J. Lu + + * binutils/binutils.texi: Put back "@end table" deleted by + accident. + +2000-07-05 Kenneth Block + + * binutils/nm.c: Add optional style to demangle switch. + * binutils/objdump.c: Add optional style to demangle switch. + * binutils/addr2line.c: Add optional style to demangle switch. + * binutils/binutils.texi: Document optional style to demangle + switch. + +2000-07-20 Hans-Peter Nilsson + + * MAINTAINERS: Add self as CRIS port maintainer. + * readelf.c: Include elf/cris.h. + (guess_is_rela): Handle EM_CRIS. + (dump_relocations): Ditto. + (get_machine_name): Ditto. + * Makefile.am: Rebuild dependencies. + * Makefile.in: Regenerate. + * po/binutils.pot: Regenerate. + +2000-07-19 H.J. Lu * readelf.c (get_dynamic_type): Change "AUXILARY" to "AUXILIARY". (process_dynamic_segment): Print out strings for DT_CONFIG, DT_DEPAUDIT, DT_AUDIT and DT_RUNPATH. - From 2000-07-19 H.J. Lu +2000-07-19 Mark Kettenis + + * nm.c (usage): Change output of `nm --help' to include a + description of the purpose of the program and a detailed + description of the accepted options. + +2000-07-19 H.J. Lu * readelf.c (process_dynamic_segment): Change DF_1_NODEPLIB to DF_1_NODEFLIB. - From 2000-07-19 H.J. Lu +2000-07-19 H.J. Lu * readelf.c (get_dynamic_type): Fix DT_CHECKSUM. - From 2000-07-19 H.J. Lu +2000-07-19 H.J. Lu * readelf.c (get_dynamic_type): Change DT_FEATURE_1 to DT_FEATURE. @@ -55,50 +407,154 @@ (process_dynamic_segment): Handle DTF_1_CONFEXP, DF_1_NODEPLIB, DF_1_NODUMP and DF_1_CONLFAT. - From 2000-07-01 Alexander Aganichev - - * stabs.c (parse_stab_type): Divide size in bits by 8 as binutils - struct debug_type stores size in bytes. +2000-07-18 Nick Clifton - From 2000-08-17 Christopher C. Chimelis + * binutils.texi (readelf): Fix spelling typo. - * objdump.c (LONGEST_ARCH): Set to sizeof("powerpc:common"). - - From 2000-07-11 Mark Kettenis +2000-07-11 Mark Kettenis * objdump.c (usage): Make output of `objdump --help' more consistent with the rest of the GNU world. Add a line describing the purpose of the program. - - From 2000-06-24 Nick Clifton + +2000-07-10 David Huggins-Daines + + * stabs.c (parse_stab_range_type): Cast to proper type to fix + warning. + +2000-07-10 Ryan Bradetich + + * readelf.c (get_dynamic_data): Add casts and use unsigned chars + to fix warnings. + (process_symbol_table): Ditto. + (procesS_extended_line_op): Ditto. + (display_debug_lines): Ditto. + (display_debug_pubnames): Ditto. + (read_and_display_attr): Ditto. + +2000-07-09 Nick Clifton + + * MAINTAINERS: Add several more port specific maintainers. + +2000-07-05 Nick Clifton + + * MAINTAINERS: Add blanket write privs for Michael Meissner. + +2000-06-05 DJ Delorie + + * MAINTAINERS: New. + +2000-07-01 Eric Fifer + + * dllwrap.c: Changed mistaken dyn_string_append() calls + to dyn_string_append_cstr(). + +2000-07-01 Alexander Aganichev + + * stabs.c (parse_stab_type): Divide size in bits by 8 as binutils + struct debug_type stores size in bytes. + +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-27 Alan Modra + + * ar.c: Revert incorrect 2000-06-25 patch. + * bucomm.c: Likewise. + +2000-06-25 Mark Elbrecht + + * rdcoff (parse_coff_symbol): Treat GNU weak symbols as external. + (external_coff_symbol_p): New function. + (parse_coff): Use it. + +2000-06-25 Alexander Aganichev + + * ar.c (normalize): Advance past both characters in a DOS based + : filepath prefix. + (main): Likewise. + * bucomm.c (make_tempname): Likewise. + +2000-06-24 Nick Clifton * objdump.c (usage): Fix description of --stabs switch. - From 2000-07-18 Nick Clifton +2000-06-22 Alan Modra - * binutils.texi (readelf): Fix spelling typo. + * Makefile.am (DEP): grep for leading `/' in DEP1, and fail if we + find one. + * Makefile.in: Regenerate. - From 2000-07-19 Mark Kettenis +2000-06-20 Alexander Aganichev - * nm.c (usage): Change output of `nm --help' to include a - description of the purpose of the program and a detailed - description of the accepted options. + * ar.c (normalize): Correct pointer comparison when checking for + backslashes. + (main): Likewise. + * bucomm.c (make_tempname): Likewise. -2000-09-05 Todd Vierling + * ieee.c (ieee_start_compilation_unit): Correct pointer comparison + and search for backslashes in the original pathname. + (ieee_add_bb11): Likewise. - From 2000-08-14 Todd Vierling - * objcopy.c (strip_main): Silently accept -d as an alias for -g - for compatability with old BSD systems. +2000-06-18 Nick Clifton -2000-09-04 Todd Vierling + * ar.c (print_contents): Improve verbose message. - * strip.1: Fix stray '\' in -o formatting. +2000-06-15 H.J. Lu + + * dyn-string.c: Removed. Not needed with dyn-string.c in + libiberty. + * dyn-string.h: Likewise. + + * Makefile.am: Remove references to dyn-string.c and + dyn-string.h. Rebuild dependency. + * Makefile.in: Rebuild. + +2000-06-15 H.J. Lu + + * binutils.texi: Put a warning on copying relocatable object + files between two different formats. + +2000-06-13 DJ Delorie + + * rcparse.y (control): ICON controls take an id as the first + parameter, not an optional string. Also, call new convenience + function that takes res_id's. + * resrc.c (define_control): missing text means zero-length string, + not zero ID. + (define_icon_control): New. + * windres.h: declare define_icon_control. + +2000-06-13 H.J. Lu + + * configure: Regenerate. + +2000-06-08 David O'Brien + + * configure.in (VERSION): Update to show this is the CVS mainline. + +2000-06-02 David O'Brien + + * strings.c (isgraphic): Interpret as a printable character, + analogous to . 2000-05-30 Alan Modra * objdump.c (display_target_list): Use bfd_close_all_done, not bfd_close to fix crash caused by 2000-05-24 change. +2000-05-25 DJ Delorie + + * resrc.c (close_input_stream): zero out cpp_pipe after closing it. + +2000-05-26 Alan Modra + + * Makefile.am: Update dependencies with "make dep-am" + * Makefile.in: Regenerate. + 2000-05-26 Eli Zaretskii * ar.c: Include filenames.h. @@ -143,10 +599,38 @@ * objdump.c (display_target_list): Close the bfd. (display_info_table): Likewise. -2000-05-23 Philip Blundell +2000-05-14 H.J. Lu (hjl@gnu.org) - * configure.in: Set version to 2.10. - * configure: Regenerate. + * objcopy.c (filter_symbols): Don't strip global symbols in + relocatable object files. + +2000-05-14 Alan Modra + + * size.c (usage): Associate short options with corresponding long + option to give a clue as to their function. + +2000-05-14 Philippe De Muyter + + * size.c (main): Accept and ignore `-f' option. + +2000-05-13 Alan Modra + + * bucomm.h (gettext, dgettext, dcgettext, textdomain, + bindtextdomain): Replace defines with those from intl/libgettext.h + to quieten gcc warnings. + +2000-05-12 H.J. Lu + + * nlmconv.c (temp_filename): Removed. + + * nlmconv.c (link_inputs): Use make_temp_file () instead of + choose_temp_base (). + * objdump.c (display_target_list): Likewise. + (display_info_table): Likewise. + +2000-05-08 Alan Modra + + * objcopy.c (setup_section): Add const and gettext calls for err. 2000-05-02 H.J. Lu @@ -156,12 +640,36 @@ ELFOSABI_FREEBSD, ELFOSABI_TRU64, ELFOSABI_MODESTO and ELFOSABI_OPENBSD. +2000-05-02 Kazu Hirata + + * coffgrok.c: Add ATTRIBUTE_UNUSED as appropriate. + * srconv.c: Likewise. + * sysdump.c: Likewise. + +Sun Apr 23 14:23:26 2000 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 + + * Makefile.am (readelf.o): Add elf/ia64.h. + * Makefile.in: Rebuild. + * readelf.c: Include elf/ia64.h. + (guess_is_rela, dump_relocations): Handle EM_IA_64. + +2000-04-17 Timothy Wall + + * objdump.c (disassemble_data): Set octets per byte *after* + resolving arch/mach for binary files. + 2000-04-14 Michael Sokolov * arlex.l: Add directives to increase lex buffer size. * objdump.c, readelf.c: Don't include strarg.h or varargs.h. They are - already included by bucomm.h. + already included by bucomm.h. 2000-04-10 Philippe De Muyter @@ -169,6 +677,13 @@ `strftime' since strftime is not available on all systems. (process_mips_specific): Ditto. +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. + 2000-04-06 Alan Modra * addr2line.c: Update copyright. @@ -265,6 +780,27 @@ (integer_arg): And here. * sysdump.c (main): And here. +2000-04-06 Timothy Wall + + * objdump.c (dump_section_header): Print CLINK and BLOCK flags. + +2000-04-06 Jason Merrill + + * readelf.c (decode_location_expression): Loop through multiple + operations. + (read_and_display_attr): Pass in length. + + * readelf.c (read_and_display_attr): Add CU offset to references. + (display_debug_info): Pass it in. + +2000-04-06 Nick Clifton + + * readelf.c (decode_ARM_machine_flags): New function. + (get_machine_flags): Call decode_ARM_machine_flags for ARM + targets. + + (get_machine_name): Catch EM_AVR + 2000-04-05 Alan Modra * binutils.texi: Remove optional `=' from long options that have @@ -438,15 +974,15 @@ * binutils/objdump.c (dump_section_header, find_symbol_for_address, show_line, disassemble_bytes, disassemble_data, dump_data): distinguish between octets and bytes. - + 2000-01-27 Thomas de Lellis - * nm.c (print_symbol_info_bsd): Use bfd_is_undefined_symclass to + * nm.c (print_symbol_info_bsd): Use bfd_is_undefined_symclass to check to unresolved symbols. - (print_symbol_info_sysv): Ditto. - (print_symbol_info_posix): Ditto. + (print_symbol_info_sysv): Ditto. + (print_symbol_info_posix): Ditto. - * binutils.texi: Document new 'V' symclass flag for nm. + * binutils.texi: Document new 'V' symclass flag for nm. 2000-01-27 Nick Clifton @@ -492,28 +1028,28 @@ 2000-01-07 Mumit Khan - * windres.c (long_options): Add --use-temp-file and + * windres.c (long_options): Add --use-temp-file and --no-use-temp-file options. (usage): Document. (main): Handle. - + * windres.h: Update read_rc_file prototype. - + * resrc.c (cpp_temp_file): New static variable. (istream_type): New static variable. (close_pipe): Delete function. (run_cmd): New static function. (open_input_stream): New static function. (close_input_stream): New static function. - (look_for_default): Handle DOS directory separator. Use + (look_for_default): Handle DOS directory separator. Use open_input_stream instead of popen. (read_rc_file): Likewise. - + * binutils.texi: Document --use-temp-file, --no-use-temp-file - options. + options. 2000-01-04 Mumit Khan - + * dlltool.c (create_compat_implib): New variable. (gen_exp_file): Use. (make_one_lib_file): Use. @@ -527,7119 +1063,9 @@ 2000-01-03 Nick Clifton * binutils.texi: Document new, ARM specific disassembler - command line switch "-M force-thumb". - -1999-12-28 Nick Clifton - - * readelf.c: Update with new constants added by Oct 4, 1999 - ELF ABI draft. - (guess_is_rela): Add new machine codes, but leave - rel type undetermined. - (get_machine_name): Add new machine codes. - (get_section_type_name): Add new section types. - (get_elf_section_flags): New funciton: Decode section flags. - (process_section_headers): Call get_elf_section_flags() in - order to decode flags in section header. - (get_dynamic_flags): New function: Decode dynamic section - flags. - (process_dynamic_section): Display flags (if present). - (get_symbol_type): Add STT_COMMON. - (get_symbol_visibility): New function: Decode a symbol's - visibility. - (process_symbol_table): Call get_symbol_visibility(). - (get_note_type): Add NT_PRXFPREGS. - -1999-12-26 Ian Lance Taylor - - * strings.c (main): Correct handling of numeric argument. - -1999-12-23 Andrew Haley - - * dlltool.c (mtable): mcore how_jtab_roff is 4 bytes into the - jtab; was 8. - -1999-12-17 Nick Clifton - - * dlltool.c (mtable): Stop compile time warnings about missing - initialisers. - (yyerror): Stop compile time warnings about unused paramater. - (INIT_SEC_DATA): New macro: initialise an entry in the secdata - array. - (secdata): Stop ccompile time warnings about uninitialised - fields. - (dtab): Stop compile time warnings about unused parameter. - (long_options): Stop compile time warning about missing - initialiser. - -1999-12-10 Nick Clifton - - * readelf.c (print_vma): Support native 64bit ELF systems. - -1999-12-09 Nick Clifton - - * dlltool.c (mtable): Add epoc-arm specific entry. - Make default arm entry pass -mpacs-26 to assembler. - (flush_page): Do not mangle null entries. - -1999-12-07 H . J . Lu hjl@valinux.com - - * readelf.c: Fix compile time warnings. Support more than 999 - symbols. - -1999-12-03 Nick Clifton - - * readelf.c (enum print_mode): New type. - (print_vma): New function. - (dump_relocations): Use print_vma to display bfd_vma values. - (process_file_header): Use print_vma to display bfd_vma values. - (process_program_headers): Use print_vma to display bfd_vma values. - (process_section_headers): Use print_vma to display bfd_vma values. - (dynamic_segment_parisc_val): Use print_vma to display bfd_vma values. - (process_dynamic_segment): Use print_vma to display bfd_vma values. - (process_symbol_table): Use print_vma to display bfd_vma values. - (process_mips_specific): Use print_vma to display bfd_vma values. - -1999-11-25 Fred Fish - - * readelf.c (process_note): Change arg from Elf_External_Note - to Elf32_Internal_Note, which also turns the function body - into little more than a call to printf. - (process_corefile_note_segment): Substantially rewritten - to properly handle case where target and host are different - endianness, handle note sections with padding, and add some - cruft to handle notes with unterminated name data. - -1999-11-22 Nick Clifton - - * objcopy.c (copy_usage): Reformat. - (strip_usage): Reformat. - -1999-11-21 Nick Clifton - - * objdump.c (usage): Overhaul output: One line per switch. - Textual description of each switch. Distinguish between - optional switches and required switches. - (long_options): Add 'g', 'G' and 'z' short options. - (main): Distinguish between optional switches and required - switches. - - * binutils.texi: Add -g -G and -z short options for - --debugging, --stabs and --disassemble-zeroes. - -1999-11-03 Nick Clifton - - * dlltool.c (flush_page): Clip short values to prevent warnings - from the assembler. - Change default mcore machine name to 'mcore-le' and rename - big-endian version to 'mcore-be'. - -1999-10-27 Fred Fish - - * objdump.c (display_bfd): Break into two functions. The - actual dumping code moves to dump_bfd. If bfd is not - unambiguously recognized as a bfd_object, attempt to dump - it as a bfd_core. - (dump_bfd): New function. - -1999-10-26 Nick Clifton - - * dlltool.c (assemble_file): Remove spurious test of exp_name. - -1999-10-22 Nick Clifton - - * dlltool.c (struct mac): Add new field 'how_default_as_switches'. - (mtable): Initialise new field. Some machines have a non empty - string for this field. - (HOW_BFD_TARGET): Undefine and replace with... - (HOW_BFD_READ_TARGET): New macro: bfd target to use when opening a - file for reading. This is set to 0 so that any recognisable bfd - format can be read. - (HOW_BFD_WRITE_TARGET): New macro: bfd target to use when opening - a file for writing. This is set to the target machine type. - (ASM_SWITCHES): New macro: default switches to use when assembling - a file. - (assemble_file): New function: Assemble a source file into a - destination object file. - (gen_exp_file): Use assemble_file to create the exp file. - (make_one_lib_file): Use assemble_file to create the lib file. - Open output file use HOW_BFD_WRITE_TARGET and input files using - HOW_BFD_READ_TARGET. - (make_head): Use assemble_file to create the head file. - (make_tail): Use assemble_file to create the tail file. - (gen_lib_file): Open output file use HOW_BFD_WRITE_TARGET. - -1999-10-15 Ian Lance Taylor - - * ar.c (normalize): Fix full_pathname code. - -1999-10-08 Ben Elliston - - * binutils.texi: Some rewording and clarifications. - -1999-09-15 Ulrich Drepper - - * readelf.c (dynamic_segment_parisc_val): Print 0 for DLD_FLAGS if - the value is zero. - (process_symbol_table): Don't print histogram if hash table is empty. - -1999-09-15 Ulrich Drepper - - * readelf.c (get_parisc_dynamic_type): Handle DT_HP_GST_* values. - -1999-09-02 Ulrich Drepper - - * readelf.c (get_symbol_type): Add support for HPUX and PARISC - specific symbol types. - - * readelf.c: Add HPUX and PARISC extensions to dynamic and program - header table printing. - - * readelf.c (get_machine_flags): Add handling of PARISC. - -1999-09-29 Mumit Khan - - * dlltool.c (scan_drectve_symbols): Handle type tags in exported - symbols. - (scan_filtered_symbols): Likewise. - -1999-09-19 Ian Lance Taylor - - * resrc.c (write_rc_rcdata): Fix local variable shadowing - problem. If RCDATA_BUFFER data can be read as strings, modify - code to print the strings as comments. - * resres.c: Add casts to avoid warnings. - (write_res_data, read_res_data): Don't put the program name in the - error message; fatal already puts it there. - -1999-09-14 Michael Meissner - - * configure.in (Canonicalization of target names): Remove adding - ${CONFIG_SHELL} in front of $ac_config_sub, since autoconfig 2.14 - generates $ac_config_sub with a ${CONFIG_SHELL} already. - * configure: Regenerate. - -1999-09-12 Ian Lance Taylor - - * ar.c (main): Clear output_file if we don't change the archive. - (delete_members, replace_members): Likewise. - -1999-09-12 Donn Terry - - * objdump.c (dump_headers): If wide_output, print Flags header. - - * objdump.c (dump_section_header): Print any comdat information. - - * objcopy.c (parse_flags): Handle "noload", "debug", and "share". - * binutils.texi, objcopy.1: Document new flags. - - * ar.c (counted_name_mode): New static variable. - (counted_name_counter): New static variable. - (map_over_members): Handle counted mode. - (usage): Mention N modifier. - (main): Handle N modifier. - (delete_members): Handle counted mode. - * binutils.texi, ar.1: Document N modifier. - - * ar.c (print_contents): Change printing of member name for - POSIX.2 conformance. - - * ar.c (output_filename): Make const. - (open_inarch): If creating a new empty archive, set - output_filename. - -1999-09-12 Ian Lance Taylor - - * ar.c (full_pathname): New static variable. - (map_over_members): Call normalize on command line parameter. - (usage): Mention P modifier. - (normalize): If full_pathname is true, don't do anything. - (main): Accept P modifier. - (delete_members): Call normalize on command line parameter. - * binutils.texi, ar.1: Document P modifier. - -1999-09-09 Andreas Schwab - - * binutils.texi: Add info dir entries for all programs described - here. Fix arguments of @var to not contain punctuation. - -1999-09-06 Donn Terry - - * nm.c (print_symbol_info_bsd): Check for 'w' as well as 'U'. - (print_symbol_info_sysv): Likewise. - (print_symbol_info_posix): Likewise. - -1999-09-04 Steve Chamberlain - - * readelf.c: Include "elf/pj.h". - (dump_relocations): Handle EM_PJ. - (get_machine_name): Likewise. - (get_machine_flags): Likewise. - -1999-08-31 Scott Bambrough - - * readelf.c (get_note_type): New function: Decode the e_type - value of a note. - (process_note): New function: Display the contents of a core note. - (process_corefile_note_segment): New function. - (process_corefile_note_segments): New function. - (process_corefile_contents): New function. - (process_file): Add call to process_corefile_contents. - (parse_args): Add parsing of -n/--notes command line switch. - (usage): Document new command line switch. - - * binutils.texi: Documemnt new command line switch to readelf. - -1999-08-31 Ian Lance Taylor - - * binutils.texi (Bug Reporting): Clarify that large files should - not be sent to bug-gnu-utils. - -1999-08-28 Stephane Carrez - - * readelf.c (process_extended_line_op): New parameter pointer_size, - read the address according to pointer_size. - (debug_line_pointer_size): New global to indicate the - size of address in .debug_line section. - (debug_displays, prescan_debug_info): Prescan the .debug_info section - to record the size of address in `debug_line_pointer_size'. - (process_section_contents): Before dumping any section, execute - the pre-scan operation defined for some debug sections. - -1999-08-27 Jim Wilson - - * readelf.c (display_debug_lines): Use i-1 not i in standard_opcodes - access. - (display_debug_aranges): New local excess. Use for calculating padding - and add that into ranges. Break from loop only if length is also 0. - -1999-08-27 Jim Wilson - - * readelf.c (display_debug_lines, case DW_LNS_const_add_pc): Multiply - adv by info.li_min_insn_length. - -1999-08-26 Jakub Jelinek - - * readelf.c (get_sparc64_dynamic_type): New function. - (get_dynamic_type): Use it. - -1999-08-26 Jim Wilson - - * readelf.c (display_debug_lines, case default): Change second line - setting adv to use = not +=. - -1999-08-19 Nick Clifton - - * dlltool.c: Added more examples to the comment at the start. - -1999-08-18 Nick Clifton - - * dlltool.c (make_head): Only emit interworking directive if - necessary. - -Thu Jul 15 22:44:21 1999 Hans-Peter Nilsson - - * readelf.c (process_abbrev_section): Handle standard-conforming - single zero at the end of the section. - -1999-08-09 Ian Lance Taylor - - * objdump.c (exit_status): New static variable. - (nonfatal): New static function. - (disassemble_data): Set exit_status on error. - (read_section_stabs): Likewise. - (display_bfd): Likewise. Call nonfatal rather than bfd_nonfatal. - (display_file): Call nonfatal rather than bfd_nonfatal. - (display_target_list, display_info_table): Likewise. - (main): Return exit_status rather than 0. - -1999-08-08 Ian Lance Taylor - - * objdump.c (dump_section_header): Update for renaming of - SEC_SHORT to SEC_SMALL_DATA. Print SEC_SHARED flag. - - From Eli Zaretskii : - * binutils.texi: Document cxxfilt as MS-DOS name for c++filt. - - * configure.in: Define and substitute DEMANGLER_NAME. - * Makefile.am (DEMANGLER_PROG): Set to cxxfilt. - (man_MANS): Use DEMANGLER_NAME rather than DEMANGLER_PROG. - (bin_PROGRAMS): Remove $(DEMANGLER_PROG). - (noinst_PROGRAMS): Add $(DEMANGLER_PROG). - (cxxfilt_SOURCES): Rename from c__filt_SOURCES. - (cxxfilt_LDADD): Rename from c__filt_LDADD. - ($(DEMANGLER_NAME).1): Rename from $(DEMANGLER_PROG).1. Use - DEMANGLER_NAME rather than DEMANGLER_PROG in substitution. - (MOSTLYCLEANFILES): Use DEMANGLER_NAME rather than - DEMANGLER_PROG. - (install-exec-local): When installing noinst_PROGRAMS, change - cxxfilt to $(DEMANGLER_NAME). - * configure, Makefile.in: Rebuild. - - * Makefile.am: Rename .dep* files to DEP*. Change DEP variable to - MKDEP. - * Makefile.in: Rebuild. - -1999-08-05 Donn Terry - - * Makefile.am (YACC): If bison is not in the source tree, use - @YACC@ rather than bison -y. - (LEX): If flex is not in the source tree, use @LEX@ rather than - flex. - * configure.in: Build dlltool for i[3-6]86-*-interix. - * Makefile.in, configure: Rebuild. - -1999-07-21 Ian Lance Taylor - - From Mark Elbrecht: - * configure.bat: Remove; obsolete. - -1999-07-16 Jakub Jelinek - - * readelf.c (get_machine_flags): Print EF_SPARC_SUN_US3. - -1999-07-15 Ian Lance Taylor - - * configure.in: Bump version number to 2.9.5. - * configure: Rebuild. - -1999-07-14 Richard Henderson - - * objdump.c (dump_section_header): Print SEC_SHORT. - -1999-07-11 Ian Lance Taylor - - * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED - as appropriate. Add variable initializations. Add casts. - * objdump.c (disassemble_bytes): Change j to bfd_vma. - * readelf.c (process_syminfo): Change i to unsigned int. - (display_debug_info): Change abbrev_number to unsigned long. - (process_mips_specific): Change fcnt to size_t. - -1999-07-09 Nick Clifton - - * readelf.c: Only support decoding 64bit ELF files if the compiler - supports a 64 bit data type. - Add -I equivalent for --histogram. - Add -A command-line option to display architecture specific information. - -1999-07-08 Jakub Jelinek - - * readelf.c (guess_is_rela): Sparcv9 and v8plus use rela. - (dump_relocations): Use ELF64_R_TYPE_ID for Sparc, for R_SPARC_OLO10 - print the secondary addend. - (get_machine_flags): Print Sparc machine flags. - (get_symbol_type): Print STT_REGISTER. - -1999-07-08 Ian Lance Taylor - - * stabs.c (parse_stab_type): Fix handling of template names with - template parameters containing `::'. - (stab_demangle_type): Handle a qualified name in a pointer to - member. - -1999-06-23 Ian Lance Taylor - - * Makefile.am (dlltool_SOURCES): Add dyn-string.c. - * Makefile.in: Rebuild. - -1999-06-23 Mumit Khan - - * configure.in (HAVE_EXECUTABLE_SUFFIX): Define. - * dlltool.c (look_for_prog): Use HAVE_EXECUTABLE_SUFFIX. - * dllwrap.c (look_for_prog): Likewise. - * resrc.c (look_for_default): Likewise. - * configure, config.in: Rebuild. - -1999-06-22 Ian Lance Taylor - - Based on patches from Mumit Khan : - * configure.in: Define EXECUTABLE_SUFFIX. - * dlltool.c: Include "dyn-string.h". Include based on - ANSI_PROTOTYPES, not __STDC__. - (outfile): Remove. - (gen_exp_file): Change uses of outfile to use alloca. - (make_one_lib_file, make_head, make_tail): Likewise. - (gen_lib_file): Likewise. - (look_for_prog): New static function. - (deduce_name): Rewrite to use look_for_prog. - (mcore_elf_gen_out_file): Use dyn_string_t rather than outfile. - * dllwrap.c: Don't include , , , - , or . Include and either - or . - (driver_name): Initialize to NULL, not "gcc". - (dlltool_name): Initialize to NULL, not "dlltool". - (display, inform, look_for_prog, deduce_name): New static - functions. - (usage): Mention -mno-cygwin. - (OPTION_MNO_CYGWIN): Define. - (main): Handle -mno-cygwin. Deduce driver_name and dlltool_name. - * resrc.c (look_for_default): Make static. Remove unused local - path. Check using EXECUTABLE_SUFFIX. - (read_rc_file): Allocate enough space to hold EXECUTABLE_SUFFIX. - * Makefile.am: Rebuild dependencies. - (dllwrap_LDADD): Add $(INTLLIBS). - * configure, Makefile.in, config.in: Rebuild. - -Mon Jun 21 16:49:11 1999 Jeffrey A Law (law@cygnus.com) - - * readelf.c (dump_relocations): Use elf_hppa_reloc_type instead of - elf32_hppa_reloc_type. - -1999-06-17 Nick Clifton - - * dlltool.c (mcore_elf_gen_out_file): Link object files with the - .exp file, not the .lib file. - -Fri Jun 18 20:17:51 1999 Mumit Khan - - * deflex.l: Accept single-character symbol names. - -1999-06-16 Nick Clifton - - * readelf.c (get_symbol_type): Detect ARM symbols typed as Thumb - functions. - -1999-06-14 Nick Clifton - - * objdump.c (disassembler_options): New variable. - (usage): Document new -M/--disassembler-options option. - (long_options): Add --disassembler-options. - (disassemble_data): Initialise disassembler_options field of - disassembler_info structure. - (main): Add parsing of -M option. - - * binutils.texi: Document new command line switch to objdump. - - * NEWS: Describe new command line switch to objdump. - - -Mon Jun 14 10:27:54 1999 Andreas Schwab - - * binutils.texi: Fix typos. - -1999-06-13 Ian Lance Taylor - - * objdump.c (disassemble_bytes): If the disassembler returns an - error, print out anything it may have printed to the buffer. From - H.J. Lu . - - * defparse.y (explist): Remove separate expline to eliminate - shift/reduce conflict. - - From Kai-Uwe Rommel : - * defparse.y: Add tokens NONSHARED, SINGLE, MULTIPLE, - INITINSTANCE, INITGLOBAL, TERMINSTANCE, and TERMGLOBAL. - (command): Add option_list after LIBRARY. - (attr): Accept and ignore NONSHARED, SINGLE, and MULTIPLE. - (option_list, option): New nonterminals. - * deflex.l: Recognize NONSHARED, SINGLE, MULTIPLE, INITINSTANCE, - INITGLOBAL, TERMINSTANCE, and TERMGLOBAL. - -1999-06-12 Ian Lance Taylor - - * ar.c (O_BINARY): Define as 0 if not defined. - (ranlib_touch): Open file with O_BINARY. - - * rename.c (O_BINARY): Define as 0 if not defined. - (simple_copy): Open files with O_BINARY. - - Based on patch from H. Peter Anvin : - * objcopy.c (struct section_list): Add copy field. - (sections_copied): New static variable. - (copy_options): Add "only-section". - (copy_usage): Mention -j and --only-section. - (find_section_list): Initialize copy field. - (is_strip_section): Check for copying sections. - (copy_object): Check sections_copied when calling filter_symbols. - (setup_section): Check for copying sections. - (copy_section): Likewise. - (copy_main): Handle -j/--only-section. - * binutils.texi, objcopy.1: Document -j/--only-section. - - * configure.in: If frexp is not available, check in -lm. - * configure: Rebuild. - - * readelf.c (get_elf_class): Use correct printf format for type. - (get_data_encoding): Likewise. - (get_osabi_name): Likewise. - (process_file_header): Don't pass an extra argument to printf. - (process_dynamic_segment): Cast dynamic_size to long before - printing. - (decode_location_expression): Cast byte_get to long before - printing. - -Wed Jun 9 11:40:16 1999 Andreas Schwab - - * readelf.c (dump_section): Cast values from byte_get to - [unsigned] long for printing, in case it is wider than long. - (display_block): Likewise. - (read_and_display_attr): Likewise. - (decode_location_expression): Likewise. Don't depend on - evaluation order. - -Mon Jun 7 12:14:57 1999 Andreas Schwab - - * windres.c (usage): Fix typo. - -1999-06-04 Nick Clifton - - * readelf.c: Use 64bit wide fields in internal strcutures even if - targetting a 32bit architecture. - (dump_relocations): Take a new parameter - the number of symbols - in the symbol table. - -1999-06-04 Nick Clifton - - * readelf.c: Add support for 64bit ELF files. - -1999-06-03 Nick Clifton - - * dlltool.c (mcore_elf_gen_out_file): Use constants for temporary - file names. - -Wed Jun 2 12:34:36 1999 Richard Henderson - - * dlltool.c (gen_exp_file): Revert 19990411 change. - -Mon May 31 09:56:22 1999 Andreas Schwab - - * readelf.c (process_relocs): Determine type of reloc from - DT_PLTREL and from section type. - -1999-05-29 Nick Clifton - - * readelf.c (get_elf_class): Display unknown class number. - (get_data_encoding): Display unknown encoding number. - (get_osabi_name): Display unknown ABI number. - (process_file_header): Display unknown version number. - -1999-05-29 Nick Clifton - - * readelf.c (dump_relocations): Fix typo. - -1999-05-28 Nick Clifton - - * readelf.c (dump_relocations): Add extra parameter: is_rela to - specify the kind of relocations to be dumped. Call guess_is_rela - if this parameter has a value of UNKNOWN. - (guess_is_rela): New function: Guess the kind of reloc being used - baced on the machine number. - (process_relocs): Determine type of reloc before calling - dump_relocations. - -1999-05-28 Ian Lance Taylor - - * readelf.c: Include "elf/i960.h". - (dump_relocations): Handle EM_960. - -Thu May 27 11:58:33 1999 Andreas Schwab - - * objcopy.c (copy_archive): Preserve dates of archive members if - requested. - - * readelf.c (dump_relocations): Always print the addend on RELA - systems even if there is no symbol. - (process_program_headers): Reset dynamic_size before looping - through the program headers. - (process_version_sections): Cast sh_offset to unsigned long for - printing in case bfd_vma is wider. - (process_symbol_table): Use get_symbol_index_type when printing - st_shndx. - -1999-05-17 DJ Delorie - - * windres.c: add verbose option - (main): process verbose option - * resrc.c (look_for_default): new. Look for the default - preprocessor in a given location. - (read_rc_file): for foo/bar-windres, look for foo/bar-gcc, - foo/gcc (in case of foo/windres), and then gcc (the old default). - -1999-05-16 Nick Clifton - - * dlltool.c (deduce_name): New function: Deduce name of program to - run. - (mcore_elf_out_file): New variable: Name of mcore-elf output file. - (mcore_elf_linker): New variable: Name of linker to use. - (mcore_elf_linker_flags): New variable: Linker flags to pass. - (scan_obj_file): Cache filenames if necessary. - (usage): Document new command line options. - (main): Support new command line options: -M (generate an - mcore-elf output file) -L (name of linker to use) -F (flags to - pass to linker). - (mcore_elf_cache_filename): Store a filename in a cache. - (mcore_elf_gen_out_file): New function: Generate an output file - per the mcore-elf spec. - -1999-05-15 Nick Clifton - - * configure.in (BUILD_MISC): Build dlltool for mcore - * configure: Regenerate. - * dlltool.c: Update example in comment. - (DLLTOOL_MCORE): Define. - (DLLTOOL_MCORE_ELF): Define. - (DRECTVE_SECTION_NAME): Define. - (mcore_be_jtab, mcore_le_jtab): Binary for performing an mcore - jump to address. - (mtable): Add entries for mcore variants. - (rvaafter, rvabefore, asm_prefix): Add mcore suppport. - (scan_drectve_symbols): Use DRECTVE_SECTION_NAME. - (make_head, make_tail): Cope if file cannot be created. - (usage): Improve layout. - -1999-05-13 DJ Delorie - - * rclex.l: add code to suppress certain output from cpp, replace - all returns with MAYBE_RETURN - (MAYBE_RETURN): new, implement the suppression by returning - IGNORED_TOKEN as needed. - (cpp_line): remember which file we're in, mark data from included - *.h files for suppression. - * rcparse.y (input): allow IGNORED_TOKEN outside of known constructs - -1999-05-10 DJ Delorie - - * windres.c (quot): Quote shell metacharacters in a string - (main): quote parameters to cpp that might have metacharacters in - them. Allow -D as an alias for --define to allow for sharing make - macros with gcc. - - * objdump.c (dump_reloc_set): don't core if howto->name is NULL - - * Makefile.am: Give rescoff.c a cpu-specific -D so it can set - the correct BFD. - * Makefile.in: ditto - * rescoff.c (write_coff_file): Set the correct BFD - -1999-05-06 Ian Lance Taylor - - * rename.c (smart_rename): Fix test of whether file exists. - -1999-05-06 Nick Clifton - - * objdump.c (disassemble_data): Set display_endian based on target - endianism. - -1999-05-05 Catherine Moore - - * dlltool.c (interwork): Remove. - (arm_interwork_jtab): Use bx insn. - (thumb_jtab): Likewise. - (MARM_INTERWORK): New machine type. - (rvaafter): Handle it. - (rvabefore) Likewise. - (asm_prefix): Likewise. - (gen_exp_type): Check machine type instead of - interwork flag. - (make_one_lib_file): Likewise. - (make_head): Likewise. - (make_tail): Likewise. - (usage): Update machine types. - (main): Remove -interwork support. - -1999-05-05 Catherine Moore - - * readelf.c (get_machine_flags): Check for EF_CPU32. - (get_data_encoding): Fix typo. - -1999-04-26 Tom Tromey - - * aclocal.m4, configure: Updated for new version of libtool. - -1999-04-18 Ian Lance Taylor - - * stabs.c (parse_stab_range_type): Correct parenthesization in - BFD64 case. - - * readelf.c (get_section_type_name): Use correct types in printf - formats. - (process_relocs): Likewise. - (process_dynamic_segment): Likewise. - (process_symbol_table): Likewise. - (process_mips_specific): Likewise. - -Tue Apr 13 21:22:00 1999 Catherine Moore - - * dlltool.c (make_one_lib_file): Mark thumb functions as - C_THUMBEXTFUNC. - -1999-04-11 Richard Henderson - - * bucomm.h (environ): Declare it, if needed. - (alloca) [C_ALLOCA]: Don't use gcc's builtin or . - * configure.in (environ): Detect declaration. - * nm.c (main): Don't declare environ. - * configure, config.in: Rebuild. - - * dlltool.c (gen_exp_file): Pad out the .reloc section to a - 32-byte boundary with dummy relocations, to make the BeOS loader - happy. Patch from Bob Manson . - -1999-04-08 Tom Tromey - - * binutils.texi (c++filt): Updated for -j/--java, and hp/edg - formats. - -1999-04-08 Nick Clifton - - * readelf.c: Add ability to decode new constants found in April 25 - 1998 Draft of System V ABI spec. - -1999-04-06 Ian Lance Taylor - - * bucomm.h (LC_MESSAGES): Never define. - * addr2line.c (main): Don't pass LC_MESSAGES to setlocale if the - system does not define it. - * ar.c (main): Likewise. - * coffdump.c (main): Likewise. - * dlltool.c (main): Likewise. - * nlmconv.c (main): Likewise. - * nm.c (main): Likewise. - * objcopy.c (main): Likewise. - * objdump.c (main): Likewise. - * size.c (main): Likewise. - * srconv.c (main): Likewise. - * strings.c (main): Likewise. - * sysdump.c (main): Likewise. - * windres.c (main): Likewise. - * readelf.c (main): Call locale setting functions. - -1999-04-05 Nick Clifton - - * readelf.c (decode_location_expression): Fix DW_OP_const8{s|u} - decodes. - -1999-04-04 Ian Lance Taylor - - * rename.c: New file, copied out of objcopy.c with a few changes. - * bucomm.h (set_times, smart_rename): Declare. - * ar.c: Don't include . - (extract_file): Call set_times rather than utime. - (write_archive): Call smart_rename rather than unlink and rename. - * objcopy.c: Don't include . - (simple_copy, smart_rename, set_times): Move to rename.c. - (strip_main): Update smart_rename call for new parameter. - (copy_main): Likewise. - * Makefile.am: Rebuild dependencies. - (CFILES): Add rename.c. - (objcopy_SOURCES, strip_new_SOURCES): Add rename.c. - (ar_SOURCES, ranlib_SOURCES): Add rename.c. - * Makefile.in: Rebuild. - - * Makefile.am: Rebuild dependencies. - (EXTRA_PROGRAMS): Remove backslash which troubles current version - of automake. - * Makefile.in: Rebuild. - - * dllwrap.c (main): Expect correct type in format string. - * resres.c: Include "bfd.h", "bucomm.h", "libiberty.h", and - . Don't include and . - (write_res_file): Remove unused locals e and i. - (read_resource_entry): Remove unused locals rtype and n. - (read_unistring): Remove unused local n. - -1999-04-03 Ian Lance Taylor - - * arparse.y: Declare yylex. - * objdump.c (disassemble_bytes): Initialize bytes. Add comment - for incorrect use of bytes. - * readelf.c: Change many formats to avoid warnings. - -1999-04-01 Nick Clifton - - * readelf.c (reset_state_machine): New function. Resets the - registers of the source line number state machine. - (process_extended_line_op): Use state machine. - (display_debug_lines): Use state machine. Handle multiple line - number blocks within the same section. - -1999-03-29 Jason Merrill - - * readelf.c (process_extended_line_op): end_sequence also resets - the line number. - (display_debug_lines): advance_line takes a signed operand. - (read_and_display_attr): Print refs as <%x>, addresses as %#x, - others as %d. Handle other location expression attributes. - (display_debug_info): Handle nesting. Always print the offset. - -1999-03-23 Ian Lance Taylor - - * objcopy.c (filter_symbols): When checking whether to keep a - symbol, check the BFD section symbol for a symbol with - BSF_SECTION_SYM set. - -1999-03-10 Ulrich Drepper - - * readelf.c (process_dynamic_segment): Print new Solaris dynamic - section entries. Correct printing of DT_POSFLAG_1 and DT_FLAGS_1. - -1999-03-10 Nick Clifton - - * readelf.c (request_dump): New function. - Removed arbitary limit on the number of sections that can be - dumped. - -Wed Mar 10 15:10:14 1999 Stan Cox - - * dlltool.c (make_one_lib_file): Use %05d to output the stub name so - order in the import library is preserved. - -1999-02-19 Nick Clifton - - * readelf.c: Fix compile time warings. - -1999-02-17 DJ Delorie - - * resbin.c (res_to_bin_versioninfo): Instead of entering a value - length of zero in a version info string, enter the appropriate - length. - -Tue Feb 16 16:00:33 1999 Ian Lance Taylor - - * configure.in: Require autoconf 2.13. Change AM_PROG_INSTALL to - AC_PROG_INSTALL. Add comments for AC_DEFINE calls. - * acconfig.h: Remove. - * aclocal.m4: Rebuild. - * configure: Rebuild. - * Makefile.in: Rebuild. - * config.in: Rebuild. - -1999-02-02 Nick Clifton - - * readelf.c (read_and_display_attr): Add display of basic type - encodings. - (display_debug_aranges): New function: Display the contents of a - .debug_aranges section. - (display_debug_info): Dump tags found after compunit entry. - - * binutils.texi: Fixed bug in readelf documentation. - -Mon Feb 1 12:38:01 1999 Catherine Moore - - * readelf.c (dump_relocations): Handle EM_ARM as REL. - -1999-01-29 Nick Clifton - - * readelf.c (process_symbol_table): Do not produce a histogram of - bucket chains if none were found. - -1999-01-27 Nick Clifton - - * version.c: Add 1999 copyright. - - * binutils.texi (readelf): Document new command line options - --debug-dump and --histogram. - - * readelf.c: Add ability to display contents of some or all of the - Dwarf2 debug sections. {Work only partially completed}. - (display_debug_section): New function. - (display_debug_info): New function. - (display_debug_not_supported): New function. - (display_debug_line): New function. - (display_debug_abbrev): New function. - (process_abbrev_section): New function. - (read_leb128): New function. - (process_extended_line_op): New function. - (get_TAG_name): New function. - (get_AT_name): New function. - (get_FORM_name): New function. - (free_abbrevs): New function. - (add_abbrev): New function. - (add_abbrev_attr): New function. - (read_and_display_attr): New function. - (display_block): New function. - -Thu Jan 14 23:36:11 1999 Jeffrey A Law (law@cygnus.com) - - * coffdump.c (xcalloc): Remove, in libiberty now. - * srconv.c (xcalloc): Likewise. - * sysdump.c (xcalloc): Likewise. - -1999-01-14 Nick Clifton - - * readelf.c (process_section_headers): Omit trailing space at end - of section header contents line. - -Wed Dec 16 17:20:05 1998 Doug Evans - - * aclocal.m4: Regenerate. - -Mon Dec 14 12:55:36 1998 Jim Wilson - - * dllwrap.c: Include bfd.h and bucomm.h. Move getopt.h include - after libiberty.h include. - -Tue Dec 8 16:29:43 1998 Ian Lance Taylor - - * objdump.1: Fix typo (-d to -D). From Nokubi Hirotaka - . - -Sun Dec 6 13:28:09 1998 Ian Lance Taylor - - * objdump.c (SFILE): Add size field. - (objdump_sprintf): Merge both versions into one. Increase buffer - size as needed to avoid overflow. - (disassemble_bytes): Change buf from 1000 bytes to 50. Change - initialization and use of sfile to match changes to - objdump_sprintf. - - * strip.1: Fix typo (-V to -v). From Issei Hirayama - . - -1998-12-03 Ulrich Drepper - - * readelf.c (process_dynamic_segment): Improve output format for - various DT_* values. - -1998-12-02 Ulrich Drepper - - * readelf.c (process_mips_specific): Print .conflict section - content. - - * readelf.c (process_mips_specific): Print l_flags in liblist in - textual form. - -1998-11-30 Nick Clifton - - * ar.c (extract_file): Add some paranoia checks for negatively - sized files. - -Tue Nov 24 09:39:24 1998 Nick Clifton - - * stabs.c (DIR_SEPARATOR): Define as '\\' if WIN32 is defined. - -Tue Nov 17 10:25:26 1998 Nick Clifton - - * Makefile.in: Regenerate. - -Mon Nov 16 19:17:23 1998 Dave Brolley - - * po/binutils.pot: Regenerate. - -Mon Nov 16 10:18:53 1998 Nick Clifton - - * Makefile.am: Regernated dependencies. - * aclocal.m4: Regenerated. - * configure: Regenerated. - -Sat Nov 14 14:50:56 1998 Ian Lance Taylor - - * debug.c (debug_name_type): Correct return type from false to - DEBUG_TYPE_NULL. - -Sat Nov 14 14:48:21 1998 Andreas Schwab - - * objdump.c (disassemble_data): Skip over relocs below start - address. - -Tue Nov 10 15:31:52 1998 Nick Clifton - - * Makefile.am: Add dependency of readelf.c on elf/fr30.h - * Makefile.in: Regenerate. - -Wed Nov 4 16:25:55 1998 Nick Clifton - - * readelf.c: Add support for the FR30. - -Mon Nov 2 14:59:33 1998 Geoffrey Noer - - * configure.in: detect cygwin* instead of cygwin32* - * configure: regenerate - -Fri Oct 30 15:14:49 1998 Geoffrey Noer - - * dllwrap.c: change all references to cygwin32_ to cygwin_, - change Cygwin target def to CYGWIN. - -Wed Oct 28 10:31:19 1998 Nick Clifton - - * objdump.c (disassemble_data): Replace 'unsigned long' with - 'bfd_vma'. - -Tue Oct 27 14:39:00 1998 Nick Clifton - - * objdump.c (disassemble_bytes): Applied this patch from Philip - Blundell : Make address variables unsigned to - avoid problems when disassembling code at high-bit-set addresses. - -Mon Oct 26 14:07:59 1998 Mumit Khan - - * dllwrap.c (strhash): New function. - (main): Use it to supply image base if not supplied by user. - (program_version): Up to 0.2.4. - -Mon Oct 26 14:07:59 1998 Mumit Khan - - * dlltool.c (add_stdcall_alias): New global. - (long_options): Add --add-stdcall-alias option. - (main): Handle it. - (scan_drectve_symbols): Add alias if --add-stdcall-alias is - specified. - (scan_filtered_symbols): Likewise. - (gen_def_file): Output alias for stdcall syms if appropriate. - - * binutils.texi (dlltool): Document --add-stdcall-alias option. - - * dllwrap.c (long_options): Add --add-stdcall-alias option. - (main): Handle it. - - * defparse.y (opt_name): Allow "." in name. - * dlltool.c (def_name): Set dll_name from NAME entry in def file. - (def_library): Set dll_name from LIBRARY entry in def file. - -Mon Oct 26 14:07:59 1998 Mumit Khan - - * dllwrap.c (long_options): --implib synonym for --output-lib. - (main): Pass --export-all to dlltool only if specified. - (program_version): Up to 0.2.3. - -Mon Oct 26 14:07:59 1998 Mumit Khan - - * dllwrap.c (mybasename): New function. - (main): Run dlltool to create export definition file and import - library file if necessary. - Change exp_file_name so that it's based on the dll name. - -Sun Oct 25 10:37:45 1998 Mumit Khan - - * dlltool.c (scan_all_symbols): Fix patch error. - -Fri Oct 16 22:56:20 1998 Felix Lee - - * nm.c (display_rel_file): fix "no symbols" messages. - * objdump.c (slurp_symtab): ditto. - * po/POTFILES.in, po/binutils.pot: rebuilt - -Mon Oct 12 14:28:03 1998 Nick Clifton - - * readelf.c (dump_relocations): Rename field from Value to Info to - match name of field in ELF structures. - -Thu Oct 8 15:33:08 1998 Geoffrey Noer - - * configure.in: call AC_EXEEXT instead of AM_EXEEXT and - AM_CYGWIN32. - * aclocal.m4: remove local AM_EXEEXT/AM_CYGWIN32 macros. - * configure: regenerate - -Thu Oct 8 15:33:08 1998 Geoffrey Noer - - From Mumit Khan : - * dlltool.c (scan_all_symbols): Don't re-export symbols exported - by other DLLs. - -Thu Oct 8 15:33:08 1998 Geoffrey Noer - - * Makefile.am (BUILD_DLLWRAP): Add. - (BUILD_DLLWRAP, DLLWRAP_PROG): Add. - (bin_PROGRAMS): Add dllwrap. - * Makefile.in: regenerate with automake - - From Mumit Khan : - * dllwrap.c: New file from dllhelpers v0.2.1. - (print_version): New function. - (long_options): Add --version. - (main): Handle. - * dyn-string.h, dyn-string.c: New files from egcs-1.1/gcc. - * configure.in (BUILD_DLLWRAP): Add. - * configure: Regenerate. - -Tue Oct 6 18:20:10 1998 Geoffrey Noer - - * Makefile.am (windres_SOURCES): Add resres.c. - (windres_OBJECTS): Add resres.o. - * Makefile.in: regenerate with automake - - From Anders Norlander . - * resres.c: New file. Implementation of read_res_file and - write_res_file functions for windres. - * rcparse.y: Handle CONTROL's with named classes. - * resbin.c: Bug in res_to_bin_dialog and bin_to_res_dialog - when dialog is extended: The version and signature fields should - be reversed (despite what the docs say). Id is 32 bits long in - extended dialogs. - * resrc.c (write_rc_dialog): properly print controls with named - classes. - * windres.c (read_res_file, write_res_file): Remove stubs. - * resres.c (write_res): Rename RT_ACCELERATORS to RT_ACCELERATOR. - -Sun Oct 4 20:34:42 1998 Ian Lance Taylor - - From Nokubi Hirotaka : - * objcopy.1: Fix typo in --remove-leading-char docs. - * objdump.1: Fix formatting in --stabs docs. - -Sat Sep 19 23:33:56 1998 Ian Lance Taylor - - * rcparse.y (memflags_move): Correct recursion. - -1998-09-10 Ulrich Drepper - - * readelf.c (process_symbol_table): Print in histogram how many - symbols are covered by the current chain length. - -Sun Sep 6 16:15:47 1998 Nick Clifton - - * readelf.c (process_section_contents): Do not try to dump empty - sections. - -Sat Sep 5 19:17:10 1998 Mumit Khan - - * dlltool.c (scan_all_symbols): Don't re-export symbols exported - by other DLLs. - -1998-09-02 14:50 Ulrich Drepper - - * readelf.c (process_dynamic_segment): Print DT_* value only if - do_dynamic. - (do_histogram): New variable. - (options): New long option histogram. Set do_histogram if this - option is used. - (usage): Document --histogram. - (parse_args): Handle 0 return value from getopt_long. Enable - do_histogram for -a. - (process_symbol_table): Read hash table also if only do_histogram. - Add code to print hash table histogram. - -1998-08-25 16:45 Ulrich Drepper - - * readelf.c (process_dynamic_segment): Read syminfo section if - available. - (process_syminfo): New function. Print syminfo information. - (process_file): Call process_syminfo and free syminfo data at the end. - -Wed Aug 19 16:19:51 1998 Ian Lance Taylor - - * dlltool.c (usage): Add file parameter. Change all callers. - (main): Don't treat '?' as a special case in getopt return. - - * binutils.texi (dlltool): Document new options. Add some uses of - @var. - -Wed Aug 19 16:19:07 1998 Mumit Khan - - * dlltool.c (gen_def_file): Plug memory leak. Don't print - demangled name if it is NULL. - - Support for exporting all symbols to an output export def file: - * dlltool.c ({export_all_symbols, no_default_excludes, - no_default_excludes, excludes}): New file static variables. - (struct string_list): Type to hold list of symbols to exclude. - (scan_drectve_symbols): Renamed from scan_open_obj_file. - (scan_filtered_symbols): New static function. - (add_excludes): New static function. - (match_exclude): New static function. - (set_default_excludes): New static function. - (filter_symbols): New static function. - (scan_all_symbols): New static function. - (scan_open_obj_file): New static function. - (usage): Document new options. - (long_options): Add new options. - (main): Handle new options. - -1998-07-31 21:24 Ulrich Drepper - - * readelf.c (process_program_headers): Print p_offset value with - six hex digits. - (dynamic_segment_mips_val): Add support for DT_MIPS_FLAGS, - DT_MIPS_IVERSION, and DT_MIPS_TIME_STAMP. - (process_mips_specific): Also print seconds of time stamp. - -Fri Jul 31 10:04:23 1998 Catherine Moore - - * readelf.c (dump_relocations): EM_ARM uses rela relocs. - -1998-07-30 16:25 Ulrich Drepper - - * readelf.c (get_dynamic_type): Don't used gettext on the names. - Add new DT_* values from Solaris. Don't print nuemric value in - case of an unknown entry. - (process_dynamic_segment): Handle new DT_* entries. Print numeric - values in decimal, not hex. - -Fri Jul 24 16:28:57 1998 Jeff Holcomb - - * readelf.c (get_dynamic_type): Remove empty default from switch - statement. - -Fri Jul 24 16:28:12 1998 Ian Lance Taylor - - * Makefile.am (install-exec-local): Don't remove the file before - checking whether $(bindir) == $(tooldir)/bin. From Maciej - W. Rozycki . - * Makefile.in: Rebuild. - -Fri Jul 24 09:38:59 1998 Nick Clifton - - * objcopy.c: Removed spurious inclusion of elf/internal.h and - elf-bfd.h. - -1998-07-22 Ulrich Drepper - - * readelf.c: Consistantly use elf_ prefix for *_reloc_type - functions. - -Wed Jul 22 16:29:12 1998 Nick Clifton - - * readelf.c (dump_relocations): Add dumps of HPPA and ARC - relocations. - - (process_relocs): Do not abort if no string table can be found. - -1998-07-22 14:58 Ulrich Drepper - - * readelf.c: Remove definition of functions to return relocation - symbol strings. They now get implicitly defined when include the - system specific ELF header. - -1998-07-22 13:51 Ulrich Drepper - - * readelf.c: Before include system specific ELF header define - START_RELOC_NUMBERS, RELOC_NUMBER, and END_RELOC_NUMBERS. For now - used for ppc, mips, and mn10300. - -Wed Jul 22 10:26:32 1998 Nick Clifton - - * readelf.c (dump_relocations): Display number of unrecognised - relocations. - -1998-07-21 13:13 Ulrich Drepper - - * readelf.c: Use symbolic names of relocation entries for the various - architectures. Correct more layout details. - Print names of MIPS specific section types. Print Alpha, ARM, and - MIPS relocation type names. - -1998-07-20 Vladimir N. Makarov - - * objcopy.c (filter_symbols): Add code for strip all symbols case. - (copy_objects): Strip all case is now processed also through - filter_symbols. No marking symbols used in relocations when strip - all symbols case. - (copy_section): When strip all symbols case, remove relocations - which are not in keep strip specific list. - (strip_main): Remove guard `strip_specific_list == NULL' for - setting up strip all symbols by default. - -Mon Jul 20 12:51:16 1998 Andreas Schwab - - * addr2line.c (find_address_in_section): Only consider a section - if the pc value is completely contained within it. - (translate_addresses): Don't crash if functionname or filename are - null. - -1998-07-20 07:45 Ulrich Drepper - - * readelf.c (process_symbol_table): Fix little alignment problem - in printed table header. - -1998-07-20 07:14 Ulrich Drepper - - * readelf.c: Correct reading of .dynamic section. - (dynamic_section): Now a global variable. - (process_mips_fpe_exception, process_mips_specific, - process_arch_specific): New functions. - (get_file_header): Call process_arch_specific. - -1998-07-19 15:15 Ulrich Drepper - - * readelf.c: Fix several versioning related bugs. Produce nicer - output. - Add support for processor specific information on MIPS. - -Fri Jul 10 15:57:58 1998 Nick Clifton - - * readelf.c: Switch prototypes from unsigned short to unsigned - int. - -Fri Jul 10 16:17:50 1998 Ian Lance Taylor - - From Christian Holland : - * ieee.c (parse_ieee): Initialize info.global_vars and - info.global_types. - (parse_ieee_atn): Ignore register lifetime information reportedly - emitted by MRI compiler. - -Thu Jul 9 13:08:01 1998 Ian Lance Taylor - - * Makefile.am (MAINTAINERCLEANFILES): Define. - * Makefile.in: Rebuild. - -Tue Jul 7 21:48:54 1998 Jeffrey A Law (law@cygnus.com) - - * readelf.c (byte_get): Use PARAMS in prototype. - (error): Make it work with non-ANSI compilers. - (warn): Likewise. - (get_ver_flags): Don't use an ANSI prototype in the definition. - -Tue Jul 7 13:26:13 1998 Ian Lance Taylor - - * objcopy.c (filter_bytes): Set size correctly if the size of the - section is not an even multiple of the interleave. Based on patch - from Brion Stone . - -Thu Jul 2 14:01:34 1998 Klaus Kaempf - - * configure.com: Add vax/vms support. - * makefile.vms-in: Renamed from makefile.vms. Add substitutions - now done by configure.com. - -Wed Jul 1 20:43:52 1998 Ian Lance Taylor - - * stabs.c (parse_stab_range_type): Handle 4 and 8 byte signed - integers with real upper bounds. Handle a lower bound one larger - than the upper bound as a signed integer. Handle 8 byte signed - integers. - (stab_demangle_template): Optionally return the demangled name of - the template. - (stab_demangle_qualified): Treat a template name as a tagged - type. - (stab_demangle_fund_type): Likewise. - -Wed Jul 1 16:29:50 1998 Nick Clifton - - * objcopy.c: Minor formatting improvements. - * readelf.c: Minor output formatting improvement. - -Wed Jul 1 14:23:48 1998 Ian Lance Taylor - - * rclex.l: Add casts and change types to avoid warnings. - * rcparse.y: Likewise. - * resbin.c: Likewise. - * rescoff.c: Likewise. - * resrc.c: Likewise. - - * Makefile.am: Rebuild dependencies. - (HFILES): Remove readelf.h. - * Makefile.in: Rebuild. - - Based on patches from Andrew Kozin - : - * winduni.h: New file, from windres.h. - * winduni.c: New file, from windres.c. - * windres.c: Move Unicode functions into winduni.c. - * windres.h: Move Unicode declarations into winduni.h. Include - winduni.h. - (RT_ACCELERATOR): Rename from RT_ACCELERATORS to match Windows - macro. Change all uses. - (RT_PLUGPLAY, RT_VXD): Correct values. - * Makefile.am (HFILES): Add windres.h. - (CFILES): Add winduni.c. - (windres_SOURCES): Add winduni.c. - -Mon Jun 29 17:01:21 1998 Nick Clifton - - * readelf.c: Use BFD Internal and External Elf structures. - * readelf.h: Removed - no longer needed. - * Makefile.in: Remove readelf.c's dependency upon readelf.h. - -1998-06-26 Vladimir N. Makarov - - * objcopy.c (strip_main): keep_specific_list == NULL as additional - condition to set up strip all symbols by default. - (copy_archive): don't change archive when error in object files of - the archive. - -Wed Jun 24 17:53:47 1998 Ian Lance Taylor - - * stabs.c (parse_number): Sign extend negative values correctly if - bfd_vma is larger than unsigned long. - -Tue Jun 23 14:55:05 1998 Mike Stump - - * Makefile.am (install-exec-local): Don't let EXEEXT interfere - with the program transform name. - * Makefile.in: Rebuild. - -Tue Jun 23 11:08:53 1998 Nick Clifton - - * readelf.c: Rewrite to use fopen/fread ratehr than mmap. - - Add --section-headers command line switch, which is an alias for - --sections. - - Incorporate improvemnts made by Andreas Schwab - including output - formatting and version info display. - - * binutils.texi: Document --section-headers switch to readelf. - -Mon Jun 22 18:28:19 1998 Ian Lance Taylor - - * readelf.c: Include bfd.h and bucomm.h before system header - files. - (parse_args): Change type of c from char to int. - -Sun Jun 14 14:26:28 1998 Nick Clifton - - * readelf.c (usage): Write to stdout, not stderr. - -Fri Jun 12 13:33:51 1998 Tom Tromey - - * po/Make-in (all-yes): Depend on .pot file if maintainer mode - enabled. - ($(PACKAGE).pot): Unconditionally depend on POTFILES. - -Fri Jun 12 16:06:15 1998 Michael Meissner - - * readelf.c (get_ppc_rel_type): New PowerPC support. - (dump_relocations): PowerPC uses RELA relocations. - (get_machine_name): Spell PowerPC correctly. - (get_file_type): Change unsigned short parameter to unsigned. - (get_machine_name): Ditto. - (get_machine_data): Return whether big endian or little endian. - (get_machine_flags): Interpret PowerPC, M32R, and MIPS flags. - (process_elf_header): Print endian-ess. Convert all numeric - formats to long or unsigned long. Print out machine specific flag - bits. - (process_section_headers): Increase name by 3 columns and decrease - type by the same so that .gcc_except_table fits in the space. - - * readelf.h: Include elf/ppc.h, elf/mips.h, and elf/m32r.h to get - machine specific flag bits. - -Thu Jun 11 17:54:26 1998 Nick Clifton - - * readelf.c: Remove extraneous #includes. Fix warnings produced - by -Wall when compiling under Linux. - - * Makefile.am (readelf_LDADD): Add $(LIBIBERTY). - -Thu Jun 11 18:30:20 1998 Ian Lance Taylor - - * stabs.c (struct stab_handle): Add self_crossref field. - (parse_stab_string): If a tag is a cross reference to itself, - don't define it in the tags list. - (parse_stab_type): Set info->self_crossref. - - * debug.c (struct debug_type_real_list): Define. - (debug_get_real_type): Add list parameter. Change all callers. - Check for circularity to avoid crashing when it occurs. - -Thu Jun 11 14:48:32 1998 Nick Clifton - - * readelf.c: New file: Display contents of ELF format file. - * readelf.h: New file: Header file for readelf.c - * Makefile.am: Add rules to build readelf. - * Makefile.in: Rebuilt. - * binutils.texi: Document readelf. - * NEWS: Mention inclusion of readelf into binutils. - * po/POTFILES.in; Rebuilt. - -Fri Jun 5 18:43:40 1998 Ian Lance Taylor - - * objcopy.c (setup_section): Adjust the section size if copy_byte - is >= 0. - (copy_section): Do not call bfd_set_section_size. - -Thu Jun 4 09:12:27 1998 Nick Clifton - - * objcopy.c (copy_usage): Add missing \n\ from help description. - -Wed Jun 3 19:31:33 1998 Ian Lance Taylor - - * Makefile.am (YACC): Correct bison -L option. - * Makefile.in: Rebuild. - - * binutils.texi, objdump.1: Document -p/--private-headers. - -Wed Jun 3 12:09:40 1998 Nick Clifton - - * objcopy.c: Add new command line options: --change-section-lma - and --change-section-vma. Rename old command line option - --adjust-section-vma to --change-section-address. Rename - --adjust-vma to --change-addresses and --adjust-start to - --change-start. Provide aliases to support the old versions of - these command line options. - - Change the names of macros and enum elements to upper case to - match the GNU coding standard. - - Replace calls to fprintf (stderr,...) with calls to fatal () or - non_fatal () as appropriate. - - * objcopy.1: Document command line option changes. - * binutils.texi: Document command line option changes. - - * bucomm.h: New exported funtion from bucomm.c: non_fatal(). - * bucomm.c (non_fatal): New exported function. Just like fatal() - except that it returns rather than calling xexit(). - - (bfd_check_format_matches): Call fatal() rather than bfd_fatal(). - - (check_matching_formats): Fix C formating. - - (parse_vma): Call fatal(). - -Mon Jun 1 18:26:40 1998 Ian Lance Taylor - - From Yuli Barcohen : - * debug.c (debug_type_samep): Avoid endless loops comparing - function and method parameter types. - -Fri May 22 14:02:42 1998 Ian Lance Taylor - - * dlltool.c (dump_iat): Comment out; not used. - (display): Rename from tell. Change all callers. - -Thu May 14 14:00:56 1998 Nick Clifton - - * dlltool.c: Add support for Thumb DLLs. Add support for - interworking between ARM and Thumb programs and DLLs. Tidy the - code. - - * binutils.texi: Document dlltool. - - * configure: Build dlltool for thumb-pe targets. - - * version.c (print_version): Include 1998 in copyright strings. - - * stabs.c (parse_stab): Support Win32 style directory separators. - -Sun May 10 22:34:44 1998 Jeffrey A Law (law@cygnus.com) - - * po/Make-in (install-info): New target. - -Fri May 8 10:33:13 1998 Nick Clifton - - * ar.c (usage): Extend information provided about command line - options. - -Wed May 6 15:28:51 1998 Klaus Kaempf - - * makefile.vms: Run dec c with /nodebug. Pass CC value when - calling make. - -Tue May 5 15:19:00 1998 Nick Clifton - - * configure: Build dlltool for thumb-pe target. - * configure.in: Build dlltool for thumb-pe target. - -Sun May 3 22:04:49 1998 Ian Lance Taylor - - * Makefile.am (EXTRA_PROGRAMS): Change $(SRCONV_PROG) to sysconf - sysdump coffdump to avoid extra $(EXEEXT). - * Makefile.in: Rebuild. - -Wed Apr 29 22:22:55 1998 Geoffrey Noer - - * configure.in: Stop appending EXEEXT to the end of - SRCONV_PROG (wrong because that variable may contain multiple - programs) - * Makefile.am: instead, add EXEEXTs to each SRCONV_PROG - program - * Makefile.in: regenerate - * configure: regenerate - -Tue Apr 28 19:14:34 1998 Tom Tromey - - * addr2line.c (main): Conditionally call setlocale. - * windres.c (main): Likewise. - * sysdump.c (main): Likewise. - * strings.c (main): Likewise. - * srconv.c (main): Likewise. - * size.c (main): Likewise. - * objdump.c (main): Likewise. - * objcopy.c (main): Likewise. - * nm.c (main): Likewise. - * nlmconv.c (main): Likewise. - * dlltool.c (main): Likewise. - * coffdump.c (main): Likewise. - * ar.c (main): Likewise. - * bucomm.h: Include if HAVE_LOCALE_H. - (LC_MESSAGES): Now can be defined even when ENABLE_NLS. - -Tue Apr 28 10:33:07 1998 Bill Moyer - - Add support for IMPORTS: - * defparse.y (impline): Add IMPORTS syntaxes. - * dlltool.c (ifunctype, iheadtype): New typedefs. - (import_list): New static variable. - (append_import): New static function. - (def_import): Add an entry to import_list. - (generate_idata_ofile): New static function. - (gen_exp_file): Call generate_idata_ofile. - * dlltool.h (def_import): Update declaration. - -Mon Apr 27 16:39:22 1998 Ian Lance Taylor - - * configure.in: Change version number to 2.9.4 - * configure: Rebuild. - -Wed Apr 22 16:00:35 1998 Tom Tromey - - * po/Make-in (MKINSTALLDIRS): Don't look in $(top_srcdir). - -Wed Apr 22 00:33:56 1998 Tom Tromey - - * Makefile.am (INCLUDES): Search intl dirs for headers; define - LOCALEDIR. - * addr2line.c (main): Call setlocale, bindtextdomain, textdomain. - * ar.c (main): Likewise. - * coffdump.c (main): Likewise. - * dlltool.c (main): Likewise. - * nlmconv.c (main): Likewise. - * nm.c (main): Likewise. - * objcopy.c (main): Likewise. - * objdump.c (main): Likewise. - * size.c (main): Likewise. - * srconv.c (main): Likewise. - * strings.c (main): Likewise. - * sysdump.c (main): Likewise. - * windres.c (main): Likewise. - -Tue Apr 21 22:13:08 1998 Tom Tromey - - * Many files: Added gettext invocations around user-visible - strings. - * bucomm.h: Added gettext-related includes and defines. - * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY, - HAVE_LC_MESSAGES): Define. - * configure.in: Call CY_GNU_GETTEXT. Create po/Makefile.in and - po/Makefile. Use AM_PROG_LEX. - * Makefile.am (SUBDIRS): New macro. - (POTFILES): Likewise. - (po/POTFILES.in): New target. - (LDADD): Added INTLLIBS. - (objdump_LDADD): Likewise. - (c__filt_LDADD): Likewise. - (ar_LDADD): Likewise. - (ranlib_LDADD): Likewise. - (dlltool_LDADD): Likewise. - (windres_LDADD): Likewise. - * po/Make-in, po/POTFILES.in, po/binutils.pot: New files. - -Tue Apr 21 16:07:18 1998 Stanislav Brabec - - * objcopy.c (preserve_dates): New file static variable. - (smart_rename): If preserve_dates, call set_times when copying. - (strip_main): Remove preserve_dates local variable. - (copy_main): Likewise. - -Tue Apr 7 15:41:15 1998 Ian Lance Taylor - - * Makefile.am (DISTSTUFF): Add defparse.h, defparse.c, rclex.c, - rcparse.h, and rcparse.c - * Makefile.in: Rebuild. - -Mon Apr 6 16:24:35 1998 Ian Lance Taylor - - * Makefile.am (PROGS): Move $(ADDR2LINE_PROG) to end, so that - Makefile.in doesn't have an empty continuation line. - (bin_PROGRAMS): Likewise. - * Makefile.in: Rebuild. - -Fri Apr 3 14:48:42 1998 Ian Lance Taylor - - * Makefile.am (DISTCLEANFILES): Add site.exp and site.bak. - (MOSTLYCLEANFILES): Add binutils.log, binutils.sum, and abcdefgh*. - (mostlyclean-local): New target. - * Makefile.in: Rebuild. - -Wed Apr 1 15:54:16 1998 Ian Lance Taylor - - From Zack Weinberg and H.J. Lu - : - * ar.c (usage): Mention S modifier. - (main): Add S modifier. - * ar.1, binutils.texi: Document S modifier. - -Wed Apr 1 13:11:23 1998 Andreas Schwab - - * binutils.texi: Use @itemx for a secondary item in a table. - -Tue Mar 31 18:44:13 1998 Ian Lance Taylor - - * dep-in.sed: Add rule to remove @OBJDIR@. - * Makefile.am (dep.sed): Substitute for @OBJDIR@. - * Makefile.in: Rebuild. - -Mon Mar 30 12:47:18 1998 Ian Lance Taylor - - * configure.in: Set version to 2.9.1. - * configure: Rebuild. - - * Branched binutils 2.9. - - * Makefile.am (DISTCLEANFILES): Remove defparse.h, arparse.h, - rcparse.h, and nlmheader.h. - * Makefile.in: Rebuild. - -Sat Mar 28 17:39:27 1998 Ian Lance Taylor - - * Makefile.am (MOSTLYCLEANFILES): Define. - * Makefile.in: Rebuild. - - Fix some gcc -Wall warnings: - * nlmconv.c (main): Add casts to avoid warnings. - (alpha_mangle_relocs): Likewise. - * objdump.c (dump_section_stabs): Likewise. - * size.c (print_sysv_format): Likewise. - * srcconv.c (wr_ob): Likewise. - * wrstabs.c (stab_modify_type): Likewise. - (stab_variable): Likewise. - * nlmconv.c (main): Initialize variables to avoid warnings. - * nm.c (sort_symbols_by_size): Likewise. - * objdump.c (disassemble_bytes): Likewise. - * wrstabs.c (stab_end_class_type): Likewise. - * coffgrok.c (do_sections_p2): Change j to unsigned int. - (do_lines): Change l to unsigned int. - * nlmheader.y (yylex): Change i to unsigned int. - * nm.c (print_symbol): Change j to long. - * size.c (lprint_number): Comment out. - * srconv.c (wr_ob): Change i to bfd_size_type. - * sysdump.c (unit_info_list): Comment out. - (object_body_list, program_structure, debug_list): Likewise. - * sysinfo.y (yyerror): Return value. - -Thu Mar 26 17:06:51 1998 Richard Henderson - - * defparse.y (explist): Allow epsilon. - Suggestion from Jonathan-Harris@psion.com. - -Thu Mar 26 16:59:09 1998 Richard Henderson - - * coffgrok.c (do_sections_p1): Use the section's lma instead of vma - for the benefit of prom loaders. - -Wed Mar 25 13:05:39 1998 Ian Lance Taylor - - Based on patch from H.J. Lu : - * Makefile.am (DISTSTUFF): New variable. - (diststuff): New target. - (DISTCLEANFILES): New variable. - * Makefile.in: Rebuild. - -Tue Mar 24 19:33:08 1998 Ian Lance Taylor - - * rclex.l: Accept { and } as synonyms for BEGIN and END. - -Fri Mar 20 19:18:08 1998 Ian Lance Taylor - - * aclocal.m4, configure: Rebuild with libtool 1.2. - -Tue Feb 24 13:07:50 1998 Doug Evans - - * objdump.c (disassemble_data): Delete "++place" after call to - find_symbol_for_address. Set disasm_info.symbols to array of - symbols at the current address. - -Wed Feb 18 23:39:46 1998 Richard Henderson - - * Makefile.am (install-exec-local): Install properly when ln - fails or tooldir == prefix. - -Tue Feb 17 18:40:55 1998 Richard Henderson - - * objcopy.c (compare_section_lma): Rename from _vma. - (copy_object): Gap fill based on LMA not VMA. - * binutils.texi: Update and clarify. - * objcopy.1: Likewise. - -Tue Feb 17 20:34:11 1998 Ian Lance Taylor - - * dlltool.c (gen_exp_file): Generate _imp__%s as well as __imp_%s, - for Microsoft compatibility. - (make_one_lib_file): Likewise. - - * dlltool.c (make_one_lib_file): Don't add 1 to hint. - -Fri Feb 13 16:37:44 1998 Ian Lance Taylor - - * Makefile.am (AUTOMAKE_OPTIONS): Define. - * configure, Makefile.in, aclocal.m4: Rebuild with automake 1.2e. - -Thu Feb 12 14:13:46 1998 Ian Lance Taylor - - * deflex.l: Accept '?' in symbol names, for VC++ mangled names. - From Mikey . - - * addr2line.c (usage): Update bug-gnu-utils address. - * ar.c (usage): Likewise. - * nlmconv.c (show_usage): Likewise. - * nm.c (usage): Likewise. - * objcopy.c (copy_usage): Likewise. - (strip_usage): Likewise. - * objdump.c (usage): Likewise. - * size.c (usage): Likewise. - * strings.c (usage): Likewise. - * windres.c (usage): Likewise. - * binutils.texi (Bug Reporting): Likewise. - -Sat Feb 7 15:36:24 1998 Ian Lance Taylor - - * configure, aclocal.m4: Rebuild with new libtool. - -Thu Feb 5 12:21:13 1998 Ian Lance Taylor - - * configure, Makefile.in, aclocal.m4: Rebuild with new libtool. - -Fri Jan 30 19:16:28 1998 Doug Evans - - * Makefile.am (CC_FOR_TARGET,nlmcomv.o): Change program_transform_name - to transform. - * Makefile.in: Regenerate. - -Thu Jan 29 16:24:04 1998 Mumit Khan - - * dlltool.c: Define exit status macros for _WIN32 but not - __CYGWIN32__. - (gen_lib_file): Check for exit status of unlink. - * resrc.c: Define popen and pclose if _WIN32 but not - __CYGWIN32__. - -Wed Jan 28 17:45:46 1998 Ian Lance Taylor - - * configure.in: Remove vfork check. - * nlmconv.c: Never include vfork.h. - * aclocal.m4, configure, Makefile.in, config.in: Rebuild. - -Wed Jan 28 17:43:02 1998 J.J. van der Heijden - - * objcopy.c (copy_archive): Only pass one argument to mkdir if - _WIN32 but not __CYGWIN32__. - (smart_rename): Add code for _WIN32 (not __CYGWIN32__), to cope - with different rename behaviour and lack of chown. - - * configure.in: Check for mingw32 when deciding whether to build - dlltool. - * dlltool.c: Never include vfork.h. - (run): Use pexecute rather than vfork. - (gen_lib_file): Check for errors from bfd_set_archive_head and - bfd_close. Close all the BFDs in the archive before deleting the - temporary files. - -Thu Jan 22 16:22:55 1998 Fred Fish - - * objdump.c (disassemble_bytes): Add flag INSN_HAS_RELOC to tell - disassembly function there is a reloc on this line. - -Wed Jan 14 15:29:43 1998 Richard Henderson - - * srconv.c (sh, h8300): Delete variables. - (addrsize, toolname, rnames): New variables. - (writeINT): Use addrsize. - (wr_un): Use toolname. - (wr_hd): Set up addrsize et al properly for h8300[hs]. - (walk_tree_symbol): Zero dsy. Use rnames. - (wr_un, wr_hd, wr_ob, wr_du): Use proper bfd access macros. - * sysdump.c (sh, h8300): Delete variables. - (addrsize): New variable. - (getINT): Use it. - (getone): Initialize it. - (getBITS): Range check on MAX. - -Mon Dec 29 16:58:05 1997 Ian Lance Taylor - - From Matthew Bellantoni : - * ar.c (get_pos_bfd): Add default_posname parameter. Change all - callers. - (replace_members): Default to replacing in the same position. - -Mon Dec 22 11:27:22 1997 Ian Lance Taylor - - * rclex.l: Don't permit a comma in a STRING. - * rcparse.y (acc_entry): Warn if an inappropriate modifier is used - with a non VIRTKEY. - (acc_event): For a control character, set VIRTKEY, and force the - character to uppercase. - (acc_options): Don't require a comma separator. - -Tue Dec 9 13:25:42 1997 Michael Meissner - - * size.c (size_number): New function to provide size of field. - ({l,r}print_number): For octal and hex fields, print field using - '0' and '0x' suffixes. Do not include following tab. - (sysv_internal_sizer): Size section name, section size, and vma - address fields. - (sysv_internal_printer): Use calculated sizes for the columns. - (print_sysv_format): Size columns before printing. - (print_berkeley_format): Print tabs between numbers now that - {l,r}print_number doesn't. Print fields right justified. - -Mon Dec 8 11:22:04 1997 Nick Clifton - - * objdump.c (objdump_print_addr_with_sym): Remove call to - disasm_symaddr() as this function no longer exists. - -Tue Dec 2 10:23:50 1997 Nick Clifton - - * objdump.c (objdump_print_addr_with_sym): Call disasm_symaddr() - to allow backend to know which symbol has just been displayed. - -Tue Dec 2 13:06:46 1997 Ian Lance Taylor - - * windres.h (ESCAPE_*): Define standard escape sequences. - * rclex.l (handle_quotes): Handle standard escape sequences. Warn - about an unrecognized escape character. - * windres.c (unicode_print): Print standard escape sequences. - * rcparse.y (acc_event): Initialize $$.next. - * resbin.c (bin_to_res_menuitems): Don't set MENUITEM_POPUP or - MENUITEM_ENDMENU in the menu item flags. - (bin_to_res_accelerators): Allocate a structure (the old code - never worked). - (res_to_bin_accelerator): Correct the test for setting ACC_LAST. - (res_to_bin_dialog): Save the extended style rather than saving - the style twice. Remove useless shadowing length variable. Set - the length of control data correctly. - * resrc.c (write_rc_dialog): Don't print the class or menu if the - string length is zero. - -Mon Nov 24 18:52:43 1997 Andreas Schwab - - * stabs.c (parse_stab_argtypes): Don't try to parse the name of a - destructor as mangled argument types. - -Mon Nov 10 17:51:41 1997 Gavin Koch - - * addr2line.c (translate_addresses): Use bfd_scan_vma rather - than strtol to scan addresses. - -Sun Nov 9 11:01:31 1997 Jeffrey A Law (law@cygnus.com) - - * Makefile.am (bin_PROGRAMS): Don't use line continuations here. - -Tue Nov 4 11:56:14 1997 Ian Lance Taylor - - * objcopy.c (copy_section): Don't crash if there is no particular - information for a section. - -Mon Nov 3 12:36:19 1997 Ian Lance Taylor - - * objcopy.c (parse_flags): Make flag check case insensitive. - Check for `contents' flag. Give an error for unrecognized flags. - (copy_section): If the contents flag was set for a section that - had no contents, zero out the new contents. - * binutils.texi (objcopy): Document contents section flag. - -Sun Nov 2 14:49:56 1997 Ian Lance Taylor - - * objcopy.c: Move new struct and variable definitions to top of - file. Remove obsolete add_strip_symbol and is_strip_symbol - declarations. Add prototype declarations for add_specific_symbol - and is_specified_symbol. - -Mon Oct 20 15:31:43 1997 Klaus K"ampf - - * configure.com (HAVE_SBRK): Undefine. - -Tue Oct 14 16:14:35 1997 Nick Clifton - - * objdump.c (objdump_symbol_at_address): New function. Returns - true if a symbol can be found at the address passed in. - (disassemble_data): Set the symbol_at_address_func field to point - to objdump_symbol_at_address. - -Fri Oct 10 14:13:09 1997 Richard Henderson - - * objcopy.c, objcopy.1, binutils.texi: "localize" is a better name - than "privatize". Update all references. - -Thu Oct 9 15:57:29 1997 Ian Lance Taylor - - * binutils.texi (strip): Remove duplicate --target. From Marty - Leisner . - - * nm.c (lineno_cache_bfd): New file static variable. - (lineno_cache_rel_bfd): New file static variable. - (display_archive): Clear lineno_cache_bfd and lineno_cache_rel_bfd - when closing a BFD. - (display_file): Likewise. - (print_symbol): Use lineno_cache_bfd and lineno_cache_rel_bfd - instead of cache_bfd and cache_rel_bfd. Make seccount static, and - only set it when setting relocs. - -Wed Oct 8 21:19:11 1997 Richard Henderson - - * objcopy.c (keep_specific_list, privatize_specific_list, - weaken_specific_list): New variables. - (keep_symbols): Removed. - (add_specific_symbol): New function from the carcas of - add_strip_symbol. Takes a list as an argument. - (is_specified_symbol): Likewise from is_strip_symbol. - (filter_symbols): Honor the new privatize and weaken lists. - Optimize bfd_asymbol_name handling. - (copy_object, copy_options, copy_usage): Add privatize-symbol & - weaken-symbol options. - - * objcopy.1, binutils.texi: Update docs. - -Sun Oct 5 09:05:44 1997 Frank Ch. Eigler - - * objdump.c (disassemble_data): Make "--prefix-addresses" - disassembly adjust to mixed-length instructions. - (objdump_print_addr_with_sym): Add "0x" prefix for hexadecimal - symbol-offsets in disassembly. - -Fri Oct 3 12:04:25 1997 Ian Lance Taylor - - * objcopy.c (set_times): New static function, replacing - make_same_dates. - (strip_main): If preserve_dates, stat the input file before - copying it, and call set_times afterward. - (copy_main): Likewise. - - * wrstabs.c (write_stabs_in_sections_debugging_info): Cast p to - char * when calling strcpy and strlen. - -Wed Sep 24 11:34:05 1997 Ian Lance Taylor - - * binutils.texi (ar cmdline): Document that q now works like r. - From Marty Leisner . - - * binutils.texi (size): The object file argument is optional. - From Marty Leisner . - - * aclocal.m4: Rebuild with new libtool. - * configure: Rebuild. - -Tue Aug 26 17:48:34 1997 Ian Lance Taylor - - * Makefile.am (EXEEXT_FOR_BUILD): New variable. Use it in all - references to the sysinfo program. - * configure.in: Rebuild with new bfd/acinclude.m4. - * Makefile.in: Rebuild. - -Fri Aug 8 15:32:49 1997 Ian Lance Taylor - - * windres.c: Include . - (define_resource): Set a timestamp for the resource. - -Wed Aug 6 13:37:58 1997 Ian Lance Taylor - - * configure.in: Define TARGET in header file. - * acconfig.h (TARGET): Add #undef. - * Makefile.am (version.o, bucomm.o): Remove special targets. - * bucomm.c (target): Remove. - * nm.c (program_name): Don't declare. - (target): Make static. - * size.c (target): Make static. - * configure, config.in, Makefile.in: Rebuild. - -Tue Aug 5 00:01:41 1997 Ian Lance Taylor - - * Makefile.am (check-DEJAGNU): Export r. - (.dep1): Use $(INCLUDES) rather than $(ALL_CFLAGS). - * Makefile.in: Rebuild. - - * nlmheader.y: Use VERSIONK rather than VERSION. - - * Makefile.am (STRIP_PROG): Change from strip.new to strip-new. - (NM_PROG): Change from nm.new to nm-new. - (TOOL_PROGS, install-exec-local): Adjust accordingly. - * Makefile.in: Rebuild. - -Mon Aug 4 11:47:31 1997 Ian Lance Taylor - - * configure.in: Remove AC_ARG_PROGRAM; it's invoked by - AM_INIT_AUTOMAKE. - * configure: Rebuild. - - * Makefile.am (install-exec-local): Create $(tooldir)/bin before - trying to install anything into it. - * Makefile.in: Rebuild. - - * Makefile.am (TOOL_PROGS): Use an explicit $(EXEEXT). - (install-exec-local): When handling $(noinst_PROGRAMS), only use - $(EXEEXT) on the installed file. When handling $(TOOL_PROGS), - handle $(EXEEXT) correctly. - * configure.in: Add an explicit $(EXEEXT) when substituting for - the name of a program to build. - * Makefile.in, configure: Rebuild. - - * aclocal.m4, configure, Makefile.in: Rebuild with new automake - patches. - - * deflex.l, defparse.y: Use VERSIONK rather than VERSION. - * rclex.l, rcparse.y: Likewise. - * Makefile.am (windres_SOURCES): Add $(BULIBS). - * Makefile.in: Rebuild. - -Fri Aug 1 13:08:39 1997 Ian Lance Taylor - - * acinclude.m4: Include bfd/acinclude.m4, not bfd/acmacros.m4. - * aclocal.m4, configure: Rebuild with new libtool. - -Thu Jul 31 11:51:35 1997 Ian Lance Taylor - - * Makefile.am: New file, based on old Makefile.in. - * acinclude.m4: New file, from old aclocal.m4. - * configure.in: Call AM_INIT_AUTOMAKE and AM_PROG_LIBTOOL. Remove - shared library handling; now handled by libtool. Replace - AC_CONFIG_HEADER with AM_CONFIG_HEADER. Call AC_PROG_YACC, - AC_PROG_LEX, AC_DECL_YYTEST, AM_MAINTAINER_MODE, AM_CYGWIN32, and - AM_EXEEXT. Replace AC_PROG_INSTALL with AM_PROG_INSTALL. Remove - stamp-h handling in AC_OUTPUT. - * acconfig.h: Mention PACKAGE and VERSION. - * stamp-h.in: New file. - * Makefile.in: Now built with automake. - * aclocal.m4: Now built with aclocal. - * config.in, configure: Rebuild. - - From Ton van Overbeek : - * rcparse.y (dialog): Default menu and class to be named. - (styles): If FONT is seen, set DS_SETFONT in dialog style. - * resbin.c (res_to_bin_dialog): Correct computation of font - information length. - -Wed Jul 30 11:21:06 1997 Ian Lance Taylor - - From Ton van Overbeek : - * resbin.c (res_to_bin_menu): Correct computation of menu - vs. menuex length. - * resrc.c (define_stringtable): Add 1 to resource ID. - -Tue Jul 29 11:06:03 1997 Ian Lance Taylor - - * resbin.c (bin_to_res_string): Correct adjustment of data and - length. From Ton van Overbeek . - -Tue Jul 22 18:01:23 1997 Ian Lance Taylor - - * nlmconv.c (link_inputs): Call libiberty pexecute function. - (pexecute) [multiple versions]: Remove. - -Tue Jul 22 16:19:34 1997 Robert Hoehne - - * bucomm.c (make_tempname): If we might be using a DOS filesystem, - check for a backslash as well as a slash. - -Thu Jun 26 13:53:17 1997 Ian Lance Taylor - - * windres.c (main): Quit if we didn't get any resources. - (usage): Fix --yydebug usage message. - * rescoff.c (write_coff_file): Don't free the relocation array - until after we've closed the BFD. - (read_coff_rsrc): Quit rather than try to read standard input. - (write_coff_file): Quit rather than try to write to standard - output. - * rcparse.y: Add a couple of missing semicolons (accepted by bison - but not byacc). - * binutils.texi: Document windres. - -Wed Jun 25 20:57:06 1997 Ian Lance Taylor - - * resbin.c: New file. - * rclex.l, rcparse.y, rescoff.c, resrc.c, windres.c, windres.h: - Numerous fixes and improvements. - * Makefile.in: Rebuild dependencies. - (CFILES): Add resbin.c. - (WINDRES_OBJS): Add resbin.o. - -Sun Jun 22 17:29:41 1997 Ian Lance Taylor - - First stab at Windows resource compiler: - * windres.h: New file. - * windres.c: New file. - * resrc.c: New file. - * rcparse.y: New file. - * rclex.l: New file. - * rescoff.c: New file. - * configure.in: Define and substitute BUILD_WINDRES. - * configure: Rebuild. - * Makefile.in: Rebuild dependencies. - (WINDRES_PROG): New variable. - (PROGS): Add @BUILD_WINDRES@. - (HFILES): Add dlltool.h and windres.h. - (CFILES): Add windres.c and resrc.c. - (GENERATED_CFILES): Add rcparse.c and rclex.c. - (WINDRES_OBJS): New variable. - $(WINDRES_PROG): New target. - (rcparse.c, rcparse.h, rclex.c): New targets. - -Thu Jun 12 12:27:51 1997 Ian Lance Taylor - - * dlltool.c (export_type): Add data field. - (def_exports): Add data parameter. Change all callers. - (dump_def_info): Print data field. - (gen_def_file): Likewise. - (make_one_lib_file): Handle data field by not emitting simple - label and not emitting anything in SEC_TEXT. - (dtab): Print data field. - (process_duplicates): Merge data field. - * dlltool.h (def_exports): Update declaration. - * defparse.y (expline): Accept opt_DATA. Pass it to def_exports. - (opt_DATA): New non-terminal. - -Wed Jun 11 17:15:47 1997 Ian Lance Taylor - - * dlltool.h: New file. - * deflex.l: Include dlltool.h and libiberty.h. Don't declare - strdup. Use xstrdup rather than strdup. - * defparse.y: Include bfd.h, bucomm.h, and dlltool.h. - * dlltool.c: Include dlltool.h and time.h. Make a lot of - variables and functions static. Make a lot of char * variables - and parameters const. Add declarations for static functions. Do - some reindenting. Hide more PowerPC stuff inside DLLTOOL_PPC. - -Wed Jun 11 12:05:52 1997 H.J. Lu - - * ar.c (bfd_special_undocumented_glue): Add const. - -Mon May 12 22:09:35 1997 Bob Manson - - * Makefile.in (check): Pass CC_FOR_TARGET and CFLAGS_FOR_TARGET - to runtest. - -Mon May 12 13:14:22 1997 Ian Lance Taylor - - * configure.in: Don't clear OPCODES when --enable-commonbfdlib is - used on HP/UX. - * configure: Rebuild. - -Fri Apr 25 14:22:08 1997 H.J. Lu - - * Makefile.in (maintainer-clean realclean): Change *.info* - to binutils.info* to save sysroff.info. - -Tue Apr 15 13:42:22 1997 Ian Lance Taylor - - * Makefile.in (INSTALL): Set to @INSTALL@. - (INSTALL_XFORM, INSTALL_XFORM1): Remove. - (install): Depend upon installdirs. Use $(program_transform_name) - directly, rather than using $(INSTALL_XFORM) and - $(INSTALL_XFORM1). - (installdirs): New target. - (install-info): Run mkinstalldirs. - -Mon Apr 14 11:52:39 1997 Ian Lance Taylor - - * Makefile.in (INSTALL): Change install.sh to install-sh. - - From Thomas Graichen : - * Makefile.in: Always use $(SHELL) when running move-if-change. - * configure.in: Use ${CONFIG_SHELL} when running $ac_config_sub. - * configure: Rebuild. - -Fri Apr 4 13:28:02 1997 Ian Lance Taylor - - * configure.in: Add AC_FUNC_ALLOCA. - * configure, config.in: Rebuild. - * bucomm.h: Add alloca handling, copied from gas/as.h. - * dlltool.c: Add #pragma alloca for AIX to start of file. - * nlmconv.c: Likewise. - - * Makefile.in (distclean): Remove site.exp and site.bak. Remove - everything that clean removes. - -Thu Apr 3 13:18:39 1997 Ian Lance Taylor - - * Makefile.in (VERSION): Set to 2.8.1. - - * Branched binutils 2.8. - -Tue Apr 1 16:21:44 1997 Klaus Kaempf - - * configure.com: New file. - * config.h-vms: Remove file. - * makefile.vms: Update for new configure scheme. - -Mon Mar 31 15:30:43 1997 Philippe De Muyter - - * objcopy.c (make_same_dates): Use statbuf, not buf, if not - HAVE_GOOD_UTIME_H. - -Fri Mar 28 17:57:53 1997 Alan Modra - - * Makefile.in ($(OBJDUMP_PROG)): Don't link against BFDLIB twice. - * configure.in: Add AC_ARG_ENABLE for commonbfdlib. If it is set, - set OPCODES to empty. - * configure: Rebuild. - -Thu Mar 27 16:03:02 1997 Ian Lance Taylor - - Based on patch from Marty Leisner : - * objcopy.c: Include or . - (strip_options): Add "preserve-dates". - (copy_options): Likewise. - (copy_usage): Mention -p and --preserve-dates. - (strip_usage): Likewise. - (make_same_dates): New static function. - (strip_main): Handle -p. - (copy_main): Likewise. - * binutils.texi, strip.1, objcopy.1: Document new option. - - addr2line.c contributed by Ulrich Lauther - : - * addr2line.c: New file. - * Makefile.in: Rebuild dependencies. - (ADDR2LINE_PROG): New variable. - (MANPAGES): Add addr2line. - (PROGS): Add $(ADDR2LINE_PROG). - (CFILES): Add addr2line.c. - ($(ADDR2LINE_PROG)): New target. - * binutils.texi: Document addr2line. - * addr2line.1: New file. - - * version.c (print_version): Update copyright date. - -Mon Mar 24 10:52:45 1997 Andreas Schwab - - * objdump.c (disassemble_data): Don't exit if a file cannot be - disassembled, instead just return. - -Thu Mar 20 21:16:51 1997 Jeffrey A Law (law@cygnus.com) - - * size.c (usage): Make definition match its prototype. - (display_bfd, lprint_number, rprint_number): Likewise. - (print_berkeley_format, sysv_internal_printer): Likewise. - (print_sysv_format): Likewise. - * nm.c (set_print_radix, set_output_format): Likewise. - * objcopy.c (filter_bytes): Likewise. - -Tue Mar 18 16:39:55 1997 H.J. Lu - - * Many files: Add function prototypes. - * ar.c (mri_emul, get_pos_bfd): Make static. - * arlex.l: Include "libiberty.h". Don't declare strdup. Use - xstrdup rather than strdup. - * arparse.y (yyerror): Make argument const. Correct typo. - * arsup.c (strdup): Don't declare. - (ar_save): Use xstrdup rather than strdup. - * filemode.c: Include "bucomm.h". - * nm.c (usage): Make static. - (print_symname): Make format and name const. - * objcopy.c (cat): Remove. - (copy_archive): Make output_target const. Use concat, not cat. - (copy_file, simple_copy, smart_rename): Make arguments const. - * objdump.c (read_section_stabs): Likewise. - (print_section_stabs): Likewise. - (display_target_tables): Don't declare getenv. - * strings.c (strings_object_file): Change file to const. - (print_strings): Change filename to const. - * Makefile.in: Rebuild dependencies. - -Tue Mar 18 11:37:24 1997 Ian Lance Taylor - - * configure.in: Add BFD_NEED_DECLARATION(getenv). - * acconfig.h: Add NEED_DECLARATION_GETENV. - * bucomm.h (getenv): Declare if NEED_DECLARATION_GETENV. - * configure, config.in: Rebuild. - * nlmconv.c (getenv): Don't declare. - - * Makefile.in: Rebuild dependencies. - -Sat Mar 15 15:35:56 1997 Ian Lance Taylor - - Based on patches from Jamie Lokier : - * objdump.c: Include "demangle.h". - (do_demangle): New static variable. - (usage): Mention -C/--demangle. - (long_options): Add "demangle". - (objdump_print_symname): New static function. - (objdump_print_addr_with_sym): Use objdump_print_symname. - (disassemble_bytes): Likewise. - (dump_reloc_set): Likewise. - (dump_symbols): Demangle symbol name. - (main): Handle -C. - * binutils.texi, objdump.1: Document -C/--demangle. - - * objdump.c (usage): Mention --no-show-raw-insn. - (long_options): Add "no-show-raw-insn". - (disassemble_bytes): Handle --no-show-raw-insn. - * binutils.texi, objdump.1: Document --no-show-raw-insn. - -Wed Mar 12 11:42:00 1997 Andreas Schwab - - * rddbg.c (free_saved_stabs): Set the strings to NULL after being - freed. - -Fri Feb 28 17:18:45 1997 Ian Lance Taylor - - * bucomm.c (set_default_bfd_target): New function. - * bucomm.h (set_default_bfd_target): Declare. - * ar.c (main): Call set_default_bfd_target. - * nlmconv.c (main): Likewise. - * nm.c (main): Likewise. - * objcopy.c (main): Likewise. - * objdump.c (main): Likewise. - * size.c (main): Likewise. - * strings.c (main): Likewise. - * Makefile.in (bucomm.o): New target, to define TARGET. - -Tue Feb 25 21:28:38 1997 Ian Lance Taylor - - * objdump.c (adjust_section_vma): New static variable. - (usage): Mention --adjust-section-vma. - (OPTION_ADJUST_VMA): Define. - (long_options): Add "addjust-vma". - (display_bfd): If adjust_section_vma is not 0, add it to all the - section addresses. - (main): Handle OPTION_ADJUST_VMA. - * binutils.texi, objdump.1: Document --adjust-vma. - -Fri Feb 14 18:46:47 1997 Ian Lance Taylor - - * nm.c (print_symbol): Cache the BFD as well as the symbols and - relocs, and don't try to use the symbols or relocs with a - different BFD. - -Thu Feb 13 21:34:43 1997 Klaus Kaempf (kkaempf@progis.de) - - * config.h-vms: sbrk() is provided on openVMS/Alpha. - * makefile.vms: allow compiling with current gcc snapshot. - -Thu Feb 13 20:14:40 1997 Ian Lance Taylor - - * arsup.c, coffgrok.c, dlltool.c, nlmconv.c: Use xmalloc rather - than malloc. - -Wed Feb 12 16:12:02 1997 Ian Lance Taylor - - * objdump.c (disassemble_data): Correct VMA argument to - find_symbol_for_address. Improve handling of code with no symbol - followed by code with a symbol. - -Wed Feb 12 12:16:47 1997 Andreas Schwab - - * objdump.c (disassemble_bytes): Make output of raw instructions - work better for non-standard values of bytes_per_chunk and - bytes_per_line. - -Thu Feb 6 14:14:59 1997 Martin M. Hunt - - * objdump.c (disassemble_bytes): Added code to allow some control - over the way raw instructions are displayed. - -Thu Feb 6 12:36:03 1997 Ian Lance Taylor - - * stabs.c (struct bincl_file): Add next_stack field. - (push_bincl): Put the new file on both bincl_list and - bincl_stack. Clear the file_types field. - (pop_bincl): Use the next_stack field when popping the stack. - Don't put the file on bincl_list. - (find_excl): Include the file name when warning about an unfound - N_EXCL. - - * debug.c (debug_type_samep): Don't crash if we are passed NULL. - -Thu Feb 6 11:54:24 1997 Alan Modra - - * objcopy.1: Add missing space after .B. - -Fri Jan 31 10:33:07 1997 Andreas Schwab - - * objdump.c (disassemble_data): Initialize `aux.require_sec'. - -Wed Jan 29 13:21:21 1997 Ian Lance Taylor - - * objdump.c (objdump_print_value): Add skip_zeroes parameter. - Change all callers. - (objdump_print_addr_with_sym): Likewise. Call objdump_print_value - to print address. - (objdump_print_addr): New static function. - (objdump_print_address): Just call objdump_print_addr. - (disassemble_bytes): Print real address, not function offset. - Skip a certain number of leading zeroes. - - * objdump.c (disassemble_zeroes): New static variable. - (usage): Mention --disassemble-zeroes. - (long_options): Add "disassemble-zeroes". - (disassemble_bytes): Check disassemble_zeroes. - -Tue Jan 28 16:47:26 1997 Ian Lance Taylor - - * objdump.c (disassemble_bytes): Don't skip zeroes if the - disassembler has told us that we are in a branch delay slot. - -Mon Jan 20 14:24:04 1997 Ian Lance Taylor - - * size.c (berkeley_sum): Rewrite. Skip sections which are not - SEC_ALLOC. Count SEC_READONLY sections as text. - -Tue Jan 14 15:14:14 1997 Ian Lance Taylor - - * Makefile.in (maintainer-clean realclean): Remove *.info*, not - just *.info. From H.J. Lu . - -Tue Dec 31 15:42:54 1996 Ian Lance Taylor - - * Makefile.in (ALL_CFLAGS): Add -D_GNU_SOURCE. - -Fri Dec 27 11:19:26 1996 Ian Lance Taylor - - * configure.in: Work around bug in AC_FUNC_VFORK in autoconf 2.12. - * configure: Rebuild. - -Thu Dec 19 13:11:20 1996 Ian Lance Taylor - - Based on patch from Andrew J Klossner : - * objcopy.c (OPTION_WEAKEN): Define. - (copy_options): Add "weaken". - (copy_usage): Mention --weaken. - (weaken): New static variable. - (filter_symbols): Handle weaken. - (copy_object): Call filter_symbols if weaken. - (copy_main): Handle OPTION_WEAKEN. - * binutils.texi, objcopy.1: Document --weaken. - -Wed Dec 18 22:49:13 1996 Stan Shebs - - * mpw-make.sed: Use NewFolderRecursive for installation. - -Sat Dec 7 10:17:25 1996 Jeffrey A Law (law@cygnus.com) - - * Makefile.in (install): Add "else true" clause to cater to - broken "make" on some systems. - -Fri Dec 6 17:21:41 1996 Ian Lance Taylor - - * ieee.c (parse_ieee_bb): Always initialize namcopy to avoid gcc - warning about uninitialized variable. - (ieee_read_cxx_class): Likewise, for pf. - (ieee_enum_type): Likewise, for i. - -Tue Nov 26 17:01:25 1996 Ian Lance Taylor - - * wrstabs.c (stab_array_type): Add casts when printing - bfd_signed_vma values. - - * configure: Rebuild with autoconf 2.12. - -Mon Nov 25 16:53:18 1996 Ian Lance Taylor - - * objdump.c (disassemble_data): Don't crash if there is no - symbol. - -Fri Nov 22 17:29:14 1996 Andreas Schwab - - * ar.c (open_inarch): Don't call bfd_openr with a null name. - -Fri Nov 1 12:08:13 1996 Ian Lance Taylor - - * binutils.texi: Add section on reporting bugs. - -Thu Oct 31 18:20:53 1996 Ian Lance Taylor - - * stabs.c (struct stab_handle): Add bincl_list field. - (parse_stab): Pass value to push_bincl. Call find_excl for - N_EXCL. - (struct bincl_file): Add hash, file and file_types fields. - (push_bincl): Add hash parameter. Save it in the new hash field. - Save the file number in the new file field. - (pop_bincl): Put the bincl_file on bincl_list, rather than freeing - it. Save the file types in the new file_types field. - (find_excl): New static function. - - * ieee.c (ieee_lineno): Don't compare line number addresses to - info->highaddr (undo part of October 28 patch). - -Tue Oct 29 16:40:22 1996 Ian Lance Taylor - - * objdump.c (objdump_print_value): Don't print the empty string - for zero. - -Mon Oct 28 16:58:14 1996 Ian Lance Taylor - - * stabs.c (struct stab_handle): Add function_end field. - (start_stab): Initialize function_end. - (finish_stab): Pass info->function_end to debug_end_function. - (parse_stab): If info->function_end is set, use it as the address - which ends a function. - - * ieee.c (ieee_array_type): Remember the correct size. - - * ieee.c (ieee_finish_compilation_unit): Permit coalescing ranges - that are up to 0x1000 bytes apart, not just 64. - (ieee_add_bb11_blocks): Don't bother to emit a BB11 that is less - than 0x100 bytes. - (ieee_lineno): Only emit line numbers that are less than - info->highaddr. - -Fri Oct 25 12:12:17 1996 Ian Lance Taylor - - * ieee.c (struct ieee_defined_enum): Add defined field. - (ieee_enum_type): If the enum tag has been seen before but not - defined, reuse the same type index, and define it. - (ieee_tag_type): If this enum has not been defined, add an - undefined entry to the list of enums. - - * objdump.c (disassemble_bytes): Let the disassembler override the - number of bytes printed on a line. - -Thu Oct 24 16:42:10 1996 Ian Lance Taylor - - * objdump.c (prefix_addresses): New static variable. - (long_options): Add "prefix-addresses". - (compare_symbols): Sort BSF_FUNCTION symbols before other - symbols. - (find_symbol_for_address): New static function, broken out of - objdump_print_address. - (objdump_print_addr_with_sym): New static function, broken out of - objdump_print_address. - (objdump_print_address): Call new functions. - (disassemble_bytes): New static function, broken out of - disassemble_data. Change disassembly format, unless - prefix_addresses is set. - (disassemble_data): Call disassemble_bytes. Unless - prefix_addresses is set, disassemble in chunks headed by a - symbol. - * binutils.texi, objdump.1: Document --prefix-addresses. - - * rddbg.c (read_section_stabs_debugging_info): Preserve the - backslash when concatenating multiple stabs strings. - -Thu Oct 10 11:36:31 1996 Doug Evans - - * dlltool.c (scan_open_obj_file): Fix loop exit test. - Add missing parameter to def_exports. - -Tue Oct 8 12:06:17 1996 Ian Lance Taylor - - * Makefile.in (LEX_OPTIONS): Set to empty string. -I -Cem is the - default for flex, and is not recognized by lex. - -Thu Oct 3 17:41:23 1996 Ian Lance Taylor - - * binutils.texi (Target Selection): Document that you can now - specify targets using configuration triplets. - - * ar.c (usage): Declare. Make sure all callers pass an argument. - -Thu Oct 3 15:39:42 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * Makefile.in (clean): Remove config.log. - -Wed Oct 2 15:49:16 1996 Klaus Kaempf - - * makefile.vms: Bump version date. - -Tue Oct 1 15:00:59 1996 Ian Lance Taylor - - * version.c (print_version): New function. - * bucomm.h (print_version): Declare. - * ar.c (program_version): Don't declare. - (do_show_version): Remove. - (usage): Add help parameter. Print bug report address. - (main): Set is_ranlib at start. Check for --help and --version. - Call print_version, not do_show_version. - * nlmconv.c (program_version): Don't declare. - (main): Call print_version. - (show_usage): Print bug report address. - * nm.c (program_version, print_version): Don't declare. - (usage): Print bug report address. - (main): Call print_version. - * objcopy.c (program_version): Don't declare. - (copy_usage): Print bug report address. - (strip_usage): Likewise. - (strip_main): Call print_version. - (copy_main): Likewise. - * objdump.c (program_version): Don't declare. - (usage): Print bug report address. - (main): Call print_version. - * size.c (program_version): Don't declare. - (usage): Print bug report address. - (main): Call print_version. - * strings.c (program_version): Don't declare. - (main): Call print_version. - (usage): Print bug report address. - * Makefile.in: Update dependencies. - -Thu Sep 19 14:53:15 1996 Ian Lance Taylor - - * ieee.c: Revert Monday's reflocalp patch, and apply this patch - instead: - (write_ieee_debugging_info): Write a dummy type at the end of the - global type block. - -Mon Sep 16 15:30:54 1996 Ian Lance Taylor - - * ieee.c (struct ieee_write_type): Add reflocalp field. - (ieee_pointer_type): Set reflocalp after pushing type. - (ieee_function_type): If reflocalp is set, make this type local. - (ieee_range_type, ieee_array_type, ieee_set_type): Likewise. - (ieee_const_type, ieee_volatile_type): Likewise. - (ieee_struct_field, ieee_class_baseclass): Likewise. - - * ieee.c (struct ieee_info): Add global_types field. - (parse_ieee_bb): When starting a BB1, initialize the types field - to the global_types field. - (parse_ieee_be): When ending a BB2, copy the types field to the - global_types field. - -Fri Sep 13 17:32:21 1996 Ian Lance Taylor - - * objcopy.c (change_leading_char): New static variable. - (OPTION_CHANGE_LEADING_CHAR): Define. - (copy_options): Add "change-leading-char". - (copy_usage): Mention --change-leading-char. - (filter_symbols): Add obfd parameter. Change all callers. - Implement change_leading_char. - (copy_object): Call filter_symbols if change_leading_char. - (copy_main): Handle OPTION_CHANGE_LEADING_CHAR. - * binutils.texi, objcopy.1: Document --change-leading-char. - -Tue Sep 3 14:05:29 1996 Ian Lance Taylor - - * ieee.c (ieee_enum_type): Don't check index into a NULL names - array. - * nm.c (sort_symbols_by_size): Always initialize next. - * rdcoff.c (parse_coff_type): Warn about an incomprehensible - type rather than crashing. - * rddbg.c (read_symbol_stabs_debugging_info): Initialize f. - * stabs.c (parse_stab_members): Set context in all cases. - -Thu Aug 29 16:56:52 1996 Michael Meissner - - * configure.in (i[345]86-*-*): Recognize i686 for pentium pro. - * configure: Regenerate. - -Thu Aug 29 11:29:20 1996 Ian Lance Taylor - - * objdump.c (L_tmpnam): Never define. - (display_target_list): Use choose_temp_base instead of tmpnam. - (display_info_table): Likewise. - -Tue Aug 27 18:15:01 1996 Ian Lance Taylor - - * stabs.c (parse_stab): An N_FUN symbol with an empty string - indicates the end of a function. - -Thu Aug 22 17:08:00 1996 Ian Lance Taylor - - * wrstabs.c (struct string_hash_entry): Add next field. - (struct stab_write_handle): Change strings to a pointer to - string_hash_entry. Add last_strings field. Remove strings_alloc - field. - (string_hash_newfunc): Initialize next field. - (stab_write_symbol): Copy string into hash table rather than into - buffer. Keep a list of hash table entries. - (write_stabs_in_sections_debugging_info): Initialize last_string. - Copy strings from list of hash table entries in memory. - (stab_modify_type): If the entry on the stack is a definition, - make a new definition rather than failing an assert. - (stab_array_type): The size is only zero if high is strictly less - than low. - - * ieee.c (struct ieee_info): Add saw_filename field. - (parse_ieee): Initialize saw_filename. - (parse_ieee_bb): Set saw_filename for a BB1 or BB2. In a BB1, - discard the current variables and types. In a BB10, if no - filename has been seen, call debug_set_filename. - (parse_ieee_ty): In case 'g', the type is optional. - - * prdbg.c (pr_fix_visibility): Don't abort on - DEBUG_VISIBILITY_IGNORE. - - * debug.c (debug_name_type): Correct error message. - - * configure.in: Substitute HLDENV. - * configure: Rebuild. - * Makefile.in (HLDENV): New variable. Use it whenever linking a - program. - -Thu Aug 15 19:30:41 1996 Stan Shebs - - * mpw-make.sed: Add symbolic doublequotes around the version - number. - -Thu Aug 8 12:27:52 1996 Klaus Kaempf - - * makefile.vms: Add better support for DEC C compilation. - Add new macros as in Makefile.in. - -Wed Aug 7 14:27:33 1996 Philippe De Muyter - - * configure.in: Call BFD_NEED_DECLARATION on strstr and sbrk. - * acconfig.h (NEED_DECLARATION_STRSTR): New macro. - (NEED_DECLARATION_SBRK): New macro. - * configure, config.in: Rebuild. - * bucomm.h (strstr): Declare if NEED_DECLARATION_STRSTR. - (sbrk): Declare if HAVE_SBRK and NEED_DECLARATION_SBRK. - - * prdbg.c (pr_end_struct_type): Avoid using a string constant in - assert, for the benefit of broken assert macros. - -Fri Jul 26 14:06:50 1996 Ian Lance Taylor - - * objdump.c (disassemble_data): Set disasm_info.flavour from - abfd. - -Tue Jul 23 13:59:54 1996 Ian Lance Taylor - - * dlltool.c (secdata): In non DLLTOOL_PPC case, change alignment - of .text section to 2. - -Mon Jul 22 08:46:15 1996 Stu Grossman (grossman@lisa.cygnus.com) - - * objdump.c (dump_section_stabs): Fix test for stabs sections - ending with numbers. This fixes a problem with .stab being - confused with .stab.index. - -Wed Jul 10 13:32:28 1996 Ian Lance Taylor - - * stabs.c (stab_demangle_fund_type): Return a void * for a - template, rather than simply aborting. - -Mon Jul 8 15:28:05 1996 Ian Lance Taylor - - * ar.c (open_inarch): Add file parameter. Change all callers. If - this is a newly created archive, set the target based on the - file. - * arsup.h (open_inarch): Update declaration. - -Thu Jul 4 12:00:55 1996 Ian Lance Taylor - - * Makefile.in (VERSION): Set to cygnus-2.7.1. - - * Released binutils 2.7. - - * rdcoff.c (parse_coff): Get address to pass to debug_end_function - from function size, not value of .ef symbol. From Ning - Mosberger-Tang . - -Sat Jun 29 21:18:09 1996 Ian Lance Taylor - - * objcopy.c (strip_main): Add -o option, and handle it. - (strip_usage): Mention -o. - * binutils.texi, strip.1: Mention -o. - -Mon Jun 24 17:19:02 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) - - * Makefile.in (bindir, libdir, datadir, mandir, infodir, includedir, - INSTALL_PROGRAM, INSTALL_DATA): Use autoconf set values. - (docdir): Removed. - * configure.in (AC_PREREQ): Autoconf 2.5 or higher. - -Mon Jun 24 11:59:13 1996 Ian Lance Taylor - - * objdump.c (endian): New static variable. - (usage): Mention -EB/-EL/--endian. - (long_options): Add "endian". - (disassemble_data): If endianness was specified, replace - abfd->xvec with a copy of itself with the given endianness. - (main): Handle -EB/-EL/--endian. - * binutils.texi, objdump.1: Mention -EB/-EL/--endian. - - * objdump.c: Make most variables and functions static. - - * configure.in: On alpha*-*-osf*, link against libbfd.a if not - using shared libraries. - * configure: Rebuild with autoconf 2.10. - -Sun Jun 23 14:47:36 1996 Kim Knuttila - - * dlltool.c (secdata): Changed .rdata to .reldata so .reloc will work. - (make_one_lib_file): Removed cruft. (#if 1) - -Wed Jun 19 14:46:38 1996 Ian Lance Taylor - - * objdump.c (stabs): Change from struct internal_nlist * to - bfd_byte *. - (print_section_stabs): Fetch stabs information directly, rather - than assuming that struct internal_nlist is the right size. - - * binutils.texi: Document change to binary format: file position - based on load address, not section VMA. - - * bucomm.h: Define SEEK_SET, SEEK_CUR, and SEEK_END if they are - not already defined. - -Tue Jun 18 18:25:00 1996 Ian Lance Taylor - - * Makefile.in (DISTSTUFF): Add deflex.c. - -Tue Jun 18 15:03:44 1996 Klaus Kaempf - - * config.h-vms, makefile.vms: New files. - -Mon Jun 17 09:47:31 1996 Ian Lance Taylor - - * dlltool.c (make_one_lib_file): Use BFD_RELOC_RVA rather than - BFD_RELOC_32 in IDATA7. - -Wed Jun 12 11:52:06 1996 Ian Lance Taylor - - * nm.c (struct get_relocs_info): Define. - (line_numbers): New static variable. - (long_options): Add "line-numbers". - (usage): Mention -l and --line-numbers. - (main): Handle -l. - (print_symbol): Print line numbers if requested. - (get_relocs): New static function. - * binutils.texi, nm.1: Document -l/--line-numbers. - -Tue Jun 11 20:12:15 1996 Ian Lance Taylor - - * objdump.c (dump_reloc_set): Add sec parameter. Change all - callers. If with_line_numbers is set, display line numbers of - relocation entries. - * binutils.texi, objdump.1: Document -l with -r. - -Mon Jun 10 23:42:59 1996 Ian Lance Taylor - - * ar.c (open_inarch): Report BFD error message if an archive can - not be recognized. List matching formats if the file is - ambiguously recognized. - (ranlib_touch): Likewise. - -Thu Jun 6 13:56:14 1996 Ian Lance Taylor - - * README: Add notes on how to build if you don't have ar. - - * Makefile.in: Remove old incorrect setting of CC. - -Tue Jun 4 10:52:49 1996 Tom Tromey - - * Makefile.in (install): Don't check to see if tooldir exists. - Make $(tooldir) and $(tooldir)/bin. - -Mon Jun 3 17:40:23 1996 Michael Meissner - - * strings.c (main): Make main an int function, not void. - -Fri May 31 13:59:24 1996 Ian Lance Taylor - - * nm.c (filter_symbols): Check for BSF_WEAK as well as - BSF_GLOBAL. - * objcopy.c (filter_symbols): Likewise. - -Wed May 8 16:57:20 1996 Ian Lance Taylor - - * objcopy.c (copy_object): Make clear that it is only a warning - when the output file can not represent the architecture. - -Fri May 3 11:30:17 1996 Ian Lance Taylor - - * objdump.c (disassemble_data): Don't refer to bytes past the end - of data. - -Wed Apr 24 14:10:21 1996 Ian Lance Taylor - - * rddbg.c (read_symbol_stabs_debugging_info): Move call to - free_saved_stabs outside the loop over the symbols. - -Tue Apr 23 12:56:11 1996 Ian Lance Taylor - - * objdump.c (compare_symbols): Sort symbols whose names start with - `.' after other symbols. If no other decision can be made, sort - symbols by name. - -Thu Apr 18 16:02:11 1996 Ian Lance Taylor - - * dep-in.sed: Substitute $(BFDDIR) for @BFDDIR@. - * Makefile.in: Rebuild dependencies. - (dep.sed): Substitute $(BFDDIR) for @BFDDIR@. - -Tue Apr 16 13:50:22 1996 Ian Lance Taylor - - * rdcoff.c: New file. - * rddbg.c (read_debugging_info): Read COFF symbols if COFF flavour - and no stabs were found. - * budbg.h (parse_coff): Declare. - * Makefile.in: Rebuild dependencies. - (CFILES): Add rdcoff.c. - (DEBUG_OBJS): Add rdcoff.o. - -Mon Apr 15 15:55:01 1996 Doug Evans - - * nlmconv.c (choose_temp_base{,_try}): Delete, in libiberty now. - (link_inputs): Update call to choose_temp_base. - -Mon Apr 8 14:40:05 1996 Ian Lance Taylor - - * configure.in: Permit --enable-shared to specify a list of - directories. - * configure: Rebuild. - -Fri Mar 29 16:11:33 1996 Ian Lance Taylor - - * objdump.c (dump_section_header): Print the SEC_LINK_ONCE flag - and the SEC_LINK_DUPLICATES field. - -Fri Mar 29 11:35:55 1996 J.T. Conklin (jtc@lisa.cygnus.com) - - * nlmconv.1: Changed to be recognized by catman -w on Solaris. - -Thu Mar 28 14:17:02 1996 Ian Lance Taylor - - * wrstabs.c (stab_enum_type): Set buf before using it. - -Fri Mar 22 15:49:08 1996 Ian Lance Taylor - - * stabs.c (struct stab_handle): Add field abfd. - (start_stab): Add abfd parameter. - (parse_stab_string): Skip the symbol leading char when searching - for the value of a global symbol. - * budbg.h (start_stab): Update declaration. - * rddbg.c (read_section_stabs_debugging_info): Pass abfd to - start_stab. - (read_symbol_stabs_debugging_info): Likewise. - -Thu Mar 21 12:40:48 1996 Ian Lance Taylor - - * wrstabs.c (stab_function_type): Output an empty typedef for an - unused argument, rather than making up a meaningless name. - (stab_variable): Use N_RSYM for a DEBUG_REGISTER variable. - - * ieee.c (struct ieee_info): Add global_vars field. - (parse_ieee_be): When ending the global typedef block, copy the - variables into info->global_vars. - (parse_ieee_atn): Don't require an NN record for a pmisc ATN. - (ieee_read_reference): Search the global variables after the local - variables. - -Wed Mar 20 18:08:19 1996 Andreas Schwab - - * objdump.c (disassemble_data): Make sure sym_name is always set. - (dump_section_header): Always put a space after the section name. - (dump_bfd_header): Terminate output with newline. - -Wed Mar 20 16:35:20 1996 Ian Lance Taylor - - * wrstabs.c: New file. - * budbg.h (write_stabs_in_sections_debugging_info): Declare. - * objcopy.c (write_debugging_info): For COFF or ELF, output stabs - in sections. - * Makefile.in: Rebuild dependencies. - (CFILES): Add wrstabs.c. - (WRITE_DEBUG_OBJS): New variable. - ($(OBJCOPY_PROG)): Use $(WRITE_DEBUG_OBJS), not $(DEBUG_OBJS). - ($(STRIP_PROG)): Likewise. - - * stabs.c (parse_stab_members): Make type stub detection more like - gdb. - - * ieee.c (struct ieee_handle): Add fields complex_float_index and - complex_double_index. - (ieee_complex_type): Cache type index in complex_float_index and - complex_double_index, depending upon size. Set size on type stack - to size * 2. - - * ieee.c (ieee_empty_type): Use builtin_unknown, not 0. - (ieee_void_type): Use builtin_void, not 1. - - * ieee.c (parse_ieee_ty): Handle 'V' type code. - (parse_ieee_atn): Don't require two numbers for type 10. - - * ieee.c (parse_ieee_be): Add one to offset at end of function or - block. - - * ieee.c (struct ieee_block): Add field skip. - (parse_ieee_bb): Don't call debug_record_function for __XRYCPP - function, and set skip field. - (parse_ieee_be): Don't call debug_end_function if skip is set. - - * debug.c (struct debug_handle): Add fields current_write_lineno - and current_write_lineno_index. - (debug_write): Initialize current_write_lineno and - current_write_lineno_index for each unit. Call - debug_write_linenos rather than writing out the line numbers - directly. - (debug_write_function): Call debug_write_linenos. - (debug_write_block): Likewise. - (debug_write_linenos): New static function. - - * debug.c (debug_write_type): For DEBUG_KIND_FUNCTION, push return - type before arguments. - -Mon Mar 18 18:05:33 1996 Ian Lance Taylor - - * configure.in: Add AC_FUNC_VFORK. - * configure, config.in: Rebuild. - * dlltool.c, nlmconv.c: Include if HAVE_VFORK_H is - defined. - - * stabs.c (parse_stab_range_type): A complex type is defined as a - subrange of itself with the high bound zero. - * ieee.c (ieee_complex_type): Don't crash on sizes of 12 or 16. - -Tue Mar 12 12:09:43 1996 Ian Lance Taylor - - * ieee.c (ieee_write_undefined_tag): Switch to global_types even - if it is not empty. - (ieee_tag_type): For an enum, look through info->enums. - - * configure: Rebuild with autoconf 2.8. - - * debug.c (debug_type_samep): Don't loop endlessly in - DEBUG_KIND_ENUM case. From Eric Baur . - -Mon Mar 11 12:35:03 1996 Ian Lance Taylor - - * rddbg.c (read_section_stabs_debugging_info): Call save_stab for - each stab entry, call stab_context on an error, and call - free_saved_stabs before rturning. - (read_symbol_stabs_debugging_info): Likewise. - (SAVE_STABS_COUNT): Define. - (struct saved_stab): Define. - (saved_stabs, saved_stabs_index): New static variables. - (save_stab, stab_context, free_saved_stabs): New static functios. - - * objdump.c (stab_name): Remove. - (struct stab_print): Remove. - (stab_print): Remove. - (dump_stabs): Don't initialize stab_name. - (print_section_stabs): Call bfd_get_stab_name rather than using - the stab_name array. - -Tue Feb 27 19:52:01 1996 Ian Lance Taylor - - * prdbg.c (pr_int_constant): Initialize info correctly. - (pr_float_constant): Likewise. - -Mon Feb 26 18:11:37 1996 Stan Shebs - - * mpw-make.sed: Update to handle shared library support. - -Sat Feb 24 11:21:49 1996 Alan Modra : - - * Makefile.in ($(OBJDUMP_PROG)): Search $(BFDLIB) before - $(OPCODES). - -Thu Feb 15 12:44:45 1996 Ian Lance Taylor - - * configure.in: Don't tamper with LDFLAGS. Call AC_PROG_CC before - configure.host. - * configure: Rebuild. - - * configure.in: Substitute RPATH_ENVVAR. - * configure: Rebuild. - * Makefile.in (RPATH_ENVVAR): New variable. - (check): Use $(RPATH_ENVVAR) rather than LD_LIBRARY_PATH. - - * objcopy.c (smart_rename): Rather than doing chmod then chown, do - chmod without setuid, then chown, then chmod with setuid. - -Wed Feb 14 16:46:42 1996 Martin Anantharaman - - * arsup.c (map_over_list): Reindent. Don't assume that the - function does not delete the BFD. - (ar_addlib_doer): Don't set prev->next if prev is NULL. - -Wed Feb 14 15:12:17 1996 Ian Lance Taylor - - * ieee.c (ieee_regno_to_genreg): Convert register numbers for m68k - and i960. - (ieee_genreg_to_regno): Likewise. - -Mon Feb 12 14:19:59 1996 Ian Lance Taylor - - * ieee.c: Extensive changes to write code to put types in the - global type block when possible, to output ranges for all memory - occupied by the module, and to improve efficiency. - - * debug.c (struct debug_handle): Remove class_mark field. Add - id_list and compare_list fields. - (struct debug_class_id): Define. - (struct debug_type_compare_list): Define. - (debug_write): Initialize info->id_list - (debug_write_name): Remove reference to info->class_mark. - (debug_write_type): Get id for all structs and classes. Simplify - test for whether struct has already been written. - (debug_write_class_type): Get id for all classes. Simplify test - for whether class has already been written. - (debug_write_block): Don't write out blocks other than the top - level block if they have no local variables. - (debug_set_class_id): New static function. - (debug_type_samep): New static function. - (debug_class_type_samep): New static function. - * prdbg.c (pr_start_struct_type): Always print id. - (pr_start_class_type): Likewise. - (pr_tag_type): Likewise. - - * stabs.c (struct stab_handle): Add syms and symcount fields. - (start_stab): Add syms and symcount parameters. Change all - callers. - (parse_stab_string): Look up global variables in the symbol table - to get the right value. - * budbg.h (start_stab): Update declaration. - * rddbg.c (read_section_stabs_debugging_info): Add syms and - symcount parameters. Change all callers. - - * stabs.c (parse_stab_array_type): If the index type is 0, use - int. - -Wed Feb 7 14:17:45 1996 Ian Lance Taylor - - * ieee.c (ieee_start_compilation_unit): Clear modified and - modified_alloc fields of info. - - * configure.in: Check for --enable-shared. Substitute new - variables BFDLIB and OPCODES. - * configure: Rebuild. - * Makefile.in (BFDLIB): Set to @BFDLIB@. - (OPCODES): Set to @OPCODES@. - -Mon Feb 5 16:18:42 1996 Ian Lance Taylor - - Support for building bfd and opcodes as shared libraries, based on - patches from Alan Modra : - * configure.in (HLDFLAGS): New substitution. - * configure: Rebuild. - * Makefile.in (HLDFLAGS): New variable. Make all links use - $(HLDFLAGS) before $(CFLAGS) and $(LDFLAGS). - (BFDLIB_DEP): New variable. Replace all occurrences of $(BFD) as - a dependency with $(BFDLIB_DEP). Remove $(BFD) as a dependency if - there is also a dependency on $(ADDL_DEPS). - (BFDLIB): Rename from BFD; change all uses; set to -L../bfd -lbfd. - (OPCODES_DEP): New variable. Replace all occurrends of $(OPCODES) - as a dependency with $(OPCODES_DEP). - (OPCODES): Set to -L../opcodes -lopcodes. - (ADDL_DEPS): New variable. Replace all occurrences of - $(ADDL_LIBS) as a dependency with $(ADDL_DEPS). - (check): Set LD_LIBRARY_PATH in the environment. - (config.status): Depend upon BFD configure.host and config.bfd. - -Fri Feb 2 17:02:59 1996 Doug Evans - - * objdump.c: #include stdarg.h or varargs.h. - (objdump_print_value): Change FILE* arg to struct disassemble_info*. - All callers updated. Use fprintf_func. - (objdump_print_address): Consistently use fprintf_func. - (objdump_sprintf): New function. - (disassemble_data): Print insn into a buffer, print raw insn ourselves, - then print insn mnemonic. - -Fri Feb 2 16:48:55 1996 Ian Lance Taylor - - * configure: Regenerate. - -Thu Feb 1 09:38:18 1996 Steve Chamberlain - - * configure.in (i[3-6]86-*-win32): Becomes i[3-6]86-*-cygwin32. - (powerpc*-*-cygwin32): New. - * configure: Regenerated. - -Wed Jan 31 13:22:03 1996 Richard Henderson - - * Makefile.in (distclean): Remove $(DEMANGLER_PROG).1. - -Mon Jan 29 17:36:29 1996 Ian Lance Taylor - - Based on patches from H J Lu : - * objcopy.c (remove_leading_char): New static variable. - (OPTION_REMOVE_LEADING_CHAR): Define. - (copy_usage): Mention --remove-leading-char. - (filter_symbols): If remove_leading_char, and the first character - of a global symbol matches the symbol leading char of the BFD, - remove the first character. - (copy_object): Filter the symbols if remove_leading_char is set. - (copy_main): Handle --remove-leading-char. - * binutils.texi, objcopy.1: Document --remove-leading-char. - -Sat Jan 27 15:40:13 1996 Michael Meissner - - * objdump.c (fprintf): Add prototype to avoid compiler warning on - SunOS. - -Fri Jan 26 11:53:42 1996 Ian Lance Taylor - - * binutils.texi (nm): Improve documentation on symbol types. - (objdump): Reference the stabs manual from the discussion of the - --stabs option. - -Thu Jan 25 11:21:46 1996 Raymond Jou - - * mpw-make.sed: Add a "stamps" target. - -Thu Jan 25 13:51:44 1996 Ian Lance Taylor - - * objdump.c (dump_headers, dump_section_header): Change objdump -h - output to be simpler and to include section file offsets. - -Wed Jan 24 12:06:05 1996 Ian Lance Taylor - - * stabs.c (parse_stab_members): Don't adjust voffset. - - * ieee.c (ieee_read_cxx_class): Don't multiply voffset by 4. - (struct ieee_write_type): Add name field. - (struct ieee_type_class): Remove name field. Change all uses to - use new name field in type instead. - (struct ieee_name_type): Likewise. - (ieee_start_struct_type): Initialize name field of type. - (ieee_start_class_type): Don't initialize classdef entry of tag. - (ieee_class_method_var): Don't adjust voffset. - (ieee_end_class_type): Likewise. - (ieee_tag_type): Initialize new name field of type. - (ieee_typdef): Set name after copying in type information. - - * debug.c (VOFFSET_STATIC_METHOD): Define as -1, not 1. - - * ieee.c (struct ieee_modified_type): Define. - (struct ieee_handle): Add modified and modified_alloc fields. - (ieee_get_modified_info): New static function. - (ieee_pointer_type): Cache type index. - (ieee_const_type): Likewise. - (ieee_volatile_type): Likewise. - - * ieee.c (ieee_define_named_type): When creating a tag for an - anonymous struct, copy the name into memory. - (ieee_tag_type): Likewise. - * debug.c (debug_write_type): Only check and set id field for an - unnamed object. - (debug_write_class_type): Likewise. - - * ieee.c: Various changes to write out types for functions and - references, and to not write out unnecessary function types. - - * ieee.c (struct ieee_var): Remove variable field. Add kind - field, and define some enum constants for it. - (parse_ieee_ty): Set kind field of variable for 'x' and 'X' types. - (parse_ieee_atn): Make an indirect slot for an external variable, - although we otherwise don't record it. Set kind field rather than - variable field of pvar. - (ieee_read_cxx_class): Try to get the type of a static member. - (ieee_read_reference): Check kind field rather than variable - field. - -Tue Jan 23 15:54:18 1996 Ian Lance Taylor - - * ieee.c: Various changes to handle reading C++ reference type - information. - - * debug.h (enum debug_var_kind): Add DEBUG_VAR_ILLEGAL. - (enum debug_parm_kind): Add DEBUG_PARM_ILLEGAL. - * debug.c (debug_get_parameter_types): Handle DEBUG_KIND_FUNCTION. - - * ieee.c: Various changes to write out definitions of C++ classes. - - * debug.c (debug_append_filename): Remove. - * debug.h (debug_append_filename): Don't declare. - - * stabs.c (struct stab_handle): Remove last_type field. Add - so_string and so_value fields. - (finish_stab): Call stab_emit_pending_vars before calling - debug_end_function. Don't warn about pending variables. - (parse_stab): Accumulate N_SO strings until a non N_SO symbol is - seen, rather than calling debug_append_filename. Call - stab_emit_pending_vars before calling debug_end_function. Don't - set info->last_type. - -Tue Jan 23 09:53:54 1996 Doug Evans - - * objdump.c (disassemble_data): Handle unknown endianness. - Pass fprintf to INIT_DISASSEMBLE_INFO. - -Mon Jan 22 16:46:43 1996 Doug Evans - - Add new option --show-raw-insn. - * objdump.c (show_raw_insn): New global. - (usage): Update. - (long_options): Update. - (disassemble_data): Set disasm_info.flags if --show-raw-insn. - - * objdump.c (disassemble_data): Set new arch,mach,endian fields in - disasm_info. - -Mon Jan 22 19:29:36 1996 Ian Lance Taylor - - * ieee.c: Extensive changes to pass a single info argument around - in the reading routines, rather than several arguments. Add code - to read C++ debugging records. - - * debug.h (debug_get_type_size): Declare. - (debug_get_field_name): Declare. - (debug_get_field_bitpos): Declare. - (debug_get_field_bitsize): Declare. - (debug_get_field_visibility): Declare. - (debug_get_field_physname): Declare. - * debug.c (debug_get_real_type): Handle DEBUG_KIND_TAGGED. - (debug_get_type_size): New function. - (debug_get_field_name): New function. - (debug_get_field_bitpos): New function. - (debug_get_field_bitsize): New function. - (debug_get_field_visibility): New function. - (debug_get_field_physname): New function. - (debug_write_type): Make sure we pass the real kind, not INDIRECT, - to tag_type. Pass the name recursively for INDIRECT. - -Fri Jan 19 12:31:57 1996 Ian Lance Taylor - - * debug.h (struct debug_write_fns): Remove ellipsis_type. Add int - and boolean parameters to function_type. Add boolean parameter to - method_type. - (debug_make_ellipsis_type): Don't declare. - (debug_make_function_type): Add debug_type * and boolean - parameters. Change all callers. - (debug_make_method_type): Add boolean parameter. Change all - callers. - (debug_get_parameter_types): Add boolean * parameter. Change all - callers. - (debug_get_target_type): Declare. - * debug.c (struct debug_function_type): Add fields arg_types and - varargs. - (struct debug_method_type): Add field varargs. - (debug_ellipsis_type, ELLIPSIS_P): Remove. - (debug_make_ellipsis_type): Remove. - (debug_make_function_type): Add arg_types and varargs parameters. - (debug_make_method_type): Add varargs parameter. - (debug_get_parameter_types): Add pvarargs parameter. - (debug_get_target_type): New function. - (debug_write_type): In case DEBUG_KIND_FUNCTION, push argument - types and pass count to function_type. In DEBUG_KIND_METHOD, use - a signed int for the count, don't call ellipsis_type, and pass - varargs to method_type. - * stabs.c (struct stab_demangle_info): Add varargs field. - (stab_demangle_argtypes): Add pvarargs parameter. Change all - callers. - (stab_demangle_args): Likewise. - (stab_demangle_type): In case 'F', pick up argument types. - * prdbg.c (pr_ellipsis_type): Remove. - (pr_function_type): Add argcount and varargs parameters. - (pr_method_type): Add varargs parameter. - * ieee.c (ieee_ellipsis_type): Remove. - (ieee_function_type): Add argcount and varargs parameters. - (ieee_method_type): Add varargs parameter. Remove most of - function body, and just call ieee_function_type. - - * stabs.c: Include "demangle.h". Added several new static - functions not listed below to demangle argument types; they are - all called via stab_demangle_argtypes. - (finish_stab): If the kind of an undefined tag is - DEBUG_KIND_ILLEGAL, use DEBUG_KIND_STRUCT instead. Warn if there - are any pending variable. - (parse_stab): Don't close the function when the block depth goes - to zero. Pass value to debug_end_function. - (parse_stab_string): In case 'T', pass the name to - parse_stab_type. - (parse_stab_type): In case 'x', use stab_find_tagged_type. In - case '#', handle functions with variable numbers of arguments. - (parse_stab_struct_type): Add tagname parameter. Change all - callers. - (parse_stab_members): Add tagname and typenums parameters. Change - all callers. If the type of a method is a stub, call - parse_stab_argtypes to demangle the argument types and get the - physical name of the function. - (parse_stab_argtypes): New static function. - (stab_record_variable): For a DEBUG_GLOBAL or DEBUG_STATIC - variable, call debug_record_variable immediately. - (stab_find_tagged_type): New static function. - - * debug.h (enum debug_type_kind): Add DEBUG_KIND_ILLEGAL. - (struct debug_write_fns): Add field ellipsis_type. Add id - parameter to start_struct_type, start_class_type, and tag_type. - (debug_make_ellipsis_type): Declare. - (debug_find_named_type): Declare. - (debug_get_type_kind): Declare. - (debug_get_return_type): Declare. - (debug_get_parameter_types): Declare. - (debug_get_fields): Declare. - (debug_get_field_type): Declare. - * debug.c (struct debug_handle): Add fields class_id and base_id. - (struct debug_class_type): Add field id. - (struct debug_method_variant): Rename argtypes to physname. - Change all uses. - (debug_ellipsis_type): New static variable. - (ELLIPSIS_P): New macro. - (debug_make_ellipsis_type): New function. - (debug_make_method_variant): Rename argtypes to physname. - (debug_make_static_method_variant): Likewise. - (debug_name_type): Always put types in the global namespace. - (debug_find_named_type): New function. - (debug_find_tagged_type): Treat DEBUG_KIND_ILLEGAL specially, - rather than DEBUG_KIND_VOID. - (debug_get_real_type): New static function. - (debug_get_type_kind): New function. - (debug_get_return_type): New function. - (debug_get_parameter_types): New function. - (debug_get_fields): New function. - (debug_get_field_type): New function. - (debug_write): Initialize base_id. - (debug_write_type): Pass new id argument to tag_type. Handle - DEBUG_KIND_ILLEGAL. Use id for DEBUG_KIND_STRUCT and - DEBUG_KIND_UNION. Handle ellipsis for method arguments. - (debug_write_class_type): Don't dereference kclass if it is NULL. - Use id. - * prdbg.c (pr_fns): Add pr_ellipsis_type. - (pr_ellipsis_type): New static function. - (pr_pointer_type): If this is a pointer to an array, parenthesize - it correctly. - (pr_start_struct_type): Add id parameter. - (pr_start_class_type): Likewise. - (pr_tag_type): Likewise. - (pr_fix_visibility): Add the visibility to the top of the stack, - not the second element on the stack. - (pr_struct_field): Pop the stack before calling pr_fix_visibility. - (pr_class_static_member): Likewise. - (pr_class_start_method): Don't push a type, just set the method - name in the type on the top of the stack. - (pr_class_end_method): Don't pop the stack. - (pr_class_method_variant): Rename argtypes parameter to physname. - Append const and volatile rather than prepending them. Add a - space after the physname. - (pr_class_static_method_variant): Likewise. - * ieee.c (ieee_fns): Add ieee_ellipsis_type. - (ieee_define_named_type): Use DEBUG_KIND_ILLEGAL rather than - DEBUG_KIND_VOID. - (write_ieee_debugging_info): Likewise. - (ieee_typdef): Likewise. - (ieee_ellipsis_type): New static function. - (ieee_start_struct_type): Add id parameter. - (ieee_start_class_type): Likewise. - (ieee_tag_type): Likewise. - (ieee_class_method_variant): Rename name to physname. - (ieee_class_static_method_variant): Likewise. - - * Makefile.in (DEBUG_OBJS): Remove prdbg.o. - ($(OBJDUMP_PROG)): Depend upon, and link against, prdbg.o. - -Thu Jan 18 17:35:06 1996 Kim Knuttila - - * dlltool.c (make_tail): Changed the order of the sections to avoid - an alignment problem. - -Wed Jan 17 14:23:00 1996 J.T. Conklin - - * srconv.c (wr_du): Set du.stackfrmt to 0. - (wr_un, wr_sc): Emit all sections, even those with 0 size. - -Tue Jan 16 16:15:49 1996 J.T. Conklin - - * srconv.c (wr_hd): Space size within segment was being - stored in segment identifier field. - -Tue Jan 16 12:07:25 1996 Stan Shebs - - * mpw-config.in (BUILD_NLMCONV, BUILD_SRCONV, SYSINFO_PROG, - BUILD_DLLTOOL): Put definitions for these into makefile when - configuring, instead of always clearing in mpw-make.sed. - * mpw-make.sed: Edit out any host_alias or target_alias settings, - fix pathname to BFD internal include files, remove dependency - calculation rules. - -Thu Jan 11 17:31:38 1996 Michael Meissner - - * objdump.c (dump_section_header): Add new section flags - SEC_{EXCLUDE,SORT_ENTRIES}. - -Thu Jan 11 11:45:34 1996 Ian Lance Taylor - - * objcopy.c (filter_symbols): NULL terminate the output symbols. - (copy_object): Allocate space for a possible extra NULL pointer. - - * debug.c (debug_make_undefined_tagged_type): Make sure we are - given a kind of type we can handle. - (debug_write_type): Handle undefined enums and structs. - (debug_write_class_type): Handle undefined classes. - * prdbg.c (pr_enum_type): Handle an undefined enum. - * ieee.c (ieee_enum_type): Likewise. - -Wed Jan 10 15:33:18 1996 Ian Lance Taylor - - * Makefile.in: Updated dependencies. - (ALLOCA, MALLOC): Remove variables. - (ADDL_LIBS): Remove $(MALLOC) from definition. - * alloca.c, gmalloc.c: Remove. - -Mon Jan 8 18:02:29 1996 Ian Lance Taylor - - * ieee.c: Add global function write_ieee_debugging_info and a - bunch of static functions and structs used to write out IEEE - debugging information. - * budbg.h (write_ieee_debugging_info): Declare. - - * ieee.c (struct ieee_type): Add pslot field. - (enum builtin_types): Define. - (ieee_builtin_type): For a pointer, return a pointer to the named - type. Use enum values rather than numbers. - (ieee_alloc_type): New static function. - (ieee_read_type_index): Use ieee_alloc_type. - (parse_ieee_bb): Likewise. - (parse_ieee_ty): Likewise. Use ieee_builtin_type for array range, - rather than making a new integer type. Store the new type in the - slot, if there is one. - (parse_ieee_atn): Treat ATN10 as defining a register variable. - (ieee_regno_to_genreg): Rename from ieee_regno_to_gen. Change all - callers. - (ieee_genreg_to_regno): New static function. - - * stabs.c (parse_stab_type): Add new typename parameter. Change - all callers. - (parse_stab_range_type): Add new typename parameter. Change all - callers. - - * debug.h (struct debug_write_fns): Add tag parameter to - enum_type, start_struct_type, and start_class_type. - * debug.c (debug_write_type): Pass any tag name to - start_struct_type, debug_write_class_type, and enum_type. If - DEBUG_KIND_TAGGED, pass the name in the recursive call. - (debug_write_class_type): Accept a new tag parameter, and pass it - to start_class_type. - * prdbg.c (pop_type): Don't remove '+' character. - (pr_enum_type): Accept and use tag parameter. - (pr_start_struct_type): Likewise. - (pr_start_class_type): Likewise. - (pr_class_baseclass): Adjust algorithm used to find where to put - the baseclass name. - (pr_tag): Don't bother to insert the tag name. - - * objcopy.c: Include budbg.h. - (convert_debugging): New static variable. - (OPTION_DEBUGGING): Define. - (copy_options): Add "debugging". - (copy_usage): Mention --debugging. - (is_strip_section): Skip debugging sections if convert_debugging. - (setup_section, copy_section): Likewise. - (filter_symbols): Skip debugging symbols if convert_debugging. - (copy_object): If convert_debugging, read and write debugging - information. - (write_debugging_info): New static function. - (copy_main): Handle --debugging. - * Makefile.in (DEBUG_OBJS): New variable. - ($(OBJCOPY_PROG)): Depend upon and link against $(DEBUG_OBJS). - ($(STRIP_PROG)): Likewise. - (OBJDUMP_OBJS): Remove variable. - ($(OBJDUMP_PROG)): Use objdump.o $(DEBUG_OBJS) rather than - $(OBJDUMP_OBJS). - * binutils.texi, objcopy.1: Document --debugging. - -Thu Jan 4 16:31:21 1996 Ian Lance Taylor - - * ieee.c: New file with code to read IEEE debugging information. - * budbg.h (parse_ieee): Declare. - * rddbg.c (read_debugging_info): Handle IEEE flavour files. - (read_ieee_debugging_info): New static function. - * Makefile.in: Rebuild dependencies. - (CFILES): Add ieee.c. - (OBJDUMP_OBJS): Add ieee.o. - - * bucomm.h (xrealloc): Change type of first parameter from char * - to PTR. - -Tue Jan 2 17:44:07 1996 Ian Lance Taylor - - * Makefile.in: Add targets to automatically rebuild dependencies. - Remove targets which just listed dependencies of .o files. - (DEP): New variable. - (HFILES, GENERATED_HFILES): New variables. - (CFILES, GENERATED_CFILES): New variables. - (underscore.c): Don't do anything, just depend upon stamp-under. - (stamp-under): New target; do what underscore.c used to do. - (nlmconv.o): Depend upon sym.h and ecoff.h. - (.dep, .dep1, dep.sed, dep, dep-in): New targets. - (stage1, stage2, stage3, against, comparison): Remove. - (de-stage1, de-stage2, de-stage3): Remove. - (clean, distclean): Remove stamp-under and dep.sed. - * dep-in.sed: New file. - - Implement generic debugging support. Implement a stabs reader and - a generic printer. - * budbg.h, debug.c, debug.h, prdbg.c, rddbg.c, stabs.c: New files. - * objdump.c: Include "debug.h" and "budbg.h". - (dump_debugging): New global variable. - (usage): Mention --debugging. - (long_options): Add "debugging". - (display_bfd): Handle --debugging. - * Makefile.in (OBJDUMP_OBJS): New variable. - ($(OBJDUMP_PROG)): Use $(OBJDUMP_OBJS). - * binutils.texi, objdump.1: Document --debugging. - -Sat Dec 30 09:59:51 1995 Jeffrey A Law (law@cygnus.com) - - * nm.c ( long_options): Add "--defined-only" option. - (usage): Update for new "--defined-only" option. - (filter_symbols): Handle "--defined-only". - -Fri Dec 29 16:04:56 1995 Ian Lance Taylor - - * arparse.y: Include "bucomm.h", not . - * nlmheader.y: Don't include "sysdep.h". - -Tue Dec 26 18:23:18 1995 Ian Lance Taylor - - * nm.c (print_symdef_entry): Check return value of - bfd_get_elt_at_index. - -Sat Dec 23 11:03:16 1995 Michael Meissner - - * configure.in (DLLTOOL_DEFS): Build dlltool for PowerPC if target - is powerpc*-*-win* in addition to powerpc*-*-*pe*. - -Fri Dec 15 16:30:57 1995 Ian Lance Taylor - - * objdump.c (endian_string): New static function. - (display_target_list): Use it. - * nlmconv.c (main): Use new bfd_big_endian macro. - -Fri Dec 15 07:51:34 1995 steve chamberlain - - * dlltool.c (fill_ordinals): Start from 1 if no other instructions - given. - -Tue Dec 12 12:05:21 1995 Ian Lance Taylor - - * Makefile.in (clean): Remove $(DEMANGLER_PROG).1. From Ronald - F. Guilmette . - -Mon Dec 11 14:33:05 1995 Stan Shebs - - * mac-binutils.r: Fix copyright and version strings. - - * Makefile.in (version): Remove, no longer used. - -Fri Dec 1 14:41:56 1995 Stan Shebs - - * mpw-make.sed (install, install-only): Edit in Mac-specific - install procedure. - -Thu Nov 30 20:26:02 1995 Kim Knuttila - - * dlltool.c (ppc_jtab): The binary glue for PowerPC dll linkage, - including the return instruction. - sinfo: added a preferred alignment field. - (secdata): section data for the PowerPC version. - (make_one_lib_file): More symbols, More sections (pdata, rdata) - (make_tail): Use idata$6 instead of idata$7 for ppc. Also added a - NULL idata$3 descriptor (temporary). - -Tue Nov 28 17:23:44 1995 Doug Evans - - * dlltool.c (fill_ordinals): Don't reference d_export_vec if - there are no exported functions. - -Mon Nov 27 13:05:59 1995 Ian Lance Taylor - - * configure: Regenerate with autoconf 2.7. - -Wed Nov 22 13:17:15 1995 Ian Lance Taylor - - * dlltool.c (fill_ordinals): Start assigning ordinals at 1. - - * Makefile.in (EXPECT): Use $$r, not $${rootme}. - (check): Set r, not rootme. - -Tue Nov 21 18:04:09 1995 Ian Lance Taylor - - * configure.in: Use BFD_NEED_DECLARATION. - * acconfig.h: Put NEED_DECLARATION_FPRINTF in @TOP@ section. - * configure, config.in: Rebuild with autoconf 2.6. - -Fri Nov 17 10:34:37 1995 Ian Lance Taylor - - * Makefile.in (CC_FOR_TARGET): Use @host@ and @target@, not - $(host_canonical) and $(target_canonical). - -Thu Nov 16 03:39:20 1995 Ken Raeburn - - Version 2.6 released. - * Makefile.in (VERSION): Update to 2.6. - -Wed Nov 15 12:14:17 1995 Ian Lance Taylor - - * Makefile.in (CC_FOR_TARGET): Define. - (check): Pass CC and CFLAGS to runtest. - - * nm.c (display_rel_file): Don't require a DYNAMIC object when - dumping the dynamic symbol table. - - * objdump.c (compare_symbols): Sort global symbols before local - symbols before debugging symbols. - (objdump_print_address): Don't futz around looking for a global - symbol with the same value. - -Tue Nov 14 17:19:11 1995 Ian Lance Taylor - - * dlltool.c: Use FOPEN_* macros rather than "r" or "w". - - * dlltool.c (fill_ordinals): Correct memset call. - -Sun Nov 12 12:56:05 1995 Stan Shebs - - * mpw-make.sed (DEMANGLER_PROG): Edit out attempts to do anything - with the man page. - -Fri Nov 10 11:41:22 1995 Ian Lance Taylor - - * objcopy.c (setup_section): Copy the section lma independently of - the vma. - -Wed Nov 8 11:33:00 1995 Ian Lance Taylor - - * arsup.c (ar_open): Cast malloc return value. - -Tue Nov 7 09:01:26 1995 Kim Knuttila - - * configure.in, configure (DLLTOOL_DEFS): Added ppc target. - * dlltool.c (MPPC): Added basic PPC definitions. - -Tue Nov 7 14:02:57 1995 Ian Lance Taylor - - * configure.in: Don't treat rs6000-*-lynx* specially. - * configure: Rebuild. - * config/rslynx: Remove. - * Makefile.in: Remove @target_makefile_fragment@. - -Mon Nov 6 15:00:50 1995 Ian Lance Taylor - - * bucomm.h: Include . - * ar.c: Don't include or . - * bucomm.c, dlltool.c, nlmconv.c, objcopy.c, objdump.c: Likewise. - -Fri Nov 3 12:38:09 1995 Ian Lance Taylor - - * objdump.c: Include . - - Permit user to override DEMANGLER_PROG from command line. From - Manfred Hollstein . - * Makefile.in ($(DEMANGLER_PROG)): Depend upon - $(DEMANGLER_PROG).1. - (install): Don't depend upon $(DEMANGLER_PROG).1. Only install - $(DEMANGLER_PROG).1 if $(DEMANGLER_PROG) is not empty. - -Wed Nov 1 15:04:57 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 - - * Makefile.in (syslex.o): add -I$(srcdir) if compiling in a - separate directory. - -Mon Oct 30 14:24:18 1995 Ian Lance Taylor - - * objdump.c (objdump_print_value): New static function. - (objdump_print_address): Use it. If we need the right section for - the symbol, and we can't find it, print an offset from the section - rather than using a symbol from some other section. - -Thu Oct 26 10:23:14 1995 steve chamberlain - - * dlltool.c (no_idata4, no_idata5): New. - (arm_jtab): Use correct encoding of jump instruction. - (usage, main, make_head, make_tail): Act on no_idata4, no_idata5. - -Wed Oct 25 12:10:07 1995 Stan Shebs - - * mpw-make.sed: Edit paths to generated y.tab.[ch] files. - -Fri Oct 20 18:40:34 1995 Ian Lance Taylor - - * binutils.texi: Change --with-targets to --enable-targets. - -Thu Oct 19 17:47:41 1995 Fred Fish - - * Makefile.in: Remove extraneous tab on otherwise empty line, - which confuses many non-GNU versions of "make". - -Wed Oct 18 16:31:58 1995 steve chamberlain - - * dlltool.c (i386_jtab, arm_jtab): New - (gen_lib_file): Rewritten to use bfd. - -Fri Oct 13 16:10:07 1995 Michael Meissner - - * Makefile.in (install): Don't give error message if dlltool - wasn't built. - -Fri Oct 13 11:04:37 1995 steve chamberlain - - * deflex.l: Allow quoting of IDs. - * defparse.y (%union): string deleted. - (command): DESCRIPTION takes ID. - * dlltool.c (gen_def_file): Quote outgoing name if - necessary. Preserve NONAME. - (gen_lib_file): Run ranlib. - (workout_prefix): Deleted. - (main, usage, long_options): Add --as, --ranlib, --ar options. - -Wed Oct 11 13:36:13 1995 steve chamberlain - - * dlltool.c (mtable): HOW_ALIGN_LONG, new. - (d_ord): Deleted. - (d_low_ord, d_high_ord, d_named_funcs): New. - (gen_exp_file): Create noname entries correctly. - (gen_lib_file): Dump exports alphabetically. - (process_duplicates): Count nonamed functions. - (fill_ordinals): Keep track of highest ord too. - (mangle_defs): Create alphabetically ordered list of names. - -Tue Oct 10 09:39:09 1995 steve chamberlain - - * Makefile.in (TOOL_PROGS): Include DLLTOOL_PROG. - -Mon Oct 9 13:06:31 1995 steve chamberlain - - * dlltool.c (add_underscore): New. - (xlate): Use new name. - (main, usage): Update. - -Fri Oct 6 14:08:51 1995 Ken Raeburn - - * sysinfo.y: Eliminate unused terminals "[" and "]" and unused - nonterminal "name". One s/r conflict remains. - - Mon Sep 25 22:49:32 1995 Andreas Schwab - - * nm.c (print_symname): Don't try to demangle an empty - name. - * objdump.c (slurp_symtab): Reset symcount if there are - no symbols. - (slurp_dynamic_symtab): Likewise, for dynsymcount. - (disassemble_data): Fix memory leak: free sorted_syms when done. - (display_bfd): Likewise, for syms and dynsyms. - (dump_relocs): Don't print header before possibly generating an - error message. - (dump_dynamic_relocs): Likewise. - - * ar.1, nm.1, objdump.1, size.1, strings.1, strip.1: Fix typos and - formatting bugs. - -Fri Oct 6 12:00:25 1995 Ian Lance Taylor - - * ar.c (do_quick_append): Comment out. - (replace_members): Add quick argument. - (main): Don't call do_quick_append. - (open_inarch): Don't call quick_append to create an empty archive. - Instead call bfd_openw/bfd_set_format/bfd_close. - -Thu Oct 5 20:53:08 1995 Ken Raeburn - - * bucomm.c: Always include time.h. - -Thu Oct 5 17:25:21 1995 Ian Lance Taylor - - * objdump.c (compare_symbols): Sort gnu_compiled and gcc2_compiled - symbols after other symbols with the same value. Likewise for - symbols which look like file names. - (objdump_print_address): Always chose the first reasonable symbol - with a given value. - -Tue Oct 3 22:38:55 1995 Ian Lance Taylor - - * arsup.c (ar_save): Use rename, not unlink/link/unlink. - -Mon Oct 2 12:10:25 1995 Ian Lance Taylor - - * strings.c (main): Exit with zero status if no files are given - and standard input is read. - -Thu Sep 28 20:03:07 1995 Stan Shebs - - * mpw-config.in: Calculate underscore and put into makefile - fragment, generate config.h. - * mpw-make.sed: New file, sed commands to edit Unix makefile - into MPW syntax. - * mpw-make.in: Remove. - * mac-binutils.r: New file, Mac resources. - -Thu Sep 28 15:49:00 1995 steve chamberlain - - * dlltool.c: (gen_exp_file): Always emit a .reloc section if - relocatable. - (imp_name_lab): New. - (gen_def_file): New. - (gen_lib_file): Use imp_name_lab. - (main): Initialize imp_name_lab. - -Mon Sep 25 12:05:34 1995 Ian Lance Taylor - - * configure.in: Call AC_HEADER_SYS_WAIT. - * configure: Rebuild. - * config.in: Rebuild. - * dlltool.c: Include "libiberty.h" and "bucomm.h". Don't include - , , or . Don't include . - Include . Use HAVE_SYS_WAIT_H to control whether to - include or define the wait macros by hand. Don't - declare xmalloc. - (gen_lib_file): Don't assume that sprintf returns the number of - characters; use strlen instead. - -Fri Sep 22 17:16:41 1995 Ian Lance Taylor - - * objdump.c (disassemble_data): Don't use the old BFD based - disassembler interface. Make info a const pointer. - -Wed Sep 13 18:33:44 1995 Ian Lance Taylor - - * objdump.c (start_address): New variable. - (stop_address): New variable. - (usage): Mention --start-address and --stop-address. - (OPTION_START_ADDRESS, OPTION_STOP_ADDRESS): Define. - (long_options): Add "start-address" and "stop-address". - (disassemble_data): Handle start_address and stop_address. - (dump_data, dump_reloc_set): Likewise. - (main): Don't set seenflag for -l. Handle OPTION_START_ADDRESS - and OPTION_STOP_ADDRESS. - * objcopy.c (parse_vma): Move to bucomm.c. - * bucomm.c (parse_vma): New function, moved in from objcopy.c. - * bucomm.h (parse_vma): Declare. - * binutils.texi, objdump.1: Document new objdump options. - -Tue Sep 12 12:37:39 1995 Ian Lance Taylor - - * Makefile.in (maintainer-clean): New target. - - * ar.c (replace_members): Don't call write_archive if nothing - changed. - - * objdump.c (disassemble_data): Add casts to avoid gcc warnings. - -Thu Sep 7 12:12:17 1995 Ian Lance Taylor - - * config.in: Rename from config.h.in. - * configure.in: Call AC_CONFIG_HEADER with config.h:config.in. - Check for config.h:config.in when creating stamp-h. - * configure: Rebuild. - * Makefile.in (stamp-h): Depend upon config.in rather than - config.h.in. Set CONFIG_HEADERS to config.h:config.in when - calling config.status. - - * Makefile.in (distclean): Remove config.h, stamp-h, and - config.log. - - * nm.c (value_format): Initialize based on BFD64 and - BFD_HOST_64BIT_LONG. - (print_radix): New static variable. - (set_print_radix): Set print_radix. Adjust changes to - value_format. - (print_value): New static function, to print 64 bit octal and - decimal values correctly. - (print_symbol_info_bsd): Check BFD64, not BFD_HOST_64_BIT. Use - print_value. - (print_symbol_info_sysv): Use print_value. - (print_symbol_info_posix): Likewise. - -Wed Sep 6 15:02:55 1995 Ian Lance Taylor - - * Makefile.in (*.o): Remove incorrect dependencies on - $(BFDDIR)/hosts/std-host.h. - - * Makefile.in (INSTALL_DATA): Add -m 644. - (INSTALL_XFORM1): Likewise. - (CC_FOR_BUILD): Set to @CC_FOR_BUILD@ rather than $(CC). - (mostlyclean): Remove config.log. - (distclean): Remove config.cache. - - * configure.in: Call BFD_CC_FOR_BUILD and BFD_BINARY_FOPEN. - * configure: Rebuild. - -Tue Sep 5 20:22:42 1995 Ian Lance Taylor - - * configure.in: Rewrite to use autoconf. - * aclocal.m4: New file. - * configure: New file, built by autoconf. - * acconfig.h: New file. - * config.h.in: New file, built by autoheader. - * Makefile.in: Various changes for new configure script. Also: - (PROGS): Remove $(SYSINFO_PROG). - (ALL_CFLAGS): Remove $(TDEFINES). - (version.o): Use $(ALL_CFLAGS). - (cplus-dem.o, dlltool.o, nlmconv.o): Likewise. - (sysdump.o): Depend upon bucomm.h and config.h. - (srconv.o, arsup.o, strings.o): Depend upon config.h. - (filemode.o): Don't depend upon ../bfd/sysdep.h. - (bucomm.o): Depend upon config.h, not ../bfd/sysdep.h. - (size.o, objdump.o, nm.o, ar.o, objcopy.o): Likewise. - (nlmheader.o, nlmconv.o): Likewise. - (distclean): Don't remove sysdep.h. - * bucomm.h: Include "ansidecl.h", , and "config.h". - Include "fopen-same.h" or "fopen-bin.h", based on - USE_BINARY_FOPEN. Include , and declare errno if it is - not a macro. Include , , , - , and if they are present. Declare strchr, - strrchr, and strstr if no string header file exists. Include - if it exists and does not. Define - O_RDONLY and O_RDWR if necessary. - * ar.c: Don't include "sysdep.h". Do include and - . Use HAVE_GOOD_UTIME_H rather than POSIX_UTIME. Use - HAVE_UTIMES rather than !USE_UTIME. Don't include , and - don't declare errno. - * arsup.c: Don't include . - * bucomm.c: Don't include "sysdep.h". Include , - , and . Include if it defines - time_t. Define time_t if necessary. - * coffdump.c: Don't include "sysdep.h". - * coffgrok.c, filemode.c, nlmconv.c, size.c: Likewise. - * srconv.c, strings.c: Likewise. - * nm.c: Don't include "sysdep.h". Don't try to define HAVE_SBRK. - * objcopy.c: Don't include "sysdep.h". Include and - . - (simple_copy): Use creat rather than assuming that O_CREAT is - defined. - * objdump.c: Don't include "sysdep.h". Use - NEED_DECLARATION_PRINTF rather than !FPRINTF_ALREADY_DECLARED. - * sysdump.c: Include "bfd.h" and "bucomm.h". Don't include - "sysdep.h" or . - (dump_symbol_info): Rename from symbol_info. Change all callers. - -Mon Sep 4 14:30:00 1995 Ian Lance Taylor - - * configure.in (host_makefile_frag): Don't set. Substitute for - @CC@, @CFLAGS@, @HDEFINES@ and @LDFLAGS@ in Makefile. - * Makefile.in (AR_FLAGS): Set to rc rather than qv. - (CC): Define as @CC@. - (CFLAGS): Set to @CFLAGS@. - (LDFLAGS): Define as @LDFLAGS@. - (ALL_CFLAGS): Use @HDEFINES@ rather than $(HDEFINES). - - * configure.in: Don't bother to call config.bfd for each target. - Just call it for the default target, and use the shell variable to - decide whether underscores are used. - -Thu Aug 31 19:21:48 1995 Jason Molenda (crash@phydeaux.cygnus.com) - - * configure.in: match i[3-6]86-*-win32, not just i386-*-win32. - -Thu Aug 31 16:30:22 1995 steve chamberlain - - * dlltool.c (add_indirect): New. - (asm_prefix): New - (gen_exp_file): Timestamp should be 0. Insert prefix when - needed. New code for indirection. - (gen_lib_file): Timestamp should be 0. Insert prefix - when needed. - (usage): Document --add-indirect. - (main): Cope with new option. - - * objdump.c (dump_private_headers): New. - (usage): Document new option. - (long_option): Add private-headers. - (dump_bfd_private_header): New. - (main): Cope with new option. - -Thu Aug 31 04:09:16 1995 Doug Evans - - * dlltool.c (run): Add missing 3rd arg to waitpid. - -Wed Aug 30 11:02:11 1995 steve chamberlain - - * Makefile.in (TOOL_PROGS): Include dlltool if needed. - -Tue Aug 29 13:25:21 1995 steve chamberlain - - * dlltool.c (rva): Deleted. - (rvaafter, rva_before): Use new assembler pseudo. - (flush_page, gen_exp_file, gen_lib_file): Use new way of RVAing. - (gen_exp_file): Don't generate .edata if no need. - (gen_lib_file): Don't make timestamp. - Put _iname in idata$7. - (workout_prefix): Fix memory initialization bug. - (usage): Tidy up, delete many single char options. - (main): rva option is gone. - -Mon Aug 21 18:41:28 1995 steve chamberlain - - * dlltool.c (options): image-base is a synonym for rva. - (gen_lib_file): Put dll name into ibase$7. - -Sun Aug 20 09:59:00 1995 steve chamberlain - - Modified to generate archives and objects rather than .s files. - * dlltool.c (run) New function. - (gen_exp_file, gen_lib_file): Use run. - (workout_prefix): New. - (usage): Document new options. - (main): Parse new options. - -Wed Aug 16 16:26:52 1995 steve chamberlain - - * dlltool.c (gen_exp_file): Fix RVA handling. - (rva_s, rva_n): Delete. - -Fri Aug 11 18:27:18 1995 Ian Lance Taylor - - * nm.c (main): Ignore -e. - -Thu Aug 10 17:35:00 1995 Ken Raeburn - - * Makefile.in (config.texi): New target. Write out a setting for - texinfo variable VERSION. - (binutils.dvi, binutils.info): Depend on it. - * binutils.texi: Include it, and reference @value{VERSION} instead - of explicitly specifying 2.2(!). - -Thu Aug 10 16:07:53 1995 Ian Lance Taylor - - * coffgrok.c (do_type): Handle array dimensions the same way gdb - does. - -Tue Aug 8 17:10:42 1995 steve chamberlain - - * dlltool.c (mtable): New fields. - (ASM_RVA_BEFORE, ASM_RVA_AFTER): New. - (flush_page): Use new macros. - -Sat Aug 5 00:16:37 1995 Jeff Law (law@snake.cs.utah.edu) - - * objcopy.c (mark_symbols_used_in_relocations): Handle sections - with no relocations. - * coffgrok.c (do_sections_p1): Likewise. - -Mon Jul 31 12:51:06 1995 Ian Lance Taylor - - * strings.c (print_strings): For compatibility with existing - strings programs, print strings which are not terminated with a - null byte or a newline. - * binutils.texi, strings.1: Update documentation accordingly. - - * ar.c (replace_members): For compatibility with existing ar - programs, permit users to add the same file multiple times. - -Tue Jul 25 11:21:53 1995 Ian Lance Taylor - - * strings.c (DATA_FLAGS): Remove SEC_DATA. - (main): If no file names are given, scan standard input. - * binutils.texi, strings.1: strings now scans non-data sections by - default. - -Mon Jul 24 13:52:28 1995 J.T. Conklin - - * srconv.c (wr_hd): Set afl field to 4 for bfd_arch_sh. - (writeINT): When size == -2, use 2 bytes for the h8300 and 4 bytes - for the sh. - - * sysdump.c (fillup): Return size - 1, the last byte is a checksum - and shouldn't be counted. - * sysroff.info (hd): Changed segment identifier from a byte to a 1 - bit field. The sysroff 2.0-01 specification seems to be in error - here. Reduce width of following "spare" field from 4 to 3 bits. - (rl): Changed order and width of first 4 bitfields to correspond - to sysroff specification. - (dln_head, dln_inside, dln_tail): Removed. - -Tue Jul 18 23:00:03 1995 Fred Fish - - * nm.c (sort_symbols_by_size): Enclose expression being casted - in parens so result is casted, not just first operand. Can't - do pointer arithmetic on void* pointers. - -Fri Jul 14 13:42:42 1995 J.T. Conklin - - * sysdump.c (dh): Changed format of output to be 16 hex digits - followed by 16 ascii characters, similar to Emacs' hexl-mode, - to make it easier to read. - (xcalloc): fix typo. - -Thu Jul 13 15:27:44 1995 J.T. Conklin - - * srconv.c (wr_tr): Write out handcrafted tr block. - (walk_tree_symbol): Use evallen and evalue instead of - vallen & value because of corresponding changes in - sysroff.info. - - * sysdump.c (sysroff_swap_tr_in, sysroff_print_tr_out): New - functions. - - * sysroff.info (tr): the tr block is a special case --- a block - without contents --- which can't be handled by generated code. - (den, dpp): only first byte is present for DENend, DPPend. - (dsy): describe a conditional portion of block, rename some fields. - (dps): describe a conditional portion of block. - (dfl): removed. - - * sysinfo.y (yyerror): write error message to standard error. - -Thu Jul 13 10:43:59 1995 Ian Lance Taylor - - * Makefile.in (DISTSTUFF): Add arparse.h and sysinfo.h. - (mostlyclean): Remove y.output. - (clean): Remove sysroff, sysroff.c, sysroff.h, and sysinfo. - - * nlmconv.c (powerpc_mangle_relocs): Cast memset arg to size_t. - * objcopy.c (copy_object): Likewise. - - * nm.c (HAVE_SBRK): Define execpt on amigados and WINDOWS_NT. - (struct size_sym): Define. - (show_stats): New static variable. - (long_options): Add undocumented option "stats". - (main): Print memory stats if requested. - (sort_bfd, sort_dynamic, sort_x, sort_y): New static variables. - (numeric_forward): Use minisymbols rather than asymbols. - (non_numeric_forward): Likewise. - (size_forward1): Rename from size_forward. Use minisymbols. - (size_forward2): New static function. - (sort_symbols_by_size): Take new arguments dynamic, size, and - symsizep. Use minisymbols. Don't store the size back in the - symbol; store in a newly allocate struct size_sym array. - (display_rel_file): Read minisymbols rather than asymbols. Set - sort_* variables. Call print_size_symbols if sorting by size. - (filter_symbols): Take new arguments dynamic and size. Use - minisymbols. - (print_symbols): Likewise. Call print_symbol for actual printing. - (print_size_symbols): New static function. - (print_symbol): New static function. - -Wed Jul 12 10:43:05 1995 Ian Lance Taylor - - * objdump.c (dump_section_stabs): Only print each stabs section - once. - (compare_relocs): Make it clear to gcc that this always returns a - value. - -Wed Jul 12 10:40:23 1995 H.J. Lu - - * objcopy.c (simple_copy): Preserve errno on failure. - (smart_rename): Print error mesage if simple_copy fails. - -Tue Jul 11 13:10:52 1995 J.T. Conklin - - * sysdump.c: re-indented file. - (module): read blocks sequentially instead of trying to parse - them, as that would require changing the parser recognize the - difference between a DPSstart and DPSend block. - (getone): Add break's between switch blocks as appropriate. - (object_body_list): parse blocks according to sysroff spec. - -Mon Jul 10 12:37:25 1995 J.T. Conklin - - * sysroff.info: re-indented file, prior formatting was confusing - because it was indentation did not reflect nesting of conditional - records. Change "space size within segment" record in hd record - from bit to byte. - - * sysinfo.y (cond_it_field): Use xcalloc instead of calloc. - - * srconv.c (wr_cs): Reformatted cs header array, tag each byte - with a comment describing the field. - (wr_unit_info): Use SEEK_SET macro instead of constant 0. - (main): Use FOPEN_WB macro instead of literal "wb". - * sysroff.info: Remove fdl (dfl) field from cs block. Compare - ptr->type with ED_TYPE_CONST instead of constant 2 in ed block. - -Tue Jul 4 14:48:42 1995 Ian Lance Taylor - - * nm.c (size_forward): Check yf against yn, not xn. - - * objcopy.c (copy_archive): Record all output BFD's, and close - them before unlinking them and removing the temporary directory, - to avoid NFS problems. - - * ar.c (replace_members): In verbose messages, use 'r' when - replacing a member, and 'a' when adding one. - - * ar.c (ar_truncate): New static variable. - (normalize): Change return type to const char *. Add abfd - argument. Change all callers. If ar_truncate, chop the filename - to abfd->ar_max_namelen. - (main): For the 'f' modifier, set ar_truncate to true. Don't - change quick_append to replace if ar_truncate is true. - (do_quick_append): If ar_truncate, set BFD_TRADITIONAL_FORMAT. - (write_archive): Likewise. - * binutils.texi, ar.1: Document 'f' modifier. - - * objcopy.c (enum strip_action): Define strip_unneeded. - (OPTION_STRIP_UNNEEDED): Define. - (strip_options): Add "strip-unneeded". - (copy_options): Likewise. - (copy_usage): Mention --strip-unneeded. - (strip_usage): Likewise. - (is_strip_section): Strip debugging sections if strip_unneeded. - (filter_symbols): If strip_unneeded, only keep BSF_KEEP symbols. - (copy_object): If strip_all, discard symbols without checking - discard_locals. - (copy_object): Call filter_symbols if strip_unneeded. - (setup_section): Strip debugging sections if strip_unneeded. - (copy_section): Likewise. - (strip_main): Handle OPTION_STRIP_UNNEEDED. - (copy_main): Likewise. - * binutils.texi, objcopy.1, strip.1: Document --strip-unneeded. - -Mon Jul 3 14:16:47 1995 Steve Chamberlain - - * configure.in (i386-*-win32): New configuration. - * dlltool.c (killat, xlate, usage, long_options, main): - Understand and cope with -k option. - -Sat Jul 1 12:25:15 1995 Fred Fish - - * ar.c: (extract_file): Change "#if POSIX_UTIME" to - "#ifdef POSIX_UTIME" to match other tests of POSIX_UTIME - and avoid lossage when POSIX_UTIME is not defined at all. - -Wed Jun 28 17:51:24 1995 Steve Chamberlain - - * ar.c: (print_contents.c, extract_file, do_quick_append): - Malloc buffers rather than allocate on stack (so it works - on NT). - * deflex.l: Names can have an @ in them. - * dlltool.c: Loads of stuff. Can now generate .imp files which - work with NT .dlls. - -Thu Jun 22 19:10:50 1995 Stan Shebs - - * mpw-make.in (demangle.c.o): Remove. - (arparse.h): Depend on arparse.c instead of arparse.y. - -Wed Jun 21 17:32:45 1995 Ken Raeburn - - * Makefile.in (DISTSTUFF): Don't include info here. - (diststuff): Include it here. - (realclean): Remove *.info. - - * objdump.c (compare_relocs): If relocation entries have the same - address, keep them in file order. - -Mon Jun 19 09:06:49 1995 Steve Chamberlain - - * dlltool.c: Change names of generated files. .*.s-> -*.s - - * objdump.c (dump_section_stabs): Check for names - which are supersets of selected names. - -Wed Jun 14 19:43:52 1995 Doug Evans - - * dlltool.c (mtable, ARM jump): Must redirect via pc offsetable ptr. - -Wed Jun 14 13:27:22 1995 Steve Chamberlain - - * deflex.l, defparse.y, dlltool.c: New files. - * Makefile.in, configure.in: Support for them. - -Mon Jun 12 11:27:54 1995 Steve Chamberlain - - * sysdump.c: Include sysdep.h - (main): Open input with FOPEN_RB. - -Fri Jun 9 17:26:11 1995 Michael Meissner - - * objdump.c (wide_output): New flag variable. - (usage): Print new -w, --wide options. - (long_options): Add --wide support. - (dump_section_header): If --wide, don't print a newline between - the section's first line and the flags. - (objdump_print_address): Use unsigned comparisons for the binary - search, not signed. - (disassemble_data): If --wide, don't put a \n between the - disassembly output and relocation information. - (main): Support -w option being the same as --wide. - -Thu Jun 1 17:09:27 1995 Ken Raeburn - - Sat May 6 08:52:24 1995 H.J. Lu (hjl@nynexst.com) - - * objcopy.c (smart_rename): make it smarter, clean up - if rename () fails. - -Tue May 30 14:24:15 1995 Ken Raeburn - - * Makefile.in: Delete lines with lots of #### because four or more - indicate a point for makefile fragment substitution. - -Tue May 9 17:17:05 1995 Michael Meissner - - * configure.in: Don't build nlmconv on PowerPC eabi any more, it - is not needed. - -Thu Apr 27 20:21:24 1995 Doug Evans - - * Makefile.in (EXPECT): Define. - (RUNTEST): Use one in source tree if present. - (check): Set `rootme' for $(EXPECT). - -Wed Apr 26 18:26:21 1995 Steve Chamberlain - - * srconv.c (main): Add support for -n option which disables - prescan of common symbols. - (wr_ob): If reading past the end of a section, fill with zeros. - -Tue Apr 25 19:14:37 1995 Ken Raeburn - - * objdump.c (dump_section_header): Display load address after - virtual memory (run-time) address. - -Wed Apr 19 09:44:06 1995 Jason Merrill - - * Makefile.in (cplus-dem.o): Pass -DVERSION='"$(VERSION)"' to the - compile. - (DEMANGLER_PROG): No longer uses version.o. - -Mon Apr 10 13:29:49 1995 Stan Shebs - - Merge in support for Mac MPW as a host. - (Old change descriptions retained for informational value.) - - * mpw-config.in (TDEFINES): Define as empty in makefile frag. - - * mpw-config.in: Create mk.tmp, define ARCHDEFS in it. - - * mpw-config.in: New file, MPW configure fragment for binutils. - * mpw-make.in (install-only): New target. - (install): Also depend on install-only. - - * mpw-make.in (cplusfilt): Renamed from c++filt. - (INCLUDES): Add more paths. - - * mpw-make.in: New file, MPW makefile fragment for binutils. - (Normally automatically generated from Makefile.in.) - -Mon Mar 27 11:52:57 1995 Ian Lance Taylor - - * ar.c (write_archive): Call make_tempname to get output file - name, rather than using a fixed name based on the input file. - - * objcopy.c (make_tempname): Copy from here... - * bucomm.c (make_tempname): ...to here, and make global. - * bucomm.h (make_tempname): Declare. - -Fri Mar 24 11:47:42 1995 Ian Lance Taylor - - * strings.c: Include "bfd.h" before other headers. Include - "sysdep.h". - * bucomm.c (print_arelt_descr): Cast st_uid and st_gid to long, - and print them with %ld. - -Fri Mar 10 13:09:42 1995 Ian Lance Taylor - - * objcopy.c (strip_options): Add --keep-symbol. - (copy_options): Likewise. - (copy_usage): Mention --keep-symbol and -K. - (strip_usage): Likewise. - (keep_symbols): New static variable. - (is_strip_symbol): Adjust the return value according to - keep_symbols. - (strip_main): Handle -K. For -N, check that -K was not given. - (copy_main): Likewise. - * binutils.texi, objcopy.1, strip.1: Document -K. - -Mon Mar 6 13:33:47 1995 Stan Shebs - - * objcopy.c (copy_archive): Check result of mkdir. - (copy_main): Cast an xmalloc result. - - * objdump.c (usage): Break long format string into shorter ones. - -Mon Mar 6 13:46:12 1995 Ian Lance Taylor - - * bucomm.c (list_supported_targets): New function. - * bucomm.h (list_supported_targets): Declare. - * ar.c (usage): Call list_supported_targets. - * nm.c (usage): Likewise. - * objcopy.c (copy_usage, strip_usage): Likewise. - * objdump.c (usage): Likewise. - * size.c (usage): Likewise. - * strings.c (usage): Likewise. - -Tue Feb 28 15:13:58 1995 Ian Lance Taylor - - * bucomm.c (print_arelt_descr): Cast st_size to long before - passing it to fprintf. - -Fri Feb 17 13:36:45 1995 Ian Lance Taylor - - * objcopy.c (struct section_list): Add fields remove, set_flags, - and flags. Change adjust from boolean to enum. - (remove_sections): Remove static variable. - (sections_removed): New static variable. - (copy_options): Add --set-section-flags. - (copy_usage): Mention --set-section-flags. - (parse_flags): New static function. - (find_section_list): New static function. - (is_strip_symbol): Change return type from int to boolean. - (is_strip_section): New static function. - (filter_symbols): Call is_strip_section. - (copy_object): When adding sections, check for specified flags or - VMA. Call filter_symbols if any sections are being removed. - (setup_section): Use find_section_list function rather than - looking through remove_sections and adjust_sections. Handle - --set-section-flags. - (copy_section): Use find_section_list rather than looking through - remove_sections. - (strip_main): Use find_section_list instead of adding items to - sections_removed. - (copy_main): Use find_section_list instead of adding items to - sections_removed and adjust_sections. Handle --set-section-flags. - * binutils.texi, objcopy.1: Document --set-section-flags. - -Tue Feb 14 18:03:03 1995 Ian Lance Taylor - - * objdump.c (with_source_code): New global variable. - (usage): Mention -S/--source. - (long_options): Add --source. - (prev_functionname, prev_line): New static variables. - (struct print_file_list): Define. - (print_files): New static variable. - (skip_to_line, show_line): New static functions. - (disassemble_data): Call show_line to handle -l and -S. - (main): Handle -S. - * binutils.texi, objdump.1: Document -S/--source. - -Thu Feb 9 16:11:53 1995 Ian Lance Taylor - - * objcopy.c (copy_usage): Rename parameter to avoid shadowing. - (strip_usage): Likewise. - - * objcopy.c (struct section_add): Define. - (add_sections): New static variable. - (copy_options): Accept --add-section. - (copy_usage): Mention --add-section. - (copy_object): Add sections from the add_sections list. - (copy_main): Handle --add-section. - * binutils.texi, objcopy.1: Document --add-section. - -Wed Feb 1 15:04:57 1995 Ken Raeburn - - * objdump.c (disassemble_data): Pass section offset, not absolute - address, to bfd_find_nearest_line. - - * nlmconv.c (powerpc_mangle_relocs): Don't use const with - reloc_howto_type. - -Thu Jan 26 18:50:06 1995 Ian Lance Taylor - - * objdump.c (compare_symbols): Use bfd_asymbol_value (VAR) rather - than VAR->value. - (objdump_print_address): Likewise. - (disassemble_data): Don't change the symbol values. It can - confuse bfd_canonicalize_reloc. - -Thu Jan 26 12:03:56 1995 Michael Meissner - - * configure.in: Add support for powerpc-*-ebai. - -Wed Jan 18 10:02:12 1995 Steve Chamberlain - - * coffdump.c: Include sysdep.h. - (dump_coff_type): Handle coff_secdef_type. - * coffgrok.c : Include sysdep.h. - * srconv.c: Include libiberty.h - (absolute_p, dty_start, dty_end, dump_tree_structure): Remove. - -Wed Jan 18 12:24:14 1995 Ian Lance Taylor - - * coffdump.c (dump_coff_scope): Cast pointer to unsigned long for - printf. - * coffgrok.c: Include bucomm.h. Don't declare xmalloc. - (push_scope): Declare type of parameter link. - * size.c: Include libiberty.h. - * srconv.c: Include bucomm.h. - (find_base): Declare at top of file. - (wr_hd): Add default case to architecture switch. - (wr_dps_start): Declare type of parameter nest. - (wr_du): Comment out variables used only in commented out blocks. - (wr_dus): Remove unused variable i. - (wr_sc): Remove unused variables myinfo, low, and high. - * strings.c: Include libiberty.h. - * sysdump.c: Include . - -Tue Dec 20 19:13:44 1994 Ian Lance Taylor - - * ar.c (main): Ignore 'f' modifier used on HP/UX 9. - -Thu Dec 15 17:34:12 1994 Stan Shebs - - * ar.c, nm.c, objcopy.c, objdump.c: Include progress.h. - * ar.c, nm.c, objcopy.c, objdump.c (main): Add START_PROGRESS - and END_PROGRESS. - * ar.c (map_over_members, open_inarch): Call PROGRESS. - * nm.c (main, display_archive, filter_symbols, print_symbols): - Call PROGRESS. - - * objcopy.c (copy_usage): Break up long usage string. - -Wed Dec 14 15:51:56 1994 Ken Raeburn - - * objcopy.c (copy_object): Don't bother setting status after - nonfatal() "call", because it won't return. - -Fri Dec 9 00:22:54 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nlmconv.c (powerpc_mangle_relocs): Don't switch a reloc to use - the section symbol if the symbol is undefined. - -Thu Dec 8 14:45:50 1994 Ken Raeburn - - * objcopy.c (add_strip_symbol): Cast return value of xmalloc. - -Wed Nov 30 11:05:43 1994 Ian Lance Taylor - - * ar.c (replace_members): Pass current->filename to normalize when - checking for duplicates, because the filename of a newly added - file will not have been normalized yet. - -Thu Nov 17 15:00:13 1994 Ian Lance Taylor - - * ar.c (main): Don't call do_quick_append if any of the archive - names are longer than 14 characters. - - * objcopy.c (main): Fix is_strip test. From - pirker@eiunix.tuwien.ac.at (Martin Pirker). - -Thu Nov 17 15:37:19 1994 Mark W. Eichin - - * objcopy.c (add_strip_symbol): New function, adds a name to an - explicit list of symbols to strip. - (is_strip_symbol): New function, reports whether the name argument - is in the explicit list. - (filter_symbols): Check against is_strip_symbol above all. - (strip_main): Recognize -N option. If used, don't default to - strip_all. - (copy_main): Recognize -N option. - (strip_usage): Document -N and --strip-symbol options. - (copy_usage): Ditto. - * objcopy.1, strip.1, binutils.texi: Document -N and - --strip-symbol options. - -Tue Nov 8 13:12:54 1994 Ian Lance Taylor - - * objdump.c (display_target_list, display_info_table): Pass an - array to tmparg, rather than NULL, since some systems can't handle - NULL. - - * objcopy.c (copy_archive): Keep a list of the names of the - temporary files we created. Close each input BFD after we open - its successor. - -Mon Nov 7 15:48:39 1994 Ken Raeburn - - * Makefile.in (VERSION): Bump to 2.5.3. - -Thu Nov 3 19:04:34 1994 Ken Raeburn - - * Makefile.in (install-info): Install info files from whatever - directory they were found in. - - Patch from DJ Delorie: - * configure.bat: do c++filt -> cxxfilt right - - * sysinfo.y: Include system header files early, so any potential - declaration of abort() occurs before its use. - - * strings.c (strings_file): Try opening the file in binary mode - first. - -Wed Nov 2 15:44:13 1994 Ian Lance Taylor - - * ar.c (main): Treat ar qs like ar rs. - -Tue Oct 25 16:19:25 1994 Ian Lance Taylor - - * objcopy.c (gap_fill): Explicitly initialize, for clarity. - (pad_to_set, pad_to): New static variables. - (copy_options): Accept --pad-to. - (copy_usage): Mention --pad-to. - (copy_object): Support --pad-to. - (compare_section_vma): Sort non loadable sections to the front. - Sort sections with the same VMA by size. - (copy_main): Handle --pad-to. - * binutils.texi, objcopy.1: Document --pad-to. - -Thu Oct 20 13:51:31 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * objcopy.c (gap_fill_set, gap_fill): New static variables. - (copy_options): Accept --gap-fill. - (copy_usage): Mention --gap-fill. - (copy_object): Support --gap-fill. - (get_sections, compare_section_vma): New static functions. - (copy_main): Handle --gap-fill. - * binutils.texi, objcopy.1: Document --gap-fill. - -Wed Oct 19 14:09:16 1994 Ian Lance Taylor - - * Makefile.in (check): Add a dummy else clause to the if - statement. - - * objcopy.c (copy_object): Revert yesterday's change. - * binutils.texi, objcopy.1: Remove special mention of --set-start - and `binary' output format. - -Tue Oct 18 11:12:01 1994 Ian Lance Taylor - - * objcopy.c (copy_object): If the output file format is `binary', - and the start address was not set using --set-start, default the - start address to zero. This hack is because the `binary' output - file format uses the start address to set the virtual address of - the first byte in the file. - * binutils.texi, objcopy.1: Add some notes on generating S-records - and binary files. - - * nm.c (print_symdef_entry): Call print_symname to print the - symbol name, so that --demangle works. - - * Makefile.in (mostlyclean): Remove tmpdir. - - * objcopy.c (struct section_list): Add fields used, adjust, val. - (adjust_start, set_start_set, set_start): New static variables. - (adjust_section_vma, adjust_sections): New static variables. - (copy_options): Add --adjust-start, --adjust-vma, - --adjust-section-vma, --adjust-warnings, --no-adjust-warnings, - --set-start. - (parse_vma): New static function. - (copy_usage): Mention new options. - (copy_object): Handle --set-start and --adjust-start. - (setup_section): Correct type of last argument to PTR. Set used - field if section is removed. Handle --adjust-vma and - --adjust-section-vma. - (copy_section): Correct type of last argument to PTR. - (mark_symbols_used_in_relocations): Likewise. - (strip_main): Clear used field when handling -R. - (copy_main): Handle new options. - * binutils.texi (objcopy): Document new options. - * objcopy.1: Document new options. - -Fri Oct 14 14:38:13 1994 Ian Lance Taylor - - * configure.in (configdirs): Remove definition--testsuite is no - longer configured. - * Makefile.in (testsuite): Remove target. - (site.exp): New target. - (check): Rewrite. - (clean, distclean): Don't recur into testsuite directory. - -Thu Oct 13 19:24:09 1994 Ken Raeburn - - * Makefile.in (VERSION): Updated to 2.5. - * Version 2.5 released. - -Tue Oct 11 15:26:42 1994 Ian Lance Taylor - - * Makefile.in (sysdump.o): Depends upon sysroff.c. - -Mon Oct 10 13:50:30 1994 J.T. Conklin (jtc@rtl.cygnus.com) - - * nlmconv.c (link_inputs): Pass -Ur flag to ld so that the - ctor/dtor tables needed by C++ programs are built. - -Sun Oct 9 18:04:00 1994 Jim Wilson (wilson@sphagnum.cygnus.com) - - * Makefile.in (srconv.o): Add dependence on sysroff.c. - -Tue Oct 4 12:19:51 1994 Ian Lance Taylor - - * configure.in: Use ${config_shell} when running config.bfd. - - * Makefile.in (sysroff.h): Split target away from sysroff.c. - (srconv.o, sysdump.o): New targets. - (srconv, sysdump): Don't depend upon sysroff.c. - -Wed Sep 28 13:04:34 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * Makefile.in (arparse.c): Don't ignore errors from mv. - (sysinfo.c): Likewise. Also, depend upon arparse.c, to prevent a - parallel make from trying to build both arparse.c and sysinfo.c - simultaneously. - (nlmheader.c): Similar change. - (arparse.h): Separate target from arparse.c, so that a parallel - make does not try to build both at once. Depend upon arparse.c. - (sysinfo.h): Similar change. - - * objdump.c (disassemble_data): Pass the reloc buffer to free, not - the pointer used to loop over the relocs. - -Sat Sep 24 16:16:57 1994 Stan Shebs (shebs@andros.cygnus.com) - - * objdump.c (disassemble_data): Cast result of xmalloc. - -Wed Sep 21 19:30:35 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * objdump.c (sorted_syms, sorted_symcount): New global variables. - (objdump_print_address): Use sorted_syms and sorted_symcount - instead of syms and symcount. - (disassemble_data): Don't bother to get the relocs before looping - over the sections. Before filtering and sorting the symbol table, - copy it into sorted_syms. - -Fri Sep 16 11:27:39 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * objdump.c (struct objdump_disasm_info): Add field require_sec. - (objdump_print_address): If aux->require_sec, require that the - symbol be in aux->sec even if HAS_RELOC is not set. If we can't - find a smaller symbol in the right section, look for a larger one. - (disassemble_data): Set aux.require_sec around the - objdump_print_address call for the instruction address. - -Thu Sep 15 21:43:17 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * ar.c: Call xexit rather than exit. - (output_filename, output_file, output_bfd): New static variables. - (remove_output): New static function. - (main): Call xatexit (remove_output). Call xexit rather than - returning. - (extract_file): Set output_filename and output_file while output - file is open. - (write_archive): Likewise, but use output_bfd, not output_file. - * arsup.c: Include libiberty.h. Call xexit rather than exit. - * bucomm.c: Likewise. - - * objdump.c (disassemble_all): New global variable. - (usage): Document --disassemble-all. - (long_options): Add disassemble-all as a synonym for -D. - (compare_symbols): Make pointers const. - (compare_relocs): New static function. - (disassemble_data): Rename disassemble to disassemble_fn to avoid - shadowing. If dump_reloc_info, print relocs along with - disassembly. Skip sections which are not SEC_CODE unless - disassemble_all or only is set. - (display_bfd): Don't call dump_relocs if disassemble is set. - (main): Accept and handle -D. - * binutils.texi: Document -D/--disassemble-all. - * objdump.1: Likewise. - -Wed Sep 14 12:19:07 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * objdump.c (disassemble_data): Initialize prevline to 0. Make - prev_function non const. Copy functionname into an malloc buffer - when setting prev_function, instead of assuming that the string - will last forever. - - * nm.c: Include libiberty.h. - (sort_by_size): New static variable. - (long_options): Add --size-sort. - (usage): Mention --size-sort. - (numeric_forward): Make static. Change from void * to PTR. - (numeric_reverse): Likewise. - (non_numeric_forward, non_numeric_reverse): Likewise. - (sorters): Change declaration from void * to PTR. - (size_forward, sort_symbol_by_size): New static functions. - (display_rel_file): Handle sort_by_size. - (filter_symbols): If sort_by_size, discard absolute and undefined - symbols. - * binutils.texi (nm): Document --size-sort. - * nm.1: Document --size-sort. - -Tue Sep 13 21:06:06 1994 Jeff Law (law@snake.cs.utah.edu) - - * objcopy.c (copy_main): Initialize input_filename and - output_filename to NULL. - -Tue Sep 13 14:17:24 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * Makefile.in (version.o): Depend upon Makefile, so that version.o - gets rebuilt when make variable VERSION is changed. - - * objdump.c (dump_section_header): Print the SEC_NEVER_LOAD flag. - -Wed Aug 24 12:40:09 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * configure.in: Change i[34]86 to i[345]86. - -Tue Aug 23 11:00:40 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * ar.c (ranlib_touch): Don't update the archive map if there isn't - one. - -Mon Aug 22 16:02:18 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * ar.c: Include libiberty.h. - (inarch): Remove variable. - (map_over_members): Make static. Add arch argument, and use it - instead of inarch. Change all callers. - (main): Treat --version as -v. Accept -t argument. Accept any - number of archive arguments. Catch and use open_inarch return - value, rather than using inarch. - (open_inarch): Return newly opened BFD, rather than using inarch. - (do_quick_append): Make archive_filename const. - (write_archive): Add iarch argument, and use it instead of inarch. - Change all callers. - (delete_members, move_members, replace_members): Likewise. - (ranlib_only): Don't exit on success. Catch and use open_inarch - return value. - (ranlib_touch): New function. - * arsup.h (map_over_members): Don't declare. - (ar_end, ar_extract): Declare. - (open_inarch): Change return value in declaration to bfd *. - * arsup.c (map_over_list): Make static. Always pass two arguments - to function. Add arch argument, and use it instead of inarch. - Change all callers. - (ar_directory_doer): Make static. Add ignored second argument. - Change all callers. - (ar_directory): Use open_inarch return value rather than inarch. - (ar_addlib_doer): Make static. - (ar_addlib): Use open_inarch return value rather than inarch. - (ar_extract): Remove unused local variable abfd. - -Thu Aug 11 14:55:57 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - Add support for removing named sections to objcopy and strip. - * objcopy.c (struct section_list): Define. - (remove_sections): New static variable. - (strip_options, copy_options): Add remove-section. - (copy_usage, strip_usage): Mention -R and --remove-section. - (setup_section): If section is in remove_sections list, ignore it. - (copy_section): Likewise. - (strip_main, copy_main): Handle -R. - * binutils.texi, objcopy.1, strip.1: Document new options. - -Wed Aug 10 10:19:55 1994 Stan Shebs (shebs@andros.cygnus.com) - - * nlmconv.c (powerpc_mangle_relocs): Rename symvalue to sym_value, - so as not to conflict with the symvalue typedef in bfd.h. - -Mon Aug 1 13:19:09 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * nlmheader.y: Per current NetWare docs, accept a revision number - of 0 and treat a revision number greater than 26 as 0. - -Mon Jul 25 12:58:36 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * objdump.c (objdump_print_address): Correct handling of end of - symbols when looking for next symbol with a different value. - -Fri Jul 22 16:48:34 1994 Ken Raeburn (raeburn@cujo.cygnus.com) - - * nm.c (numeric_forward): Treat undefined symbols as "less than" - defined symbols with zero values. If numeric values are equal, or - both symbols are undefined, sort alphabetically. Don't assume - that the difference of two bfd_vma values will truncate to "int" - and still have the same sign. - (numeric_reverse): Call numeric_forward and negate the result. - (print_symbol_info_bsd): For undefined symbols, print leading - spaces equivalent to the width of a printed bfd_vma, rather than - assuming that 8 will look right. - -Fri Jul 22 10:36:50 1994 Steve Chamberlain (sac@jonny.cygnus.com) - - * coffgrok.c (doit): Zero all fields of new structure. - * srconv.c (sysroff_swap_*_out): Remove redundant trailing arg. - * sysinfo.y: Generate sysroff_swap_*_out without requiring extra - arg. - -Fri Jul 22 10:09:53 1994 J.T. Conklin (jtc@phishhead.cygnus.com) - - * nlmheader.y: Make "stack" and "stacksize" synonyms in the lexer - rather than the parser. - -Thu Jul 21 10:25:09 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * config/mh-alphaosf, config/mh-apollo68v, config/mh-delta88: - Remove; obsolete. - -Sat Jul 16 22:34:39 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * objdump.c (slurp_dynamic_symtab): Try to get the dynamic symbols - even if the bfd is not marked DYNAMIC. ELF executables are not - marked DYNAMIC, but do have dynamic symbols. - -Fri Jul 15 01:41:35 1994 Steve Chamberlain (sac@jonny.cygnus.com) - - * coffgrok.c (do_where): Make data with no type 'int'. - (do_define): Keep info on source file of a symbol. - * coffgrok.h (coff_symbol): New field. - * srconv.c (PROGRAM_VERSION): Now 1.3 - (wr_rl): Use external ref number for symbol. - (wr_dus): Only keep one source file per debug unit. - (wr_dln): Always emit line numbers for first source file, - (wr_globals): Emit globals in the du of their owning source file. - -Mon Jul 11 15:59:03 1994 J.T. Conklin (jtc@phishhead.cygnus.com) - - * nlmheader.y: Null terminate var_hdr->threadName. - -Fri Jul 8 17:33:22 1994 Ken Raeburn (raeburn@cujo.cygnus.com) - - * Makefile.in (syslex.o, sysinfo.o): Permit C source files to be - in $(srcdir), as they will be for FSF releases. - -Wed Jul 6 01:13:14 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nlmconv.c (setup_sections): Preserve existing section flags when - copying in flags from a new section. - -Tue Jul 5 15:56:01 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * objcopy.c: Include libiberty.h. - (copy_file): If output_target is NULL, set it to the target of the - input file. - -Wed Jun 29 17:17:14 1994 J.T. Conklin (jtc@phishhead.cygnus.com) - - * nlmconv.c (link_inputs): Fixed memory allocation bug. - -Thu Jun 23 12:52:46 1994 David J. Mackenzie (djm@rtl.cygnus.com) - - * configure.in: Change --with-targets to --enable-targets. - -Tue Jun 21 12:53:21 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * Makefile.in (sysinfo): Does not depend upon $(ADDL_LIBS). - - * nlmconv.c (powerpc_build_stubs): Don't generate the PowerPC - NetWare custom header; no longer needed. - (powerpc_mangle_relocs): Convert relocs against the uninitialized - data section into relocs against the data section. - - * configure.in: Set nlmconv_defs to -DNLMCONV_cputype for all the - netware targets. Write it into Makefile as NLMCONV_DEFS. - * Makefile.in (nlmconv.o): Pass $(NLMCONV_DEFS) to $(CC). - * nlmconv.c: Only compile code for specific CPU types if - NLMCONV_cputype is defined. - - * nlmconv.c (main): Change uses of bfd_abs_section, etc., to use - bfd_abs_section_ptr or bfd_is_abs_section, etc. - (i386_mangle_relocs, alpha_mangle_relocs): Likewise. - (powerpc_build_stubs): Likewise. - * nm.c (filter_symbols, print_symbols): Likewise. - * objcopy.c (filter_symbols): Likewise. - (mark_symbols_used_in_relocations): Likewise. - * objdump.c (remove_useless_symbols, dump_relocs): Likewise. - * size.c (sysv_internal_printer): Likewise. - -Mon Jun 20 16:43:03 1994 Ken Raeburn (raeburn@cujo.cygnus.com) - - * Makefile.in (MANPAGES): Remove $(DEMANGLER_PROG). - (install): Install it explicitly, from build dir, not srcdir. - -Mon Jun 20 16:29:54 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) - - * objdump.c: Don't include elf/internal.h. - (bfd_elf_find_section): Don't declare. - (read_section_stabs): No special handling for ELF. Always read - using BFD sections. - -Thu Jun 16 17:25:20 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * configure.in: Set UNDERSCORE in Makefile based on result of - invoking config.bfd with a second argument of ``_''. - * Makefile.in (underscore.c): Depend upon Makefile. Don't try to - run $(CC) and $(NM), just use $(UNDERSCORE). Create via temporary - file. - (demangle.o): Remove target. - ($(NM_PROG)): Don't depend upon demangle.o, and don't link against - demangle.o. It's in libiberty anyhow. - (cplus-dem.o): Don't depend upon demangle.o. - * binutils.texi: Mention -n and --no-strip-underscores arguments - to c++filt. - -Wed Jun 15 12:10:31 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nm.c (long_options): Add --no-demangle to turn off --demangle, - and --no-cplus for Linux compatibility. - (usage): Mention --no-demangle. - * binutils.texi: Document --no-demangle. - -Fri Jun 10 15:41:25 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nm.c: HOST_64_BIT was renamed to BFD_HOST_64_BIT. - - * objcopy.c (copy_archive): Make the temporary directory in the - same directory as the output BFD, since we may not have write - permission on the current directory. Set the permissions of the - new directory to 0700, not 0777. - -Mon Jun 6 21:36:43 1994 D. V. Henkel-Wallace (gumby@cygnus.com) - - * configure.in: if this is an rs6000 (and we're not building for - any other bfd targets) then build only nm (collect needs it on - rs6000-lynx). - - * Makefile.in: define TOOL_PROGS which the list of programes to - install in $tooldir -- replaces a hard-coded list. - -Fri Jun 3 10:59:18 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * objdump.c (display_target_list): Remove unused local ok. - -Thu May 26 18:05:52 1994 Ken Raeburn (raeburn@cujo.cygnus.com) - - * config/mh-alphaosf (CFLAGS): Don't specify both -g and -O; - they're not compatible under native cc. Use -O1 instead. - - * Makefile.in (VERSION): Updated to cygnus-2.4.1. - - Changes from binutils-2.4 net release: - - * Makefile.in (MANPAGES): Use $(DEMANGLER_PROG). - ($(DEMANGLER_PROG).1): Build from cxxfilt.man, using sed. - * cxxfilt.man: Renamed from c++filt.1, replaced "c++filt" with - magic token to be replaced by sed. - - Wed May 11 22:32:00 1994 DJ Delorie (dj@ctron.com) - - * configure.bat: update for latest makefile.in - -Fri May 13 23:25:13 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * bucomm.c: Check ANSI_PROTOTYPES rather than __STDC__. - -Tue May 10 18:22:06 1994 Jason Molenda (crash@sendai.cygnus.com) - - * objcopy.c (copy_section): Set section size correctly if using - interleave. - -Sat May 7 16:49:36 1994 Steve Chamberlain (sac@cygnus.com) - - * Makefile.in: Add rule for sysinfo.h - -Fri May 6 12:18:33 1994 Steve Chamberlain (sac@cygnus.com) - - * Makefile.in (SRCONV_PROG): Define. - (PROGS): Use $(SRCONV_PROG) too. - -Thu May 5 19:41:43 1994 Ken Raeburn (raeburn@cujo.cygnus.com) - - * Makefile.in (DISTSTUFF): Add sysinfo.c, syslex.c, in case - someone configures with `targets=all'. - (distclean): Remove y.*. - (syslex.o): Depend on sysinfo.h. - (sysinfo.c): Rename y.tab.h to sysinfo.h. - (install-info): Don't try to install into $(infodir)/$(srcdir). - * syslex.l: Include sysinfo.h, not y.tab.h. - -Thu May 5 11:50:55 1994 Ken Raeburn (raeburn@kr-pc.cygnus.com) - - * syslex.l (yywrap): Define as function if not defined as a macro. - - * Makefile.in (objdump.o): Deleted special rule. - * configure.in: Don't bother building ARCHDEFS variable for - Makefile. - * objdump.c (ARCH_*): Deleted handling. - (disassemble_data): Call `disassembler' from opcodes library. - -Thu May 5 13:28:42 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * Makefile.in (install): Correct handling of $(tooldir) and - $(bindir) being on different devices. - -Fri Apr 29 09:50:38 1994 Steve Chamberlain (sac@cygnus.com) - - * sysdump.c (h8300, sh): Add declarations. - -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, - sysroff.info: Major changes. - -Tue Apr 26 18:18:24 1994 Stan Shebs (shebs@andros.cygnus.com) - - * objdump.c (print_section_stabs): Indicate the stab header symbol - more clearly, print numbers of unrecognized stab n_type values. - -Tue Apr 26 16:22:55 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nlmconv.c (copy_sections): Copy arelent pointers, not arelents. - -Mon Apr 25 16:14:32 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * Makefile.in (distclean): Remove $(PROGS) and underscore.c. - -Fri Apr 22 11:14:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nlmconv.c (setup_sections): Remove special handling of .reginfo - section. - (copy_sections): Likewise. - (alpha_mangle_relocs): Use bfd_ecoff_get_gp_value rather than the - special ECOFF .reginfo section. - - * objcopy.c (copy_object): Call bfd_copy_private_bfd_data after - copying everything else, to let it fiddle with the file in its - final state. - - * objdump.c: Include libiberty.h. - (display_target_list): If a format fails, just go on to the next - one. Check return value of bfd_set_format. - (display_info_table): Likewise. Don't increment loop variable in - for loop test, since that skips the first element. - (display_target_tables): Rewrite loop for clarity. Ensure that it - always prints at least one element. - - * nlmconv.c (main): Use CyGnUsEx rather than CyGnUsSeCs for - sections header. Rename from cygnus_sections to cygnus_ext. - -Thu Apr 21 12:12:26 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * objdump.c (_DUMMY_NAME_): Don't define. - (display_target_list): Use tmpnam to get a file name rather than - using _DUMMY_NAME_. Unlink it when done. - (display_info_table): Likewise. - - * nlmconv.c (secsec): New static variable. - (main): Create .nlmsections section in output BFD. Store - information about it in sections header. - (setup_sections): Allocate space in sections header. - (copy_sections): Copy zero sized sections. Put information about - each section in the sections header. - -Wed Apr 20 14:34:51 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nlmconv.c (powerpc_build_stubs): Take new outbfd argument. - Change caller. Create custom header for new PowerPC NetWare - format. - - * Makefile.in (nlmheader.o, nlmconv.o): Update dependencies. - * nlmconv.c: Include bfd.h and libiberty.h with "", not <>. - * nlmheader.y: Include bfd.h with "", not <>. - -Wed Apr 13 10:52:50 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * objdump.c: Do an ifdef on __GO32__, not unix. - -Wed Apr 6 21:54:49 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - Added -D (--dynamic) option to nm and -T (--dynamic-syms) and -R - (--dynamic-reloc) arguments to objdump. - * nm.c (dynamic): New static variable. - (long_options): Added "dynamic". - (usage): Mention -D and --dynamic. - (main): Add D to getopt string. Handle -D by setting dynamic. - (display_rel_file): If dynamic is non-zero, read dynamic symbols - rather than normal symbols. - * nm.1: Updated for -D (--dynamic) option. - * objdump.c (dump_dynamic_symtab): New global variable. - (dump_dynamic_reloc_info): New global variable. - (dynsyms, dynsymcount): New global variables. - (usage): Mention -R, -T, --dynamic-syms and --dynamic-reloc. - (long_options): Added "dynamic-reloc" and "dynamic-syms". - (slurp_symtab): If no symbols, return rather than exit. - (slurp_dynamic_symtab): New function. - (display_bfd): Handle dump_dynamic_symtab and - dump_dynamic_reloc_info. - (dump_symbols): Take new dynamic argument, indicating whether to - display dynamic symbols. - (dump_relocs): Move most printing into dump_reloc_set. - (dump_dynamic_relocs): New function. - (dump_reloc_set): New function, extracted from dump_relocs. - (main): Add R and T to getopt string. Handle -T by setting - dump_dynamic_symtab and -R by setting dump_dynamic_reloc_info. - * objdump.1: Updated for -R (--dynamic-reloc) and -T - (--dynamic-syms) options. - * binutils.texi: Updated for new nm and objdump options. - -Wed Mar 30 15:52:40 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - Update for recent BFD changes to symbol and reloc reading. Rename - all uses of get_symtab_upper_bound to bfd_get_symtab_upper_bound. - Also: - * coffgrok.c (symcount): Change to long. - (do_sections_p1): Check for error return from - bfd_get_reloc_upper_bound. Change relcount to long, and check for - error from bfd_canonicalize_reloc. - (coff_grok): Change storage to long. Check for error from - bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. - * nlmconv.c (main): Change symcount, newsymalloc, newsymcount, and - i to long. Check for error from bfd_get_symtab_upper_bound and - bfd_canonicalize_symtab. - (copy_sections): Change reloc_size and reloc_count to long. Check - for error from bfd_get_reloc_upper_bound and - bfd_canonicalize_reloc. - (mangle_relocs, i386_mangle_relocs, alpha_mangle_relocs): Change - reloc_count_ptr argument to long *. Make corresponding changes to - variables loaded from *reloc_count_ptr. - * nm.c (display_rel_file): Change storage and symcount to long. - Check for errors from bfd_get_symtab_upper_bound and - bfd_canonicalize_symtab. - * objcopy.c (filter_symbols): Change symcount, src_count and - dst_count to long. - (copy_object): Change symcount to long. Pass another argument to - fprintf. Check for errors from bfd_get_symtab_upper_bound and - bfd_canonicalize_symtab. - (copy_section): Change relcount to long. Check for errors from - bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. - (mark_symbols_used_in_relocations): Change relcount and i to long. - Check for errors form bfd_get_reloc_upper_bound and - bfd_canonicalize_reloc. - * objdump.c (storage): Remove global variable. - (symcount): Changed to long. - (slurp_symtab): New local variable storage. Check for errors from - bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. - (remove_useless_symbols): Change return value and count to long. - (objdump_print_address): Change min, max, thisplace and i to long. - (disassemble_data): Change i to long. - (dump_symbols): Change count to long. - (dump_relocs): Change relcount to long. Check for errors from - bfd_ret_reloc_upper_bound and bfd_canonicalize_reloc. - (display_info_table): Add casts when passing LONGEST_ARCH for - printf %* argument. - -Tue Mar 29 14:59:04 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nm.c (display_archive): Close each archive element after it has - been displayed. - * objdump.c (display_file): Likewise. - -Mon Mar 28 13:04:08 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * configure.in: Change error message to refer to bfd/config.bfd - rather than bfd/configure.in. - -Sun Mar 27 16:23:39 1994 Jeffrey A. Law (law@snake.cs.utah.edu) - - * More fixes for object formats which allow multiple sections - with the same name: - * objcopy.c (setup_section): Make a new output section even if - one already exists with the given name. - (copy_section): Use isection->output_section rather than trying - to look the output section up by its (possibly non-unique) name. - - * Makefile.in (install-info): Look for binutils.info in the - current directory, then in $(srcdir). Don't use $<. - -Mon Mar 21 12:55:45 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * objdump.c (objdump_print_address): Make static. Declare with - prototype. Change vardiff from int to bfd_signed_vma. Correct - binary search termination condition. When looking for same - section symbol in relocatable file, handle final symbol correctly. - -Sun Mar 20 11:26:36 1994 Jeffrey A. Law (law@snake.cs.utah.edu) - - * Makefile.in: Avoid bug in hpux sed. - - * objcopy.c: Changes to keep it from stripping symbols used - in output relocations. - (mark_symbols_used_in_relocations): New function. Mark symbols - used in output relocations with BSF_KEEP. - (filter_symbols): Do not strip symbols marked with BSF_KEEP. - (copy_object): Reorder actions. First setup sections, then - build the output symbol table, then copy the section contents. - -Fri Mar 18 10:53:55 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * ar.c (write_archive): Allocate space for the null byte. From - Robert Lipe . - -Thu Mar 17 16:20:28 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * Makefile.in: Built nm.new and strip.new to avoid problems with - collect when . is in PATH. - (STRIP_PROG): Change from strip to strip.new. - (NM_PROG): Change from nm to nm.new. - (install): Remove the .new when installing. - -Wed Mar 16 16:27:05 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nlmconv.c (powerpc_build_stubs): Set BSF_DYNAMIC flag for each - symbol for which we build a stub. - (powerpc_mangle_relocs): Only reset TOC pointer for a call to a - symbol with BSF_DYNAMIC flag set. - -Tue Mar 15 23:04:13 1994 Jeffrey A. Law (law@snake.cs.utah.edu) - - * objcopy.c (filter_symbols): Use bfd_is_local_label to determine - if a symbol represents a compiler-generated local label. - (copy_object): Give the BFD backends a chance to copy any private - bfd data from the input BFD to the output BFD. - (setup_section): Give the BFD backends a chance to copy any private - section data from the input section to the output section. - -Mon Mar 14 11:15:58 1994 Jeffrey A. Law (law@snake.cs.utah.edu) - - * objcopy.c (mangle_section): Delete unused function. - (setup_section): Set osection here instead of calling - mangle section to do it. - -Mon Mar 14 12:11:01 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * ar.c (write_archive): Close inarch before unlinking it. - -Fri Mar 11 22:20:48 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nlmconv.c (main): For PowerPC, call powerpc_build_stubs and - powerpc_resolve_stubs. Use __GOT0, not __toc_start. Handle it if - the start and end symbols are not in the text section. - (struct powerpc_stub): New struct definition. - (powerpc_stubs, powerpc_stub_insns): New static variables. - (powerpc_initial_got_size): New static variable. - (powerpc_build_stubs): New function. - (powerpc_resolve_stubs): New function. - (powerpc_mangle_relocs): Clear extraneous data in .got section. - Rearrange reloc handling to handle ELF relocs that are not - partial_inplace. Resolve PC relative relocs. - -Wed Mar 9 13:48:11 1994 Steve Chamberlain (sac@jonny.cygnus.com) - - * ar.c (move_members): Fix it so that the abi positional modifiers - don't delete all archive members following the insert point. - -Tue Mar 8 13:14:43 1994 Steve Chamberlain (sac@jonny.cygnus.com) - - * coffgrok.[ch]: New files, understand coff objects. - * coffdump.c: Uses coffgrok to dump out the debug info of a coff - file. - * sysroff.info: Description of a SYSROFF object file. - * sysinfo.y, syslex.l: Parse info file, generate a reader, writer, - header files and a printer. - * srconv.c: Uses coffgrok.c and sysroff.info to convert a coff - file to a SYSROFF file. - -Sat Feb 26 13:35:26 1994 Stan Shebs (shebs@andros.cygnus.com) - - * ar.c (do_quick_append): Pad with a genuine character 10, - rather than whatever '\n' might happen to be. - -Tue Feb 22 18:25:52 1994 Ian Lance Taylor (ian@cygnus.com) - - * nlmconv.c (main): Ignore debugging symbols when looking for - special symbols by name. - -Sun Feb 20 18:47:42 1994 Ian Lance Taylor (ian@lisa.cygnus.com) - - * nlmconv.c: Include libiberty.h. - - Support for PowerPC NetWare. - * nlmconv.c (main): For PowerPC NetWare, automatically define the - special symbols __toc_start. - (select_output_format): Handle bfd_arch_powerpc. - (mangle_relocs): Likewise. - (powerpc_mangle_relocs): New function. - -Thu Feb 17 09:28:23 1994 David J. Mackenzie (djm@thepub.cygnus.com) - - * ar.c, bucomm.c, nlmconv.c, nm.c, objcopy.c, objdump.c, - size.c: Use bfd_get_error and bfd_set_error and new error names. - -Fri Feb 11 15:54:51 1994 David J. Mackenzie (djm@thepub.cygnus.com) - - * objcopy.c (strip_main, copy_main): Add missing 'break' in switch. - -Mon Feb 7 19:45:52 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * objdump.c (disassemble_data): Handle bfd_arch_powerpc. - -Sun Feb 6 22:08:20 1994 David J. Mackenzie (djm@thepub.cygnus.com) - - * strings.c objdump.c nlmconv.c objcopy.c nm.c ar.c size.c (main): - Call xmalloc_set_program_name. - -Fri Feb 4 10:46:01 1994 David J. Mackenzie (djm@thepub.cygnus.com) - - * objcopy.c (filter_bytes): Make MEMHUNK a char *, not PTR, so we - can do arithmetic on it. - -Thu Feb 3 14:06:41 1994 David J. Mackenzie (djm@thepub.cygnus.com) - - * objdump.c (dump_section_stabs, read_section_stabs, - print_section_stabs): Functions broken out of dump_stabs_1. - Free the stabs and strings when done with them. - -Wed Feb 2 13:42:23 1994 David J. Mackenzie (djm@thepub.cygnus.com) - - * nlmconv.c (main): Use bfd_get_flavour instead of struct member. - * ar.c (print_contents, extract_file), size.c - (print_berkeley_format, print_sysv_format): Use bfd_get_filename and - bfd_my_archive instead of dereferencing the structs directly. - - * ar.c: Use bfd_fatal and bfd_nonfatal instead of bfd_perror and exit. - Indent. Remove DEFUNs. - - * nlmconv.c (main), objcopy.c (copy_file): Print matching formats - if ambiguous match. - * nm.c (display_file, display_archive), size.c (display_bfd): - Eliminate gotos. - Print matching formats if there is an ambiguous match. Use - bfd_nonfatal instead of hardcoded error message if nothing matches. - - * arsup.c, ar.c, objdump.c: Use bfd_get_filename instead of - abfd->filename. - - * nm.c (display_archive): New function, from code in display_file. - (display_rel_file): Renamed from do_one_rel_file. - - * size.c: Indent. - (display_archive): New function from code in display_file. - (display_file): Check bfd_close error return. - - * strings.c (strings_object_file): Check bfd_check_format - error return. - - * strings.c, objdump.c, size.c: Use bfd_nonfatal instead of bfd_perror. - - * bucomm.c: Delete references to exit_handler. It wasn't set - anywhere, and now that we're using the libiberty xmalloc, it - wouldn't always get called before exiting. - (list_matching_formats): Function moved from objdump.c. - * bucomm.h: Declare it. - - * objdump.c (disassemble_data): Move some variable decls closer to - their use. Add some comments. Replace a nested block with a - return. - -Mon Jan 31 18:50:41 1994 Stan Shebs (shebs@andros.cygnus.com) - - * objdump.c (display_target_list, display_info_table): Check that - the bfd of the dummy output file is not null. - -Wed Jan 26 13:13:18 1994 David J. Mackenzie (djm@thepub.cygnus.com) - - * objcopy.c (filter_bytes): New function. - (copy_section): Call it. - (copy_options, copy_usage, copy_main): Add --byte option to - activate it. Appropriate the -b option (which was an undocumented - synonym for -F) for it, also. Add --interleave, -i option for - additional control. - (setup_section, copy_section, mangle_section): Renamed with no `s' - on the end. - * objcopy.1, binutils.texi: Document the new options. - - * objdump.c (display_target_tables, display_target_list): - New functions broken out of display_info. - Eliminate some magic constants. Use more meaningful variable names. - (dump_bfd_header): New function broken out of display_bfd. - (dump_section_header): New function broken out of dump_headers. - (remove_useless_symbols): Don't shadow global variable name with - parameter. - (objdump_print_address): Fix backward test. - -Tue Jan 25 19:40:54 1994 Stan Shebs (shebs@andros.cygnus.com) - - * bucomm.c (print_arelt_descr): Change decl of `when' to time_t. - * objdump.h: Removed. - -Mon Jan 24 13:29:02 1994 David J. Mackenzie (djm@thepub.cygnus.com) - - * objdump.c (display_file): Remove call to list_matching_formats. - It would never be called. - (list_matching_formats): Take an arg giving the list of matching - formats. - (display_bfd): Pass the arg, and get it filled in by calling - bfd_check_format_matches instead of bfd_check_format. - (display_info, display_info_table): target_vector was renamed to - bfd_target_vector. - - * binutils.texi (objdump): Note some limitations of -h section - address printing. - -Sat Jan 22 16:20:46 1994 Stan Shebs (shebs@andros.cygnus.com) - - * Makefile.in (MALLOC): Set to emptiness by default. - (ALL_CFLAGS): Add and use. - (arparse.h): Make it depend on arparse.y. - * ar.c (libbfd.h): Don't require to be in ../bfd. - * objdump.c (comp): Rename to compare_symbols. - -Fri Jan 21 20:22:30 1994 David J. Mackenzie (djm@thepub.cygnus.com) - - * objdump.c (list_matching_formats): If the file format is ambiguous, - print the matching names so the user can choose one. - (display_bfd): Call it. - (display_file): Call it. - -Fri Jan 21 19:17:25 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * objdump.c (disassemble_data): Support bfd_arch_rs6000. - -Mon Jan 17 13:57:25 1994 Stan Shebs (shebs@andros.cygnus.com) - - * objdump.c (stab_name): Allocate dynamically. - (stab_print): Use pointers to strings instead of char arrays. - (dump_stabs): Change alloc and init of arrays appropriately. - (dump_stabs_1): Always decide whether to print stab_name or - the stab's type number, if unnamed. - -Fri Jan 14 14:42:48 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * objcopy.c (strip_main, copy_main): Don't clobber the input file - if copy_file fails. - - * nlmconv.c (main): Warn about an attempt to use a shared library - with uninitialized data. - - * nlmconv.c (setup_sections): Make sure that we align the - output_offset of each input section appropriately. - -Thu Jan 13 17:32:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * objdump.c (dump_relocs): Don't crash if section name is NULL. - -Tue Jan 11 19:46:33 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * filemode.c (filemodestring): Commented out; not used. - (mode_string): Use POSIX definitions. - (ftypelet): Likewise. - (rwx): Removed; no longer used. - * bucomm.c: Include bucomm.h. - (bfd_nonfatal, bfd_fatal): Argument is const. - (fatal): Make __STDC__ version. - * bucomm.h (mode_string): Declare. - * Makefile.in (bucomm.o): Depend upon bucomm.h - -Sun Jan 9 12:03:20 1994 Ken Raeburn (raeburn@rtl.cygnus.com) - - * bucomm.c (xmalloc, xrealloc): Deleted. - * bucomm.h (xmalloc, xrealloc): Fix prototypes, to correspond to - libiberty version of functions. - -Thu Jan 6 06:18:15 1994 David J. Mackenzie (djm@thepub.cygnus.com) - - * binutils.texi: Add a chapter summarizing the ways to select - aspects of the target for each program. - - * objdump.c (long_options, usage): Add long equivalents for all - remaining short options that lacked them. - * binutils.texi objdump.1: Document them. - - * size.c (usage): Tweak usage message. - * size.1: Add missing `=' in examples. - - * binutils.texi strip.1 objcopy.1 nlmconv.1 objcopy.c nlmconv.c: - Use "--target=bfdname" as the option to select the BFD target, - like nm and size already do. - Reserve "--format=format" for textual output selection options, but - for now keep old option names as obsolete for backward compatibility. - - * strings.c (main, strings_object_file, usage): Add --target option. - * binutils.texi strings.1: Document it. - -Sat Jan 1 13:58:24 1994 David J. Mackenzie (djm@thepub.cygnus.com) - - * ar.c (main): Add \n in error message. - -Thu Dec 23 12:23:11 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - gcc -Wall lint: - * ar.c (main): Put parens around assignment used as truth value. - * objcopy.c (strip_main): Remove unused variables. Return 0. - (copy_main): Remove unused variables. Return 0. - * objdump.c (display_bfd): Declare return value as void. - (stab_print): Use "" instead of 0 to initialize array. - (dump_stabs_1): Print vma using printf_vma. - (display_info): Put parens around assignment used as truth value. - * strings.c (print_strings): Cast printf arguments. - - * objcopy.c (copy_main): Use copy_options, not strip_options. - - * nlmheader.y (command): Warn about illegal date values. - -Wed Dec 15 11:18:03 1993 David J. MacKenzie (djm@frosty.eng.umd.edu) - - * bucomm.c bucomm.h: Run through indent. De-ansidecl-ify. - (bfd_nonfatal): New function. - (bfd_fatal): Call it. - - * objcopy.c (smart_rename): Do a copy if the dest file has - multiple hard links. Remove source file on successful copy. - Try to preserve mode and owner on successful rename. - - * objcopy.c: Run through indent. Clean up a bit. - Make global variables static. - Make {input,output}_{target,filename}, show_version local - to various functions. - New global variable `status' for exit status. - (strip_main, copy_main): New functions with code from main. - (nonfatal): New macro. Use it globally instead of bfd_perror and - bfd_fatal. - - (copy_object): Call mangle_sections with bfd_map_over_sections. - (mangle_sections): Adjust for new calling convention. - -Fri Dec 10 11:28:11 1993 Ian Lance Taylor (ian@deneb.cygnus.com) - - * nlmheader.y (command): Accept MAP and FULLMAP without arguments. - * nlmconv.c (main): Change error message for MAP and FULLMAP. - -Thu Dec 9 17:47:19 1993 Ian Lance Taylor (ian@deneb.cygnus.com) - - * nlmconv.c (main): Warn about imported symbols that are not in - the IMPORT list even if the IMPORT keyword is not used. - - * nlmconv.c (debug, unlink_on_exit): New static variables. - (long_options): Add "debug" and "linker". - (main): Handle -d and -l arguments. Make command line input and - output files optional. Parse the command file before opening the - BFD's, which requires storing more information in local variables. - If INPUT names multiple files, link them together. Use OUTPUT for - the output file name if not named on command line. - (show_usage): Changed for new options. - (link_inputs): New function to automatically invoke linker to - handle multiple INPUT files. - (choose_temp_base_try, choose_temp_base, pexecute): New functions, - mostly copied from gcc/gcc.c. - * nlmconv.h (input_files, output_file): Declare. - * nlmheader.y (input_files, output_file): Define. - (command): Support INPUT with a string_list argument. Support - OUTPUT. - (string_list): Renamed from module_list. - * Makefile.in (nlmconv.o): Define LD_NAME based on - program_transform_name. - -Wed Dec 8 10:09:04 1993 Ian Lance Taylor (ian@deneb.cygnus.com) - - * nlmheader.y (nlmheader_identify): New function. Use it to print - the program name just once, instead of with every error message. - -Mon Dec 6 16:11:32 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nlmconv.c (long_options): Changed --header-info to --header-file - to match documentation and usage message. - -Sun Dec 5 01:31:01 1993 Jeffrey A. Law (law@snake.cs.utah.edu) - - * objdump.c (dump_relocs): Avoid dereferencing a NULL sym_ptr_ptr - in a relocation. - -Thu Dec 2 16:00:06 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nlmconv.c (main): Change various types from bfd_size_type to - size_t, since they have to be arguments to fread and fwrite. - Change set from char * to unsigned char *. - (select_output_format): Make mach argument unsigned. Handle - bfd_arch_alpha. - (setup_sections): Don't copy the .reginfo section of an ECOFF - file. Call bfd_set_reloc to initialize the relocation fields. - (copy_sections): Don't copy the .reginfo section of an ECOFF file. - Combine all relocs for a section. - (mangle_relocs): Change type of relocs to permit specific - functions to change it. Call alpha_mangle_relocs for alpha, - default_mangle_relocs for other architectures. - (default_mangle_relocs): New function. Adjust the address of all - relocs by the output_offset. - (i386_mangle_relocs): Change type of relocs argument. Cast length - argument to memmove to size_t. - (alpha_mangle_relocs): New function. - -Wed Nov 17 17:38:58 1993 Sean Eric Fagan (sef@cygnus.com) - - * nlmconv.c (select_output_format): Use nlm32-sparc for - bfd_arch_sparc. - -Wed Nov 17 14:41:35 1993 Jeffrey Osier (jeffrey@thepub.cygnus.com) - - * nlmconv.1: added man page - * objcopy.1: fixed format errors - -Wed Nov 17 12:03:41 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * Makefile.in: Use CFLAGS as well as LDFLAGS when linking. - -Wed Nov 17 04:50:55 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * strings.1: Fix typo. - -Mon Nov 15 12:03:20 1993 Ken Raeburn (raeburn@rtl.cygnus.com) - - * Makefile.in (DISTSTUFF): Build "info". - (VERSION): Updated to cygnus-2.3.1; 2.3 has gone out. - -Sun Nov 14 00:27:24 1993 Jeffrey A. Law (law@snake.cs.utah.edu) - - * objdump.c (dump_stabs): Handle stabs-in-som as implemented - by the new BFD SOM assembler. - -Sat Nov 13 07:14:05 1993 David J. Mackenzie (djm@rtl.cygnus.com) - - * ar.1 c++filt.1 nm.1 objcopy.1 objdump.1 ranlib.1 size.1 - strings.1 strip.1: Replace \(em in NAME section with \- so - makewhatis can grok it. - -Tue Nov 9 15:22:12 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nlmconv.c (i386_mangle_relocs): Adjust reloc address by - section output_offset. - -Fri Nov 5 12:11:52 1993 Jeffrey Osier (jeffrey@thepub.cygnus.com) - - * binutils.texi: added nlmconv chapter - -Wed Nov 3 16:10:50 1993 Jeffrey Wheat (cassidy@cygnus.com) - - * Makefile.in: Change RUNTESTFLAGS to RUNTEST_FLAGS - -Wed Nov 3 15:09:23 1993 Ken Raeburn (raeburn@rover.cygnus.com) - - * Makefile.in (distclean): Don't get rid of dvi or info files. - -Tue Nov 2 13:29:59 1993 David J. Mackenzie (djm@rtl.cygnus.com) - - * objcopy.c (S_ISLNK): Define as 0 if there's no S_IFLNK. - -Fri Oct 29 16:02:34 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * binutils.texi: Move objcopy docs into alphabetical order. - - * objdump.c: Use xmalloc instead of malloc. - -Fri Oct 29 11:11:14 1993 Stan Shebs (shebs@rtl.cygnus.com) - - * objdump.c (info): Rename to formats_info. - (dump_stabs_1): Better comments and formatting. - -Thu Oct 28 19:43:16 1993 Stan Shebs (shebs@rtl.cygnus.com) - - * ar.c (main): Always create the archive when quick appending, - even if no input files have been given. - -Wed Oct 27 12:03:06 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nlmconv.c (main): Set sharedDebugRecordOffset and - sharedDebugRecordCount fields in extended header. - - * nlmconv.c (main): Force moduleName field to upper case. - -Mon Oct 25 16:45:42 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * objcopy.c (main): Give a usage message if there are too many - arguments. - -Mon Oct 25 10:37:08 1993 Ken Raeburn (raeburn@rover.cygnus.com) - - * Makefile.in (install-info): Rewrite to take advantage of VPATH, - so FSF distributions (with info files in $(srcdir)) install - properly. - (DISTSTUFF): Build nlmheader.c too. - -Fri Oct 22 11:43:23 1993 Ken Raeburn (raeburn@rover.cygnus.com) - - * ar.c (program_name): Don't define here. - * objdump.c: Include "bucomm.h". - (xmalloc): Don't declare here. - (program_name): Don't define here. - (program_version): Fixed type in declaration. - * size.c: Include "bucomm.h". - (program_name): Don't declare here. - -Fri Oct 22 14:10:41 1993 Mark Eichin (eichin@cygnus.com) - - * objdump.c (fprintf): hide declaration in FPRINTF_ALREADY_DECLARED - -Fri Oct 1 12:43:00 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nlmconv.c (i386_mangle_relocs): Resolve and remove PC relative - relocs against defined symbols in the same section. - -Thu Sep 30 16:46:26 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) - - * Makefile.in (binutils.dvi): use TEXIDIR to find texinfo.tex - -Sat Sep 25 18:09:29 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * objcopy.c (simple_copy, smart_rename): New functions. - (main): Use them. - -Fri Sep 24 15:38:29 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * Makefile.in (clean, distclean): Recurse into testsuite. - -Thu Sep 23 01:05:06 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * objcopy.c (setup_sections, copy_sections): If stripping, don't - copy SEC_DEBUGGING sections. - * objdump.c (dump_headers): Print SEC_DEBUGGING flag. - - * objdump.c (usage): Mention --stabs. - - * objcopy.c (copy_object): Copy all applicable file flags. - (copy_file): Don't copy EXEC_P specially here. - -Mon Sep 20 19:28:57 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nlmconv.c (main): Adjust data section size to correspond to bss - alignment adjustment. Clear BSF_SECTION_SYM if symbol is moved to - a different section. Use time_t for time variable. - (setup_sections): Only put sections with contents in output NLM. - (i386_mangle_relocs): No symbols are common at this point. Add - casts to avoid warnings. - -Fri Sep 10 11:00:40 1993 Stan Shebs (shebs@rtl.cygnus.com) - - * objdump.c: Made the --stabs option work for stabs-in-coff. - (ELF_STAB_DISPLAY): Removed. - (dump_elf_stabs): Renamed to dump_stabs, changed to run for - any object file format. - (dump_elf_stabs_1): Renamed to dump_stabs_1, added calls to - generic BFD routines for non-ELF case, changed format of message - for no-section-found case. - (display_bfd): Always call dump_stabs if requested. - (dump_data): Call bfd_section_size to get section size. - -Fri Sep 10 08:12:23 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * Makefile.in (install): Don't put strings in tooldir/bin. - -Mon Sep 6 15:39:04 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nlmconv.c (total_bss_size): Removed. - (main): Set the bss vma to always follow the data section. Move - symbols into new sections, and adjust values by output_offset. - (setup_sections): Don't copy all sections, but instead point all - text sections to .text, all data sections to .data, and all bss - sections to .bss. - (copy_sections): Adjust accordingly. - -Thu Sep 2 12:34:03 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - Only build nlmconv if configured for a NetWare target. - * configure.in: If we have some *-*-netware* target, or are using - all targets, set BUILD_NLMCONV to $(NLMCONV_PROG) in Makefile. - * Makefile.in (PROGS): Use $(BUILD_NLMCONV) rather than - $(NLMCONV_PROG). - -Tue Aug 31 14:13:35 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * objdump.c (ARCH_all): Define ARCH_hppa too. - (dump_headers): Don't test for SEC_BALIGN if it's not defined by - bfd.h. - -Tue Aug 31 13:29:12 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * nlmconv.c (main): Force creation of .bss section. Set up the - sections before looking at the symbols. Move all common symbols - into .bss section. Automatically define _edata and _end. Only - export symbols in the export list, with multiple prefixes if - necessary. Warn if no version. Always create extended header. - Set date automatically if not already set. - (setup_sections): Count size of bss sections. - (mangle_relocs, i386_mangle_relocs): Accept section argument, and - take reloc_count as a changeable pointer; changed callers. - (i386_mangle_relocs): Remove PC relative relocs within a section, - as they require no adjustment. - * nlmheader.y: Fixed memory allocation throughout: token STRING is - now allocated on the heap, and freed if not needed. Null - terminated copyright message. Accept version with only two - strings. - (symbol_list_opt): New nonterminal, either symbol_list or empty. - (symbol_list): Use left recursion to avoid overflowing parser - stack. - (yylex): Rearranged beginning of line check. Accept quoted - strings using single quotes. End generic argument at comment - character or parentheses. - (string_list_append): Fixed. - (string_list_append1): New function. - - * bucomm.h: The first argument to xrealloc is PTR, not char *. - * bucomm.c (xrealloc): Use PTR rather than char *. - * Makefile.in (objdump.o): Depend upon config.status to notice - --with-targets changes. - (nlmconv.o): Depend upon bucomm.h. - -Tue Aug 17 09:46:01 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * configure.in: Don't pass cpu to config.bfd. - -Thu Aug 12 16:43:04 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * Makefile.in ($(NM_PROG)): Depend on demangle.o. - (demangle.o): New target. - (cplus-dem.o): Depend on it, to force compilation order when doing - parallel compiles. - - * nm.c (print_symbol_info_{bsd,sysv,posix}): Take a bfd arg. - (struct output_fns print_symbol_info): Ditto. - (long_options, usage, main): Add -C --demangle option. - (print_symname): New function, demangling if requested. - (print_symbols, print_symbol_info_{bsd,sysv,posix}): Use it. - -Wed Aug 11 22:57:23 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * Makefile.in: Put CFLAGS last in compilation rules and omit from - linking rules. Use ARCHDEFS to compile objdump.c. - Update dependencies. - * configure.in: Construct ARCHDEFS based on the BFD target makefile - fragments. - * objdump.c: Conditionalize calls to the print_insn_ARCH functions - according to ARCHDEFS. - -Thu Aug 12 08:06:15 1993 Ian Lance Taylor (ian@cygnus.com) - - * ar.c: Removed obsolete and non-functional GNU960 code. - -Wed Aug 11 13:08:26 1993 Ian Lance Taylor (ian@cygnus.com) - - * size.c (berkeley_sum): New function. - (bsssize, datasize, textsize): New global variables. - (bss_section_name, data_section_name, text_section_name): Removed. - (print_berkeley_format): Map berkeley_sum over all the sections, - rather than only reporting sizes of specifically named sections. - * Makefile.in ($(OBJDUMP_PROG)): Removed dependency on size.o. - -Tue Aug 10 10:46:01 1993 Ian Lance Taylor (ian@cygnus.com) - - * nlmconv.c, nlmconv.h, nlmheader.y: New files for program to - convert object files into NetWare Loadable Modules. - * Makefile.in (NLMCONV_PROG): New macro, define to be nlmconv. - (PROGS): Add NLMCONV_PROG. - (nlmheader.c, nlmheader.o, nlmconv.o, $(NLMCONV_PROG)): New - targets. - -Thu Aug 5 15:48:32 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) - - * Makefile.in: define MAKEOVERRIDES to an empty string - -Wed Aug 4 17:08:08 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * objcopy.c (copy_file): Make failures to process a file nonfatal. - -Mon Aug 2 11:28:23 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * nm.c: Add -B option, like --format=bsd. - -Tue Jul 27 16:29:54 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * objcopy.c (copy_file): If the file is neither an object nor an - archive, give an error rather than returning success. - -Mon Jul 19 16:13:40 1993 Ken Raeburn (raeburn@rtl.cygnus.com) - - * objdump.c (objdump_print_address): Prefer non-local symbols over - local ones, and especially discriminate against debugging symbols. - Also, for relocateable files, try to find a symbol in the current - section, instead of picking one from some random section with a - convenient value (read, section offset). - (disassemble_data): Cast argument to malloc to size_t first. - (dump_data): Likewise. - (dump_relocs): If a single section name is specified, show relocs - only for that section. Otherwise, silently omit sections without - relocs. Format table nicely even if values are printed using 16 - digits instead of 8. - -Fri Jul 16 15:19:59 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * nm.c: Changes for final version of POSIX.2. - (print_symbol_filename_{bsd,sysv,posix}): New functions. - (formats): Add an element for a pointer to them. - (print_symbols): Call it. - (print_object_filename_posix, print_archive_member_posix): Produce - output according to new POSIX.2 spec. - - * strings.c (print_strings): Handle STREAM being NULL. - (strings_a_section): Pass a NULL. - (main): Don't open /dev/null. - -Thu Jul 15 12:44:09 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * objdump.c (disassemble_data): Handle the m88k. - (display_bfd): Use bfd_errmsg, rather than just claiming that the - bfd is not an object file. - -Mon Jul 12 17:55:34 1993 K. Richard Pixley (rich@cygnus.com) - - * Makefile.in (TAGS): make work again by naming directories - explicitly rather than depending on undefined macros. - (INSTALL_XFORM): correct bad install target. - -Fri Jul 2 16:58:34 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * strings.c: Doc fixes. - -Sun Jun 27 13:35:24 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * Makefile.in: Note dependencies on bucomm.h. - (cplus-dem.o): Link c++filt with version.o. - - * strings.c: Include bucomm.h and add prototypes to other decls. - Remove -h option. - - * bucomm.h: Declare xrealloc. - - * nm.c, objcopy.c, objdump.c, size.c, strings.c (main, usage): Add - --help option. Put "GNU" in the version message. - (usage): Take stream and exit status as args. - (main): Pass new args to usage. - -Fri Jun 25 23:12:12 1993 David J. Mackenzie (djm@thepub.cygnus.com) - - * strings.c, strings.1: New files. - * binutils.texi: Document strings. - * Makefile.in: Add rules for it. - -Fri Jun 25 20:44:43 1993 Ken Raeburn (raeburn@poseidon.cygnus.com) - - * objdump.c: Use size-independent bfd elf section names. - -Sun Jun 20 23:09:06 1993 Ken Raeburn (raeburn@poseidon.cygnus.com) - - * objdump.c (objdump_print_address): Handle wide offsets by - calling sprintf_vma. - -Fri Jun 18 14:29:12 1993 Per Bothner (bothner@deneb.cygnus.com) - - * objdump.c (syms2): Removed unused variable. - * objdump.c (remove_useless_symbols): New function. - * objdump.c (comp): Simplify. - * objdump.c (dis-assemble_data): Make simpler and more - efficient how we filter out useless symbols: Just filter - BEFORE the sort (using remove_useless_symbols). - * objdump.c (objdump_print_address): Simplify. - Change output syntax to match gdb. - -Thu Jun 17 16:53:56 1993 david d `zoo' zuhn (zoo@cygnus.com) - - * Makefile.in: canonicalize install.sh; for use within - this directory (and subdirs) - -Mon Jun 14 12:13:22 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com) - - * Makefile.in (install, install-info): remove parentdir support, - use INSTALL_XFORM; define INSTALL_XFORM - -Thu Jun 10 17:29:21 1993 Per Bothner (bothner@cygnus.com) - - * objcopy.c (copy_object): Fix bad size passed to xmalloc(). - -Mon Jun 7 12:41:12 1993 Per Bothner (bothner@rtl.cygnus.com) - - * Makefile.in (INCLUDES): Add -I../bfd for sysdep.h and bfd.h. - * configure.in: No longer need to configure to get sysdep.h. - * objcopy.c (copy_object): Fix symbol table handling. - -Fri Jun 4 17:20:03 1993 Per Bothner (bothner@cygnus.com) - - * objcopy.c (filter_symbols): Cannot filter the symbols - in place, because that confuses the relocs, so take separate - parameter for output array. - * objcopy.c (sympp): Make two variables: isympp and osympp. - * objcopy.c (copy_object): Allocate separate array (osympp) - for filtered symbols. - -Fri Jun 4 10:51:44 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * Makefile.in: change recursion test to presence of a configured - testsuite directory - -Thu Jun 3 14:05:57 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * Makefile.in (underscore.c): Hack the backquoted command so it - doesn't cause Solaris make to bomb. - -Thu Jun 3 10:40:19 1993 Jeffrey Osier (jeffrey@cygnus.com) - - * Makefile.in: added c++filt and objcopy to MANPAGES variable - -Thu Jun 3 00:32:52 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * Makefile.in: rename LOADLIBES to EXTRALIBS - -Wed Jun 2 18:30:24 1993 Jeffrey Osier (jeffrey@cygnus.com) - - * c++filt.1, objcopy.1: new man pages - -Fri May 28 15:01:24 1993 Per Bothner (bothner@rtl.cygnus.com) - - * Makefile.in (install): Also install ar and ranlib in - $(tooldir)/bin; needed for building libgcc.a. - * objdump.c (objdump_print_address): Fix the check - "coincidental" label matches by dis-allowing undefined - or com symbols. - -Thu May 27 16:58:31 1993 Jeffrey Osier (jeffrey@cygnus.com) - - * biutils.texi: revised c++filt chapter - -Wed May 26 17:24:17 1993 Ian Lance Taylor (ian@cygnus.com) - - * Makefile.in (FLAGS_TO_PASS): Pass down CC and CFLAGS. - -Tue May 25 00:26:47 1993 Ken Raeburn (raeburn@cygnus.com) - - * objdump.c (slurp_symtab): Print warning for bad symbol table. - (bfd_elf32_find_section, Elf32_Internal_Shdr): Updated - declarations and uses. - - * Makefile.in (DISTSTUFF): Don't build binutils.mm. - -Fri May 21 10:51:19 1993 David J. Mackenzie (djm@rtl.cygnus.com) - - * nm.c: Add -f/--format, -P/--portability, -t/--radix options. - Make global variables static. - (main): Make -v like -n, not -V, and make -A like -o, for POSIX.2. - (set_print_radix, set_output_format, - print_{object_filename,archive_filename,archive_member,symbol_info} - {bsd,sysv,posix}): New functions. - (display_file, print_symbols): Call them. - - * ar.c: Improve error messages. - - * nm.c (main): Handle long options that just set a flag. - - * nm.c (main), ar.c (do_show_version), objcopy.c (main), size.c - (main): Exit after printing the version number, per the GNU coding - standards. - -Mon May 17 13:20:25 1993 Per Bothner (bothner@cygnus.com) - - * README, Makefile.in: Minor updates for 2.2. - -Fri May 14 11:12:26 1993 Per Bothner (bothner@cygnus.com) - - * Makefile.in (underscore.c): Automatically generate - (using nm) a file with the variable prepends_underscore. - * Makefile.in (c++filt): Link underscore.o with cplus-dem.o - so that initial underscores get removed iff appropriate. - * binutils.texi: Preliminary documentation for c++filt. - * Makefile.in, binutils.texi: Set to version 2.2. - - * NEWS: Mention copy->objcopy renaming and new c++filt program. - -Wed May 12 12:05:36 1993 Ian Lance Taylor (ian@cygnus.com) - - * Makefile.in (cplus-dem.o, $(DEMANGLER_PROG)): Build the - demangler via cplus-dem.o, rather than directly from the .c file. - - * objcopy.c: Renamed from copy.c, updated comments accordingly. - * Makefile.in, binutils.texi: Renamed copy to objcopy. - * is-strip.c, maybe-strip.c, not-strip.c: Updated comments for - rename of copy to objcopy. - -Mon May 10 17:20:18 1993 Per Bothner (bothner@cygnus.com) - - * binutils.texi (strip, -v option): Fix typo. - -Fri May 7 13:57:50 1993 Ian Lance Taylor (ian@cygnus.com) - - * Makefile.in (RUNTEST): Define. - (FLAGS_TO_PASS): Pass down RUNTEST. - -Tue May 4 10:06:50 1993 Ian Lance Taylor (ian@cygnus.com) - - * Makefile.in (DEMANGLER_PROG): Name it c++filt. - (PROG): Also build and install COPY_PROG. - -Mon May 3 19:11:48 1993 Per Bothner (bothner@cygnus.com) - - * Makefile.in: Change definition of $(tooldir) to match FSF. - -Wed Apr 28 23:41:32 1993 David J. Mackenzie (djm@rtl.cygnus.com) - - * size.c (usage): Add missing options. - (main): Clean up option parser. - - * objdump.c (usage): Add missing options. - (display_file): Print program name before calling - bdf_perror. - - * nm.c (usage): Add missing options. - (main): Clean up option parser. - (display_file): Print program name before calling - bdf_perror. - - * copy.c (copy_usage, strip_usage): Add missing options. - - * ar.c (usage): New function. - (main): Call it. - (open_inarch, do_quick_append): Print program name before calling - bdf_perror. - -Thu Apr 22 15:01:35 1993 Ian Lance Taylor (ian@cygnus.com) - - * nm.c (main): Accept and ignore -A and -B for MIPS compatibility. - -Mon Apr 19 14:06:59 1993 Rob Savoye (rob@cygnus.com) - - * Makefile.in: Added FLAGS_TO_PASS so tests get run on freshly - built binaries if they exist. (otherwise the path) - -Wed Apr 7 22:22:50 1993 Rob Savoye (rob@cygnus.com) - - * Makefile.in: Changed check target to use DejaGnu. - -Thu Apr 1 12:37:13 1993 Jim Kingdon (kingdon@cygnus.com) - - * Makefile.in: Remove am29k-pinsn.c, i960-pinsn.c. - objdump.c: a29k and i960 are `disassemble' not `print'. - - * objdump.c: Rename print_address to objdump_print_address - and change parameters. - (disassemble_data): Use objdump_print_address. - -Wed Mar 31 10:25:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com) - - * objdump.c (disassemble_data): print_insn_sparc is now a - `disassemble' not a `print'. - Makefile.in: Remove sparc-pinsn.c (now in libopcodes.a). - - * objdump.c (disassemble_data): Use new read_memory_func stuff. - -Thu Mar 25 10:38:11 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * objdump.c (fprintf): Declaration of variadic function had better - be a prototype for ANSI C systems. - -Mon Mar 22 23:19:46 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * Makefile.in: rename test-install to install-check - -Fri Mar 19 14:40:08 1993 Steve Chamberlain (sac@thepub.cygnus.com) - - * objdump.c (disassemble_data): Add H8500. - -Fri Mar 19 10:56:51 1993 Jim Kingdon (kingdon@cygnus.com) - - * objdump.c (usage): Mention long options. - -Thu Mar 18 14:22:17 1993 Per Bothner (bothner@rtl.cygnus.com) - - * nm.c: Modify behavior of -o flag for archives to match - BSD4.4 and Sunos 4: Prefix archive name before each line. - - * m68k-pinsn.c: Removed. Subsumed by ../opcodes/m68k-dis.c. - * i386-pinsn.c: Removed. Subsumed by ../opcodes/i386-dis.c. - * Makefile.in: Adjust accordingly. - * objdump.c: Support new-style disassemblers (ones that use - the interface of ../include/dis-asm.h). - -Thu Feb 25 15:57:00 1993 Per Bothner (bothner@rtl.cygnus.com) - - * Makefile.in: When making tar file, remove texinfo/*, - except for texinfo/texinfo.tex. - * ardup.c: Add extern declaration of strdup. - * Makefile.in (testsuite): Add 'else true' since otherwise - Ultrix /bin/sh complains. - -Wed Feb 24 19:44:18 1993 Per Bothner (bothner@rtl.cygnus.com) - - * Makefile.in: Set VERSION to 2.1. - * README, NEWS: Updates. - * nm.c: Add -v as a synonym for -V. - -Tue Feb 23 19:00:50 1993 Mike Werner (mtw@poseidon.cygnus.com) - - * configure.in: added testsuite to configdirs. - * Makefile.in: added support for building testsuite. - -Mon Feb 22 22:52:10 1993 Per Bothner (bothner@rtl.cygnus.com) - - * objdump.c (disassemble_data): Print function names when - given by bfd_find_nearest_line. If not - still print - line numbers. - -Mon Feb 22 07:54:03 1993 Mike Werner (mtw@poseidon.cygnus.com) - - * binutils/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. - -Mon Feb 22 10:27:24 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) - - * objdump.c (dump_data): Free up section contents each time - through the loop. Reported by minyard@bnr.ca. - -Sun Feb 21 10:55:55 1993 Mike Werner (mtw@poseidon.cygnus.com) - - * binutils/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 - of dejagnu. The modifications to these testcases, etc., which - will allow them to work with the new version of dejagnu will be - made in a future update. - -Fri Feb 12 10:05:20 1993 Fred Fish (fnf@cygnus.com) - - * Makefile.in (LIBIBERTY_SRC_DIR, LIBIBERTY_BIN_DIR): New macros. - * Makefile.in (LIBIBERTY): Use LIBIBERTY_BIN_DIR. - * Makefile.in (DEMANGLER_PROG): New program to build. Add macro - and rule. - * Makefile.in (PROGS): Add DEMANGLER_PROG. - -Tue Jan 26 11:56:33 1993 Ian Lance Taylor (ian@cygnus.com) - - * copy.c, nm.c, objdump.c, size.c: Use new bfd_is_com_section - macro rather than checking for equality to bfd_com_section. - -Fri Jan 8 15:50:05 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * objdump.c (disassemble_data): Fix code to find first useless - symbol. - -Thu Jan 7 13:13:31 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) - - * objdump.c (disassemble_data): Use mips_print_insn for MIPS. - Don't core dump if bfd_find_nearest_line returns false. - -Wed Jan 6 17:14:01 1993 Steve Chamberlain (sac@thepub.cygnus.com) - - * objdump.c (disassemble_data): know how to disassemble z8000s - too. - -Wed Jan 6 15:16:27 1993 Per Bothner (bothner@cygnus.com) - - * arsup.h (interactive), bucomm.h (program_name): Prefix - with 'extern', to avoid warnings from some compilers. - -Wed Jan 6 15:14:11 1993 Per Bothner (bothner@rtl.cygnus.com) - - * arparse.y: fix unnecessary shift/reduce - -Tue Dec 22 15:46:56 1992 Per Bothner (bothner@rtl.cygnus.com) - - * Makefile.in: Make check depend on all. - * Makefile.in (distclean): Remove sysdep.h. - * size.c: Use %u format where appropriate. - * objdump.c: Standardize: L_SET -> SEEK_SET. - * objdump.c: Use new macro bfd_asymbol_bfd. - * configure.in: Allow std-host as the default ${mys_host}. - -Thu Dec 17 19:38:19 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * Makefile.in: added dvi target, define and use TEXI2DVI - -Tue Dec 15 18:05:07 1992 Per Bothner (bothner@cygnus.com) - - * Makefile.in (dist): Fix permissions before release. - * size.c: Use bfd_size_type (and long) where appropriate. - * ar.c: Make writing a map the default, to be compatible - with SYSV and Posix.2. Remove some bogus kludges that - handled __.SYMDEF directly. - * NEWS: New file. - -Mon Nov 9 13:36:53 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * Makefile.in: flex no longer needs the -S flag - -Sat Nov 7 15:06:13 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * ar.c (extract_file): utime needs a pointer to a utimbuf - - * Makefile.in: handle -I includes better, adding $(BASEDIR)/bfd to - the list (since some of the bfd/hosts/*.h files include other - files from that directory) - -Fri Nov 6 00:12:51 1992 John Gilmore (gnu@cygnus.com) - - * i960-pinsn.c (MEM_MAX, MEM_SIZ): Set upper bound properly. - -Thu Nov 5 03:37:15 1992 John Gilmore (gnu@cygnus.com) - - Clean up some old BFD ansification macros. - - * arsup.h, bucomm.h, objdump.h: Remove EXFUN from binutils. - It still remains as a local macro in gmalloc.c, which is derived - from some other copy of GNU Malloc somewhere (FIXME). - - * ar.c, objdump.c, size.c: Replace EXFUN with PROTO. Make static - fns really static. - * arsup.h: Declare extract_files. - -Mon Nov 2 12:42:11 1992 Ian Lance Taylor (ian@cygnus.com) - - * ar.c (extract_file): instead of checking USG: if POSIX_UTIME, - use utime and utimbuf structure, otherwise if USE_UTIME use utime - and array of two longs, otherwise use utimes. - -Thu Oct 15 13:57:35 1992 Per Bothner (bothner@cygnus.com) - - * binutils.tex: Document yesterday's changes to strip and copy. - -Wed Oct 14 13:22:14 1992 Per Bothner (bothner@cygnus.com) - - * copy.c: Re-do command-line parsing to use getopt_long(). - Add long option names. Re-think option letters to be more - consistent. - * copy.c: New function filter_symbols() for stripping only - debug-symbols and/or local symbols. Use these to support - the previously-missing options of the old FSF strip. - -Tue Oct 13 01:24:20 1992 John Gilmore (gnu@cygnus.com) - - * configure.in (host): Use ${srcdir}/../bfd/configure.host rather - than repeating a copy of it here. - -Wed Oct 7 12:53:52 1992 Ken Raeburn (raeburn@cygnus.com) - - * copy.c (main): Even if is_strip, accept -d argument indicating - alternate output format. Needed by gdb for Nindy. - - * m68k-pinsn.c (print_insn_arg): Handle new "`" operand type. - -Tue Oct 6 16:33:56 1992 Jeffrey Osier (jeffrey@cygnus.com) - - * binutils.texi: added documentation for "copy" - -Tue Oct 6 14:22:56 1992 Per Bothner (bothner at PersSony) - - * Makefile.in (*clean rules): Some cleaning up. - * Makefile.in (dist): Make diststuff in gprof for a dist. - - * ar.c (do_show_version): New function. - * ar.c (main): Fix so "ar -V" works. - -Thu Oct 1 22:44:45 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * configure.in: now uses the cpu-vendor-os triple instead of - nested cases. - -Fri Sep 25 22:41:08 1992 John Gilmore (gnu@cygnus.com) - - * i960-pinsn.c: Change bzero to memset. - * sparc-pinsn.c: Change index to strchr. - -Mon Sep 21 14:39:56 1992 Ian Lance Taylor (ian@cygnus.com) - - * m68k-pinsn (print_insn_arg, fetch_arg): added support for - operands to memory management instructions, from WRS. - -Tue Sep 15 15:26:38 1992 Ian Lance Taylor (ian@cygnus.com) - - * Makefile.in (install): if $(tooldir) exists, install nm and - strip in $(tooldir)/bin. - -Thu Sep 3 11:57:40 1992 Per Bothner (bothner@rtl.cygnus.com) - - * Makefile.in: Let's call it version 2.0. - -Wed Sep 2 00:25:13 1992 Per Bothner (bothner@rtl.cygnus.com) - - * Makefile.in: Bump to version 0.98. - * TODO, README: Minor updates. - - * Makefile.in: Added mostlyclean, distclean rules, - and cleaned up clean, realclean. - -Sun Aug 30 21:18:59 1992 Ian Lance Taylor (ian@cygnus.com) - - * Makefile.in: map program names through program_transform_name - when installing. - -Sun Aug 30 18:09:03 1992 Per Bothner (bothner@rtl.cygnus.com) - - * Makefile.in: Bump to versions 1.97.90. - * cplus-dem.c: Removed. Was nowhere used - and if some - programs are changed to to demangling should now use the - versions in libiberty. - -Thu Aug 27 12:58:09 1992 Brendan Kehoe (brendan@cygnus.com) - - * configure.in: add we32k - -Mon Aug 24 14:53:42 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - * ar.c (map_over_members): if the element of the archive has a - null name, fill it in. - - * nm.c (do_one_rel_file): only warn if a bfd's flags say there - will be symbols and there aren't any. - -Wed Aug 19 11:20:25 1992 Ian Lance Taylor (ian@cygnus.com) - - * m68k-pinsn.c: handle new operand type 'r', introduced for cas2. - -Tue Aug 18 20:45:48 1992 Rob Savoye (rob@cygnus.com) - - * nm.c objdump.c: Added support for a +version (-V) - to print the version number. - - * ar.c, copy.c: Added support for a -V option to print - the version number. - -Tue Aug 18 13:28:44 1992 Ian Lance Taylor (ian@cygnus.com) - - * config/mh-apollo68v: removed -g from CC definition. - - * Makefile.in: always create installation directories. - -Mon Aug 17 18:33:41 1992 Per Bothner (bothner@rtl.cygnus.com) - - * m68k-pinsn.c: Minor fix in style of output (don't use - range to indicate floating point control registers). - -Tue Aug 11 23:42:21 1992 Per Bothner (bothner@cygnus.com) - - * ar.c (main): Don't *always* set the verbose flag! - -Wed Aug 5 11:25:27 1992 Per Bothner (bothner@rtl.cygnus.com) - - * copy.c: When is_strip (because it is invoked as the strip - program), follow traditional argv processing: - 'strip file1 file2' now strips file1 and file2, rather - than stripping file1 (as input), leaving output in file2. - -Mon Jul 27 16:28:08 1992 Per Bothner (bothner@rtl.cygnus.com) - - * objdump.c (display_info, display_info_table): Call - bfd_set_format() on dummy bfd before using it (twice). - * ar.c: Make sure archive is created on command 'r' - even when no elements are inserted. (Clean up and - simplify some non-working related code.) - -Mon Jul 20 02:48:38 1992 D. V. Henkel-Wallace (gumby@cygnus.com) - - * configure.in: hppa support doesn't assume hp OS (from sef). - -Sat Jul 18 14:35:22 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) - - * configure.in: recognize hppa hosts (bsd & hpux), error messages - to stderr, not stdout - -Fri Jul 17 18:39:44 1992 K. Richard Pixley (rich@rtl.cygnus.com) - - * ar.1, binutils.texi, i960-pinsn.c, nm.1, objdump.1, ranlib.1, - size.1, sparc-pinsn.c, strip.1: removed rcsid's. - -Thu Jul 16 16:55:24 1992 K. Richard Pixley (rich@rtl.cygnus.com) - - * Makefile.dos: removed rcsid. - -Thu Jul 16 08:23:07 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - * objdump.c (display_bfd): print state of BFD_IS_RELAXABLE too - -Tue Jun 30 20:26:15 1992 D. V. Henkel-Wallace (gumby@cygnus.com) - - * Makefile.in: Add program_suffix (parallel to program_prefix) - -Thu Jun 25 04:52:45 1992 John Gilmore (gnu at cygnus.com) - - * nm.c (sorters): Lint. Remove excess whitespace. - -Wed Jun 24 13:48:07 1992 Per Bothner (bothner@cygnus.com) - - * nm.c (valueof macro): Add missing parentheses. - (Their lack screwed up numeric_forward().) - -Sun Jun 14 10:33:27 1992 John Gilmore (gnu at cygnus.com) - - * objdump.c (dump_elf_stabs): Also dump .stab.index and - .stab.excl sections. - (dump_elf_stabs_1): Split out main body of old dump_elf_stabs. - * objdump.1, binutils.texi: Document new sections dumped. - -Fri Jun 12 22:23:35 1992 John Gilmore (gnu at cygnus.com) - - * size.c, objdump.c, bucomm.c: Lint. - -Thu Jun 11 01:19:06 1992 John Gilmore (gnu at cygnus.com) - - * objdump.c (dump_elf_stabs): New feature: --stabs prints out a - .stab section from an ELF file. Installed under #ifdef - ELF_STAB_DISPLAY so it can be easily disabled, since it requires - bfd-internals header files and such. - * objdump.1, binutils.texi: Update for --stabs. Also fix - objdump's doc to use -- rather than + for long options. - (FIXME: Not yet fixed everywhere in binutils.texinfo.) - -Wed Jun 10 07:53:24 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - * objdump.c(display_info), patches from - mohring@informatik.tu-muenchen.de to print the table much more - nicely. - -Thu May 28 13:36:16 1992 Per Bothner (bothner@rtl.cygnus.com) - - * objdump.c: Add another enum->int cast, for the sake of - old compilers (such as PCC). - -Wed May 27 13:01:44 1992 Per Bothner (bothner@rtl.cygnus.com) - - * arlex.l: Don't include (unneeded conflicts). - Add declaration of strdup(). - -Fri May 22 13:40:37 1992 Per Bothner (bothner@cygnus.com) - - * Makefile.in: Use srcdir instead of VPATH in ldgram/ldlex - rules, since these are used when building a distribution. - * Makefile.in (arlex.c): Don't re-direct output, since that - leaves a bogus output files if it fails. - - * arlex.l: Make work with lex, for what it's worth. - * Makefile.in: Better lex support. - * Makefile.in (dist): Generate flex and bison outputs - for distribution. - -Thu May 14 17:17:59 1992 K. Richard Pixley (rich@rtl.cygnus.com) - - * Makefile.in: get BISON definition right. - -Fri May 8 07:47:08 1992 K. Richard Pixley (rich@cygnus.com) - - * sanity.sh: default TMPDIR to ".". - -Thu May 7 12:34:50 1992 Roland H. Pesch (pesch@fowanton.cygnus.com) - - * binutils.texi: add doc for ar command language. - -Wed May 6 18:05:36 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - * arparse.y: make END call ar_end - * arsup.c (ar_end): added, deletes temp file if archive session - aborted. - - -Wed May 6 11:08:53 1992 K. Richard Pixley (rich@rtl.cygnus.com) - - * Makefile.in: use bison & flex from ../ if they exist. Also, - FLEX->LEX. - - * sanity.sh: remove temporary directory when finished. - -Tue May 5 12:00:58 1992 Per Bothner (bothner@rtl.cygnus.com) - - * Makefile.in: Bump to version 1.97. - * ar.c: Declare errno for machines that need it. - -Mon May 4 23:29:51 1992 John Gilmore (gnu@cygnus.com) - - * objdump.c (display_info): Handle error cases without coredump. - Close the dummy temporary file we open in the loop. - * Makefile.in (arsup.o): Add kludge to build with Sun Make. - -Fri May 1 16:20:23 1992 K. Richard Pixley (rich@cygnus.com) - - * Makefile.in: added test-install target. - - * sanity.sh: new file. - - * Makefile.in: use sanity test on make check. - -Tue Apr 21 13:38:37 1992 K. Richard Pixley (rich@cygnus.com) - - * Makefile.in: rework CFLAGS so that they can be passed on the - command line to make. Remove MINUS_G. Default CFLAGS to -g. - -Wed Apr 15 14:33:07 1992 Steve Chamberlain (sac@thepub.cygnus.com) - - * arsup.c, arsup.h, arparse.y, arlex.l: support for archive - scripting language. - -Fri Mar 6 21:54:53 1992 K. Richard Pixley (rich@cygnus.com) - - * Makefile.in: added check target. - -Thu Mar 5 21:35:49 1992 K. Richard Pixley (rich@cygnus.com) - - * Makefile.in: added clean-info target. - -Tue Mar 3 15:36:37 1992 K. Richard Pixley (rich@rtl.cygnus.com) - - * Makefile.in: remove $(COPY_PROG) from PROGS. It shouldn't be - installed. added tooldir and program_prefix. - -Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com) - - * Makefile.in, configure.in: removed traces of namesubdir, - -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced - copyrights to '92, changed some from Cygnus to FSF. - -Sun Feb 16 12:53:02 1992 Per Bothner (bothner at cygnus.com) - - * Makefile.in: Bump version to 1.96, and remove -beta - suffix from distribution name. - * m68k-pinsn.c: New macro COERCE_SIGNED_CHAR to extract - the signed value of a character (even if chars are unsigned). - * sparc-pinsn.c: Add new operand types. - -Thu Feb 6 12:14:19 1992 Steve Chamberlain (sac at rtl.cygnus.com) - - * objdump.c (disassemble_data): don't print a section's contents - if it's not loadable (eg bss) - -Tue Jan 28 11:11:06 1992 Steve Chamberlain (sac at rtl.cygnus.com) - - * m68k-pinsn.c (print_insn_arg): fixed so that -ve branch - displacements don't get printed as large +ve ones. - -Fri Jan 24 14:47:53 1992 Steve Chamberlain (sac at rtl.cygnus.com) - - * copy.c, nm.c, objdump.c, size.c : changed to use the - new reloc scheme. - - -Mon Dec 30 18:34:41 1991 Per Bothner (bothner at cygnus.com) - - * bucomm.c (print_arelt_descr): Tweek the output format - so that 'ar tv' output follows Posix 1003.2/D11. - Output is now also identical to Sun's (except __.SYMDEF). - -Mon Dec 30 06:09:53 1991 John Gilmore (gnu at cygnus.com) - - * Makefile.in: Make `make' output more readable. - -Wed Dec 18 15:04:45 1991 Per Bothner (bothner at cygnus.com) - - * Makefile.in: Bump to version 1.94. - -Wed Dec 11 16:48:09 1991 Steve Chamberlain (sac at cygnus.com) - - * ar.c: added "b" to fopens for dos - * configdj.bat, makefile.dos new files from DJ - -Tue Dec 10 04:07:26 1991 K. Richard Pixley (rich at rtl.cygnus.com) - - * Makefile.in: infodir belongs in datadir. - -Sat Dec 7 17:09:37 1991 Steve Chamberlain (sac at rtl.cygnus.com) - - * bucomm.h: created to hold prototypes of bucomm.c - * objdump.h: created to hold prototyes of objdump.c - * am29k-pinsn.c: include objdump.h - * ar.c: include bucomm.h, get ar.h from the right place and - include libbfd.h - * bucomm.c: defunize bfd_fatal - * copy.c: include bucomm.h, lint. - * i960-pinsn.h: include bucomm.h - * m68k-pinsn.h: lint - * nm.c: include bucomm.h, lint - * objdump.c: lint - * sparc-pinsn.c: include objdump.h - - - -Fri Dec 6 23:02:14 1991 K. Richard Pixley (rich at rtl.cygnus.com) - - * Makefile.in: added standards.text support. install using - INSTALL_PROGRAM and INSTALL_DATA. - - * configure.in: configure now does all of it's work from objdir so - make file existence tests against ${srcdir}. - -Thu Dec 5 22:46:22 1991 K. Richard Pixley (rich at rtl.cygnus.com) - - * Makefile.in: idestdir and ddestdir go away. Added copyrights - and shift gpl to v2. Added ChangeLog if it didn't exist. docdir - and mandir now keyed off datadir by default. - -Wed Dec 4 22:42:03 1991 Per Bothner (bothner at cygnus.com) - - * Makefile.in: Bump to version 1.93. - * Makefile.in: Add make-strip.o:maybe-strip.c dependency - for make versions that provide half-baked VPATH-support (e.g. Sun's). - * size.c: Improvements suggested by - "david d [zoo] zuhn" : - - Don't emit (Berkeley) headers if no files were found. - - Return a non-zero return code on failure. - -Sat Nov 30 21:34:19 1991 Steve Chamberlain (sac at rtl.cygnus.com) - - Changes due to include file renaming: - * am29k-pinsn.c: a29k-opcode.h -> opcode/a29k.h - * sparc-pinsn.c: sparc-opcode.h -> opcode/sparc.h - * m68k-pinsn.c: m68k-opcode.h -> opcode/m68k.h - * nm.c: stab.gnu.h -> aout/stab_gnu.h - -Tue Nov 19 19:20:43 1991 Per Bothner (bothner at cygnus.com) - - * README: Mention MINIMIZE flag for bfd's make. - -Mon Nov 18 12:05:37 1991 Per Bothner (bothner at cygnus.com) - - * README: Various improvements. - -Sun Nov 17 23:40:59 1991 Per Bothner (bothner at cygnus.com) - - * Makefile.in: Bump to version 1.92. - * version.c, Makefile.in: Get version string from Makefile. - * copy.c, is-strip.c, not-strip.c, maybe-strip.c, Makefile.in: - Make the same change that we earlier did for ar/ranlib: - Generate two different binaries for strip and copy and use - a global variable with different values to distinguish - ostrip from copy. (-1 means to use argv[0] to decide, - so you can get the old behavior, but it is no longer the default). - * copy.c (copy_file): Set EXEC_P of output bfd if input is so. - * copy.c (main): If is_strip==-1, compare last 5 chars - of argv[0], not the whole path. - * copy.c (main): Return 0, not 1. - * copy.c (setup_sections): Fix due to change in bfd_make_section - now failing if asked for a duplicate section. - * strip.c, ostrip.c: Removed obsolete files. - * ar.c, not-ranlib.c, maybe-ranlib.c: - Change encoding of is_ranlib variable to be consistent - with is_strip for strip.copy (i.e -1 to means use argv[0]). - -Thu Nov 14 20:11:02 1991 Per Bothner (bothner at cygnus.com) - - * version.c (program_version): Update to version 1.92. - -Tue Nov 12 16:17:53 1991 Per Bothner (bothner at cygnus.com) - - * ar.c (get_pos_bfd): Previous fix was missing a "break". - -Thu Nov 7 08:55:56 1991 Steve Chamberlain (sac at cygnus.com) - - * am29k-pinsn.c: Fixed bug in mtacc, dmac and fmac instruction - encodings. (Thaks to David Wood) - -Sun Nov 3 14:50:23 1991 Per Bothner (bothner at cygnus.com) - - * Makefile.in ($(DIST_NAME).tar.Z), TODO: Various fixes. - * ar.c (get_pos_bfd): Fix to handling of before/after - positioning options. - * bucomm.c (fatal): MISSING_VFPRINTF is no longer an issue, - since libiberty contains vfprintf etc if otherwise missing. - * m68k-pinsn.c (print_insn_arg): Support BB/BW/BL - type operands, as used by branch instructions. - * nm.c: Delegate printing of symbols to BFD, - by using bfd_print_symbol to do the formatting. - -Mon Oct 28 11:20:47 1991 Steve Chamberlain (steve at cygnus.com) - - * ar.c (write_archive.c): added unlink before rename since some - systems can't rename onto an existant file. - -Mon Oct 21 09:47:23 1991 Steve Chamberlain (steve at rtl.cygnus.com) - - * nm.c: now doesn't crash if a symbol with no section and no - SEC_ABS appears. - -Thu Oct 17 15:25:50 1991 Per Bothner (bothner at cygnus.com) - - * Makefile.in, version.c: Bump to version 1.91. - -Wed Oct 16 11:45:36 1991 Per Bothner (bothner at cygnus.com) - - * Makefile.in, ar.c, bucomm.c, copy.c, cplus-dem.c, filemode.c, - i960-pinsn.c, m68k-pinsn.c, nm.c, objdump.c, size.c, sparc-pinsn.c, - * strip.c: Add or update Copyright notice. - * TODO: Add note on 'nm -a'. - * version.c: Update version number to 1.90. - * Makefile.in: Fix making of documentation for dist. - -Tue Oct 15 00:17:17 1991 Per Bothner (bothner at cygnus.com) - - * README: New file. - * Makefile.in: New kludgy rules for making a tarfile. - * Makefile.in: Fix bindir path. - -Mon Oct 14 17:34:29 1991 Roland H. Pesch (pesch at cygnus.com) - - * Makefile.in: add targets binutils.mm, binutils.me - -Fri Oct 11 22:44:21 1991 John Gilmore (gnu at cygnus.com) - - * Makefile.in: Avoid Sun Make VPATH bugs by adding dependencies. - -Fri Oct 11 12:51:33 1991 Roland H. Pesch (pesch at cygnus.com) - - * Makefile.in: add target "binutils.ms" - - * binutils.texinfo: minor restructuring for texi2roff comfort. - -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() - get defined first. - * Makefile.in: Use -I. to get sysdep.h. - -Wed Oct 9 22:42:56 1991 Per Bothner (bothner at cygnus.com) - - * nm.c (print_symbols): Handle NULL name field of symbol. - * Makefile.in: Removed spurious comment. - -Tue Oct 8 16:55:03 1991 Roland H. Pesch (pesch at cygnus.com) - - * binutils.texinfo: minor typos, phrasing, formatting fixes. - -Tue Oct 8 15:13:20 1991 Per Bothner (bothner at cygnus.com) - - * configure.in: Get host file from ../bfd/config, not config. - * config/*: Remove config directory and its files. - -Tue Oct 8 13:58:59 1991 Roland H. Pesch (pesch at cygnus.com) - - * Makefile.in: new targets binutils.dvi, binutils.info - - * binutils.texinfo: remove most remaining FIXME's, delete - references to __.SYMDEF by name - - -Tue Oct 8 10:23:44 1991 Steve Chamberlain (steve at cygnus.com) - - * objdump.c (print_address) Print addresses nicely. - -Mon Oct 7 11:31:05 1991 Per Bothner (bothner at cygnus.com) - - * ar.c, Makefile.in, new files {is,not,maybe}-ranlib.c: - Make two different binaries for ar and ranlib, instead of - distinguishing them at run time using argv[0]. - (Old behavior is still available if you "make ar_with_ranlib", - but it is not the default.) - * ranlib.sh (new): An alternative one-line - shell implementation of ranlib. - -Fri Oct 4 21:49:44 1991 John Gilmore (gnu at cygnus.com) - - * objdump.c: Cope with renames of a few BFD types & enums. - -Fri Oct 4 19:08:09 1991 Roland H. Pesch (pesch at cygnus.com) - - * binutils.texinfo: add new file (rudimentary docn) - -Mon Sep 30 12:30:39 1991 Per Bothner (bothner at cygnus.com) - - * config/hmake-news: Add new file (for Sony NEWSOS3). - * bucomm.c (fatal): Conditionally compile fatal() depending on - MISSING_VFPRINTF, and don't confuse the issue with NO_VARARGS. - * objdump.c (dump_headers): Trivial output format change. - * objdump.c (display_info): Loop over integers, not enums, - to appease old compilers. - -Mon May 20 16:14:07 1991 Steve Chamberlain (steve at cygint.cygnus.com) - - *objdump.c *nm.c *copy.c: Changed some types to work with 64 bit - object files. - -Thu May 16 16:06:55 1991 Steve Chamberlain (steve at cygint.cygnus.com) - from bother - * objdump.c (print_address): Make disasembled output more - consistent with gdb and as: Add 0x when printing hex. - Don't print extra leading zeros. - Attempt to not print "filename.o". - * objdump.c: Add some enum-to-int casts to accomodate old compilers. - - -Fri May 3 22:21:44 1991 John Gilmore (gnu at cygint.cygnus.com) - - * copy.c: Change =& constructs to = &, since they confuse older - C compilers. + command line switch "-M force-thumb". +For older changes see ChangeLog-9899 Local Variables: mode: change-log diff --git a/gnu/dist/toolchain/binutils/ChangeLog-9197 b/gnu/dist/toolchain/binutils/ChangeLog-9197 new file mode 100644 index 000000000000..d989ae43251c --- /dev/null +++ b/gnu/dist/toolchain/binutils/ChangeLog-9197 @@ -0,0 +1,5218 @@ +Mon Dec 29 16:58:05 1997 Ian Lance Taylor + + From Matthew Bellantoni : + * ar.c (get_pos_bfd): Add default_posname parameter. Change all + callers. + (replace_members): Default to replacing in the same position. + +Mon Dec 22 11:27:22 1997 Ian Lance Taylor + + * rclex.l: Don't permit a comma in a STRING. + * rcparse.y (acc_entry): Warn if an inappropriate modifier is used + with a non VIRTKEY. + (acc_event): For a control character, set VIRTKEY, and force the + character to uppercase. + (acc_options): Don't require a comma separator. + +Tue Dec 9 13:25:42 1997 Michael Meissner + + * size.c (size_number): New function to provide size of field. + ({l,r}print_number): For octal and hex fields, print field using + '0' and '0x' suffixes. Do not include following tab. + (sysv_internal_sizer): Size section name, section size, and vma + address fields. + (sysv_internal_printer): Use calculated sizes for the columns. + (print_sysv_format): Size columns before printing. + (print_berkeley_format): Print tabs between numbers now that + {l,r}print_number doesn't. Print fields right justified. + +Mon Dec 8 11:22:04 1997 Nick Clifton + + * objdump.c (objdump_print_addr_with_sym): Remove call to + disasm_symaddr() as this function no longer exists. + +Tue Dec 2 10:23:50 1997 Nick Clifton + + * objdump.c (objdump_print_addr_with_sym): Call disasm_symaddr() + to allow backend to know which symbol has just been displayed. + +Tue Dec 2 13:06:46 1997 Ian Lance Taylor + + * windres.h (ESCAPE_*): Define standard escape sequences. + * rclex.l (handle_quotes): Handle standard escape sequences. Warn + about an unrecognized escape character. + * windres.c (unicode_print): Print standard escape sequences. + * rcparse.y (acc_event): Initialize $$.next. + * resbin.c (bin_to_res_menuitems): Don't set MENUITEM_POPUP or + MENUITEM_ENDMENU in the menu item flags. + (bin_to_res_accelerators): Allocate a structure (the old code + never worked). + (res_to_bin_accelerator): Correct the test for setting ACC_LAST. + (res_to_bin_dialog): Save the extended style rather than saving + the style twice. Remove useless shadowing length variable. Set + the length of control data correctly. + * resrc.c (write_rc_dialog): Don't print the class or menu if the + string length is zero. + +Mon Nov 24 18:52:43 1997 Andreas Schwab + + * stabs.c (parse_stab_argtypes): Don't try to parse the name of a + destructor as mangled argument types. + +Mon Nov 10 17:51:41 1997 Gavin Koch + + * addr2line.c (translate_addresses): Use bfd_scan_vma rather + than strtol to scan addresses. + +Sun Nov 9 11:01:31 1997 Jeffrey A Law (law@cygnus.com) + + * Makefile.am (bin_PROGRAMS): Don't use line continuations here. + +Tue Nov 4 11:56:14 1997 Ian Lance Taylor + + * objcopy.c (copy_section): Don't crash if there is no particular + information for a section. + +Mon Nov 3 12:36:19 1997 Ian Lance Taylor + + * objcopy.c (parse_flags): Make flag check case insensitive. + Check for `contents' flag. Give an error for unrecognized flags. + (copy_section): If the contents flag was set for a section that + had no contents, zero out the new contents. + * binutils.texi (objcopy): Document contents section flag. + +Sun Nov 2 14:49:56 1997 Ian Lance Taylor + + * objcopy.c: Move new struct and variable definitions to top of + file. Remove obsolete add_strip_symbol and is_strip_symbol + declarations. Add prototype declarations for add_specific_symbol + and is_specified_symbol. + +Mon Oct 20 15:31:43 1997 Klaus K"ampf + + * configure.com (HAVE_SBRK): Undefine. + +Tue Oct 14 16:14:35 1997 Nick Clifton + + * objdump.c (objdump_symbol_at_address): New function. Returns + true if a symbol can be found at the address passed in. + (disassemble_data): Set the symbol_at_address_func field to point + to objdump_symbol_at_address. + +Fri Oct 10 14:13:09 1997 Richard Henderson + + * objcopy.c, objcopy.1, binutils.texi: "localize" is a better name + than "privatize". Update all references. + +Thu Oct 9 15:57:29 1997 Ian Lance Taylor + + * binutils.texi (strip): Remove duplicate --target. From Marty + Leisner . + + * nm.c (lineno_cache_bfd): New file static variable. + (lineno_cache_rel_bfd): New file static variable. + (display_archive): Clear lineno_cache_bfd and lineno_cache_rel_bfd + when closing a BFD. + (display_file): Likewise. + (print_symbol): Use lineno_cache_bfd and lineno_cache_rel_bfd + instead of cache_bfd and cache_rel_bfd. Make seccount static, and + only set it when setting relocs. + +Wed Oct 8 21:19:11 1997 Richard Henderson + + * objcopy.c (keep_specific_list, privatize_specific_list, + weaken_specific_list): New variables. + (keep_symbols): Removed. + (add_specific_symbol): New function from the carcas of + add_strip_symbol. Takes a list as an argument. + (is_specified_symbol): Likewise from is_strip_symbol. + (filter_symbols): Honor the new privatize and weaken lists. + Optimize bfd_asymbol_name handling. + (copy_object, copy_options, copy_usage): Add privatize-symbol & + weaken-symbol options. + + * objcopy.1, binutils.texi: Update docs. + +Sun Oct 5 09:05:44 1997 Frank Ch. Eigler + + * objdump.c (disassemble_data): Make "--prefix-addresses" + disassembly adjust to mixed-length instructions. + (objdump_print_addr_with_sym): Add "0x" prefix for hexadecimal + symbol-offsets in disassembly. + +Fri Oct 3 12:04:25 1997 Ian Lance Taylor + + * objcopy.c (set_times): New static function, replacing + make_same_dates. + (strip_main): If preserve_dates, stat the input file before + copying it, and call set_times afterward. + (copy_main): Likewise. + + * wrstabs.c (write_stabs_in_sections_debugging_info): Cast p to + char * when calling strcpy and strlen. + +Wed Sep 24 11:34:05 1997 Ian Lance Taylor + + * binutils.texi (ar cmdline): Document that q now works like r. + From Marty Leisner . + + * binutils.texi (size): The object file argument is optional. + From Marty Leisner . + + * aclocal.m4: Rebuild with new libtool. + * configure: Rebuild. + +Tue Aug 26 17:48:34 1997 Ian Lance Taylor + + * Makefile.am (EXEEXT_FOR_BUILD): New variable. Use it in all + references to the sysinfo program. + * configure.in: Rebuild with new bfd/acinclude.m4. + * Makefile.in: Rebuild. + +Fri Aug 8 15:32:49 1997 Ian Lance Taylor + + * windres.c: Include . + (define_resource): Set a timestamp for the resource. + +Wed Aug 6 13:37:58 1997 Ian Lance Taylor + + * configure.in: Define TARGET in header file. + * acconfig.h (TARGET): Add #undef. + * Makefile.am (version.o, bucomm.o): Remove special targets. + * bucomm.c (target): Remove. + * nm.c (program_name): Don't declare. + (target): Make static. + * size.c (target): Make static. + * configure, config.in, Makefile.in: Rebuild. + +Tue Aug 5 00:01:41 1997 Ian Lance Taylor + + * Makefile.am (check-DEJAGNU): Export r. + (.dep1): Use $(INCLUDES) rather than $(ALL_CFLAGS). + * Makefile.in: Rebuild. + + * nlmheader.y: Use VERSIONK rather than VERSION. + + * Makefile.am (STRIP_PROG): Change from strip.new to strip-new. + (NM_PROG): Change from nm.new to nm-new. + (TOOL_PROGS, install-exec-local): Adjust accordingly. + * Makefile.in: Rebuild. + +Mon Aug 4 11:47:31 1997 Ian Lance Taylor + + * configure.in: Remove AC_ARG_PROGRAM; it's invoked by + AM_INIT_AUTOMAKE. + * configure: Rebuild. + + * Makefile.am (install-exec-local): Create $(tooldir)/bin before + trying to install anything into it. + * Makefile.in: Rebuild. + + * Makefile.am (TOOL_PROGS): Use an explicit $(EXEEXT). + (install-exec-local): When handling $(noinst_PROGRAMS), only use + $(EXEEXT) on the installed file. When handling $(TOOL_PROGS), + handle $(EXEEXT) correctly. + * configure.in: Add an explicit $(EXEEXT) when substituting for + the name of a program to build. + * Makefile.in, configure: Rebuild. + + * aclocal.m4, configure, Makefile.in: Rebuild with new automake + patches. + + * deflex.l, defparse.y: Use VERSIONK rather than VERSION. + * rclex.l, rcparse.y: Likewise. + * Makefile.am (windres_SOURCES): Add $(BULIBS). + * Makefile.in: Rebuild. + +Fri Aug 1 13:08:39 1997 Ian Lance Taylor + + * acinclude.m4: Include bfd/acinclude.m4, not bfd/acmacros.m4. + * aclocal.m4, configure: Rebuild with new libtool. + +Thu Jul 31 11:51:35 1997 Ian Lance Taylor + + * Makefile.am: New file, based on old Makefile.in. + * acinclude.m4: New file, from old aclocal.m4. + * configure.in: Call AM_INIT_AUTOMAKE and AM_PROG_LIBTOOL. Remove + shared library handling; now handled by libtool. Replace + AC_CONFIG_HEADER with AM_CONFIG_HEADER. Call AC_PROG_YACC, + AC_PROG_LEX, AC_DECL_YYTEST, AM_MAINTAINER_MODE, AM_CYGWIN32, and + AM_EXEEXT. Replace AC_PROG_INSTALL with AM_PROG_INSTALL. Remove + stamp-h handling in AC_OUTPUT. + * acconfig.h: Mention PACKAGE and VERSION. + * stamp-h.in: New file. + * Makefile.in: Now built with automake. + * aclocal.m4: Now built with aclocal. + * config.in, configure: Rebuild. + + From Ton van Overbeek : + * rcparse.y (dialog): Default menu and class to be named. + (styles): If FONT is seen, set DS_SETFONT in dialog style. + * resbin.c (res_to_bin_dialog): Correct computation of font + information length. + +Wed Jul 30 11:21:06 1997 Ian Lance Taylor + + From Ton van Overbeek : + * resbin.c (res_to_bin_menu): Correct computation of menu + vs. menuex length. + * resrc.c (define_stringtable): Add 1 to resource ID. + +Tue Jul 29 11:06:03 1997 Ian Lance Taylor + + * resbin.c (bin_to_res_string): Correct adjustment of data and + length. From Ton van Overbeek . + +Tue Jul 22 18:01:23 1997 Ian Lance Taylor + + * nlmconv.c (link_inputs): Call libiberty pexecute function. + (pexecute) [multiple versions]: Remove. + +Tue Jul 22 16:19:34 1997 Robert Hoehne + + * bucomm.c (make_tempname): If we might be using a DOS filesystem, + check for a backslash as well as a slash. + +Thu Jun 26 13:53:17 1997 Ian Lance Taylor + + * windres.c (main): Quit if we didn't get any resources. + (usage): Fix --yydebug usage message. + * rescoff.c (write_coff_file): Don't free the relocation array + until after we've closed the BFD. + (read_coff_rsrc): Quit rather than try to read standard input. + (write_coff_file): Quit rather than try to write to standard + output. + * rcparse.y: Add a couple of missing semicolons (accepted by bison + but not byacc). + * binutils.texi: Document windres. + +Wed Jun 25 20:57:06 1997 Ian Lance Taylor + + * resbin.c: New file. + * rclex.l, rcparse.y, rescoff.c, resrc.c, windres.c, windres.h: + Numerous fixes and improvements. + * Makefile.in: Rebuild dependencies. + (CFILES): Add resbin.c. + (WINDRES_OBJS): Add resbin.o. + +Sun Jun 22 17:29:41 1997 Ian Lance Taylor + + First stab at Windows resource compiler: + * windres.h: New file. + * windres.c: New file. + * resrc.c: New file. + * rcparse.y: New file. + * rclex.l: New file. + * rescoff.c: New file. + * configure.in: Define and substitute BUILD_WINDRES. + * configure: Rebuild. + * Makefile.in: Rebuild dependencies. + (WINDRES_PROG): New variable. + (PROGS): Add @BUILD_WINDRES@. + (HFILES): Add dlltool.h and windres.h. + (CFILES): Add windres.c and resrc.c. + (GENERATED_CFILES): Add rcparse.c and rclex.c. + (WINDRES_OBJS): New variable. + $(WINDRES_PROG): New target. + (rcparse.c, rcparse.h, rclex.c): New targets. + +Thu Jun 12 12:27:51 1997 Ian Lance Taylor + + * dlltool.c (export_type): Add data field. + (def_exports): Add data parameter. Change all callers. + (dump_def_info): Print data field. + (gen_def_file): Likewise. + (make_one_lib_file): Handle data field by not emitting simple + label and not emitting anything in SEC_TEXT. + (dtab): Print data field. + (process_duplicates): Merge data field. + * dlltool.h (def_exports): Update declaration. + * defparse.y (expline): Accept opt_DATA. Pass it to def_exports. + (opt_DATA): New non-terminal. + +Wed Jun 11 17:15:47 1997 Ian Lance Taylor + + * dlltool.h: New file. + * deflex.l: Include dlltool.h and libiberty.h. Don't declare + strdup. Use xstrdup rather than strdup. + * defparse.y: Include bfd.h, bucomm.h, and dlltool.h. + * dlltool.c: Include dlltool.h and time.h. Make a lot of + variables and functions static. Make a lot of char * variables + and parameters const. Add declarations for static functions. Do + some reindenting. Hide more PowerPC stuff inside DLLTOOL_PPC. + +Wed Jun 11 12:05:52 1997 H.J. Lu + + * ar.c (bfd_special_undocumented_glue): Add const. + +Mon May 12 22:09:35 1997 Bob Manson + + * Makefile.in (check): Pass CC_FOR_TARGET and CFLAGS_FOR_TARGET + to runtest. + +Mon May 12 13:14:22 1997 Ian Lance Taylor + + * configure.in: Don't clear OPCODES when --enable-commonbfdlib is + used on HP/UX. + * configure: Rebuild. + +Fri Apr 25 14:22:08 1997 H.J. Lu + + * Makefile.in (maintainer-clean realclean): Change *.info* + to binutils.info* to save sysroff.info. + +Tue Apr 15 13:42:22 1997 Ian Lance Taylor + + * Makefile.in (INSTALL): Set to @INSTALL@. + (INSTALL_XFORM, INSTALL_XFORM1): Remove. + (install): Depend upon installdirs. Use $(program_transform_name) + directly, rather than using $(INSTALL_XFORM) and + $(INSTALL_XFORM1). + (installdirs): New target. + (install-info): Run mkinstalldirs. + +Mon Apr 14 11:52:39 1997 Ian Lance Taylor + + * Makefile.in (INSTALL): Change install.sh to install-sh. + + From Thomas Graichen : + * Makefile.in: Always use $(SHELL) when running move-if-change. + * configure.in: Use ${CONFIG_SHELL} when running $ac_config_sub. + * configure: Rebuild. + +Fri Apr 4 13:28:02 1997 Ian Lance Taylor + + * configure.in: Add AC_FUNC_ALLOCA. + * configure, config.in: Rebuild. + * bucomm.h: Add alloca handling, copied from gas/as.h. + * dlltool.c: Add #pragma alloca for AIX to start of file. + * nlmconv.c: Likewise. + + * Makefile.in (distclean): Remove site.exp and site.bak. Remove + everything that clean removes. + +Thu Apr 3 13:18:39 1997 Ian Lance Taylor + + * Makefile.in (VERSION): Set to 2.8.1. + + * Branched binutils 2.8. + +Tue Apr 1 16:21:44 1997 Klaus Kaempf + + * configure.com: New file. + * config.h-vms: Remove file. + * makefile.vms: Update for new configure scheme. + +Mon Mar 31 15:30:43 1997 Philippe De Muyter + + * objcopy.c (make_same_dates): Use statbuf, not buf, if not + HAVE_GOOD_UTIME_H. + +Fri Mar 28 17:57:53 1997 Alan Modra + + * Makefile.in ($(OBJDUMP_PROG)): Don't link against BFDLIB twice. + * configure.in: Add AC_ARG_ENABLE for commonbfdlib. If it is set, + set OPCODES to empty. + * configure: Rebuild. + +Thu Mar 27 16:03:02 1997 Ian Lance Taylor + + Based on patch from Marty Leisner : + * objcopy.c: Include or . + (strip_options): Add "preserve-dates". + (copy_options): Likewise. + (copy_usage): Mention -p and --preserve-dates. + (strip_usage): Likewise. + (make_same_dates): New static function. + (strip_main): Handle -p. + (copy_main): Likewise. + * binutils.texi, strip.1, objcopy.1: Document new option. + + addr2line.c contributed by Ulrich Lauther + : + * addr2line.c: New file. + * Makefile.in: Rebuild dependencies. + (ADDR2LINE_PROG): New variable. + (MANPAGES): Add addr2line. + (PROGS): Add $(ADDR2LINE_PROG). + (CFILES): Add addr2line.c. + ($(ADDR2LINE_PROG)): New target. + * binutils.texi: Document addr2line. + * addr2line.1: New file. + + * version.c (print_version): Update copyright date. + +Mon Mar 24 10:52:45 1997 Andreas Schwab + + * objdump.c (disassemble_data): Don't exit if a file cannot be + disassembled, instead just return. + +Thu Mar 20 21:16:51 1997 Jeffrey A Law (law@cygnus.com) + + * size.c (usage): Make definition match its prototype. + (display_bfd, lprint_number, rprint_number): Likewise. + (print_berkeley_format, sysv_internal_printer): Likewise. + (print_sysv_format): Likewise. + * nm.c (set_print_radix, set_output_format): Likewise. + * objcopy.c (filter_bytes): Likewise. + +Tue Mar 18 16:39:55 1997 H.J. Lu + + * Many files: Add function prototypes. + * ar.c (mri_emul, get_pos_bfd): Make static. + * arlex.l: Include "libiberty.h". Don't declare strdup. Use + xstrdup rather than strdup. + * arparse.y (yyerror): Make argument const. Correct typo. + * arsup.c (strdup): Don't declare. + (ar_save): Use xstrdup rather than strdup. + * filemode.c: Include "bucomm.h". + * nm.c (usage): Make static. + (print_symname): Make format and name const. + * objcopy.c (cat): Remove. + (copy_archive): Make output_target const. Use concat, not cat. + (copy_file, simple_copy, smart_rename): Make arguments const. + * objdump.c (read_section_stabs): Likewise. + (print_section_stabs): Likewise. + (display_target_tables): Don't declare getenv. + * strings.c (strings_object_file): Change file to const. + (print_strings): Change filename to const. + * Makefile.in: Rebuild dependencies. + +Tue Mar 18 11:37:24 1997 Ian Lance Taylor + + * configure.in: Add BFD_NEED_DECLARATION(getenv). + * acconfig.h: Add NEED_DECLARATION_GETENV. + * bucomm.h (getenv): Declare if NEED_DECLARATION_GETENV. + * configure, config.in: Rebuild. + * nlmconv.c (getenv): Don't declare. + + * Makefile.in: Rebuild dependencies. + +Sat Mar 15 15:35:56 1997 Ian Lance Taylor + + Based on patches from Jamie Lokier : + * objdump.c: Include "demangle.h". + (do_demangle): New static variable. + (usage): Mention -C/--demangle. + (long_options): Add "demangle". + (objdump_print_symname): New static function. + (objdump_print_addr_with_sym): Use objdump_print_symname. + (disassemble_bytes): Likewise. + (dump_reloc_set): Likewise. + (dump_symbols): Demangle symbol name. + (main): Handle -C. + * binutils.texi, objdump.1: Document -C/--demangle. + + * objdump.c (usage): Mention --no-show-raw-insn. + (long_options): Add "no-show-raw-insn". + (disassemble_bytes): Handle --no-show-raw-insn. + * binutils.texi, objdump.1: Document --no-show-raw-insn. + +Wed Mar 12 11:42:00 1997 Andreas Schwab + + * rddbg.c (free_saved_stabs): Set the strings to NULL after being + freed. + +Fri Feb 28 17:18:45 1997 Ian Lance Taylor + + * bucomm.c (set_default_bfd_target): New function. + * bucomm.h (set_default_bfd_target): Declare. + * ar.c (main): Call set_default_bfd_target. + * nlmconv.c (main): Likewise. + * nm.c (main): Likewise. + * objcopy.c (main): Likewise. + * objdump.c (main): Likewise. + * size.c (main): Likewise. + * strings.c (main): Likewise. + * Makefile.in (bucomm.o): New target, to define TARGET. + +Tue Feb 25 21:28:38 1997 Ian Lance Taylor + + * objdump.c (adjust_section_vma): New static variable. + (usage): Mention --adjust-section-vma. + (OPTION_ADJUST_VMA): Define. + (long_options): Add "addjust-vma". + (display_bfd): If adjust_section_vma is not 0, add it to all the + section addresses. + (main): Handle OPTION_ADJUST_VMA. + * binutils.texi, objdump.1: Document --adjust-vma. + +Fri Feb 14 18:46:47 1997 Ian Lance Taylor + + * nm.c (print_symbol): Cache the BFD as well as the symbols and + relocs, and don't try to use the symbols or relocs with a + different BFD. + +Thu Feb 13 21:34:43 1997 Klaus Kaempf (kkaempf@progis.de) + + * config.h-vms: sbrk() is provided on openVMS/Alpha. + * makefile.vms: allow compiling with current gcc snapshot. + +Thu Feb 13 20:14:40 1997 Ian Lance Taylor + + * arsup.c, coffgrok.c, dlltool.c, nlmconv.c: Use xmalloc rather + than malloc. + +Wed Feb 12 16:12:02 1997 Ian Lance Taylor + + * objdump.c (disassemble_data): Correct VMA argument to + find_symbol_for_address. Improve handling of code with no symbol + followed by code with a symbol. + +Wed Feb 12 12:16:47 1997 Andreas Schwab + + * objdump.c (disassemble_bytes): Make output of raw instructions + work better for non-standard values of bytes_per_chunk and + bytes_per_line. + +Thu Feb 6 14:14:59 1997 Martin M. Hunt + + * objdump.c (disassemble_bytes): Added code to allow some control + over the way raw instructions are displayed. + +Thu Feb 6 12:36:03 1997 Ian Lance Taylor + + * stabs.c (struct bincl_file): Add next_stack field. + (push_bincl): Put the new file on both bincl_list and + bincl_stack. Clear the file_types field. + (pop_bincl): Use the next_stack field when popping the stack. + Don't put the file on bincl_list. + (find_excl): Include the file name when warning about an unfound + N_EXCL. + + * debug.c (debug_type_samep): Don't crash if we are passed NULL. + +Thu Feb 6 11:54:24 1997 Alan Modra + + * objcopy.1: Add missing space after .B. + +Fri Jan 31 10:33:07 1997 Andreas Schwab + + * objdump.c (disassemble_data): Initialize `aux.require_sec'. + +Wed Jan 29 13:21:21 1997 Ian Lance Taylor + + * objdump.c (objdump_print_value): Add skip_zeroes parameter. + Change all callers. + (objdump_print_addr_with_sym): Likewise. Call objdump_print_value + to print address. + (objdump_print_addr): New static function. + (objdump_print_address): Just call objdump_print_addr. + (disassemble_bytes): Print real address, not function offset. + Skip a certain number of leading zeroes. + + * objdump.c (disassemble_zeroes): New static variable. + (usage): Mention --disassemble-zeroes. + (long_options): Add "disassemble-zeroes". + (disassemble_bytes): Check disassemble_zeroes. + +Tue Jan 28 16:47:26 1997 Ian Lance Taylor + + * objdump.c (disassemble_bytes): Don't skip zeroes if the + disassembler has told us that we are in a branch delay slot. + +Mon Jan 20 14:24:04 1997 Ian Lance Taylor + + * size.c (berkeley_sum): Rewrite. Skip sections which are not + SEC_ALLOC. Count SEC_READONLY sections as text. + +Tue Jan 14 15:14:14 1997 Ian Lance Taylor + + * Makefile.in (maintainer-clean realclean): Remove *.info*, not + just *.info. From H.J. Lu . + +Tue Dec 31 15:42:54 1996 Ian Lance Taylor + + * Makefile.in (ALL_CFLAGS): Add -D_GNU_SOURCE. + +Fri Dec 27 11:19:26 1996 Ian Lance Taylor + + * configure.in: Work around bug in AC_FUNC_VFORK in autoconf 2.12. + * configure: Rebuild. + +Thu Dec 19 13:11:20 1996 Ian Lance Taylor + + Based on patch from Andrew J Klossner : + * objcopy.c (OPTION_WEAKEN): Define. + (copy_options): Add "weaken". + (copy_usage): Mention --weaken. + (weaken): New static variable. + (filter_symbols): Handle weaken. + (copy_object): Call filter_symbols if weaken. + (copy_main): Handle OPTION_WEAKEN. + * binutils.texi, objcopy.1: Document --weaken. + +Wed Dec 18 22:49:13 1996 Stan Shebs + + * mpw-make.sed: Use NewFolderRecursive for installation. + +Sat Dec 7 10:17:25 1996 Jeffrey A Law (law@cygnus.com) + + * Makefile.in (install): Add "else true" clause to cater to + broken "make" on some systems. + +Fri Dec 6 17:21:41 1996 Ian Lance Taylor + + * ieee.c (parse_ieee_bb): Always initialize namcopy to avoid gcc + warning about uninitialized variable. + (ieee_read_cxx_class): Likewise, for pf. + (ieee_enum_type): Likewise, for i. + +Tue Nov 26 17:01:25 1996 Ian Lance Taylor + + * wrstabs.c (stab_array_type): Add casts when printing + bfd_signed_vma values. + + * configure: Rebuild with autoconf 2.12. + +Mon Nov 25 16:53:18 1996 Ian Lance Taylor + + * objdump.c (disassemble_data): Don't crash if there is no + symbol. + +Fri Nov 22 17:29:14 1996 Andreas Schwab + + * ar.c (open_inarch): Don't call bfd_openr with a null name. + +Fri Nov 1 12:08:13 1996 Ian Lance Taylor + + * binutils.texi: Add section on reporting bugs. + +Thu Oct 31 18:20:53 1996 Ian Lance Taylor + + * stabs.c (struct stab_handle): Add bincl_list field. + (parse_stab): Pass value to push_bincl. Call find_excl for + N_EXCL. + (struct bincl_file): Add hash, file and file_types fields. + (push_bincl): Add hash parameter. Save it in the new hash field. + Save the file number in the new file field. + (pop_bincl): Put the bincl_file on bincl_list, rather than freeing + it. Save the file types in the new file_types field. + (find_excl): New static function. + + * ieee.c (ieee_lineno): Don't compare line number addresses to + info->highaddr (undo part of October 28 patch). + +Tue Oct 29 16:40:22 1996 Ian Lance Taylor + + * objdump.c (objdump_print_value): Don't print the empty string + for zero. + +Mon Oct 28 16:58:14 1996 Ian Lance Taylor + + * stabs.c (struct stab_handle): Add function_end field. + (start_stab): Initialize function_end. + (finish_stab): Pass info->function_end to debug_end_function. + (parse_stab): If info->function_end is set, use it as the address + which ends a function. + + * ieee.c (ieee_array_type): Remember the correct size. + + * ieee.c (ieee_finish_compilation_unit): Permit coalescing ranges + that are up to 0x1000 bytes apart, not just 64. + (ieee_add_bb11_blocks): Don't bother to emit a BB11 that is less + than 0x100 bytes. + (ieee_lineno): Only emit line numbers that are less than + info->highaddr. + +Fri Oct 25 12:12:17 1996 Ian Lance Taylor + + * ieee.c (struct ieee_defined_enum): Add defined field. + (ieee_enum_type): If the enum tag has been seen before but not + defined, reuse the same type index, and define it. + (ieee_tag_type): If this enum has not been defined, add an + undefined entry to the list of enums. + + * objdump.c (disassemble_bytes): Let the disassembler override the + number of bytes printed on a line. + +Thu Oct 24 16:42:10 1996 Ian Lance Taylor + + * objdump.c (prefix_addresses): New static variable. + (long_options): Add "prefix-addresses". + (compare_symbols): Sort BSF_FUNCTION symbols before other + symbols. + (find_symbol_for_address): New static function, broken out of + objdump_print_address. + (objdump_print_addr_with_sym): New static function, broken out of + objdump_print_address. + (objdump_print_address): Call new functions. + (disassemble_bytes): New static function, broken out of + disassemble_data. Change disassembly format, unless + prefix_addresses is set. + (disassemble_data): Call disassemble_bytes. Unless + prefix_addresses is set, disassemble in chunks headed by a + symbol. + * binutils.texi, objdump.1: Document --prefix-addresses. + + * rddbg.c (read_section_stabs_debugging_info): Preserve the + backslash when concatenating multiple stabs strings. + +Thu Oct 10 11:36:31 1996 Doug Evans + + * dlltool.c (scan_open_obj_file): Fix loop exit test. + Add missing parameter to def_exports. + +Tue Oct 8 12:06:17 1996 Ian Lance Taylor + + * Makefile.in (LEX_OPTIONS): Set to empty string. -I -Cem is the + default for flex, and is not recognized by lex. + +Thu Oct 3 17:41:23 1996 Ian Lance Taylor + + * binutils.texi (Target Selection): Document that you can now + specify targets using configuration triplets. + + * ar.c (usage): Declare. Make sure all callers pass an argument. + +Thu Oct 3 15:39:42 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) + + * Makefile.in (clean): Remove config.log. + +Wed Oct 2 15:49:16 1996 Klaus Kaempf + + * makefile.vms: Bump version date. + +Tue Oct 1 15:00:59 1996 Ian Lance Taylor + + * version.c (print_version): New function. + * bucomm.h (print_version): Declare. + * ar.c (program_version): Don't declare. + (do_show_version): Remove. + (usage): Add help parameter. Print bug report address. + (main): Set is_ranlib at start. Check for --help and --version. + Call print_version, not do_show_version. + * nlmconv.c (program_version): Don't declare. + (main): Call print_version. + (show_usage): Print bug report address. + * nm.c (program_version, print_version): Don't declare. + (usage): Print bug report address. + (main): Call print_version. + * objcopy.c (program_version): Don't declare. + (copy_usage): Print bug report address. + (strip_usage): Likewise. + (strip_main): Call print_version. + (copy_main): Likewise. + * objdump.c (program_version): Don't declare. + (usage): Print bug report address. + (main): Call print_version. + * size.c (program_version): Don't declare. + (usage): Print bug report address. + (main): Call print_version. + * strings.c (program_version): Don't declare. + (main): Call print_version. + (usage): Print bug report address. + * Makefile.in: Update dependencies. + +Thu Sep 19 14:53:15 1996 Ian Lance Taylor + + * ieee.c: Revert Monday's reflocalp patch, and apply this patch + instead: + (write_ieee_debugging_info): Write a dummy type at the end of the + global type block. + +Mon Sep 16 15:30:54 1996 Ian Lance Taylor + + * ieee.c (struct ieee_write_type): Add reflocalp field. + (ieee_pointer_type): Set reflocalp after pushing type. + (ieee_function_type): If reflocalp is set, make this type local. + (ieee_range_type, ieee_array_type, ieee_set_type): Likewise. + (ieee_const_type, ieee_volatile_type): Likewise. + (ieee_struct_field, ieee_class_baseclass): Likewise. + + * ieee.c (struct ieee_info): Add global_types field. + (parse_ieee_bb): When starting a BB1, initialize the types field + to the global_types field. + (parse_ieee_be): When ending a BB2, copy the types field to the + global_types field. + +Fri Sep 13 17:32:21 1996 Ian Lance Taylor + + * objcopy.c (change_leading_char): New static variable. + (OPTION_CHANGE_LEADING_CHAR): Define. + (copy_options): Add "change-leading-char". + (copy_usage): Mention --change-leading-char. + (filter_symbols): Add obfd parameter. Change all callers. + Implement change_leading_char. + (copy_object): Call filter_symbols if change_leading_char. + (copy_main): Handle OPTION_CHANGE_LEADING_CHAR. + * binutils.texi, objcopy.1: Document --change-leading-char. + +Tue Sep 3 14:05:29 1996 Ian Lance Taylor + + * ieee.c (ieee_enum_type): Don't check index into a NULL names + array. + * nm.c (sort_symbols_by_size): Always initialize next. + * rdcoff.c (parse_coff_type): Warn about an incomprehensible + type rather than crashing. + * rddbg.c (read_symbol_stabs_debugging_info): Initialize f. + * stabs.c (parse_stab_members): Set context in all cases. + +Thu Aug 29 16:56:52 1996 Michael Meissner + + * configure.in (i[345]86-*-*): Recognize i686 for pentium pro. + * configure: Regenerate. + +Thu Aug 29 11:29:20 1996 Ian Lance Taylor + + * objdump.c (L_tmpnam): Never define. + (display_target_list): Use choose_temp_base instead of tmpnam. + (display_info_table): Likewise. + +Tue Aug 27 18:15:01 1996 Ian Lance Taylor + + * stabs.c (parse_stab): An N_FUN symbol with an empty string + indicates the end of a function. + +Thu Aug 22 17:08:00 1996 Ian Lance Taylor + + * wrstabs.c (struct string_hash_entry): Add next field. + (struct stab_write_handle): Change strings to a pointer to + string_hash_entry. Add last_strings field. Remove strings_alloc + field. + (string_hash_newfunc): Initialize next field. + (stab_write_symbol): Copy string into hash table rather than into + buffer. Keep a list of hash table entries. + (write_stabs_in_sections_debugging_info): Initialize last_string. + Copy strings from list of hash table entries in memory. + (stab_modify_type): If the entry on the stack is a definition, + make a new definition rather than failing an assert. + (stab_array_type): The size is only zero if high is strictly less + than low. + + * ieee.c (struct ieee_info): Add saw_filename field. + (parse_ieee): Initialize saw_filename. + (parse_ieee_bb): Set saw_filename for a BB1 or BB2. In a BB1, + discard the current variables and types. In a BB10, if no + filename has been seen, call debug_set_filename. + (parse_ieee_ty): In case 'g', the type is optional. + + * prdbg.c (pr_fix_visibility): Don't abort on + DEBUG_VISIBILITY_IGNORE. + + * debug.c (debug_name_type): Correct error message. + + * configure.in: Substitute HLDENV. + * configure: Rebuild. + * Makefile.in (HLDENV): New variable. Use it whenever linking a + program. + +Thu Aug 15 19:30:41 1996 Stan Shebs + + * mpw-make.sed: Add symbolic doublequotes around the version + number. + +Thu Aug 8 12:27:52 1996 Klaus Kaempf + + * makefile.vms: Add better support for DEC C compilation. + Add new macros as in Makefile.in. + +Wed Aug 7 14:27:33 1996 Philippe De Muyter + + * configure.in: Call BFD_NEED_DECLARATION on strstr and sbrk. + * acconfig.h (NEED_DECLARATION_STRSTR): New macro. + (NEED_DECLARATION_SBRK): New macro. + * configure, config.in: Rebuild. + * bucomm.h (strstr): Declare if NEED_DECLARATION_STRSTR. + (sbrk): Declare if HAVE_SBRK and NEED_DECLARATION_SBRK. + + * prdbg.c (pr_end_struct_type): Avoid using a string constant in + assert, for the benefit of broken assert macros. + +Fri Jul 26 14:06:50 1996 Ian Lance Taylor + + * objdump.c (disassemble_data): Set disasm_info.flavour from + abfd. + +Tue Jul 23 13:59:54 1996 Ian Lance Taylor + + * dlltool.c (secdata): In non DLLTOOL_PPC case, change alignment + of .text section to 2. + +Mon Jul 22 08:46:15 1996 Stu Grossman (grossman@lisa.cygnus.com) + + * objdump.c (dump_section_stabs): Fix test for stabs sections + ending with numbers. This fixes a problem with .stab being + confused with .stab.index. + +Wed Jul 10 13:32:28 1996 Ian Lance Taylor + + * stabs.c (stab_demangle_fund_type): Return a void * for a + template, rather than simply aborting. + +Mon Jul 8 15:28:05 1996 Ian Lance Taylor + + * ar.c (open_inarch): Add file parameter. Change all callers. If + this is a newly created archive, set the target based on the + file. + * arsup.h (open_inarch): Update declaration. + +Thu Jul 4 12:00:55 1996 Ian Lance Taylor + + * Makefile.in (VERSION): Set to cygnus-2.7.1. + + * Released binutils 2.7. + + * rdcoff.c (parse_coff): Get address to pass to debug_end_function + from function size, not value of .ef symbol. From Ning + Mosberger-Tang . + +Sat Jun 29 21:18:09 1996 Ian Lance Taylor + + * objcopy.c (strip_main): Add -o option, and handle it. + (strip_usage): Mention -o. + * binutils.texi, strip.1: Mention -o. + +Mon Jun 24 17:19:02 1996 Jason Molenda (crash@godzilla.cygnus.co.jp) + + * Makefile.in (bindir, libdir, datadir, mandir, infodir, includedir, + INSTALL_PROGRAM, INSTALL_DATA): Use autoconf set values. + (docdir): Removed. + * configure.in (AC_PREREQ): Autoconf 2.5 or higher. + +Mon Jun 24 11:59:13 1996 Ian Lance Taylor + + * objdump.c (endian): New static variable. + (usage): Mention -EB/-EL/--endian. + (long_options): Add "endian". + (disassemble_data): If endianness was specified, replace + abfd->xvec with a copy of itself with the given endianness. + (main): Handle -EB/-EL/--endian. + * binutils.texi, objdump.1: Mention -EB/-EL/--endian. + + * objdump.c: Make most variables and functions static. + + * configure.in: On alpha*-*-osf*, link against libbfd.a if not + using shared libraries. + * configure: Rebuild with autoconf 2.10. + +Sun Jun 23 14:47:36 1996 Kim Knuttila + + * dlltool.c (secdata): Changed .rdata to .reldata so .reloc will work. + (make_one_lib_file): Removed cruft. (#if 1) + +Wed Jun 19 14:46:38 1996 Ian Lance Taylor + + * objdump.c (stabs): Change from struct internal_nlist * to + bfd_byte *. + (print_section_stabs): Fetch stabs information directly, rather + than assuming that struct internal_nlist is the right size. + + * binutils.texi: Document change to binary format: file position + based on load address, not section VMA. + + * bucomm.h: Define SEEK_SET, SEEK_CUR, and SEEK_END if they are + not already defined. + +Tue Jun 18 18:25:00 1996 Ian Lance Taylor + + * Makefile.in (DISTSTUFF): Add deflex.c. + +Tue Jun 18 15:03:44 1996 Klaus Kaempf + + * config.h-vms, makefile.vms: New files. + +Mon Jun 17 09:47:31 1996 Ian Lance Taylor + + * dlltool.c (make_one_lib_file): Use BFD_RELOC_RVA rather than + BFD_RELOC_32 in IDATA7. + +Wed Jun 12 11:52:06 1996 Ian Lance Taylor + + * nm.c (struct get_relocs_info): Define. + (line_numbers): New static variable. + (long_options): Add "line-numbers". + (usage): Mention -l and --line-numbers. + (main): Handle -l. + (print_symbol): Print line numbers if requested. + (get_relocs): New static function. + * binutils.texi, nm.1: Document -l/--line-numbers. + +Tue Jun 11 20:12:15 1996 Ian Lance Taylor + + * objdump.c (dump_reloc_set): Add sec parameter. Change all + callers. If with_line_numbers is set, display line numbers of + relocation entries. + * binutils.texi, objdump.1: Document -l with -r. + +Mon Jun 10 23:42:59 1996 Ian Lance Taylor + + * ar.c (open_inarch): Report BFD error message if an archive can + not be recognized. List matching formats if the file is + ambiguously recognized. + (ranlib_touch): Likewise. + +Thu Jun 6 13:56:14 1996 Ian Lance Taylor + + * README: Add notes on how to build if you don't have ar. + + * Makefile.in: Remove old incorrect setting of CC. + +Tue Jun 4 10:52:49 1996 Tom Tromey + + * Makefile.in (install): Don't check to see if tooldir exists. + Make $(tooldir) and $(tooldir)/bin. + +Mon Jun 3 17:40:23 1996 Michael Meissner + + * strings.c (main): Make main an int function, not void. + +Fri May 31 13:59:24 1996 Ian Lance Taylor + + * nm.c (filter_symbols): Check for BSF_WEAK as well as + BSF_GLOBAL. + * objcopy.c (filter_symbols): Likewise. + +Wed May 8 16:57:20 1996 Ian Lance Taylor + + * objcopy.c (copy_object): Make clear that it is only a warning + when the output file can not represent the architecture. + +Fri May 3 11:30:17 1996 Ian Lance Taylor + + * objdump.c (disassemble_data): Don't refer to bytes past the end + of data. + +Wed Apr 24 14:10:21 1996 Ian Lance Taylor + + * rddbg.c (read_symbol_stabs_debugging_info): Move call to + free_saved_stabs outside the loop over the symbols. + +Tue Apr 23 12:56:11 1996 Ian Lance Taylor + + * objdump.c (compare_symbols): Sort symbols whose names start with + `.' after other symbols. If no other decision can be made, sort + symbols by name. + +Thu Apr 18 16:02:11 1996 Ian Lance Taylor + + * dep-in.sed: Substitute $(BFDDIR) for @BFDDIR@. + * Makefile.in: Rebuild dependencies. + (dep.sed): Substitute $(BFDDIR) for @BFDDIR@. + +Tue Apr 16 13:50:22 1996 Ian Lance Taylor + + * rdcoff.c: New file. + * rddbg.c (read_debugging_info): Read COFF symbols if COFF flavour + and no stabs were found. + * budbg.h (parse_coff): Declare. + * Makefile.in: Rebuild dependencies. + (CFILES): Add rdcoff.c. + (DEBUG_OBJS): Add rdcoff.o. + +Mon Apr 15 15:55:01 1996 Doug Evans + + * nlmconv.c (choose_temp_base{,_try}): Delete, in libiberty now. + (link_inputs): Update call to choose_temp_base. + +Mon Apr 8 14:40:05 1996 Ian Lance Taylor + + * configure.in: Permit --enable-shared to specify a list of + directories. + * configure: Rebuild. + +Fri Mar 29 16:11:33 1996 Ian Lance Taylor + + * objdump.c (dump_section_header): Print the SEC_LINK_ONCE flag + and the SEC_LINK_DUPLICATES field. + +Fri Mar 29 11:35:55 1996 J.T. Conklin (jtc@lisa.cygnus.com) + + * nlmconv.1: Changed to be recognized by catman -w on Solaris. + +Thu Mar 28 14:17:02 1996 Ian Lance Taylor + + * wrstabs.c (stab_enum_type): Set buf before using it. + +Fri Mar 22 15:49:08 1996 Ian Lance Taylor + + * stabs.c (struct stab_handle): Add field abfd. + (start_stab): Add abfd parameter. + (parse_stab_string): Skip the symbol leading char when searching + for the value of a global symbol. + * budbg.h (start_stab): Update declaration. + * rddbg.c (read_section_stabs_debugging_info): Pass abfd to + start_stab. + (read_symbol_stabs_debugging_info): Likewise. + +Thu Mar 21 12:40:48 1996 Ian Lance Taylor + + * wrstabs.c (stab_function_type): Output an empty typedef for an + unused argument, rather than making up a meaningless name. + (stab_variable): Use N_RSYM for a DEBUG_REGISTER variable. + + * ieee.c (struct ieee_info): Add global_vars field. + (parse_ieee_be): When ending the global typedef block, copy the + variables into info->global_vars. + (parse_ieee_atn): Don't require an NN record for a pmisc ATN. + (ieee_read_reference): Search the global variables after the local + variables. + +Wed Mar 20 18:08:19 1996 Andreas Schwab + + * objdump.c (disassemble_data): Make sure sym_name is always set. + (dump_section_header): Always put a space after the section name. + (dump_bfd_header): Terminate output with newline. + +Wed Mar 20 16:35:20 1996 Ian Lance Taylor + + * wrstabs.c: New file. + * budbg.h (write_stabs_in_sections_debugging_info): Declare. + * objcopy.c (write_debugging_info): For COFF or ELF, output stabs + in sections. + * Makefile.in: Rebuild dependencies. + (CFILES): Add wrstabs.c. + (WRITE_DEBUG_OBJS): New variable. + ($(OBJCOPY_PROG)): Use $(WRITE_DEBUG_OBJS), not $(DEBUG_OBJS). + ($(STRIP_PROG)): Likewise. + + * stabs.c (parse_stab_members): Make type stub detection more like + gdb. + + * ieee.c (struct ieee_handle): Add fields complex_float_index and + complex_double_index. + (ieee_complex_type): Cache type index in complex_float_index and + complex_double_index, depending upon size. Set size on type stack + to size * 2. + + * ieee.c (ieee_empty_type): Use builtin_unknown, not 0. + (ieee_void_type): Use builtin_void, not 1. + + * ieee.c (parse_ieee_ty): Handle 'V' type code. + (parse_ieee_atn): Don't require two numbers for type 10. + + * ieee.c (parse_ieee_be): Add one to offset at end of function or + block. + + * ieee.c (struct ieee_block): Add field skip. + (parse_ieee_bb): Don't call debug_record_function for __XRYCPP + function, and set skip field. + (parse_ieee_be): Don't call debug_end_function if skip is set. + + * debug.c (struct debug_handle): Add fields current_write_lineno + and current_write_lineno_index. + (debug_write): Initialize current_write_lineno and + current_write_lineno_index for each unit. Call + debug_write_linenos rather than writing out the line numbers + directly. + (debug_write_function): Call debug_write_linenos. + (debug_write_block): Likewise. + (debug_write_linenos): New static function. + + * debug.c (debug_write_type): For DEBUG_KIND_FUNCTION, push return + type before arguments. + +Mon Mar 18 18:05:33 1996 Ian Lance Taylor + + * configure.in: Add AC_FUNC_VFORK. + * configure, config.in: Rebuild. + * dlltool.c, nlmconv.c: Include if HAVE_VFORK_H is + defined. + + * stabs.c (parse_stab_range_type): A complex type is defined as a + subrange of itself with the high bound zero. + * ieee.c (ieee_complex_type): Don't crash on sizes of 12 or 16. + +Tue Mar 12 12:09:43 1996 Ian Lance Taylor + + * ieee.c (ieee_write_undefined_tag): Switch to global_types even + if it is not empty. + (ieee_tag_type): For an enum, look through info->enums. + + * configure: Rebuild with autoconf 2.8. + + * debug.c (debug_type_samep): Don't loop endlessly in + DEBUG_KIND_ENUM case. From Eric Baur . + +Mon Mar 11 12:35:03 1996 Ian Lance Taylor + + * rddbg.c (read_section_stabs_debugging_info): Call save_stab for + each stab entry, call stab_context on an error, and call + free_saved_stabs before rturning. + (read_symbol_stabs_debugging_info): Likewise. + (SAVE_STABS_COUNT): Define. + (struct saved_stab): Define. + (saved_stabs, saved_stabs_index): New static variables. + (save_stab, stab_context, free_saved_stabs): New static functios. + + * objdump.c (stab_name): Remove. + (struct stab_print): Remove. + (stab_print): Remove. + (dump_stabs): Don't initialize stab_name. + (print_section_stabs): Call bfd_get_stab_name rather than using + the stab_name array. + +Tue Feb 27 19:52:01 1996 Ian Lance Taylor + + * prdbg.c (pr_int_constant): Initialize info correctly. + (pr_float_constant): Likewise. + +Mon Feb 26 18:11:37 1996 Stan Shebs + + * mpw-make.sed: Update to handle shared library support. + +Sat Feb 24 11:21:49 1996 Alan Modra : + + * Makefile.in ($(OBJDUMP_PROG)): Search $(BFDLIB) before + $(OPCODES). + +Thu Feb 15 12:44:45 1996 Ian Lance Taylor + + * configure.in: Don't tamper with LDFLAGS. Call AC_PROG_CC before + configure.host. + * configure: Rebuild. + + * configure.in: Substitute RPATH_ENVVAR. + * configure: Rebuild. + * Makefile.in (RPATH_ENVVAR): New variable. + (check): Use $(RPATH_ENVVAR) rather than LD_LIBRARY_PATH. + + * objcopy.c (smart_rename): Rather than doing chmod then chown, do + chmod without setuid, then chown, then chmod with setuid. + +Wed Feb 14 16:46:42 1996 Martin Anantharaman + + * arsup.c (map_over_list): Reindent. Don't assume that the + function does not delete the BFD. + (ar_addlib_doer): Don't set prev->next if prev is NULL. + +Wed Feb 14 15:12:17 1996 Ian Lance Taylor + + * ieee.c (ieee_regno_to_genreg): Convert register numbers for m68k + and i960. + (ieee_genreg_to_regno): Likewise. + +Mon Feb 12 14:19:59 1996 Ian Lance Taylor + + * ieee.c: Extensive changes to write code to put types in the + global type block when possible, to output ranges for all memory + occupied by the module, and to improve efficiency. + + * debug.c (struct debug_handle): Remove class_mark field. Add + id_list and compare_list fields. + (struct debug_class_id): Define. + (struct debug_type_compare_list): Define. + (debug_write): Initialize info->id_list + (debug_write_name): Remove reference to info->class_mark. + (debug_write_type): Get id for all structs and classes. Simplify + test for whether struct has already been written. + (debug_write_class_type): Get id for all classes. Simplify test + for whether class has already been written. + (debug_write_block): Don't write out blocks other than the top + level block if they have no local variables. + (debug_set_class_id): New static function. + (debug_type_samep): New static function. + (debug_class_type_samep): New static function. + * prdbg.c (pr_start_struct_type): Always print id. + (pr_start_class_type): Likewise. + (pr_tag_type): Likewise. + + * stabs.c (struct stab_handle): Add syms and symcount fields. + (start_stab): Add syms and symcount parameters. Change all + callers. + (parse_stab_string): Look up global variables in the symbol table + to get the right value. + * budbg.h (start_stab): Update declaration. + * rddbg.c (read_section_stabs_debugging_info): Add syms and + symcount parameters. Change all callers. + + * stabs.c (parse_stab_array_type): If the index type is 0, use + int. + +Wed Feb 7 14:17:45 1996 Ian Lance Taylor + + * ieee.c (ieee_start_compilation_unit): Clear modified and + modified_alloc fields of info. + + * configure.in: Check for --enable-shared. Substitute new + variables BFDLIB and OPCODES. + * configure: Rebuild. + * Makefile.in (BFDLIB): Set to @BFDLIB@. + (OPCODES): Set to @OPCODES@. + +Mon Feb 5 16:18:42 1996 Ian Lance Taylor + + Support for building bfd and opcodes as shared libraries, based on + patches from Alan Modra : + * configure.in (HLDFLAGS): New substitution. + * configure: Rebuild. + * Makefile.in (HLDFLAGS): New variable. Make all links use + $(HLDFLAGS) before $(CFLAGS) and $(LDFLAGS). + (BFDLIB_DEP): New variable. Replace all occurrences of $(BFD) as + a dependency with $(BFDLIB_DEP). Remove $(BFD) as a dependency if + there is also a dependency on $(ADDL_DEPS). + (BFDLIB): Rename from BFD; change all uses; set to -L../bfd -lbfd. + (OPCODES_DEP): New variable. Replace all occurrends of $(OPCODES) + as a dependency with $(OPCODES_DEP). + (OPCODES): Set to -L../opcodes -lopcodes. + (ADDL_DEPS): New variable. Replace all occurrences of + $(ADDL_LIBS) as a dependency with $(ADDL_DEPS). + (check): Set LD_LIBRARY_PATH in the environment. + (config.status): Depend upon BFD configure.host and config.bfd. + +Fri Feb 2 17:02:59 1996 Doug Evans + + * objdump.c: #include stdarg.h or varargs.h. + (objdump_print_value): Change FILE* arg to struct disassemble_info*. + All callers updated. Use fprintf_func. + (objdump_print_address): Consistently use fprintf_func. + (objdump_sprintf): New function. + (disassemble_data): Print insn into a buffer, print raw insn ourselves, + then print insn mnemonic. + +Fri Feb 2 16:48:55 1996 Ian Lance Taylor + + * configure: Regenerate. + +Thu Feb 1 09:38:18 1996 Steve Chamberlain + + * configure.in (i[3-6]86-*-win32): Becomes i[3-6]86-*-cygwin32. + (powerpc*-*-cygwin32): New. + * configure: Regenerated. + +Wed Jan 31 13:22:03 1996 Richard Henderson + + * Makefile.in (distclean): Remove $(DEMANGLER_PROG).1. + +Mon Jan 29 17:36:29 1996 Ian Lance Taylor + + Based on patches from H J Lu : + * objcopy.c (remove_leading_char): New static variable. + (OPTION_REMOVE_LEADING_CHAR): Define. + (copy_usage): Mention --remove-leading-char. + (filter_symbols): If remove_leading_char, and the first character + of a global symbol matches the symbol leading char of the BFD, + remove the first character. + (copy_object): Filter the symbols if remove_leading_char is set. + (copy_main): Handle --remove-leading-char. + * binutils.texi, objcopy.1: Document --remove-leading-char. + +Sat Jan 27 15:40:13 1996 Michael Meissner + + * objdump.c (fprintf): Add prototype to avoid compiler warning on + SunOS. + +Fri Jan 26 11:53:42 1996 Ian Lance Taylor + + * binutils.texi (nm): Improve documentation on symbol types. + (objdump): Reference the stabs manual from the discussion of the + --stabs option. + +Thu Jan 25 11:21:46 1996 Raymond Jou + + * mpw-make.sed: Add a "stamps" target. + +Thu Jan 25 13:51:44 1996 Ian Lance Taylor + + * objdump.c (dump_headers, dump_section_header): Change objdump -h + output to be simpler and to include section file offsets. + +Wed Jan 24 12:06:05 1996 Ian Lance Taylor + + * stabs.c (parse_stab_members): Don't adjust voffset. + + * ieee.c (ieee_read_cxx_class): Don't multiply voffset by 4. + (struct ieee_write_type): Add name field. + (struct ieee_type_class): Remove name field. Change all uses to + use new name field in type instead. + (struct ieee_name_type): Likewise. + (ieee_start_struct_type): Initialize name field of type. + (ieee_start_class_type): Don't initialize classdef entry of tag. + (ieee_class_method_var): Don't adjust voffset. + (ieee_end_class_type): Likewise. + (ieee_tag_type): Initialize new name field of type. + (ieee_typdef): Set name after copying in type information. + + * debug.c (VOFFSET_STATIC_METHOD): Define as -1, not 1. + + * ieee.c (struct ieee_modified_type): Define. + (struct ieee_handle): Add modified and modified_alloc fields. + (ieee_get_modified_info): New static function. + (ieee_pointer_type): Cache type index. + (ieee_const_type): Likewise. + (ieee_volatile_type): Likewise. + + * ieee.c (ieee_define_named_type): When creating a tag for an + anonymous struct, copy the name into memory. + (ieee_tag_type): Likewise. + * debug.c (debug_write_type): Only check and set id field for an + unnamed object. + (debug_write_class_type): Likewise. + + * ieee.c: Various changes to write out types for functions and + references, and to not write out unnecessary function types. + + * ieee.c (struct ieee_var): Remove variable field. Add kind + field, and define some enum constants for it. + (parse_ieee_ty): Set kind field of variable for 'x' and 'X' types. + (parse_ieee_atn): Make an indirect slot for an external variable, + although we otherwise don't record it. Set kind field rather than + variable field of pvar. + (ieee_read_cxx_class): Try to get the type of a static member. + (ieee_read_reference): Check kind field rather than variable + field. + +Tue Jan 23 15:54:18 1996 Ian Lance Taylor + + * ieee.c: Various changes to handle reading C++ reference type + information. + + * debug.h (enum debug_var_kind): Add DEBUG_VAR_ILLEGAL. + (enum debug_parm_kind): Add DEBUG_PARM_ILLEGAL. + * debug.c (debug_get_parameter_types): Handle DEBUG_KIND_FUNCTION. + + * ieee.c: Various changes to write out definitions of C++ classes. + + * debug.c (debug_append_filename): Remove. + * debug.h (debug_append_filename): Don't declare. + + * stabs.c (struct stab_handle): Remove last_type field. Add + so_string and so_value fields. + (finish_stab): Call stab_emit_pending_vars before calling + debug_end_function. Don't warn about pending variables. + (parse_stab): Accumulate N_SO strings until a non N_SO symbol is + seen, rather than calling debug_append_filename. Call + stab_emit_pending_vars before calling debug_end_function. Don't + set info->last_type. + +Tue Jan 23 09:53:54 1996 Doug Evans + + * objdump.c (disassemble_data): Handle unknown endianness. + Pass fprintf to INIT_DISASSEMBLE_INFO. + +Mon Jan 22 16:46:43 1996 Doug Evans + + Add new option --show-raw-insn. + * objdump.c (show_raw_insn): New global. + (usage): Update. + (long_options): Update. + (disassemble_data): Set disasm_info.flags if --show-raw-insn. + + * objdump.c (disassemble_data): Set new arch,mach,endian fields in + disasm_info. + +Mon Jan 22 19:29:36 1996 Ian Lance Taylor + + * ieee.c: Extensive changes to pass a single info argument around + in the reading routines, rather than several arguments. Add code + to read C++ debugging records. + + * debug.h (debug_get_type_size): Declare. + (debug_get_field_name): Declare. + (debug_get_field_bitpos): Declare. + (debug_get_field_bitsize): Declare. + (debug_get_field_visibility): Declare. + (debug_get_field_physname): Declare. + * debug.c (debug_get_real_type): Handle DEBUG_KIND_TAGGED. + (debug_get_type_size): New function. + (debug_get_field_name): New function. + (debug_get_field_bitpos): New function. + (debug_get_field_bitsize): New function. + (debug_get_field_visibility): New function. + (debug_get_field_physname): New function. + (debug_write_type): Make sure we pass the real kind, not INDIRECT, + to tag_type. Pass the name recursively for INDIRECT. + +Fri Jan 19 12:31:57 1996 Ian Lance Taylor + + * debug.h (struct debug_write_fns): Remove ellipsis_type. Add int + and boolean parameters to function_type. Add boolean parameter to + method_type. + (debug_make_ellipsis_type): Don't declare. + (debug_make_function_type): Add debug_type * and boolean + parameters. Change all callers. + (debug_make_method_type): Add boolean parameter. Change all + callers. + (debug_get_parameter_types): Add boolean * parameter. Change all + callers. + (debug_get_target_type): Declare. + * debug.c (struct debug_function_type): Add fields arg_types and + varargs. + (struct debug_method_type): Add field varargs. + (debug_ellipsis_type, ELLIPSIS_P): Remove. + (debug_make_ellipsis_type): Remove. + (debug_make_function_type): Add arg_types and varargs parameters. + (debug_make_method_type): Add varargs parameter. + (debug_get_parameter_types): Add pvarargs parameter. + (debug_get_target_type): New function. + (debug_write_type): In case DEBUG_KIND_FUNCTION, push argument + types and pass count to function_type. In DEBUG_KIND_METHOD, use + a signed int for the count, don't call ellipsis_type, and pass + varargs to method_type. + * stabs.c (struct stab_demangle_info): Add varargs field. + (stab_demangle_argtypes): Add pvarargs parameter. Change all + callers. + (stab_demangle_args): Likewise. + (stab_demangle_type): In case 'F', pick up argument types. + * prdbg.c (pr_ellipsis_type): Remove. + (pr_function_type): Add argcount and varargs parameters. + (pr_method_type): Add varargs parameter. + * ieee.c (ieee_ellipsis_type): Remove. + (ieee_function_type): Add argcount and varargs parameters. + (ieee_method_type): Add varargs parameter. Remove most of + function body, and just call ieee_function_type. + + * stabs.c: Include "demangle.h". Added several new static + functions not listed below to demangle argument types; they are + all called via stab_demangle_argtypes. + (finish_stab): If the kind of an undefined tag is + DEBUG_KIND_ILLEGAL, use DEBUG_KIND_STRUCT instead. Warn if there + are any pending variable. + (parse_stab): Don't close the function when the block depth goes + to zero. Pass value to debug_end_function. + (parse_stab_string): In case 'T', pass the name to + parse_stab_type. + (parse_stab_type): In case 'x', use stab_find_tagged_type. In + case '#', handle functions with variable numbers of arguments. + (parse_stab_struct_type): Add tagname parameter. Change all + callers. + (parse_stab_members): Add tagname and typenums parameters. Change + all callers. If the type of a method is a stub, call + parse_stab_argtypes to demangle the argument types and get the + physical name of the function. + (parse_stab_argtypes): New static function. + (stab_record_variable): For a DEBUG_GLOBAL or DEBUG_STATIC + variable, call debug_record_variable immediately. + (stab_find_tagged_type): New static function. + + * debug.h (enum debug_type_kind): Add DEBUG_KIND_ILLEGAL. + (struct debug_write_fns): Add field ellipsis_type. Add id + parameter to start_struct_type, start_class_type, and tag_type. + (debug_make_ellipsis_type): Declare. + (debug_find_named_type): Declare. + (debug_get_type_kind): Declare. + (debug_get_return_type): Declare. + (debug_get_parameter_types): Declare. + (debug_get_fields): Declare. + (debug_get_field_type): Declare. + * debug.c (struct debug_handle): Add fields class_id and base_id. + (struct debug_class_type): Add field id. + (struct debug_method_variant): Rename argtypes to physname. + Change all uses. + (debug_ellipsis_type): New static variable. + (ELLIPSIS_P): New macro. + (debug_make_ellipsis_type): New function. + (debug_make_method_variant): Rename argtypes to physname. + (debug_make_static_method_variant): Likewise. + (debug_name_type): Always put types in the global namespace. + (debug_find_named_type): New function. + (debug_find_tagged_type): Treat DEBUG_KIND_ILLEGAL specially, + rather than DEBUG_KIND_VOID. + (debug_get_real_type): New static function. + (debug_get_type_kind): New function. + (debug_get_return_type): New function. + (debug_get_parameter_types): New function. + (debug_get_fields): New function. + (debug_get_field_type): New function. + (debug_write): Initialize base_id. + (debug_write_type): Pass new id argument to tag_type. Handle + DEBUG_KIND_ILLEGAL. Use id for DEBUG_KIND_STRUCT and + DEBUG_KIND_UNION. Handle ellipsis for method arguments. + (debug_write_class_type): Don't dereference kclass if it is NULL. + Use id. + * prdbg.c (pr_fns): Add pr_ellipsis_type. + (pr_ellipsis_type): New static function. + (pr_pointer_type): If this is a pointer to an array, parenthesize + it correctly. + (pr_start_struct_type): Add id parameter. + (pr_start_class_type): Likewise. + (pr_tag_type): Likewise. + (pr_fix_visibility): Add the visibility to the top of the stack, + not the second element on the stack. + (pr_struct_field): Pop the stack before calling pr_fix_visibility. + (pr_class_static_member): Likewise. + (pr_class_start_method): Don't push a type, just set the method + name in the type on the top of the stack. + (pr_class_end_method): Don't pop the stack. + (pr_class_method_variant): Rename argtypes parameter to physname. + Append const and volatile rather than prepending them. Add a + space after the physname. + (pr_class_static_method_variant): Likewise. + * ieee.c (ieee_fns): Add ieee_ellipsis_type. + (ieee_define_named_type): Use DEBUG_KIND_ILLEGAL rather than + DEBUG_KIND_VOID. + (write_ieee_debugging_info): Likewise. + (ieee_typdef): Likewise. + (ieee_ellipsis_type): New static function. + (ieee_start_struct_type): Add id parameter. + (ieee_start_class_type): Likewise. + (ieee_tag_type): Likewise. + (ieee_class_method_variant): Rename name to physname. + (ieee_class_static_method_variant): Likewise. + + * Makefile.in (DEBUG_OBJS): Remove prdbg.o. + ($(OBJDUMP_PROG)): Depend upon, and link against, prdbg.o. + +Thu Jan 18 17:35:06 1996 Kim Knuttila + + * dlltool.c (make_tail): Changed the order of the sections to avoid + an alignment problem. + +Wed Jan 17 14:23:00 1996 J.T. Conklin + + * srconv.c (wr_du): Set du.stackfrmt to 0. + (wr_un, wr_sc): Emit all sections, even those with 0 size. + +Tue Jan 16 16:15:49 1996 J.T. Conklin + + * srconv.c (wr_hd): Space size within segment was being + stored in segment identifier field. + +Tue Jan 16 12:07:25 1996 Stan Shebs + + * mpw-config.in (BUILD_NLMCONV, BUILD_SRCONV, SYSINFO_PROG, + BUILD_DLLTOOL): Put definitions for these into makefile when + configuring, instead of always clearing in mpw-make.sed. + * mpw-make.sed: Edit out any host_alias or target_alias settings, + fix pathname to BFD internal include files, remove dependency + calculation rules. + +Thu Jan 11 17:31:38 1996 Michael Meissner + + * objdump.c (dump_section_header): Add new section flags + SEC_{EXCLUDE,SORT_ENTRIES}. + +Thu Jan 11 11:45:34 1996 Ian Lance Taylor + + * objcopy.c (filter_symbols): NULL terminate the output symbols. + (copy_object): Allocate space for a possible extra NULL pointer. + + * debug.c (debug_make_undefined_tagged_type): Make sure we are + given a kind of type we can handle. + (debug_write_type): Handle undefined enums and structs. + (debug_write_class_type): Handle undefined classes. + * prdbg.c (pr_enum_type): Handle an undefined enum. + * ieee.c (ieee_enum_type): Likewise. + +Wed Jan 10 15:33:18 1996 Ian Lance Taylor + + * Makefile.in: Updated dependencies. + (ALLOCA, MALLOC): Remove variables. + (ADDL_LIBS): Remove $(MALLOC) from definition. + * alloca.c, gmalloc.c: Remove. + +Mon Jan 8 18:02:29 1996 Ian Lance Taylor + + * ieee.c: Add global function write_ieee_debugging_info and a + bunch of static functions and structs used to write out IEEE + debugging information. + * budbg.h (write_ieee_debugging_info): Declare. + + * ieee.c (struct ieee_type): Add pslot field. + (enum builtin_types): Define. + (ieee_builtin_type): For a pointer, return a pointer to the named + type. Use enum values rather than numbers. + (ieee_alloc_type): New static function. + (ieee_read_type_index): Use ieee_alloc_type. + (parse_ieee_bb): Likewise. + (parse_ieee_ty): Likewise. Use ieee_builtin_type for array range, + rather than making a new integer type. Store the new type in the + slot, if there is one. + (parse_ieee_atn): Treat ATN10 as defining a register variable. + (ieee_regno_to_genreg): Rename from ieee_regno_to_gen. Change all + callers. + (ieee_genreg_to_regno): New static function. + + * stabs.c (parse_stab_type): Add new typename parameter. Change + all callers. + (parse_stab_range_type): Add new typename parameter. Change all + callers. + + * debug.h (struct debug_write_fns): Add tag parameter to + enum_type, start_struct_type, and start_class_type. + * debug.c (debug_write_type): Pass any tag name to + start_struct_type, debug_write_class_type, and enum_type. If + DEBUG_KIND_TAGGED, pass the name in the recursive call. + (debug_write_class_type): Accept a new tag parameter, and pass it + to start_class_type. + * prdbg.c (pop_type): Don't remove '+' character. + (pr_enum_type): Accept and use tag parameter. + (pr_start_struct_type): Likewise. + (pr_start_class_type): Likewise. + (pr_class_baseclass): Adjust algorithm used to find where to put + the baseclass name. + (pr_tag): Don't bother to insert the tag name. + + * objcopy.c: Include budbg.h. + (convert_debugging): New static variable. + (OPTION_DEBUGGING): Define. + (copy_options): Add "debugging". + (copy_usage): Mention --debugging. + (is_strip_section): Skip debugging sections if convert_debugging. + (setup_section, copy_section): Likewise. + (filter_symbols): Skip debugging symbols if convert_debugging. + (copy_object): If convert_debugging, read and write debugging + information. + (write_debugging_info): New static function. + (copy_main): Handle --debugging. + * Makefile.in (DEBUG_OBJS): New variable. + ($(OBJCOPY_PROG)): Depend upon and link against $(DEBUG_OBJS). + ($(STRIP_PROG)): Likewise. + (OBJDUMP_OBJS): Remove variable. + ($(OBJDUMP_PROG)): Use objdump.o $(DEBUG_OBJS) rather than + $(OBJDUMP_OBJS). + * binutils.texi, objcopy.1: Document --debugging. + +Thu Jan 4 16:31:21 1996 Ian Lance Taylor + + * ieee.c: New file with code to read IEEE debugging information. + * budbg.h (parse_ieee): Declare. + * rddbg.c (read_debugging_info): Handle IEEE flavour files. + (read_ieee_debugging_info): New static function. + * Makefile.in: Rebuild dependencies. + (CFILES): Add ieee.c. + (OBJDUMP_OBJS): Add ieee.o. + + * bucomm.h (xrealloc): Change type of first parameter from char * + to PTR. + +Tue Jan 2 17:44:07 1996 Ian Lance Taylor + + * Makefile.in: Add targets to automatically rebuild dependencies. + Remove targets which just listed dependencies of .o files. + (DEP): New variable. + (HFILES, GENERATED_HFILES): New variables. + (CFILES, GENERATED_CFILES): New variables. + (underscore.c): Don't do anything, just depend upon stamp-under. + (stamp-under): New target; do what underscore.c used to do. + (nlmconv.o): Depend upon sym.h and ecoff.h. + (.dep, .dep1, dep.sed, dep, dep-in): New targets. + (stage1, stage2, stage3, against, comparison): Remove. + (de-stage1, de-stage2, de-stage3): Remove. + (clean, distclean): Remove stamp-under and dep.sed. + * dep-in.sed: New file. + + Implement generic debugging support. Implement a stabs reader and + a generic printer. + * budbg.h, debug.c, debug.h, prdbg.c, rddbg.c, stabs.c: New files. + * objdump.c: Include "debug.h" and "budbg.h". + (dump_debugging): New global variable. + (usage): Mention --debugging. + (long_options): Add "debugging". + (display_bfd): Handle --debugging. + * Makefile.in (OBJDUMP_OBJS): New variable. + ($(OBJDUMP_PROG)): Use $(OBJDUMP_OBJS). + * binutils.texi, objdump.1: Document --debugging. + +Sat Dec 30 09:59:51 1995 Jeffrey A Law (law@cygnus.com) + + * nm.c ( long_options): Add "--defined-only" option. + (usage): Update for new "--defined-only" option. + (filter_symbols): Handle "--defined-only". + +Fri Dec 29 16:04:56 1995 Ian Lance Taylor + + * arparse.y: Include "bucomm.h", not . + * nlmheader.y: Don't include "sysdep.h". + +Tue Dec 26 18:23:18 1995 Ian Lance Taylor + + * nm.c (print_symdef_entry): Check return value of + bfd_get_elt_at_index. + +Sat Dec 23 11:03:16 1995 Michael Meissner + + * configure.in (DLLTOOL_DEFS): Build dlltool for PowerPC if target + is powerpc*-*-win* in addition to powerpc*-*-*pe*. + +Fri Dec 15 16:30:57 1995 Ian Lance Taylor + + * objdump.c (endian_string): New static function. + (display_target_list): Use it. + * nlmconv.c (main): Use new bfd_big_endian macro. + +Fri Dec 15 07:51:34 1995 steve chamberlain + + * dlltool.c (fill_ordinals): Start from 1 if no other instructions + given. + +Tue Dec 12 12:05:21 1995 Ian Lance Taylor + + * Makefile.in (clean): Remove $(DEMANGLER_PROG).1. From Ronald + F. Guilmette . + +Mon Dec 11 14:33:05 1995 Stan Shebs + + * mac-binutils.r: Fix copyright and version strings. + + * Makefile.in (version): Remove, no longer used. + +Fri Dec 1 14:41:56 1995 Stan Shebs + + * mpw-make.sed (install, install-only): Edit in Mac-specific + install procedure. + +Thu Nov 30 20:26:02 1995 Kim Knuttila + + * dlltool.c (ppc_jtab): The binary glue for PowerPC dll linkage, + including the return instruction. + sinfo: added a preferred alignment field. + (secdata): section data for the PowerPC version. + (make_one_lib_file): More symbols, More sections (pdata, rdata) + (make_tail): Use idata$6 instead of idata$7 for ppc. Also added a + NULL idata$3 descriptor (temporary). + +Tue Nov 28 17:23:44 1995 Doug Evans + + * dlltool.c (fill_ordinals): Don't reference d_export_vec if + there are no exported functions. + +Mon Nov 27 13:05:59 1995 Ian Lance Taylor + + * configure: Regenerate with autoconf 2.7. + +Wed Nov 22 13:17:15 1995 Ian Lance Taylor + + * dlltool.c (fill_ordinals): Start assigning ordinals at 1. + + * Makefile.in (EXPECT): Use $$r, not $${rootme}. + (check): Set r, not rootme. + +Tue Nov 21 18:04:09 1995 Ian Lance Taylor + + * configure.in: Use BFD_NEED_DECLARATION. + * acconfig.h: Put NEED_DECLARATION_FPRINTF in @TOP@ section. + * configure, config.in: Rebuild with autoconf 2.6. + +Fri Nov 17 10:34:37 1995 Ian Lance Taylor + + * Makefile.in (CC_FOR_TARGET): Use @host@ and @target@, not + $(host_canonical) and $(target_canonical). + +Thu Nov 16 03:39:20 1995 Ken Raeburn + + Version 2.6 released. + * Makefile.in (VERSION): Update to 2.6. + +Wed Nov 15 12:14:17 1995 Ian Lance Taylor + + * Makefile.in (CC_FOR_TARGET): Define. + (check): Pass CC and CFLAGS to runtest. + + * nm.c (display_rel_file): Don't require a DYNAMIC object when + dumping the dynamic symbol table. + + * objdump.c (compare_symbols): Sort global symbols before local + symbols before debugging symbols. + (objdump_print_address): Don't futz around looking for a global + symbol with the same value. + +Tue Nov 14 17:19:11 1995 Ian Lance Taylor + + * dlltool.c: Use FOPEN_* macros rather than "r" or "w". + + * dlltool.c (fill_ordinals): Correct memset call. + +Sun Nov 12 12:56:05 1995 Stan Shebs + + * mpw-make.sed (DEMANGLER_PROG): Edit out attempts to do anything + with the man page. + +Fri Nov 10 11:41:22 1995 Ian Lance Taylor + + * objcopy.c (setup_section): Copy the section lma independently of + the vma. + +Wed Nov 8 11:33:00 1995 Ian Lance Taylor + + * arsup.c (ar_open): Cast malloc return value. + +Tue Nov 7 09:01:26 1995 Kim Knuttila + + * configure.in, configure (DLLTOOL_DEFS): Added ppc target. + * dlltool.c (MPPC): Added basic PPC definitions. + +Tue Nov 7 14:02:57 1995 Ian Lance Taylor + + * configure.in: Don't treat rs6000-*-lynx* specially. + * configure: Rebuild. + * config/rslynx: Remove. + * Makefile.in: Remove @target_makefile_fragment@. + +Mon Nov 6 15:00:50 1995 Ian Lance Taylor + + * bucomm.h: Include . + * ar.c: Don't include or . + * bucomm.c, dlltool.c, nlmconv.c, objcopy.c, objdump.c: Likewise. + +Fri Nov 3 12:38:09 1995 Ian Lance Taylor + + * objdump.c: Include . + + Permit user to override DEMANGLER_PROG from command line. From + Manfred Hollstein . + * Makefile.in ($(DEMANGLER_PROG)): Depend upon + $(DEMANGLER_PROG).1. + (install): Don't depend upon $(DEMANGLER_PROG).1. Only install + $(DEMANGLER_PROG).1 if $(DEMANGLER_PROG) is not empty. + +Wed Nov 1 15:04:57 1995 Manfred Hollstein KS/EF4A 60/1F/110 #40283 + + * Makefile.in (syslex.o): add -I$(srcdir) if compiling in a + separate directory. + +Mon Oct 30 14:24:18 1995 Ian Lance Taylor + + * objdump.c (objdump_print_value): New static function. + (objdump_print_address): Use it. If we need the right section for + the symbol, and we can't find it, print an offset from the section + rather than using a symbol from some other section. + +Thu Oct 26 10:23:14 1995 steve chamberlain + + * dlltool.c (no_idata4, no_idata5): New. + (arm_jtab): Use correct encoding of jump instruction. + (usage, main, make_head, make_tail): Act on no_idata4, no_idata5. + +Wed Oct 25 12:10:07 1995 Stan Shebs + + * mpw-make.sed: Edit paths to generated y.tab.[ch] files. + +Fri Oct 20 18:40:34 1995 Ian Lance Taylor + + * binutils.texi: Change --with-targets to --enable-targets. + +Thu Oct 19 17:47:41 1995 Fred Fish + + * Makefile.in: Remove extraneous tab on otherwise empty line, + which confuses many non-GNU versions of "make". + +Wed Oct 18 16:31:58 1995 steve chamberlain + + * dlltool.c (i386_jtab, arm_jtab): New + (gen_lib_file): Rewritten to use bfd. + +Fri Oct 13 16:10:07 1995 Michael Meissner + + * Makefile.in (install): Don't give error message if dlltool + wasn't built. + +Fri Oct 13 11:04:37 1995 steve chamberlain + + * deflex.l: Allow quoting of IDs. + * defparse.y (%union): string deleted. + (command): DESCRIPTION takes ID. + * dlltool.c (gen_def_file): Quote outgoing name if + necessary. Preserve NONAME. + (gen_lib_file): Run ranlib. + (workout_prefix): Deleted. + (main, usage, long_options): Add --as, --ranlib, --ar options. + +Wed Oct 11 13:36:13 1995 steve chamberlain + + * dlltool.c (mtable): HOW_ALIGN_LONG, new. + (d_ord): Deleted. + (d_low_ord, d_high_ord, d_named_funcs): New. + (gen_exp_file): Create noname entries correctly. + (gen_lib_file): Dump exports alphabetically. + (process_duplicates): Count nonamed functions. + (fill_ordinals): Keep track of highest ord too. + (mangle_defs): Create alphabetically ordered list of names. + +Tue Oct 10 09:39:09 1995 steve chamberlain + + * Makefile.in (TOOL_PROGS): Include DLLTOOL_PROG. + +Mon Oct 9 13:06:31 1995 steve chamberlain + + * dlltool.c (add_underscore): New. + (xlate): Use new name. + (main, usage): Update. + +Fri Oct 6 14:08:51 1995 Ken Raeburn + + * sysinfo.y: Eliminate unused terminals "[" and "]" and unused + nonterminal "name". One s/r conflict remains. + + Mon Sep 25 22:49:32 1995 Andreas Schwab + + * nm.c (print_symname): Don't try to demangle an empty + name. + * objdump.c (slurp_symtab): Reset symcount if there are + no symbols. + (slurp_dynamic_symtab): Likewise, for dynsymcount. + (disassemble_data): Fix memory leak: free sorted_syms when done. + (display_bfd): Likewise, for syms and dynsyms. + (dump_relocs): Don't print header before possibly generating an + error message. + (dump_dynamic_relocs): Likewise. + + * ar.1, nm.1, objdump.1, size.1, strings.1, strip.1: Fix typos and + formatting bugs. + +Fri Oct 6 12:00:25 1995 Ian Lance Taylor + + * ar.c (do_quick_append): Comment out. + (replace_members): Add quick argument. + (main): Don't call do_quick_append. + (open_inarch): Don't call quick_append to create an empty archive. + Instead call bfd_openw/bfd_set_format/bfd_close. + +Thu Oct 5 20:53:08 1995 Ken Raeburn + + * bucomm.c: Always include time.h. + +Thu Oct 5 17:25:21 1995 Ian Lance Taylor + + * objdump.c (compare_symbols): Sort gnu_compiled and gcc2_compiled + symbols after other symbols with the same value. Likewise for + symbols which look like file names. + (objdump_print_address): Always chose the first reasonable symbol + with a given value. + +Tue Oct 3 22:38:55 1995 Ian Lance Taylor + + * arsup.c (ar_save): Use rename, not unlink/link/unlink. + +Mon Oct 2 12:10:25 1995 Ian Lance Taylor + + * strings.c (main): Exit with zero status if no files are given + and standard input is read. + +Thu Sep 28 20:03:07 1995 Stan Shebs + + * mpw-config.in: Calculate underscore and put into makefile + fragment, generate config.h. + * mpw-make.sed: New file, sed commands to edit Unix makefile + into MPW syntax. + * mpw-make.in: Remove. + * mac-binutils.r: New file, Mac resources. + +Thu Sep 28 15:49:00 1995 steve chamberlain + + * dlltool.c: (gen_exp_file): Always emit a .reloc section if + relocatable. + (imp_name_lab): New. + (gen_def_file): New. + (gen_lib_file): Use imp_name_lab. + (main): Initialize imp_name_lab. + +Mon Sep 25 12:05:34 1995 Ian Lance Taylor + + * configure.in: Call AC_HEADER_SYS_WAIT. + * configure: Rebuild. + * config.in: Rebuild. + * dlltool.c: Include "libiberty.h" and "bucomm.h". Don't include + , , or . Don't include . + Include . Use HAVE_SYS_WAIT_H to control whether to + include or define the wait macros by hand. Don't + declare xmalloc. + (gen_lib_file): Don't assume that sprintf returns the number of + characters; use strlen instead. + +Fri Sep 22 17:16:41 1995 Ian Lance Taylor + + * objdump.c (disassemble_data): Don't use the old BFD based + disassembler interface. Make info a const pointer. + +Wed Sep 13 18:33:44 1995 Ian Lance Taylor + + * objdump.c (start_address): New variable. + (stop_address): New variable. + (usage): Mention --start-address and --stop-address. + (OPTION_START_ADDRESS, OPTION_STOP_ADDRESS): Define. + (long_options): Add "start-address" and "stop-address". + (disassemble_data): Handle start_address and stop_address. + (dump_data, dump_reloc_set): Likewise. + (main): Don't set seenflag for -l. Handle OPTION_START_ADDRESS + and OPTION_STOP_ADDRESS. + * objcopy.c (parse_vma): Move to bucomm.c. + * bucomm.c (parse_vma): New function, moved in from objcopy.c. + * bucomm.h (parse_vma): Declare. + * binutils.texi, objdump.1: Document new objdump options. + +Tue Sep 12 12:37:39 1995 Ian Lance Taylor + + * Makefile.in (maintainer-clean): New target. + + * ar.c (replace_members): Don't call write_archive if nothing + changed. + + * objdump.c (disassemble_data): Add casts to avoid gcc warnings. + +Thu Sep 7 12:12:17 1995 Ian Lance Taylor + + * config.in: Rename from config.h.in. + * configure.in: Call AC_CONFIG_HEADER with config.h:config.in. + Check for config.h:config.in when creating stamp-h. + * configure: Rebuild. + * Makefile.in (stamp-h): Depend upon config.in rather than + config.h.in. Set CONFIG_HEADERS to config.h:config.in when + calling config.status. + + * Makefile.in (distclean): Remove config.h, stamp-h, and + config.log. + + * nm.c (value_format): Initialize based on BFD64 and + BFD_HOST_64BIT_LONG. + (print_radix): New static variable. + (set_print_radix): Set print_radix. Adjust changes to + value_format. + (print_value): New static function, to print 64 bit octal and + decimal values correctly. + (print_symbol_info_bsd): Check BFD64, not BFD_HOST_64_BIT. Use + print_value. + (print_symbol_info_sysv): Use print_value. + (print_symbol_info_posix): Likewise. + +Wed Sep 6 15:02:55 1995 Ian Lance Taylor + + * Makefile.in (*.o): Remove incorrect dependencies on + $(BFDDIR)/hosts/std-host.h. + + * Makefile.in (INSTALL_DATA): Add -m 644. + (INSTALL_XFORM1): Likewise. + (CC_FOR_BUILD): Set to @CC_FOR_BUILD@ rather than $(CC). + (mostlyclean): Remove config.log. + (distclean): Remove config.cache. + + * configure.in: Call BFD_CC_FOR_BUILD and BFD_BINARY_FOPEN. + * configure: Rebuild. + +Tue Sep 5 20:22:42 1995 Ian Lance Taylor + + * configure.in: Rewrite to use autoconf. + * aclocal.m4: New file. + * configure: New file, built by autoconf. + * acconfig.h: New file. + * config.h.in: New file, built by autoheader. + * Makefile.in: Various changes for new configure script. Also: + (PROGS): Remove $(SYSINFO_PROG). + (ALL_CFLAGS): Remove $(TDEFINES). + (version.o): Use $(ALL_CFLAGS). + (cplus-dem.o, dlltool.o, nlmconv.o): Likewise. + (sysdump.o): Depend upon bucomm.h and config.h. + (srconv.o, arsup.o, strings.o): Depend upon config.h. + (filemode.o): Don't depend upon ../bfd/sysdep.h. + (bucomm.o): Depend upon config.h, not ../bfd/sysdep.h. + (size.o, objdump.o, nm.o, ar.o, objcopy.o): Likewise. + (nlmheader.o, nlmconv.o): Likewise. + (distclean): Don't remove sysdep.h. + * bucomm.h: Include "ansidecl.h", , and "config.h". + Include "fopen-same.h" or "fopen-bin.h", based on + USE_BINARY_FOPEN. Include , and declare errno if it is + not a macro. Include , , , + , and if they are present. Declare strchr, + strrchr, and strstr if no string header file exists. Include + if it exists and does not. Define + O_RDONLY and O_RDWR if necessary. + * ar.c: Don't include "sysdep.h". Do include and + . Use HAVE_GOOD_UTIME_H rather than POSIX_UTIME. Use + HAVE_UTIMES rather than !USE_UTIME. Don't include , and + don't declare errno. + * arsup.c: Don't include . + * bucomm.c: Don't include "sysdep.h". Include , + , and . Include if it defines + time_t. Define time_t if necessary. + * coffdump.c: Don't include "sysdep.h". + * coffgrok.c, filemode.c, nlmconv.c, size.c: Likewise. + * srconv.c, strings.c: Likewise. + * nm.c: Don't include "sysdep.h". Don't try to define HAVE_SBRK. + * objcopy.c: Don't include "sysdep.h". Include and + . + (simple_copy): Use creat rather than assuming that O_CREAT is + defined. + * objdump.c: Don't include "sysdep.h". Use + NEED_DECLARATION_PRINTF rather than !FPRINTF_ALREADY_DECLARED. + * sysdump.c: Include "bfd.h" and "bucomm.h". Don't include + "sysdep.h" or . + (dump_symbol_info): Rename from symbol_info. Change all callers. + +Mon Sep 4 14:30:00 1995 Ian Lance Taylor + + * configure.in (host_makefile_frag): Don't set. Substitute for + @CC@, @CFLAGS@, @HDEFINES@ and @LDFLAGS@ in Makefile. + * Makefile.in (AR_FLAGS): Set to rc rather than qv. + (CC): Define as @CC@. + (CFLAGS): Set to @CFLAGS@. + (LDFLAGS): Define as @LDFLAGS@. + (ALL_CFLAGS): Use @HDEFINES@ rather than $(HDEFINES). + + * configure.in: Don't bother to call config.bfd for each target. + Just call it for the default target, and use the shell variable to + decide whether underscores are used. + +Thu Aug 31 19:21:48 1995 Jason Molenda (crash@phydeaux.cygnus.com) + + * configure.in: match i[3-6]86-*-win32, not just i386-*-win32. + +Thu Aug 31 16:30:22 1995 steve chamberlain + + * dlltool.c (add_indirect): New. + (asm_prefix): New + (gen_exp_file): Timestamp should be 0. Insert prefix when + needed. New code for indirection. + (gen_lib_file): Timestamp should be 0. Insert prefix + when needed. + (usage): Document --add-indirect. + (main): Cope with new option. + + * objdump.c (dump_private_headers): New. + (usage): Document new option. + (long_option): Add private-headers. + (dump_bfd_private_header): New. + (main): Cope with new option. + +Thu Aug 31 04:09:16 1995 Doug Evans + + * dlltool.c (run): Add missing 3rd arg to waitpid. + +Wed Aug 30 11:02:11 1995 steve chamberlain + + * Makefile.in (TOOL_PROGS): Include dlltool if needed. + +Tue Aug 29 13:25:21 1995 steve chamberlain + + * dlltool.c (rva): Deleted. + (rvaafter, rva_before): Use new assembler pseudo. + (flush_page, gen_exp_file, gen_lib_file): Use new way of RVAing. + (gen_exp_file): Don't generate .edata if no need. + (gen_lib_file): Don't make timestamp. + Put _iname in idata$7. + (workout_prefix): Fix memory initialization bug. + (usage): Tidy up, delete many single char options. + (main): rva option is gone. + +Mon Aug 21 18:41:28 1995 steve chamberlain + + * dlltool.c (options): image-base is a synonym for rva. + (gen_lib_file): Put dll name into ibase$7. + +Sun Aug 20 09:59:00 1995 steve chamberlain + + Modified to generate archives and objects rather than .s files. + * dlltool.c (run) New function. + (gen_exp_file, gen_lib_file): Use run. + (workout_prefix): New. + (usage): Document new options. + (main): Parse new options. + +Wed Aug 16 16:26:52 1995 steve chamberlain + + * dlltool.c (gen_exp_file): Fix RVA handling. + (rva_s, rva_n): Delete. + +Fri Aug 11 18:27:18 1995 Ian Lance Taylor + + * nm.c (main): Ignore -e. + +Thu Aug 10 17:35:00 1995 Ken Raeburn + + * Makefile.in (config.texi): New target. Write out a setting for + texinfo variable VERSION. + (binutils.dvi, binutils.info): Depend on it. + * binutils.texi: Include it, and reference @value{VERSION} instead + of explicitly specifying 2.2(!). + +Thu Aug 10 16:07:53 1995 Ian Lance Taylor + + * coffgrok.c (do_type): Handle array dimensions the same way gdb + does. + +Tue Aug 8 17:10:42 1995 steve chamberlain + + * dlltool.c (mtable): New fields. + (ASM_RVA_BEFORE, ASM_RVA_AFTER): New. + (flush_page): Use new macros. + +Sat Aug 5 00:16:37 1995 Jeff Law (law@snake.cs.utah.edu) + + * objcopy.c (mark_symbols_used_in_relocations): Handle sections + with no relocations. + * coffgrok.c (do_sections_p1): Likewise. + +Mon Jul 31 12:51:06 1995 Ian Lance Taylor + + * strings.c (print_strings): For compatibility with existing + strings programs, print strings which are not terminated with a + null byte or a newline. + * binutils.texi, strings.1: Update documentation accordingly. + + * ar.c (replace_members): For compatibility with existing ar + programs, permit users to add the same file multiple times. + +Tue Jul 25 11:21:53 1995 Ian Lance Taylor + + * strings.c (DATA_FLAGS): Remove SEC_DATA. + (main): If no file names are given, scan standard input. + * binutils.texi, strings.1: strings now scans non-data sections by + default. + +Mon Jul 24 13:52:28 1995 J.T. Conklin + + * srconv.c (wr_hd): Set afl field to 4 for bfd_arch_sh. + (writeINT): When size == -2, use 2 bytes for the h8300 and 4 bytes + for the sh. + + * sysdump.c (fillup): Return size - 1, the last byte is a checksum + and shouldn't be counted. + * sysroff.info (hd): Changed segment identifier from a byte to a 1 + bit field. The sysroff 2.0-01 specification seems to be in error + here. Reduce width of following "spare" field from 4 to 3 bits. + (rl): Changed order and width of first 4 bitfields to correspond + to sysroff specification. + (dln_head, dln_inside, dln_tail): Removed. + +Tue Jul 18 23:00:03 1995 Fred Fish + + * nm.c (sort_symbols_by_size): Enclose expression being casted + in parens so result is casted, not just first operand. Can't + do pointer arithmetic on void* pointers. + +Fri Jul 14 13:42:42 1995 J.T. Conklin + + * sysdump.c (dh): Changed format of output to be 16 hex digits + followed by 16 ascii characters, similar to Emacs' hexl-mode, + to make it easier to read. + (xcalloc): fix typo. + +Thu Jul 13 15:27:44 1995 J.T. Conklin + + * srconv.c (wr_tr): Write out handcrafted tr block. + (walk_tree_symbol): Use evallen and evalue instead of + vallen & value because of corresponding changes in + sysroff.info. + + * sysdump.c (sysroff_swap_tr_in, sysroff_print_tr_out): New + functions. + + * sysroff.info (tr): the tr block is a special case --- a block + without contents --- which can't be handled by generated code. + (den, dpp): only first byte is present for DENend, DPPend. + (dsy): describe a conditional portion of block, rename some fields. + (dps): describe a conditional portion of block. + (dfl): removed. + + * sysinfo.y (yyerror): write error message to standard error. + +Thu Jul 13 10:43:59 1995 Ian Lance Taylor + + * Makefile.in (DISTSTUFF): Add arparse.h and sysinfo.h. + (mostlyclean): Remove y.output. + (clean): Remove sysroff, sysroff.c, sysroff.h, and sysinfo. + + * nlmconv.c (powerpc_mangle_relocs): Cast memset arg to size_t. + * objcopy.c (copy_object): Likewise. + + * nm.c (HAVE_SBRK): Define execpt on amigados and WINDOWS_NT. + (struct size_sym): Define. + (show_stats): New static variable. + (long_options): Add undocumented option "stats". + (main): Print memory stats if requested. + (sort_bfd, sort_dynamic, sort_x, sort_y): New static variables. + (numeric_forward): Use minisymbols rather than asymbols. + (non_numeric_forward): Likewise. + (size_forward1): Rename from size_forward. Use minisymbols. + (size_forward2): New static function. + (sort_symbols_by_size): Take new arguments dynamic, size, and + symsizep. Use minisymbols. Don't store the size back in the + symbol; store in a newly allocate struct size_sym array. + (display_rel_file): Read minisymbols rather than asymbols. Set + sort_* variables. Call print_size_symbols if sorting by size. + (filter_symbols): Take new arguments dynamic and size. Use + minisymbols. + (print_symbols): Likewise. Call print_symbol for actual printing. + (print_size_symbols): New static function. + (print_symbol): New static function. + +Wed Jul 12 10:43:05 1995 Ian Lance Taylor + + * objdump.c (dump_section_stabs): Only print each stabs section + once. + (compare_relocs): Make it clear to gcc that this always returns a + value. + +Wed Jul 12 10:40:23 1995 H.J. Lu + + * objcopy.c (simple_copy): Preserve errno on failure. + (smart_rename): Print error mesage if simple_copy fails. + +Tue Jul 11 13:10:52 1995 J.T. Conklin + + * sysdump.c: re-indented file. + (module): read blocks sequentially instead of trying to parse + them, as that would require changing the parser recognize the + difference between a DPSstart and DPSend block. + (getone): Add break's between switch blocks as appropriate. + (object_body_list): parse blocks according to sysroff spec. + +Mon Jul 10 12:37:25 1995 J.T. Conklin + + * sysroff.info: re-indented file, prior formatting was confusing + because it was indentation did not reflect nesting of conditional + records. Change "space size within segment" record in hd record + from bit to byte. + + * sysinfo.y (cond_it_field): Use xcalloc instead of calloc. + + * srconv.c (wr_cs): Reformatted cs header array, tag each byte + with a comment describing the field. + (wr_unit_info): Use SEEK_SET macro instead of constant 0. + (main): Use FOPEN_WB macro instead of literal "wb". + * sysroff.info: Remove fdl (dfl) field from cs block. Compare + ptr->type with ED_TYPE_CONST instead of constant 2 in ed block. + +Tue Jul 4 14:48:42 1995 Ian Lance Taylor + + * nm.c (size_forward): Check yf against yn, not xn. + + * objcopy.c (copy_archive): Record all output BFD's, and close + them before unlinking them and removing the temporary directory, + to avoid NFS problems. + + * ar.c (replace_members): In verbose messages, use 'r' when + replacing a member, and 'a' when adding one. + + * ar.c (ar_truncate): New static variable. + (normalize): Change return type to const char *. Add abfd + argument. Change all callers. If ar_truncate, chop the filename + to abfd->ar_max_namelen. + (main): For the 'f' modifier, set ar_truncate to true. Don't + change quick_append to replace if ar_truncate is true. + (do_quick_append): If ar_truncate, set BFD_TRADITIONAL_FORMAT. + (write_archive): Likewise. + * binutils.texi, ar.1: Document 'f' modifier. + + * objcopy.c (enum strip_action): Define strip_unneeded. + (OPTION_STRIP_UNNEEDED): Define. + (strip_options): Add "strip-unneeded". + (copy_options): Likewise. + (copy_usage): Mention --strip-unneeded. + (strip_usage): Likewise. + (is_strip_section): Strip debugging sections if strip_unneeded. + (filter_symbols): If strip_unneeded, only keep BSF_KEEP symbols. + (copy_object): If strip_all, discard symbols without checking + discard_locals. + (copy_object): Call filter_symbols if strip_unneeded. + (setup_section): Strip debugging sections if strip_unneeded. + (copy_section): Likewise. + (strip_main): Handle OPTION_STRIP_UNNEEDED. + (copy_main): Likewise. + * binutils.texi, objcopy.1, strip.1: Document --strip-unneeded. + +Mon Jul 3 14:16:47 1995 Steve Chamberlain + + * configure.in (i386-*-win32): New configuration. + * dlltool.c (killat, xlate, usage, long_options, main): + Understand and cope with -k option. + +Sat Jul 1 12:25:15 1995 Fred Fish + + * ar.c: (extract_file): Change "#if POSIX_UTIME" to + "#ifdef POSIX_UTIME" to match other tests of POSIX_UTIME + and avoid lossage when POSIX_UTIME is not defined at all. + +Wed Jun 28 17:51:24 1995 Steve Chamberlain + + * ar.c: (print_contents.c, extract_file, do_quick_append): + Malloc buffers rather than allocate on stack (so it works + on NT). + * deflex.l: Names can have an @ in them. + * dlltool.c: Loads of stuff. Can now generate .imp files which + work with NT .dlls. + +Thu Jun 22 19:10:50 1995 Stan Shebs + + * mpw-make.in (demangle.c.o): Remove. + (arparse.h): Depend on arparse.c instead of arparse.y. + +Wed Jun 21 17:32:45 1995 Ken Raeburn + + * Makefile.in (DISTSTUFF): Don't include info here. + (diststuff): Include it here. + (realclean): Remove *.info. + + * objdump.c (compare_relocs): If relocation entries have the same + address, keep them in file order. + +Mon Jun 19 09:06:49 1995 Steve Chamberlain + + * dlltool.c: Change names of generated files. .*.s-> -*.s + + * objdump.c (dump_section_stabs): Check for names + which are supersets of selected names. + +Wed Jun 14 19:43:52 1995 Doug Evans + + * dlltool.c (mtable, ARM jump): Must redirect via pc offsetable ptr. + +Wed Jun 14 13:27:22 1995 Steve Chamberlain + + * deflex.l, defparse.y, dlltool.c: New files. + * Makefile.in, configure.in: Support for them. + +Mon Jun 12 11:27:54 1995 Steve Chamberlain + + * sysdump.c: Include sysdep.h + (main): Open input with FOPEN_RB. + +Fri Jun 9 17:26:11 1995 Michael Meissner + + * objdump.c (wide_output): New flag variable. + (usage): Print new -w, --wide options. + (long_options): Add --wide support. + (dump_section_header): If --wide, don't print a newline between + the section's first line and the flags. + (objdump_print_address): Use unsigned comparisons for the binary + search, not signed. + (disassemble_data): If --wide, don't put a \n between the + disassembly output and relocation information. + (main): Support -w option being the same as --wide. + +Thu Jun 1 17:09:27 1995 Ken Raeburn + + Sat May 6 08:52:24 1995 H.J. Lu (hjl@nynexst.com) + + * objcopy.c (smart_rename): make it smarter, clean up + if rename () fails. + +Tue May 30 14:24:15 1995 Ken Raeburn + + * Makefile.in: Delete lines with lots of #### because four or more + indicate a point for makefile fragment substitution. + +Tue May 9 17:17:05 1995 Michael Meissner + + * configure.in: Don't build nlmconv on PowerPC eabi any more, it + is not needed. + +Thu Apr 27 20:21:24 1995 Doug Evans + + * Makefile.in (EXPECT): Define. + (RUNTEST): Use one in source tree if present. + (check): Set `rootme' for $(EXPECT). + +Wed Apr 26 18:26:21 1995 Steve Chamberlain + + * srconv.c (main): Add support for -n option which disables + prescan of common symbols. + (wr_ob): If reading past the end of a section, fill with zeros. + +Tue Apr 25 19:14:37 1995 Ken Raeburn + + * objdump.c (dump_section_header): Display load address after + virtual memory (run-time) address. + +Wed Apr 19 09:44:06 1995 Jason Merrill + + * Makefile.in (cplus-dem.o): Pass -DVERSION='"$(VERSION)"' to the + compile. + (DEMANGLER_PROG): No longer uses version.o. + +Mon Apr 10 13:29:49 1995 Stan Shebs + + Merge in support for Mac MPW as a host. + (Old change descriptions retained for informational value.) + + * mpw-config.in (TDEFINES): Define as empty in makefile frag. + + * mpw-config.in: Create mk.tmp, define ARCHDEFS in it. + + * mpw-config.in: New file, MPW configure fragment for binutils. + * mpw-make.in (install-only): New target. + (install): Also depend on install-only. + + * mpw-make.in (cplusfilt): Renamed from c++filt. + (INCLUDES): Add more paths. + + * mpw-make.in: New file, MPW makefile fragment for binutils. + (Normally automatically generated from Makefile.in.) + +Mon Mar 27 11:52:57 1995 Ian Lance Taylor + + * ar.c (write_archive): Call make_tempname to get output file + name, rather than using a fixed name based on the input file. + + * objcopy.c (make_tempname): Copy from here... + * bucomm.c (make_tempname): ...to here, and make global. + * bucomm.h (make_tempname): Declare. + +Fri Mar 24 11:47:42 1995 Ian Lance Taylor + + * strings.c: Include "bfd.h" before other headers. Include + "sysdep.h". + * bucomm.c (print_arelt_descr): Cast st_uid and st_gid to long, + and print them with %ld. + +Fri Mar 10 13:09:42 1995 Ian Lance Taylor + + * objcopy.c (strip_options): Add --keep-symbol. + (copy_options): Likewise. + (copy_usage): Mention --keep-symbol and -K. + (strip_usage): Likewise. + (keep_symbols): New static variable. + (is_strip_symbol): Adjust the return value according to + keep_symbols. + (strip_main): Handle -K. For -N, check that -K was not given. + (copy_main): Likewise. + * binutils.texi, objcopy.1, strip.1: Document -K. + +Mon Mar 6 13:33:47 1995 Stan Shebs + + * objcopy.c (copy_archive): Check result of mkdir. + (copy_main): Cast an xmalloc result. + + * objdump.c (usage): Break long format string into shorter ones. + +Mon Mar 6 13:46:12 1995 Ian Lance Taylor + + * bucomm.c (list_supported_targets): New function. + * bucomm.h (list_supported_targets): Declare. + * ar.c (usage): Call list_supported_targets. + * nm.c (usage): Likewise. + * objcopy.c (copy_usage, strip_usage): Likewise. + * objdump.c (usage): Likewise. + * size.c (usage): Likewise. + * strings.c (usage): Likewise. + +Tue Feb 28 15:13:58 1995 Ian Lance Taylor + + * bucomm.c (print_arelt_descr): Cast st_size to long before + passing it to fprintf. + +Fri Feb 17 13:36:45 1995 Ian Lance Taylor + + * objcopy.c (struct section_list): Add fields remove, set_flags, + and flags. Change adjust from boolean to enum. + (remove_sections): Remove static variable. + (sections_removed): New static variable. + (copy_options): Add --set-section-flags. + (copy_usage): Mention --set-section-flags. + (parse_flags): New static function. + (find_section_list): New static function. + (is_strip_symbol): Change return type from int to boolean. + (is_strip_section): New static function. + (filter_symbols): Call is_strip_section. + (copy_object): When adding sections, check for specified flags or + VMA. Call filter_symbols if any sections are being removed. + (setup_section): Use find_section_list function rather than + looking through remove_sections and adjust_sections. Handle + --set-section-flags. + (copy_section): Use find_section_list rather than looking through + remove_sections. + (strip_main): Use find_section_list instead of adding items to + sections_removed. + (copy_main): Use find_section_list instead of adding items to + sections_removed and adjust_sections. Handle --set-section-flags. + * binutils.texi, objcopy.1: Document --set-section-flags. + +Tue Feb 14 18:03:03 1995 Ian Lance Taylor + + * objdump.c (with_source_code): New global variable. + (usage): Mention -S/--source. + (long_options): Add --source. + (prev_functionname, prev_line): New static variables. + (struct print_file_list): Define. + (print_files): New static variable. + (skip_to_line, show_line): New static functions. + (disassemble_data): Call show_line to handle -l and -S. + (main): Handle -S. + * binutils.texi, objdump.1: Document -S/--source. + +Thu Feb 9 16:11:53 1995 Ian Lance Taylor + + * objcopy.c (copy_usage): Rename parameter to avoid shadowing. + (strip_usage): Likewise. + + * objcopy.c (struct section_add): Define. + (add_sections): New static variable. + (copy_options): Accept --add-section. + (copy_usage): Mention --add-section. + (copy_object): Add sections from the add_sections list. + (copy_main): Handle --add-section. + * binutils.texi, objcopy.1: Document --add-section. + +Wed Feb 1 15:04:57 1995 Ken Raeburn + + * objdump.c (disassemble_data): Pass section offset, not absolute + address, to bfd_find_nearest_line. + + * nlmconv.c (powerpc_mangle_relocs): Don't use const with + reloc_howto_type. + +Thu Jan 26 18:50:06 1995 Ian Lance Taylor + + * objdump.c (compare_symbols): Use bfd_asymbol_value (VAR) rather + than VAR->value. + (objdump_print_address): Likewise. + (disassemble_data): Don't change the symbol values. It can + confuse bfd_canonicalize_reloc. + +Thu Jan 26 12:03:56 1995 Michael Meissner + + * configure.in: Add support for powerpc-*-ebai. + +Wed Jan 18 10:02:12 1995 Steve Chamberlain + + * coffdump.c: Include sysdep.h. + (dump_coff_type): Handle coff_secdef_type. + * coffgrok.c : Include sysdep.h. + * srconv.c: Include libiberty.h + (absolute_p, dty_start, dty_end, dump_tree_structure): Remove. + +Wed Jan 18 12:24:14 1995 Ian Lance Taylor + + * coffdump.c (dump_coff_scope): Cast pointer to unsigned long for + printf. + * coffgrok.c: Include bucomm.h. Don't declare xmalloc. + (push_scope): Declare type of parameter link. + * size.c: Include libiberty.h. + * srconv.c: Include bucomm.h. + (find_base): Declare at top of file. + (wr_hd): Add default case to architecture switch. + (wr_dps_start): Declare type of parameter nest. + (wr_du): Comment out variables used only in commented out blocks. + (wr_dus): Remove unused variable i. + (wr_sc): Remove unused variables myinfo, low, and high. + * strings.c: Include libiberty.h. + * sysdump.c: Include . + +Tue Dec 20 19:13:44 1994 Ian Lance Taylor + + * ar.c (main): Ignore 'f' modifier used on HP/UX 9. + +Thu Dec 15 17:34:12 1994 Stan Shebs + + * ar.c, nm.c, objcopy.c, objdump.c: Include progress.h. + * ar.c, nm.c, objcopy.c, objdump.c (main): Add START_PROGRESS + and END_PROGRESS. + * ar.c (map_over_members, open_inarch): Call PROGRESS. + * nm.c (main, display_archive, filter_symbols, print_symbols): + Call PROGRESS. + + * objcopy.c (copy_usage): Break up long usage string. + +Wed Dec 14 15:51:56 1994 Ken Raeburn + + * objcopy.c (copy_object): Don't bother setting status after + nonfatal() "call", because it won't return. + +Fri Dec 9 00:22:54 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmconv.c (powerpc_mangle_relocs): Don't switch a reloc to use + the section symbol if the symbol is undefined. + +Thu Dec 8 14:45:50 1994 Ken Raeburn + + * objcopy.c (add_strip_symbol): Cast return value of xmalloc. + +Wed Nov 30 11:05:43 1994 Ian Lance Taylor + + * ar.c (replace_members): Pass current->filename to normalize when + checking for duplicates, because the filename of a newly added + file will not have been normalized yet. + +Thu Nov 17 15:00:13 1994 Ian Lance Taylor + + * ar.c (main): Don't call do_quick_append if any of the archive + names are longer than 14 characters. + + * objcopy.c (main): Fix is_strip test. From + pirker@eiunix.tuwien.ac.at (Martin Pirker). + +Thu Nov 17 15:37:19 1994 Mark W. Eichin + + * objcopy.c (add_strip_symbol): New function, adds a name to an + explicit list of symbols to strip. + (is_strip_symbol): New function, reports whether the name argument + is in the explicit list. + (filter_symbols): Check against is_strip_symbol above all. + (strip_main): Recognize -N option. If used, don't default to + strip_all. + (copy_main): Recognize -N option. + (strip_usage): Document -N and --strip-symbol options. + (copy_usage): Ditto. + * objcopy.1, strip.1, binutils.texi: Document -N and + --strip-symbol options. + +Tue Nov 8 13:12:54 1994 Ian Lance Taylor + + * objdump.c (display_target_list, display_info_table): Pass an + array to tmparg, rather than NULL, since some systems can't handle + NULL. + + * objcopy.c (copy_archive): Keep a list of the names of the + temporary files we created. Close each input BFD after we open + its successor. + +Mon Nov 7 15:48:39 1994 Ken Raeburn + + * Makefile.in (VERSION): Bump to 2.5.3. + +Thu Nov 3 19:04:34 1994 Ken Raeburn + + * Makefile.in (install-info): Install info files from whatever + directory they were found in. + + Patch from DJ Delorie: + * configure.bat: do c++filt -> cxxfilt right + + * sysinfo.y: Include system header files early, so any potential + declaration of abort() occurs before its use. + + * strings.c (strings_file): Try opening the file in binary mode + first. + +Wed Nov 2 15:44:13 1994 Ian Lance Taylor + + * ar.c (main): Treat ar qs like ar rs. + +Tue Oct 25 16:19:25 1994 Ian Lance Taylor + + * objcopy.c (gap_fill): Explicitly initialize, for clarity. + (pad_to_set, pad_to): New static variables. + (copy_options): Accept --pad-to. + (copy_usage): Mention --pad-to. + (copy_object): Support --pad-to. + (compare_section_vma): Sort non loadable sections to the front. + Sort sections with the same VMA by size. + (copy_main): Handle --pad-to. + * binutils.texi, objcopy.1: Document --pad-to. + +Thu Oct 20 13:51:31 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * objcopy.c (gap_fill_set, gap_fill): New static variables. + (copy_options): Accept --gap-fill. + (copy_usage): Mention --gap-fill. + (copy_object): Support --gap-fill. + (get_sections, compare_section_vma): New static functions. + (copy_main): Handle --gap-fill. + * binutils.texi, objcopy.1: Document --gap-fill. + +Wed Oct 19 14:09:16 1994 Ian Lance Taylor + + * Makefile.in (check): Add a dummy else clause to the if + statement. + + * objcopy.c (copy_object): Revert yesterday's change. + * binutils.texi, objcopy.1: Remove special mention of --set-start + and `binary' output format. + +Tue Oct 18 11:12:01 1994 Ian Lance Taylor + + * objcopy.c (copy_object): If the output file format is `binary', + and the start address was not set using --set-start, default the + start address to zero. This hack is because the `binary' output + file format uses the start address to set the virtual address of + the first byte in the file. + * binutils.texi, objcopy.1: Add some notes on generating S-records + and binary files. + + * nm.c (print_symdef_entry): Call print_symname to print the + symbol name, so that --demangle works. + + * Makefile.in (mostlyclean): Remove tmpdir. + + * objcopy.c (struct section_list): Add fields used, adjust, val. + (adjust_start, set_start_set, set_start): New static variables. + (adjust_section_vma, adjust_sections): New static variables. + (copy_options): Add --adjust-start, --adjust-vma, + --adjust-section-vma, --adjust-warnings, --no-adjust-warnings, + --set-start. + (parse_vma): New static function. + (copy_usage): Mention new options. + (copy_object): Handle --set-start and --adjust-start. + (setup_section): Correct type of last argument to PTR. Set used + field if section is removed. Handle --adjust-vma and + --adjust-section-vma. + (copy_section): Correct type of last argument to PTR. + (mark_symbols_used_in_relocations): Likewise. + (strip_main): Clear used field when handling -R. + (copy_main): Handle new options. + * binutils.texi (objcopy): Document new options. + * objcopy.1: Document new options. + +Fri Oct 14 14:38:13 1994 Ian Lance Taylor + + * configure.in (configdirs): Remove definition--testsuite is no + longer configured. + * Makefile.in (testsuite): Remove target. + (site.exp): New target. + (check): Rewrite. + (clean, distclean): Don't recur into testsuite directory. + +Thu Oct 13 19:24:09 1994 Ken Raeburn + + * Makefile.in (VERSION): Updated to 2.5. + * Version 2.5 released. + +Tue Oct 11 15:26:42 1994 Ian Lance Taylor + + * Makefile.in (sysdump.o): Depends upon sysroff.c. + +Mon Oct 10 13:50:30 1994 J.T. Conklin (jtc@rtl.cygnus.com) + + * nlmconv.c (link_inputs): Pass -Ur flag to ld so that the + ctor/dtor tables needed by C++ programs are built. + +Sun Oct 9 18:04:00 1994 Jim Wilson (wilson@sphagnum.cygnus.com) + + * Makefile.in (srconv.o): Add dependence on sysroff.c. + +Tue Oct 4 12:19:51 1994 Ian Lance Taylor + + * configure.in: Use ${config_shell} when running config.bfd. + + * Makefile.in (sysroff.h): Split target away from sysroff.c. + (srconv.o, sysdump.o): New targets. + (srconv, sysdump): Don't depend upon sysroff.c. + +Wed Sep 28 13:04:34 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * Makefile.in (arparse.c): Don't ignore errors from mv. + (sysinfo.c): Likewise. Also, depend upon arparse.c, to prevent a + parallel make from trying to build both arparse.c and sysinfo.c + simultaneously. + (nlmheader.c): Similar change. + (arparse.h): Separate target from arparse.c, so that a parallel + make does not try to build both at once. Depend upon arparse.c. + (sysinfo.h): Similar change. + + * objdump.c (disassemble_data): Pass the reloc buffer to free, not + the pointer used to loop over the relocs. + +Sat Sep 24 16:16:57 1994 Stan Shebs (shebs@andros.cygnus.com) + + * objdump.c (disassemble_data): Cast result of xmalloc. + +Wed Sep 21 19:30:35 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * objdump.c (sorted_syms, sorted_symcount): New global variables. + (objdump_print_address): Use sorted_syms and sorted_symcount + instead of syms and symcount. + (disassemble_data): Don't bother to get the relocs before looping + over the sections. Before filtering and sorting the symbol table, + copy it into sorted_syms. + +Fri Sep 16 11:27:39 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * objdump.c (struct objdump_disasm_info): Add field require_sec. + (objdump_print_address): If aux->require_sec, require that the + symbol be in aux->sec even if HAS_RELOC is not set. If we can't + find a smaller symbol in the right section, look for a larger one. + (disassemble_data): Set aux.require_sec around the + objdump_print_address call for the instruction address. + +Thu Sep 15 21:43:17 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ar.c: Call xexit rather than exit. + (output_filename, output_file, output_bfd): New static variables. + (remove_output): New static function. + (main): Call xatexit (remove_output). Call xexit rather than + returning. + (extract_file): Set output_filename and output_file while output + file is open. + (write_archive): Likewise, but use output_bfd, not output_file. + * arsup.c: Include libiberty.h. Call xexit rather than exit. + * bucomm.c: Likewise. + + * objdump.c (disassemble_all): New global variable. + (usage): Document --disassemble-all. + (long_options): Add disassemble-all as a synonym for -D. + (compare_symbols): Make pointers const. + (compare_relocs): New static function. + (disassemble_data): Rename disassemble to disassemble_fn to avoid + shadowing. If dump_reloc_info, print relocs along with + disassembly. Skip sections which are not SEC_CODE unless + disassemble_all or only is set. + (display_bfd): Don't call dump_relocs if disassemble is set. + (main): Accept and handle -D. + * binutils.texi: Document -D/--disassemble-all. + * objdump.1: Likewise. + +Wed Sep 14 12:19:07 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * objdump.c (disassemble_data): Initialize prevline to 0. Make + prev_function non const. Copy functionname into an malloc buffer + when setting prev_function, instead of assuming that the string + will last forever. + + * nm.c: Include libiberty.h. + (sort_by_size): New static variable. + (long_options): Add --size-sort. + (usage): Mention --size-sort. + (numeric_forward): Make static. Change from void * to PTR. + (numeric_reverse): Likewise. + (non_numeric_forward, non_numeric_reverse): Likewise. + (sorters): Change declaration from void * to PTR. + (size_forward, sort_symbol_by_size): New static functions. + (display_rel_file): Handle sort_by_size. + (filter_symbols): If sort_by_size, discard absolute and undefined + symbols. + * binutils.texi (nm): Document --size-sort. + * nm.1: Document --size-sort. + +Tue Sep 13 21:06:06 1994 Jeff Law (law@snake.cs.utah.edu) + + * objcopy.c (copy_main): Initialize input_filename and + output_filename to NULL. + +Tue Sep 13 14:17:24 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * Makefile.in (version.o): Depend upon Makefile, so that version.o + gets rebuilt when make variable VERSION is changed. + + * objdump.c (dump_section_header): Print the SEC_NEVER_LOAD flag. + +Wed Aug 24 12:40:09 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * configure.in: Change i[34]86 to i[345]86. + +Tue Aug 23 11:00:40 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * ar.c (ranlib_touch): Don't update the archive map if there isn't + one. + +Mon Aug 22 16:02:18 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * ar.c: Include libiberty.h. + (inarch): Remove variable. + (map_over_members): Make static. Add arch argument, and use it + instead of inarch. Change all callers. + (main): Treat --version as -v. Accept -t argument. Accept any + number of archive arguments. Catch and use open_inarch return + value, rather than using inarch. + (open_inarch): Return newly opened BFD, rather than using inarch. + (do_quick_append): Make archive_filename const. + (write_archive): Add iarch argument, and use it instead of inarch. + Change all callers. + (delete_members, move_members, replace_members): Likewise. + (ranlib_only): Don't exit on success. Catch and use open_inarch + return value. + (ranlib_touch): New function. + * arsup.h (map_over_members): Don't declare. + (ar_end, ar_extract): Declare. + (open_inarch): Change return value in declaration to bfd *. + * arsup.c (map_over_list): Make static. Always pass two arguments + to function. Add arch argument, and use it instead of inarch. + Change all callers. + (ar_directory_doer): Make static. Add ignored second argument. + Change all callers. + (ar_directory): Use open_inarch return value rather than inarch. + (ar_addlib_doer): Make static. + (ar_addlib): Use open_inarch return value rather than inarch. + (ar_extract): Remove unused local variable abfd. + +Thu Aug 11 14:55:57 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + Add support for removing named sections to objcopy and strip. + * objcopy.c (struct section_list): Define. + (remove_sections): New static variable. + (strip_options, copy_options): Add remove-section. + (copy_usage, strip_usage): Mention -R and --remove-section. + (setup_section): If section is in remove_sections list, ignore it. + (copy_section): Likewise. + (strip_main, copy_main): Handle -R. + * binutils.texi, objcopy.1, strip.1: Document new options. + +Wed Aug 10 10:19:55 1994 Stan Shebs (shebs@andros.cygnus.com) + + * nlmconv.c (powerpc_mangle_relocs): Rename symvalue to sym_value, + so as not to conflict with the symvalue typedef in bfd.h. + +Mon Aug 1 13:19:09 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * nlmheader.y: Per current NetWare docs, accept a revision number + of 0 and treat a revision number greater than 26 as 0. + +Mon Jul 25 12:58:36 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * objdump.c (objdump_print_address): Correct handling of end of + symbols when looking for next symbol with a different value. + +Fri Jul 22 16:48:34 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * nm.c (numeric_forward): Treat undefined symbols as "less than" + defined symbols with zero values. If numeric values are equal, or + both symbols are undefined, sort alphabetically. Don't assume + that the difference of two bfd_vma values will truncate to "int" + and still have the same sign. + (numeric_reverse): Call numeric_forward and negate the result. + (print_symbol_info_bsd): For undefined symbols, print leading + spaces equivalent to the width of a printed bfd_vma, rather than + assuming that 8 will look right. + +Fri Jul 22 10:36:50 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * coffgrok.c (doit): Zero all fields of new structure. + * srconv.c (sysroff_swap_*_out): Remove redundant trailing arg. + * sysinfo.y: Generate sysroff_swap_*_out without requiring extra + arg. + +Fri Jul 22 10:09:53 1994 J.T. Conklin (jtc@phishhead.cygnus.com) + + * nlmheader.y: Make "stack" and "stacksize" synonyms in the lexer + rather than the parser. + +Thu Jul 21 10:25:09 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * config/mh-alphaosf, config/mh-apollo68v, config/mh-delta88: + Remove; obsolete. + +Sat Jul 16 22:34:39 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * objdump.c (slurp_dynamic_symtab): Try to get the dynamic symbols + even if the bfd is not marked DYNAMIC. ELF executables are not + marked DYNAMIC, but do have dynamic symbols. + +Fri Jul 15 01:41:35 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * coffgrok.c (do_where): Make data with no type 'int'. + (do_define): Keep info on source file of a symbol. + * coffgrok.h (coff_symbol): New field. + * srconv.c (PROGRAM_VERSION): Now 1.3 + (wr_rl): Use external ref number for symbol. + (wr_dus): Only keep one source file per debug unit. + (wr_dln): Always emit line numbers for first source file, + (wr_globals): Emit globals in the du of their owning source file. + +Mon Jul 11 15:59:03 1994 J.T. Conklin (jtc@phishhead.cygnus.com) + + * nlmheader.y: Null terminate var_hdr->threadName. + +Fri Jul 8 17:33:22 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * Makefile.in (syslex.o, sysinfo.o): Permit C source files to be + in $(srcdir), as they will be for FSF releases. + +Wed Jul 6 01:13:14 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmconv.c (setup_sections): Preserve existing section flags when + copying in flags from a new section. + +Tue Jul 5 15:56:01 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * objcopy.c: Include libiberty.h. + (copy_file): If output_target is NULL, set it to the target of the + input file. + +Wed Jun 29 17:17:14 1994 J.T. Conklin (jtc@phishhead.cygnus.com) + + * nlmconv.c (link_inputs): Fixed memory allocation bug. + +Thu Jun 23 12:52:46 1994 David J. Mackenzie (djm@rtl.cygnus.com) + + * configure.in: Change --with-targets to --enable-targets. + +Tue Jun 21 12:53:21 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * Makefile.in (sysinfo): Does not depend upon $(ADDL_LIBS). + + * nlmconv.c (powerpc_build_stubs): Don't generate the PowerPC + NetWare custom header; no longer needed. + (powerpc_mangle_relocs): Convert relocs against the uninitialized + data section into relocs against the data section. + + * configure.in: Set nlmconv_defs to -DNLMCONV_cputype for all the + netware targets. Write it into Makefile as NLMCONV_DEFS. + * Makefile.in (nlmconv.o): Pass $(NLMCONV_DEFS) to $(CC). + * nlmconv.c: Only compile code for specific CPU types if + NLMCONV_cputype is defined. + + * nlmconv.c (main): Change uses of bfd_abs_section, etc., to use + bfd_abs_section_ptr or bfd_is_abs_section, etc. + (i386_mangle_relocs, alpha_mangle_relocs): Likewise. + (powerpc_build_stubs): Likewise. + * nm.c (filter_symbols, print_symbols): Likewise. + * objcopy.c (filter_symbols): Likewise. + (mark_symbols_used_in_relocations): Likewise. + * objdump.c (remove_useless_symbols, dump_relocs): Likewise. + * size.c (sysv_internal_printer): Likewise. + +Mon Jun 20 16:43:03 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * Makefile.in (MANPAGES): Remove $(DEMANGLER_PROG). + (install): Install it explicitly, from build dir, not srcdir. + +Mon Jun 20 16:29:54 1994 Ian Lance Taylor (ian@sanguine.cygnus.com) + + * objdump.c: Don't include elf/internal.h. + (bfd_elf_find_section): Don't declare. + (read_section_stabs): No special handling for ELF. Always read + using BFD sections. + +Thu Jun 16 17:25:20 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure.in: Set UNDERSCORE in Makefile based on result of + invoking config.bfd with a second argument of ``_''. + * Makefile.in (underscore.c): Depend upon Makefile. Don't try to + run $(CC) and $(NM), just use $(UNDERSCORE). Create via temporary + file. + (demangle.o): Remove target. + ($(NM_PROG)): Don't depend upon demangle.o, and don't link against + demangle.o. It's in libiberty anyhow. + (cplus-dem.o): Don't depend upon demangle.o. + * binutils.texi: Mention -n and --no-strip-underscores arguments + to c++filt. + +Wed Jun 15 12:10:31 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nm.c (long_options): Add --no-demangle to turn off --demangle, + and --no-cplus for Linux compatibility. + (usage): Mention --no-demangle. + * binutils.texi: Document --no-demangle. + +Fri Jun 10 15:41:25 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nm.c: HOST_64_BIT was renamed to BFD_HOST_64_BIT. + + * objcopy.c (copy_archive): Make the temporary directory in the + same directory as the output BFD, since we may not have write + permission on the current directory. Set the permissions of the + new directory to 0700, not 0777. + +Mon Jun 6 21:36:43 1994 D. V. Henkel-Wallace (gumby@cygnus.com) + + * configure.in: if this is an rs6000 (and we're not building for + any other bfd targets) then build only nm (collect needs it on + rs6000-lynx). + + * Makefile.in: define TOOL_PROGS which the list of programes to + install in $tooldir -- replaces a hard-coded list. + +Fri Jun 3 10:59:18 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * objdump.c (display_target_list): Remove unused local ok. + +Thu May 26 18:05:52 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * config/mh-alphaosf (CFLAGS): Don't specify both -g and -O; + they're not compatible under native cc. Use -O1 instead. + + * Makefile.in (VERSION): Updated to cygnus-2.4.1. + + Changes from binutils-2.4 net release: + + * Makefile.in (MANPAGES): Use $(DEMANGLER_PROG). + ($(DEMANGLER_PROG).1): Build from cxxfilt.man, using sed. + * cxxfilt.man: Renamed from c++filt.1, replaced "c++filt" with + magic token to be replaced by sed. + + Wed May 11 22:32:00 1994 DJ Delorie (dj@ctron.com) + + * configure.bat: update for latest makefile.in + +Fri May 13 23:25:13 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * bucomm.c: Check ANSI_PROTOTYPES rather than __STDC__. + +Tue May 10 18:22:06 1994 Jason Molenda (crash@sendai.cygnus.com) + + * objcopy.c (copy_section): Set section size correctly if using + interleave. + +Sat May 7 16:49:36 1994 Steve Chamberlain (sac@cygnus.com) + + * Makefile.in: Add rule for sysinfo.h + +Fri May 6 12:18:33 1994 Steve Chamberlain (sac@cygnus.com) + + * Makefile.in (SRCONV_PROG): Define. + (PROGS): Use $(SRCONV_PROG) too. + +Thu May 5 19:41:43 1994 Ken Raeburn (raeburn@cujo.cygnus.com) + + * Makefile.in (DISTSTUFF): Add sysinfo.c, syslex.c, in case + someone configures with `targets=all'. + (distclean): Remove y.*. + (syslex.o): Depend on sysinfo.h. + (sysinfo.c): Rename y.tab.h to sysinfo.h. + (install-info): Don't try to install into $(infodir)/$(srcdir). + * syslex.l: Include sysinfo.h, not y.tab.h. + +Thu May 5 11:50:55 1994 Ken Raeburn (raeburn@kr-pc.cygnus.com) + + * syslex.l (yywrap): Define as function if not defined as a macro. + + * Makefile.in (objdump.o): Deleted special rule. + * configure.in: Don't bother building ARCHDEFS variable for + Makefile. + * objdump.c (ARCH_*): Deleted handling. + (disassemble_data): Call `disassembler' from opcodes library. + +Thu May 5 13:28:42 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * Makefile.in (install): Correct handling of $(tooldir) and + $(bindir) being on different devices. + +Fri Apr 29 09:50:38 1994 Steve Chamberlain (sac@cygnus.com) + + * sysdump.c (h8300, sh): Add declarations. + +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, + sysroff.info: Major changes. + +Tue Apr 26 18:18:24 1994 Stan Shebs (shebs@andros.cygnus.com) + + * objdump.c (print_section_stabs): Indicate the stab header symbol + more clearly, print numbers of unrecognized stab n_type values. + +Tue Apr 26 16:22:55 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmconv.c (copy_sections): Copy arelent pointers, not arelents. + +Mon Apr 25 16:14:32 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * Makefile.in (distclean): Remove $(PROGS) and underscore.c. + +Fri Apr 22 11:14:19 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmconv.c (setup_sections): Remove special handling of .reginfo + section. + (copy_sections): Likewise. + (alpha_mangle_relocs): Use bfd_ecoff_get_gp_value rather than the + special ECOFF .reginfo section. + + * objcopy.c (copy_object): Call bfd_copy_private_bfd_data after + copying everything else, to let it fiddle with the file in its + final state. + + * objdump.c: Include libiberty.h. + (display_target_list): If a format fails, just go on to the next + one. Check return value of bfd_set_format. + (display_info_table): Likewise. Don't increment loop variable in + for loop test, since that skips the first element. + (display_target_tables): Rewrite loop for clarity. Ensure that it + always prints at least one element. + + * nlmconv.c (main): Use CyGnUsEx rather than CyGnUsSeCs for + sections header. Rename from cygnus_sections to cygnus_ext. + +Thu Apr 21 12:12:26 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * objdump.c (_DUMMY_NAME_): Don't define. + (display_target_list): Use tmpnam to get a file name rather than + using _DUMMY_NAME_. Unlink it when done. + (display_info_table): Likewise. + + * nlmconv.c (secsec): New static variable. + (main): Create .nlmsections section in output BFD. Store + information about it in sections header. + (setup_sections): Allocate space in sections header. + (copy_sections): Copy zero sized sections. Put information about + each section in the sections header. + +Wed Apr 20 14:34:51 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmconv.c (powerpc_build_stubs): Take new outbfd argument. + Change caller. Create custom header for new PowerPC NetWare + format. + + * Makefile.in (nlmheader.o, nlmconv.o): Update dependencies. + * nlmconv.c: Include bfd.h and libiberty.h with "", not <>. + * nlmheader.y: Include bfd.h with "", not <>. + +Wed Apr 13 10:52:50 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * objdump.c: Do an ifdef on __GO32__, not unix. + +Wed Apr 6 21:54:49 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Added -D (--dynamic) option to nm and -T (--dynamic-syms) and -R + (--dynamic-reloc) arguments to objdump. + * nm.c (dynamic): New static variable. + (long_options): Added "dynamic". + (usage): Mention -D and --dynamic. + (main): Add D to getopt string. Handle -D by setting dynamic. + (display_rel_file): If dynamic is non-zero, read dynamic symbols + rather than normal symbols. + * nm.1: Updated for -D (--dynamic) option. + * objdump.c (dump_dynamic_symtab): New global variable. + (dump_dynamic_reloc_info): New global variable. + (dynsyms, dynsymcount): New global variables. + (usage): Mention -R, -T, --dynamic-syms and --dynamic-reloc. + (long_options): Added "dynamic-reloc" and "dynamic-syms". + (slurp_symtab): If no symbols, return rather than exit. + (slurp_dynamic_symtab): New function. + (display_bfd): Handle dump_dynamic_symtab and + dump_dynamic_reloc_info. + (dump_symbols): Take new dynamic argument, indicating whether to + display dynamic symbols. + (dump_relocs): Move most printing into dump_reloc_set. + (dump_dynamic_relocs): New function. + (dump_reloc_set): New function, extracted from dump_relocs. + (main): Add R and T to getopt string. Handle -T by setting + dump_dynamic_symtab and -R by setting dump_dynamic_reloc_info. + * objdump.1: Updated for -R (--dynamic-reloc) and -T + (--dynamic-syms) options. + * binutils.texi: Updated for new nm and objdump options. + +Wed Mar 30 15:52:40 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Update for recent BFD changes to symbol and reloc reading. Rename + all uses of get_symtab_upper_bound to bfd_get_symtab_upper_bound. + Also: + * coffgrok.c (symcount): Change to long. + (do_sections_p1): Check for error return from + bfd_get_reloc_upper_bound. Change relcount to long, and check for + error from bfd_canonicalize_reloc. + (coff_grok): Change storage to long. Check for error from + bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. + * nlmconv.c (main): Change symcount, newsymalloc, newsymcount, and + i to long. Check for error from bfd_get_symtab_upper_bound and + bfd_canonicalize_symtab. + (copy_sections): Change reloc_size and reloc_count to long. Check + for error from bfd_get_reloc_upper_bound and + bfd_canonicalize_reloc. + (mangle_relocs, i386_mangle_relocs, alpha_mangle_relocs): Change + reloc_count_ptr argument to long *. Make corresponding changes to + variables loaded from *reloc_count_ptr. + * nm.c (display_rel_file): Change storage and symcount to long. + Check for errors from bfd_get_symtab_upper_bound and + bfd_canonicalize_symtab. + * objcopy.c (filter_symbols): Change symcount, src_count and + dst_count to long. + (copy_object): Change symcount to long. Pass another argument to + fprintf. Check for errors from bfd_get_symtab_upper_bound and + bfd_canonicalize_symtab. + (copy_section): Change relcount to long. Check for errors from + bfd_get_reloc_upper_bound and bfd_canonicalize_reloc. + (mark_symbols_used_in_relocations): Change relcount and i to long. + Check for errors form bfd_get_reloc_upper_bound and + bfd_canonicalize_reloc. + * objdump.c (storage): Remove global variable. + (symcount): Changed to long. + (slurp_symtab): New local variable storage. Check for errors from + bfd_get_symtab_upper_bound and bfd_canonicalize_symtab. + (remove_useless_symbols): Change return value and count to long. + (objdump_print_address): Change min, max, thisplace and i to long. + (disassemble_data): Change i to long. + (dump_symbols): Change count to long. + (dump_relocs): Change relcount to long. Check for errors from + bfd_ret_reloc_upper_bound and bfd_canonicalize_reloc. + (display_info_table): Add casts when passing LONGEST_ARCH for + printf %* argument. + +Tue Mar 29 14:59:04 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nm.c (display_archive): Close each archive element after it has + been displayed. + * objdump.c (display_file): Likewise. + +Mon Mar 28 13:04:08 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * configure.in: Change error message to refer to bfd/config.bfd + rather than bfd/configure.in. + +Sun Mar 27 16:23:39 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * More fixes for object formats which allow multiple sections + with the same name: + * objcopy.c (setup_section): Make a new output section even if + one already exists with the given name. + (copy_section): Use isection->output_section rather than trying + to look the output section up by its (possibly non-unique) name. + + * Makefile.in (install-info): Look for binutils.info in the + current directory, then in $(srcdir). Don't use $<. + +Mon Mar 21 12:55:45 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * objdump.c (objdump_print_address): Make static. Declare with + prototype. Change vardiff from int to bfd_signed_vma. Correct + binary search termination condition. When looking for same + section symbol in relocatable file, handle final symbol correctly. + +Sun Mar 20 11:26:36 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * Makefile.in: Avoid bug in hpux sed. + + * objcopy.c: Changes to keep it from stripping symbols used + in output relocations. + (mark_symbols_used_in_relocations): New function. Mark symbols + used in output relocations with BSF_KEEP. + (filter_symbols): Do not strip symbols marked with BSF_KEEP. + (copy_object): Reorder actions. First setup sections, then + build the output symbol table, then copy the section contents. + +Fri Mar 18 10:53:55 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ar.c (write_archive): Allocate space for the null byte. From + Robert Lipe . + +Thu Mar 17 16:20:28 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * Makefile.in: Built nm.new and strip.new to avoid problems with + collect when . is in PATH. + (STRIP_PROG): Change from strip to strip.new. + (NM_PROG): Change from nm to nm.new. + (install): Remove the .new when installing. + +Wed Mar 16 16:27:05 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmconv.c (powerpc_build_stubs): Set BSF_DYNAMIC flag for each + symbol for which we build a stub. + (powerpc_mangle_relocs): Only reset TOC pointer for a call to a + symbol with BSF_DYNAMIC flag set. + +Tue Mar 15 23:04:13 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * objcopy.c (filter_symbols): Use bfd_is_local_label to determine + if a symbol represents a compiler-generated local label. + (copy_object): Give the BFD backends a chance to copy any private + bfd data from the input BFD to the output BFD. + (setup_section): Give the BFD backends a chance to copy any private + section data from the input section to the output section. + +Mon Mar 14 11:15:58 1994 Jeffrey A. Law (law@snake.cs.utah.edu) + + * objcopy.c (mangle_section): Delete unused function. + (setup_section): Set osection here instead of calling + mangle section to do it. + +Mon Mar 14 12:11:01 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * ar.c (write_archive): Close inarch before unlinking it. + +Fri Mar 11 22:20:48 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmconv.c (main): For PowerPC, call powerpc_build_stubs and + powerpc_resolve_stubs. Use __GOT0, not __toc_start. Handle it if + the start and end symbols are not in the text section. + (struct powerpc_stub): New struct definition. + (powerpc_stubs, powerpc_stub_insns): New static variables. + (powerpc_initial_got_size): New static variable. + (powerpc_build_stubs): New function. + (powerpc_resolve_stubs): New function. + (powerpc_mangle_relocs): Clear extraneous data in .got section. + Rearrange reloc handling to handle ELF relocs that are not + partial_inplace. Resolve PC relative relocs. + +Wed Mar 9 13:48:11 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * ar.c (move_members): Fix it so that the abi positional modifiers + don't delete all archive members following the insert point. + +Tue Mar 8 13:14:43 1994 Steve Chamberlain (sac@jonny.cygnus.com) + + * coffgrok.[ch]: New files, understand coff objects. + * coffdump.c: Uses coffgrok to dump out the debug info of a coff + file. + * sysroff.info: Description of a SYSROFF object file. + * sysinfo.y, syslex.l: Parse info file, generate a reader, writer, + header files and a printer. + * srconv.c: Uses coffgrok.c and sysroff.info to convert a coff + file to a SYSROFF file. + +Sat Feb 26 13:35:26 1994 Stan Shebs (shebs@andros.cygnus.com) + + * ar.c (do_quick_append): Pad with a genuine character 10, + rather than whatever '\n' might happen to be. + +Tue Feb 22 18:25:52 1994 Ian Lance Taylor (ian@cygnus.com) + + * nlmconv.c (main): Ignore debugging symbols when looking for + special symbols by name. + +Sun Feb 20 18:47:42 1994 Ian Lance Taylor (ian@lisa.cygnus.com) + + * nlmconv.c: Include libiberty.h. + + Support for PowerPC NetWare. + * nlmconv.c (main): For PowerPC NetWare, automatically define the + special symbols __toc_start. + (select_output_format): Handle bfd_arch_powerpc. + (mangle_relocs): Likewise. + (powerpc_mangle_relocs): New function. + +Thu Feb 17 09:28:23 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * ar.c, bucomm.c, nlmconv.c, nm.c, objcopy.c, objdump.c, + size.c: Use bfd_get_error and bfd_set_error and new error names. + +Fri Feb 11 15:54:51 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * objcopy.c (strip_main, copy_main): Add missing 'break' in switch. + +Mon Feb 7 19:45:52 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * objdump.c (disassemble_data): Handle bfd_arch_powerpc. + +Sun Feb 6 22:08:20 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * strings.c objdump.c nlmconv.c objcopy.c nm.c ar.c size.c (main): + Call xmalloc_set_program_name. + +Fri Feb 4 10:46:01 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * objcopy.c (filter_bytes): Make MEMHUNK a char *, not PTR, so we + can do arithmetic on it. + +Thu Feb 3 14:06:41 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * objdump.c (dump_section_stabs, read_section_stabs, + print_section_stabs): Functions broken out of dump_stabs_1. + Free the stabs and strings when done with them. + +Wed Feb 2 13:42:23 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * nlmconv.c (main): Use bfd_get_flavour instead of struct member. + * ar.c (print_contents, extract_file), size.c + (print_berkeley_format, print_sysv_format): Use bfd_get_filename and + bfd_my_archive instead of dereferencing the structs directly. + + * ar.c: Use bfd_fatal and bfd_nonfatal instead of bfd_perror and exit. + Indent. Remove DEFUNs. + + * nlmconv.c (main), objcopy.c (copy_file): Print matching formats + if ambiguous match. + * nm.c (display_file, display_archive), size.c (display_bfd): + Eliminate gotos. + Print matching formats if there is an ambiguous match. Use + bfd_nonfatal instead of hardcoded error message if nothing matches. + + * arsup.c, ar.c, objdump.c: Use bfd_get_filename instead of + abfd->filename. + + * nm.c (display_archive): New function, from code in display_file. + (display_rel_file): Renamed from do_one_rel_file. + + * size.c: Indent. + (display_archive): New function from code in display_file. + (display_file): Check bfd_close error return. + + * strings.c (strings_object_file): Check bfd_check_format + error return. + + * strings.c, objdump.c, size.c: Use bfd_nonfatal instead of bfd_perror. + + * bucomm.c: Delete references to exit_handler. It wasn't set + anywhere, and now that we're using the libiberty xmalloc, it + wouldn't always get called before exiting. + (list_matching_formats): Function moved from objdump.c. + * bucomm.h: Declare it. + + * objdump.c (disassemble_data): Move some variable decls closer to + their use. Add some comments. Replace a nested block with a + return. + +Mon Jan 31 18:50:41 1994 Stan Shebs (shebs@andros.cygnus.com) + + * objdump.c (display_target_list, display_info_table): Check that + the bfd of the dummy output file is not null. + +Wed Jan 26 13:13:18 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * objcopy.c (filter_bytes): New function. + (copy_section): Call it. + (copy_options, copy_usage, copy_main): Add --byte option to + activate it. Appropriate the -b option (which was an undocumented + synonym for -F) for it, also. Add --interleave, -i option for + additional control. + (setup_section, copy_section, mangle_section): Renamed with no `s' + on the end. + * objcopy.1, binutils.texi: Document the new options. + + * objdump.c (display_target_tables, display_target_list): + New functions broken out of display_info. + Eliminate some magic constants. Use more meaningful variable names. + (dump_bfd_header): New function broken out of display_bfd. + (dump_section_header): New function broken out of dump_headers. + (remove_useless_symbols): Don't shadow global variable name with + parameter. + (objdump_print_address): Fix backward test. + +Tue Jan 25 19:40:54 1994 Stan Shebs (shebs@andros.cygnus.com) + + * bucomm.c (print_arelt_descr): Change decl of `when' to time_t. + * objdump.h: Removed. + +Mon Jan 24 13:29:02 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * objdump.c (display_file): Remove call to list_matching_formats. + It would never be called. + (list_matching_formats): Take an arg giving the list of matching + formats. + (display_bfd): Pass the arg, and get it filled in by calling + bfd_check_format_matches instead of bfd_check_format. + (display_info, display_info_table): target_vector was renamed to + bfd_target_vector. + + * binutils.texi (objdump): Note some limitations of -h section + address printing. + +Sat Jan 22 16:20:46 1994 Stan Shebs (shebs@andros.cygnus.com) + + * Makefile.in (MALLOC): Set to emptiness by default. + (ALL_CFLAGS): Add and use. + (arparse.h): Make it depend on arparse.y. + * ar.c (libbfd.h): Don't require to be in ../bfd. + * objdump.c (comp): Rename to compare_symbols. + +Fri Jan 21 20:22:30 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * objdump.c (list_matching_formats): If the file format is ambiguous, + print the matching names so the user can choose one. + (display_bfd): Call it. + (display_file): Call it. + +Fri Jan 21 19:17:25 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * objdump.c (disassemble_data): Support bfd_arch_rs6000. + +Mon Jan 17 13:57:25 1994 Stan Shebs (shebs@andros.cygnus.com) + + * objdump.c (stab_name): Allocate dynamically. + (stab_print): Use pointers to strings instead of char arrays. + (dump_stabs): Change alloc and init of arrays appropriately. + (dump_stabs_1): Always decide whether to print stab_name or + the stab's type number, if unnamed. + +Fri Jan 14 14:42:48 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * objcopy.c (strip_main, copy_main): Don't clobber the input file + if copy_file fails. + + * nlmconv.c (main): Warn about an attempt to use a shared library + with uninitialized data. + + * nlmconv.c (setup_sections): Make sure that we align the + output_offset of each input section appropriately. + +Thu Jan 13 17:32:44 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * objdump.c (dump_relocs): Don't crash if section name is NULL. + +Tue Jan 11 19:46:33 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * filemode.c (filemodestring): Commented out; not used. + (mode_string): Use POSIX definitions. + (ftypelet): Likewise. + (rwx): Removed; no longer used. + * bucomm.c: Include bucomm.h. + (bfd_nonfatal, bfd_fatal): Argument is const. + (fatal): Make __STDC__ version. + * bucomm.h (mode_string): Declare. + * Makefile.in (bucomm.o): Depend upon bucomm.h + +Sun Jan 9 12:03:20 1994 Ken Raeburn (raeburn@rtl.cygnus.com) + + * bucomm.c (xmalloc, xrealloc): Deleted. + * bucomm.h (xmalloc, xrealloc): Fix prototypes, to correspond to + libiberty version of functions. + +Thu Jan 6 06:18:15 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * binutils.texi: Add a chapter summarizing the ways to select + aspects of the target for each program. + + * objdump.c (long_options, usage): Add long equivalents for all + remaining short options that lacked them. + * binutils.texi objdump.1: Document them. + + * size.c (usage): Tweak usage message. + * size.1: Add missing `=' in examples. + + * binutils.texi strip.1 objcopy.1 nlmconv.1 objcopy.c nlmconv.c: + Use "--target=bfdname" as the option to select the BFD target, + like nm and size already do. + Reserve "--format=format" for textual output selection options, but + for now keep old option names as obsolete for backward compatibility. + + * strings.c (main, strings_object_file, usage): Add --target option. + * binutils.texi strings.1: Document it. + +Sat Jan 1 13:58:24 1994 David J. Mackenzie (djm@thepub.cygnus.com) + + * ar.c (main): Add \n in error message. + +Thu Dec 23 12:23:11 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + gcc -Wall lint: + * ar.c (main): Put parens around assignment used as truth value. + * objcopy.c (strip_main): Remove unused variables. Return 0. + (copy_main): Remove unused variables. Return 0. + * objdump.c (display_bfd): Declare return value as void. + (stab_print): Use "" instead of 0 to initialize array. + (dump_stabs_1): Print vma using printf_vma. + (display_info): Put parens around assignment used as truth value. + * strings.c (print_strings): Cast printf arguments. + + * objcopy.c (copy_main): Use copy_options, not strip_options. + + * nlmheader.y (command): Warn about illegal date values. + +Wed Dec 15 11:18:03 1993 David J. MacKenzie (djm@frosty.eng.umd.edu) + + * bucomm.c bucomm.h: Run through indent. De-ansidecl-ify. + (bfd_nonfatal): New function. + (bfd_fatal): Call it. + + * objcopy.c (smart_rename): Do a copy if the dest file has + multiple hard links. Remove source file on successful copy. + Try to preserve mode and owner on successful rename. + + * objcopy.c: Run through indent. Clean up a bit. + Make global variables static. + Make {input,output}_{target,filename}, show_version local + to various functions. + New global variable `status' for exit status. + (strip_main, copy_main): New functions with code from main. + (nonfatal): New macro. Use it globally instead of bfd_perror and + bfd_fatal. + + (copy_object): Call mangle_sections with bfd_map_over_sections. + (mangle_sections): Adjust for new calling convention. + +Fri Dec 10 11:28:11 1993 Ian Lance Taylor (ian@deneb.cygnus.com) + + * nlmheader.y (command): Accept MAP and FULLMAP without arguments. + * nlmconv.c (main): Change error message for MAP and FULLMAP. + +Thu Dec 9 17:47:19 1993 Ian Lance Taylor (ian@deneb.cygnus.com) + + * nlmconv.c (main): Warn about imported symbols that are not in + the IMPORT list even if the IMPORT keyword is not used. + + * nlmconv.c (debug, unlink_on_exit): New static variables. + (long_options): Add "debug" and "linker". + (main): Handle -d and -l arguments. Make command line input and + output files optional. Parse the command file before opening the + BFD's, which requires storing more information in local variables. + If INPUT names multiple files, link them together. Use OUTPUT for + the output file name if not named on command line. + (show_usage): Changed for new options. + (link_inputs): New function to automatically invoke linker to + handle multiple INPUT files. + (choose_temp_base_try, choose_temp_base, pexecute): New functions, + mostly copied from gcc/gcc.c. + * nlmconv.h (input_files, output_file): Declare. + * nlmheader.y (input_files, output_file): Define. + (command): Support INPUT with a string_list argument. Support + OUTPUT. + (string_list): Renamed from module_list. + * Makefile.in (nlmconv.o): Define LD_NAME based on + program_transform_name. + +Wed Dec 8 10:09:04 1993 Ian Lance Taylor (ian@deneb.cygnus.com) + + * nlmheader.y (nlmheader_identify): New function. Use it to print + the program name just once, instead of with every error message. + +Mon Dec 6 16:11:32 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmconv.c (long_options): Changed --header-info to --header-file + to match documentation and usage message. + +Sun Dec 5 01:31:01 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * objdump.c (dump_relocs): Avoid dereferencing a NULL sym_ptr_ptr + in a relocation. + +Thu Dec 2 16:00:06 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmconv.c (main): Change various types from bfd_size_type to + size_t, since they have to be arguments to fread and fwrite. + Change set from char * to unsigned char *. + (select_output_format): Make mach argument unsigned. Handle + bfd_arch_alpha. + (setup_sections): Don't copy the .reginfo section of an ECOFF + file. Call bfd_set_reloc to initialize the relocation fields. + (copy_sections): Don't copy the .reginfo section of an ECOFF file. + Combine all relocs for a section. + (mangle_relocs): Change type of relocs to permit specific + functions to change it. Call alpha_mangle_relocs for alpha, + default_mangle_relocs for other architectures. + (default_mangle_relocs): New function. Adjust the address of all + relocs by the output_offset. + (i386_mangle_relocs): Change type of relocs argument. Cast length + argument to memmove to size_t. + (alpha_mangle_relocs): New function. + +Wed Nov 17 17:38:58 1993 Sean Eric Fagan (sef@cygnus.com) + + * nlmconv.c (select_output_format): Use nlm32-sparc for + bfd_arch_sparc. + +Wed Nov 17 14:41:35 1993 Jeffrey Osier (jeffrey@thepub.cygnus.com) + + * nlmconv.1: added man page + * objcopy.1: fixed format errors + +Wed Nov 17 12:03:41 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * Makefile.in: Use CFLAGS as well as LDFLAGS when linking. + +Wed Nov 17 04:50:55 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * strings.1: Fix typo. + +Mon Nov 15 12:03:20 1993 Ken Raeburn (raeburn@rtl.cygnus.com) + + * Makefile.in (DISTSTUFF): Build "info". + (VERSION): Updated to cygnus-2.3.1; 2.3 has gone out. + +Sun Nov 14 00:27:24 1993 Jeffrey A. Law (law@snake.cs.utah.edu) + + * objdump.c (dump_stabs): Handle stabs-in-som as implemented + by the new BFD SOM assembler. + +Sat Nov 13 07:14:05 1993 David J. Mackenzie (djm@rtl.cygnus.com) + + * ar.1 c++filt.1 nm.1 objcopy.1 objdump.1 ranlib.1 size.1 + strings.1 strip.1: Replace \(em in NAME section with \- so + makewhatis can grok it. + +Tue Nov 9 15:22:12 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmconv.c (i386_mangle_relocs): Adjust reloc address by + section output_offset. + +Fri Nov 5 12:11:52 1993 Jeffrey Osier (jeffrey@thepub.cygnus.com) + + * binutils.texi: added nlmconv chapter + +Wed Nov 3 16:10:50 1993 Jeffrey Wheat (cassidy@cygnus.com) + + * Makefile.in: Change RUNTESTFLAGS to RUNTEST_FLAGS + +Wed Nov 3 15:09:23 1993 Ken Raeburn (raeburn@rover.cygnus.com) + + * Makefile.in (distclean): Don't get rid of dvi or info files. + +Tue Nov 2 13:29:59 1993 David J. Mackenzie (djm@rtl.cygnus.com) + + * objcopy.c (S_ISLNK): Define as 0 if there's no S_IFLNK. + +Fri Oct 29 16:02:34 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * binutils.texi: Move objcopy docs into alphabetical order. + + * objdump.c: Use xmalloc instead of malloc. + +Fri Oct 29 11:11:14 1993 Stan Shebs (shebs@rtl.cygnus.com) + + * objdump.c (info): Rename to formats_info. + (dump_stabs_1): Better comments and formatting. + +Thu Oct 28 19:43:16 1993 Stan Shebs (shebs@rtl.cygnus.com) + + * ar.c (main): Always create the archive when quick appending, + even if no input files have been given. + +Wed Oct 27 12:03:06 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmconv.c (main): Set sharedDebugRecordOffset and + sharedDebugRecordCount fields in extended header. + + * nlmconv.c (main): Force moduleName field to upper case. + +Mon Oct 25 16:45:42 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * objcopy.c (main): Give a usage message if there are too many + arguments. + +Mon Oct 25 10:37:08 1993 Ken Raeburn (raeburn@rover.cygnus.com) + + * Makefile.in (install-info): Rewrite to take advantage of VPATH, + so FSF distributions (with info files in $(srcdir)) install + properly. + (DISTSTUFF): Build nlmheader.c too. + +Fri Oct 22 11:43:23 1993 Ken Raeburn (raeburn@rover.cygnus.com) + + * ar.c (program_name): Don't define here. + * objdump.c: Include "bucomm.h". + (xmalloc): Don't declare here. + (program_name): Don't define here. + (program_version): Fixed type in declaration. + * size.c: Include "bucomm.h". + (program_name): Don't declare here. + +Fri Oct 22 14:10:41 1993 Mark Eichin (eichin@cygnus.com) + + * objdump.c (fprintf): hide declaration in FPRINTF_ALREADY_DECLARED + +Fri Oct 1 12:43:00 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmconv.c (i386_mangle_relocs): Resolve and remove PC relative + relocs against defined symbols in the same section. + +Thu Sep 30 16:46:26 1993 Roland H. Pesch (pesch@fowanton.cygnus.com) + + * Makefile.in (binutils.dvi): use TEXIDIR to find texinfo.tex + +Sat Sep 25 18:09:29 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * objcopy.c (simple_copy, smart_rename): New functions. + (main): Use them. + +Fri Sep 24 15:38:29 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * Makefile.in (clean, distclean): Recurse into testsuite. + +Thu Sep 23 01:05:06 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * objcopy.c (setup_sections, copy_sections): If stripping, don't + copy SEC_DEBUGGING sections. + * objdump.c (dump_headers): Print SEC_DEBUGGING flag. + + * objdump.c (usage): Mention --stabs. + + * objcopy.c (copy_object): Copy all applicable file flags. + (copy_file): Don't copy EXEC_P specially here. + +Mon Sep 20 19:28:57 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmconv.c (main): Adjust data section size to correspond to bss + alignment adjustment. Clear BSF_SECTION_SYM if symbol is moved to + a different section. Use time_t for time variable. + (setup_sections): Only put sections with contents in output NLM. + (i386_mangle_relocs): No symbols are common at this point. Add + casts to avoid warnings. + +Fri Sep 10 11:00:40 1993 Stan Shebs (shebs@rtl.cygnus.com) + + * objdump.c: Made the --stabs option work for stabs-in-coff. + (ELF_STAB_DISPLAY): Removed. + (dump_elf_stabs): Renamed to dump_stabs, changed to run for + any object file format. + (dump_elf_stabs_1): Renamed to dump_stabs_1, added calls to + generic BFD routines for non-ELF case, changed format of message + for no-section-found case. + (display_bfd): Always call dump_stabs if requested. + (dump_data): Call bfd_section_size to get section size. + +Fri Sep 10 08:12:23 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * Makefile.in (install): Don't put strings in tooldir/bin. + +Mon Sep 6 15:39:04 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmconv.c (total_bss_size): Removed. + (main): Set the bss vma to always follow the data section. Move + symbols into new sections, and adjust values by output_offset. + (setup_sections): Don't copy all sections, but instead point all + text sections to .text, all data sections to .data, and all bss + sections to .bss. + (copy_sections): Adjust accordingly. + +Thu Sep 2 12:34:03 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + Only build nlmconv if configured for a NetWare target. + * configure.in: If we have some *-*-netware* target, or are using + all targets, set BUILD_NLMCONV to $(NLMCONV_PROG) in Makefile. + * Makefile.in (PROGS): Use $(BUILD_NLMCONV) rather than + $(NLMCONV_PROG). + +Tue Aug 31 14:13:35 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * objdump.c (ARCH_all): Define ARCH_hppa too. + (dump_headers): Don't test for SEC_BALIGN if it's not defined by + bfd.h. + +Tue Aug 31 13:29:12 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * nlmconv.c (main): Force creation of .bss section. Set up the + sections before looking at the symbols. Move all common symbols + into .bss section. Automatically define _edata and _end. Only + export symbols in the export list, with multiple prefixes if + necessary. Warn if no version. Always create extended header. + Set date automatically if not already set. + (setup_sections): Count size of bss sections. + (mangle_relocs, i386_mangle_relocs): Accept section argument, and + take reloc_count as a changeable pointer; changed callers. + (i386_mangle_relocs): Remove PC relative relocs within a section, + as they require no adjustment. + * nlmheader.y: Fixed memory allocation throughout: token STRING is + now allocated on the heap, and freed if not needed. Null + terminated copyright message. Accept version with only two + strings. + (symbol_list_opt): New nonterminal, either symbol_list or empty. + (symbol_list): Use left recursion to avoid overflowing parser + stack. + (yylex): Rearranged beginning of line check. Accept quoted + strings using single quotes. End generic argument at comment + character or parentheses. + (string_list_append): Fixed. + (string_list_append1): New function. + + * bucomm.h: The first argument to xrealloc is PTR, not char *. + * bucomm.c (xrealloc): Use PTR rather than char *. + * Makefile.in (objdump.o): Depend upon config.status to notice + --with-targets changes. + (nlmconv.o): Depend upon bucomm.h. + +Tue Aug 17 09:46:01 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * configure.in: Don't pass cpu to config.bfd. + +Thu Aug 12 16:43:04 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * Makefile.in ($(NM_PROG)): Depend on demangle.o. + (demangle.o): New target. + (cplus-dem.o): Depend on it, to force compilation order when doing + parallel compiles. + + * nm.c (print_symbol_info_{bsd,sysv,posix}): Take a bfd arg. + (struct output_fns print_symbol_info): Ditto. + (long_options, usage, main): Add -C --demangle option. + (print_symname): New function, demangling if requested. + (print_symbols, print_symbol_info_{bsd,sysv,posix}): Use it. + +Wed Aug 11 22:57:23 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * Makefile.in: Put CFLAGS last in compilation rules and omit from + linking rules. Use ARCHDEFS to compile objdump.c. + Update dependencies. + * configure.in: Construct ARCHDEFS based on the BFD target makefile + fragments. + * objdump.c: Conditionalize calls to the print_insn_ARCH functions + according to ARCHDEFS. + +Thu Aug 12 08:06:15 1993 Ian Lance Taylor (ian@cygnus.com) + + * ar.c: Removed obsolete and non-functional GNU960 code. + +Wed Aug 11 13:08:26 1993 Ian Lance Taylor (ian@cygnus.com) + + * size.c (berkeley_sum): New function. + (bsssize, datasize, textsize): New global variables. + (bss_section_name, data_section_name, text_section_name): Removed. + (print_berkeley_format): Map berkeley_sum over all the sections, + rather than only reporting sizes of specifically named sections. + * Makefile.in ($(OBJDUMP_PROG)): Removed dependency on size.o. + +Tue Aug 10 10:46:01 1993 Ian Lance Taylor (ian@cygnus.com) + + * nlmconv.c, nlmconv.h, nlmheader.y: New files for program to + convert object files into NetWare Loadable Modules. + * Makefile.in (NLMCONV_PROG): New macro, define to be nlmconv. + (PROGS): Add NLMCONV_PROG. + (nlmheader.c, nlmheader.o, nlmconv.o, $(NLMCONV_PROG)): New + targets. + +Thu Aug 5 15:48:32 1993 david d `zoo' zuhn (zoo@rtl.cygnus.com) + + * Makefile.in: define MAKEOVERRIDES to an empty string + +Wed Aug 4 17:08:08 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * objcopy.c (copy_file): Make failures to process a file nonfatal. + +Mon Aug 2 11:28:23 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * nm.c: Add -B option, like --format=bsd. + +Tue Jul 27 16:29:54 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * objcopy.c (copy_file): If the file is neither an object nor an + archive, give an error rather than returning success. + +Mon Jul 19 16:13:40 1993 Ken Raeburn (raeburn@rtl.cygnus.com) + + * objdump.c (objdump_print_address): Prefer non-local symbols over + local ones, and especially discriminate against debugging symbols. + Also, for relocateable files, try to find a symbol in the current + section, instead of picking one from some random section with a + convenient value (read, section offset). + (disassemble_data): Cast argument to malloc to size_t first. + (dump_data): Likewise. + (dump_relocs): If a single section name is specified, show relocs + only for that section. Otherwise, silently omit sections without + relocs. Format table nicely even if values are printed using 16 + digits instead of 8. + +Fri Jul 16 15:19:59 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * nm.c: Changes for final version of POSIX.2. + (print_symbol_filename_{bsd,sysv,posix}): New functions. + (formats): Add an element for a pointer to them. + (print_symbols): Call it. + (print_object_filename_posix, print_archive_member_posix): Produce + output according to new POSIX.2 spec. + + * strings.c (print_strings): Handle STREAM being NULL. + (strings_a_section): Pass a NULL. + (main): Don't open /dev/null. + +Thu Jul 15 12:44:09 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * objdump.c (disassemble_data): Handle the m88k. + (display_bfd): Use bfd_errmsg, rather than just claiming that the + bfd is not an object file. + +Mon Jul 12 17:55:34 1993 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in (TAGS): make work again by naming directories + explicitly rather than depending on undefined macros. + (INSTALL_XFORM): correct bad install target. + +Fri Jul 2 16:58:34 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * strings.c: Doc fixes. + +Sun Jun 27 13:35:24 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * Makefile.in: Note dependencies on bucomm.h. + (cplus-dem.o): Link c++filt with version.o. + + * strings.c: Include bucomm.h and add prototypes to other decls. + Remove -h option. + + * bucomm.h: Declare xrealloc. + + * nm.c, objcopy.c, objdump.c, size.c, strings.c (main, usage): Add + --help option. Put "GNU" in the version message. + (usage): Take stream and exit status as args. + (main): Pass new args to usage. + +Fri Jun 25 23:12:12 1993 David J. Mackenzie (djm@thepub.cygnus.com) + + * strings.c, strings.1: New files. + * binutils.texi: Document strings. + * Makefile.in: Add rules for it. + +Fri Jun 25 20:44:43 1993 Ken Raeburn (raeburn@poseidon.cygnus.com) + + * objdump.c: Use size-independent bfd elf section names. + +Sun Jun 20 23:09:06 1993 Ken Raeburn (raeburn@poseidon.cygnus.com) + + * objdump.c (objdump_print_address): Handle wide offsets by + calling sprintf_vma. + +Fri Jun 18 14:29:12 1993 Per Bothner (bothner@deneb.cygnus.com) + + * objdump.c (syms2): Removed unused variable. + * objdump.c (remove_useless_symbols): New function. + * objdump.c (comp): Simplify. + * objdump.c (dis-assemble_data): Make simpler and more + efficient how we filter out useless symbols: Just filter + BEFORE the sort (using remove_useless_symbols). + * objdump.c (objdump_print_address): Simplify. + Change output syntax to match gdb. + +Thu Jun 17 16:53:56 1993 david d `zoo' zuhn (zoo@cygnus.com) + + * Makefile.in: canonicalize install.sh; for use within + this directory (and subdirs) + +Mon Jun 14 12:13:22 1993 david d `zoo' zuhn (zoo at rtl.cygnus.com) + + * Makefile.in (install, install-info): remove parentdir support, + use INSTALL_XFORM; define INSTALL_XFORM + +Thu Jun 10 17:29:21 1993 Per Bothner (bothner@cygnus.com) + + * objcopy.c (copy_object): Fix bad size passed to xmalloc(). + +Mon Jun 7 12:41:12 1993 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in (INCLUDES): Add -I../bfd for sysdep.h and bfd.h. + * configure.in: No longer need to configure to get sysdep.h. + * objcopy.c (copy_object): Fix symbol table handling. + +Fri Jun 4 17:20:03 1993 Per Bothner (bothner@cygnus.com) + + * objcopy.c (filter_symbols): Cannot filter the symbols + in place, because that confuses the relocs, so take separate + parameter for output array. + * objcopy.c (sympp): Make two variables: isympp and osympp. + * objcopy.c (copy_object): Allocate separate array (osympp) + for filtered symbols. + +Fri Jun 4 10:51:44 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: change recursion test to presence of a configured + testsuite directory + +Thu Jun 3 14:05:57 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * Makefile.in (underscore.c): Hack the backquoted command so it + doesn't cause Solaris make to bomb. + +Thu Jun 3 10:40:19 1993 Jeffrey Osier (jeffrey@cygnus.com) + + * Makefile.in: added c++filt and objcopy to MANPAGES variable + +Thu Jun 3 00:32:52 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: rename LOADLIBES to EXTRALIBS + +Wed Jun 2 18:30:24 1993 Jeffrey Osier (jeffrey@cygnus.com) + + * c++filt.1, objcopy.1: new man pages + +Fri May 28 15:01:24 1993 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in (install): Also install ar and ranlib in + $(tooldir)/bin; needed for building libgcc.a. + * objdump.c (objdump_print_address): Fix the check + "coincidental" label matches by dis-allowing undefined + or com symbols. + +Thu May 27 16:58:31 1993 Jeffrey Osier (jeffrey@cygnus.com) + + * biutils.texi: revised c++filt chapter + +Wed May 26 17:24:17 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (FLAGS_TO_PASS): Pass down CC and CFLAGS. + +Tue May 25 00:26:47 1993 Ken Raeburn (raeburn@cygnus.com) + + * objdump.c (slurp_symtab): Print warning for bad symbol table. + (bfd_elf32_find_section, Elf32_Internal_Shdr): Updated + declarations and uses. + + * Makefile.in (DISTSTUFF): Don't build binutils.mm. + +Fri May 21 10:51:19 1993 David J. Mackenzie (djm@rtl.cygnus.com) + + * nm.c: Add -f/--format, -P/--portability, -t/--radix options. + Make global variables static. + (main): Make -v like -n, not -V, and make -A like -o, for POSIX.2. + (set_print_radix, set_output_format, + print_{object_filename,archive_filename,archive_member,symbol_info} + {bsd,sysv,posix}): New functions. + (display_file, print_symbols): Call them. + + * ar.c: Improve error messages. + + * nm.c (main): Handle long options that just set a flag. + + * nm.c (main), ar.c (do_show_version), objcopy.c (main), size.c + (main): Exit after printing the version number, per the GNU coding + standards. + +Mon May 17 13:20:25 1993 Per Bothner (bothner@cygnus.com) + + * README, Makefile.in: Minor updates for 2.2. + +Fri May 14 11:12:26 1993 Per Bothner (bothner@cygnus.com) + + * Makefile.in (underscore.c): Automatically generate + (using nm) a file with the variable prepends_underscore. + * Makefile.in (c++filt): Link underscore.o with cplus-dem.o + so that initial underscores get removed iff appropriate. + * binutils.texi: Preliminary documentation for c++filt. + * Makefile.in, binutils.texi: Set to version 2.2. + + * NEWS: Mention copy->objcopy renaming and new c++filt program. + +Wed May 12 12:05:36 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (cplus-dem.o, $(DEMANGLER_PROG)): Build the + demangler via cplus-dem.o, rather than directly from the .c file. + + * objcopy.c: Renamed from copy.c, updated comments accordingly. + * Makefile.in, binutils.texi: Renamed copy to objcopy. + * is-strip.c, maybe-strip.c, not-strip.c: Updated comments for + rename of copy to objcopy. + +Mon May 10 17:20:18 1993 Per Bothner (bothner@cygnus.com) + + * binutils.texi (strip, -v option): Fix typo. + +Fri May 7 13:57:50 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (RUNTEST): Define. + (FLAGS_TO_PASS): Pass down RUNTEST. + +Tue May 4 10:06:50 1993 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (DEMANGLER_PROG): Name it c++filt. + (PROG): Also build and install COPY_PROG. + +Mon May 3 19:11:48 1993 Per Bothner (bothner@cygnus.com) + + * Makefile.in: Change definition of $(tooldir) to match FSF. + +Wed Apr 28 23:41:32 1993 David J. Mackenzie (djm@rtl.cygnus.com) + + * size.c (usage): Add missing options. + (main): Clean up option parser. + + * objdump.c (usage): Add missing options. + (display_file): Print program name before calling + bdf_perror. + + * nm.c (usage): Add missing options. + (main): Clean up option parser. + (display_file): Print program name before calling + bdf_perror. + + * copy.c (copy_usage, strip_usage): Add missing options. + + * ar.c (usage): New function. + (main): Call it. + (open_inarch, do_quick_append): Print program name before calling + bdf_perror. + +Thu Apr 22 15:01:35 1993 Ian Lance Taylor (ian@cygnus.com) + + * nm.c (main): Accept and ignore -A and -B for MIPS compatibility. + +Mon Apr 19 14:06:59 1993 Rob Savoye (rob@cygnus.com) + + * Makefile.in: Added FLAGS_TO_PASS so tests get run on freshly + built binaries if they exist. (otherwise the path) + +Wed Apr 7 22:22:50 1993 Rob Savoye (rob@cygnus.com) + + * Makefile.in: Changed check target to use DejaGnu. + +Thu Apr 1 12:37:13 1993 Jim Kingdon (kingdon@cygnus.com) + + * Makefile.in: Remove am29k-pinsn.c, i960-pinsn.c. + objdump.c: a29k and i960 are `disassemble' not `print'. + + * objdump.c: Rename print_address to objdump_print_address + and change parameters. + (disassemble_data): Use objdump_print_address. + +Wed Mar 31 10:25:29 1993 Jim Kingdon (kingdon@lioth.cygnus.com) + + * objdump.c (disassemble_data): print_insn_sparc is now a + `disassemble' not a `print'. + Makefile.in: Remove sparc-pinsn.c (now in libopcodes.a). + + * objdump.c (disassemble_data): Use new read_memory_func stuff. + +Thu Mar 25 10:38:11 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * objdump.c (fprintf): Declaration of variadic function had better + be a prototype for ANSI C systems. + +Mon Mar 22 23:19:46 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: rename test-install to install-check + +Fri Mar 19 14:40:08 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * objdump.c (disassemble_data): Add H8500. + +Fri Mar 19 10:56:51 1993 Jim Kingdon (kingdon@cygnus.com) + + * objdump.c (usage): Mention long options. + +Thu Mar 18 14:22:17 1993 Per Bothner (bothner@rtl.cygnus.com) + + * nm.c: Modify behavior of -o flag for archives to match + BSD4.4 and Sunos 4: Prefix archive name before each line. + + * m68k-pinsn.c: Removed. Subsumed by ../opcodes/m68k-dis.c. + * i386-pinsn.c: Removed. Subsumed by ../opcodes/i386-dis.c. + * Makefile.in: Adjust accordingly. + * objdump.c: Support new-style disassemblers (ones that use + the interface of ../include/dis-asm.h). + +Thu Feb 25 15:57:00 1993 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in: When making tar file, remove texinfo/*, + except for texinfo/texinfo.tex. + * ardup.c: Add extern declaration of strdup. + * Makefile.in (testsuite): Add 'else true' since otherwise + Ultrix /bin/sh complains. + +Wed Feb 24 19:44:18 1993 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in: Set VERSION to 2.1. + * README, NEWS: Updates. + * nm.c: Add -v as a synonym for -V. + +Tue Feb 23 19:00:50 1993 Mike Werner (mtw@poseidon.cygnus.com) + + * configure.in: added testsuite to configdirs. + * Makefile.in: added support for building testsuite. + +Mon Feb 22 22:52:10 1993 Per Bothner (bothner@rtl.cygnus.com) + + * objdump.c (disassemble_data): Print function names when + given by bfd_find_nearest_line. If not - still print + line numbers. + +Mon Feb 22 07:54:03 1993 Mike Werner (mtw@poseidon.cygnus.com) + + * binutils/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. + +Mon Feb 22 10:27:24 1993 Ken Raeburn (raeburn@cambridge.cygnus.com) + + * objdump.c (dump_data): Free up section contents each time + through the loop. Reported by minyard@bnr.ca. + +Sun Feb 21 10:55:55 1993 Mike Werner (mtw@poseidon.cygnus.com) + + * binutils/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 + of dejagnu. The modifications to these testcases, etc., which + will allow them to work with the new version of dejagnu will be + made in a future update. + +Fri Feb 12 10:05:20 1993 Fred Fish (fnf@cygnus.com) + + * Makefile.in (LIBIBERTY_SRC_DIR, LIBIBERTY_BIN_DIR): New macros. + * Makefile.in (LIBIBERTY): Use LIBIBERTY_BIN_DIR. + * Makefile.in (DEMANGLER_PROG): New program to build. Add macro + and rule. + * Makefile.in (PROGS): Add DEMANGLER_PROG. + +Tue Jan 26 11:56:33 1993 Ian Lance Taylor (ian@cygnus.com) + + * copy.c, nm.c, objdump.c, size.c: Use new bfd_is_com_section + macro rather than checking for equality to bfd_com_section. + +Fri Jan 8 15:50:05 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * objdump.c (disassemble_data): Fix code to find first useless + symbol. + +Thu Jan 7 13:13:31 1993 Ian Lance Taylor (ian@tweedledumb.cygnus.com) + + * objdump.c (disassemble_data): Use mips_print_insn for MIPS. + Don't core dump if bfd_find_nearest_line returns false. + +Wed Jan 6 17:14:01 1993 Steve Chamberlain (sac@thepub.cygnus.com) + + * objdump.c (disassemble_data): know how to disassemble z8000s + too. + +Wed Jan 6 15:16:27 1993 Per Bothner (bothner@cygnus.com) + + * arsup.h (interactive), bucomm.h (program_name): Prefix + with 'extern', to avoid warnings from some compilers. + +Wed Jan 6 15:14:11 1993 Per Bothner (bothner@rtl.cygnus.com) + + * arparse.y: fix unnecessary shift/reduce + +Tue Dec 22 15:46:56 1992 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in: Make check depend on all. + * Makefile.in (distclean): Remove sysdep.h. + * size.c: Use %u format where appropriate. + * objdump.c: Standardize: L_SET -> SEEK_SET. + * objdump.c: Use new macro bfd_asymbol_bfd. + * configure.in: Allow std-host as the default ${mys_host}. + +Thu Dec 17 19:38:19 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: added dvi target, define and use TEXI2DVI + +Tue Dec 15 18:05:07 1992 Per Bothner (bothner@cygnus.com) + + * Makefile.in (dist): Fix permissions before release. + * size.c: Use bfd_size_type (and long) where appropriate. + * ar.c: Make writing a map the default, to be compatible + with SYSV and Posix.2. Remove some bogus kludges that + handled __.SYMDEF directly. + * NEWS: New file. + +Mon Nov 9 13:36:53 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * Makefile.in: flex no longer needs the -S flag + +Sat Nov 7 15:06:13 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * ar.c (extract_file): utime needs a pointer to a utimbuf + + * Makefile.in: handle -I includes better, adding $(BASEDIR)/bfd to + the list (since some of the bfd/hosts/*.h files include other + files from that directory) + +Fri Nov 6 00:12:51 1992 John Gilmore (gnu@cygnus.com) + + * i960-pinsn.c (MEM_MAX, MEM_SIZ): Set upper bound properly. + +Thu Nov 5 03:37:15 1992 John Gilmore (gnu@cygnus.com) + + Clean up some old BFD ansification macros. + + * arsup.h, bucomm.h, objdump.h: Remove EXFUN from binutils. + It still remains as a local macro in gmalloc.c, which is derived + from some other copy of GNU Malloc somewhere (FIXME). + + * ar.c, objdump.c, size.c: Replace EXFUN with PROTO. Make static + fns really static. + * arsup.h: Declare extract_files. + +Mon Nov 2 12:42:11 1992 Ian Lance Taylor (ian@cygnus.com) + + * ar.c (extract_file): instead of checking USG: if POSIX_UTIME, + use utime and utimbuf structure, otherwise if USE_UTIME use utime + and array of two longs, otherwise use utimes. + +Thu Oct 15 13:57:35 1992 Per Bothner (bothner@cygnus.com) + + * binutils.tex: Document yesterday's changes to strip and copy. + +Wed Oct 14 13:22:14 1992 Per Bothner (bothner@cygnus.com) + + * copy.c: Re-do command-line parsing to use getopt_long(). + Add long option names. Re-think option letters to be more + consistent. + * copy.c: New function filter_symbols() for stripping only + debug-symbols and/or local symbols. Use these to support + the previously-missing options of the old FSF strip. + +Tue Oct 13 01:24:20 1992 John Gilmore (gnu@cygnus.com) + + * configure.in (host): Use ${srcdir}/../bfd/configure.host rather + than repeating a copy of it here. + +Wed Oct 7 12:53:52 1992 Ken Raeburn (raeburn@cygnus.com) + + * copy.c (main): Even if is_strip, accept -d argument indicating + alternate output format. Needed by gdb for Nindy. + + * m68k-pinsn.c (print_insn_arg): Handle new "`" operand type. + +Tue Oct 6 16:33:56 1992 Jeffrey Osier (jeffrey@cygnus.com) + + * binutils.texi: added documentation for "copy" + +Tue Oct 6 14:22:56 1992 Per Bothner (bothner at PersSony) + + * Makefile.in (*clean rules): Some cleaning up. + * Makefile.in (dist): Make diststuff in gprof for a dist. + + * ar.c (do_show_version): New function. + * ar.c (main): Fix so "ar -V" works. + +Thu Oct 1 22:44:45 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: now uses the cpu-vendor-os triple instead of + nested cases. + +Fri Sep 25 22:41:08 1992 John Gilmore (gnu@cygnus.com) + + * i960-pinsn.c: Change bzero to memset. + * sparc-pinsn.c: Change index to strchr. + +Mon Sep 21 14:39:56 1992 Ian Lance Taylor (ian@cygnus.com) + + * m68k-pinsn (print_insn_arg, fetch_arg): added support for + operands to memory management instructions, from WRS. + +Tue Sep 15 15:26:38 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in (install): if $(tooldir) exists, install nm and + strip in $(tooldir)/bin. + +Thu Sep 3 11:57:40 1992 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in: Let's call it version 2.0. + +Wed Sep 2 00:25:13 1992 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in: Bump to version 0.98. + * TODO, README: Minor updates. + + * Makefile.in: Added mostlyclean, distclean rules, + and cleaned up clean, realclean. + +Sun Aug 30 21:18:59 1992 Ian Lance Taylor (ian@cygnus.com) + + * Makefile.in: map program names through program_transform_name + when installing. + +Sun Aug 30 18:09:03 1992 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in: Bump to versions 1.97.90. + * cplus-dem.c: Removed. Was nowhere used - and if some + programs are changed to to demangling should now use the + versions in libiberty. + +Thu Aug 27 12:58:09 1992 Brendan Kehoe (brendan@cygnus.com) + + * configure.in: add we32k + +Mon Aug 24 14:53:42 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * ar.c (map_over_members): if the element of the archive has a + null name, fill it in. + + * nm.c (do_one_rel_file): only warn if a bfd's flags say there + will be symbols and there aren't any. + +Wed Aug 19 11:20:25 1992 Ian Lance Taylor (ian@cygnus.com) + + * m68k-pinsn.c: handle new operand type 'r', introduced for cas2. + +Tue Aug 18 20:45:48 1992 Rob Savoye (rob@cygnus.com) + + * nm.c objdump.c: Added support for a +version (-V) + to print the version number. + + * ar.c, copy.c: Added support for a -V option to print + the version number. + +Tue Aug 18 13:28:44 1992 Ian Lance Taylor (ian@cygnus.com) + + * config/mh-apollo68v: removed -g from CC definition. + + * Makefile.in: always create installation directories. + +Mon Aug 17 18:33:41 1992 Per Bothner (bothner@rtl.cygnus.com) + + * m68k-pinsn.c: Minor fix in style of output (don't use + range to indicate floating point control registers). + +Tue Aug 11 23:42:21 1992 Per Bothner (bothner@cygnus.com) + + * ar.c (main): Don't *always* set the verbose flag! + +Wed Aug 5 11:25:27 1992 Per Bothner (bothner@rtl.cygnus.com) + + * copy.c: When is_strip (because it is invoked as the strip + program), follow traditional argv processing: + 'strip file1 file2' now strips file1 and file2, rather + than stripping file1 (as input), leaving output in file2. + +Mon Jul 27 16:28:08 1992 Per Bothner (bothner@rtl.cygnus.com) + + * objdump.c (display_info, display_info_table): Call + bfd_set_format() on dummy bfd before using it (twice). + * ar.c: Make sure archive is created on command 'r' + even when no elements are inserted. (Clean up and + simplify some non-working related code.) + +Mon Jul 20 02:48:38 1992 D. V. Henkel-Wallace (gumby@cygnus.com) + + * configure.in: hppa support doesn't assume hp OS (from sef). + +Sat Jul 18 14:35:22 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * configure.in: recognize hppa hosts (bsd & hpux), error messages + to stderr, not stdout + +Fri Jul 17 18:39:44 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * ar.1, binutils.texi, i960-pinsn.c, nm.1, objdump.1, ranlib.1, + size.1, sparc-pinsn.c, strip.1: removed rcsid's. + +Thu Jul 16 16:55:24 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.dos: removed rcsid. + +Thu Jul 16 08:23:07 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * objdump.c (display_bfd): print state of BFD_IS_RELAXABLE too + +Tue Jun 30 20:26:15 1992 D. V. Henkel-Wallace (gumby@cygnus.com) + + * Makefile.in: Add program_suffix (parallel to program_prefix) + +Thu Jun 25 04:52:45 1992 John Gilmore (gnu at cygnus.com) + + * nm.c (sorters): Lint. Remove excess whitespace. + +Wed Jun 24 13:48:07 1992 Per Bothner (bothner@cygnus.com) + + * nm.c (valueof macro): Add missing parentheses. + (Their lack screwed up numeric_forward().) + +Sun Jun 14 10:33:27 1992 John Gilmore (gnu at cygnus.com) + + * objdump.c (dump_elf_stabs): Also dump .stab.index and + .stab.excl sections. + (dump_elf_stabs_1): Split out main body of old dump_elf_stabs. + * objdump.1, binutils.texi: Document new sections dumped. + +Fri Jun 12 22:23:35 1992 John Gilmore (gnu at cygnus.com) + + * size.c, objdump.c, bucomm.c: Lint. + +Thu Jun 11 01:19:06 1992 John Gilmore (gnu at cygnus.com) + + * objdump.c (dump_elf_stabs): New feature: --stabs prints out a + .stab section from an ELF file. Installed under #ifdef + ELF_STAB_DISPLAY so it can be easily disabled, since it requires + bfd-internals header files and such. + * objdump.1, binutils.texi: Update for --stabs. Also fix + objdump's doc to use -- rather than + for long options. + (FIXME: Not yet fixed everywhere in binutils.texinfo.) + +Wed Jun 10 07:53:24 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * objdump.c(display_info), patches from + mohring@informatik.tu-muenchen.de to print the table much more + nicely. + +Thu May 28 13:36:16 1992 Per Bothner (bothner@rtl.cygnus.com) + + * objdump.c: Add another enum->int cast, for the sake of + old compilers (such as PCC). + +Wed May 27 13:01:44 1992 Per Bothner (bothner@rtl.cygnus.com) + + * arlex.l: Don't include (unneeded conflicts). + Add declaration of strdup(). + +Fri May 22 13:40:37 1992 Per Bothner (bothner@cygnus.com) + + * Makefile.in: Use srcdir instead of VPATH in ldgram/ldlex + rules, since these are used when building a distribution. + * Makefile.in (arlex.c): Don't re-direct output, since that + leaves a bogus output files if it fails. + + * arlex.l: Make work with lex, for what it's worth. + * Makefile.in: Better lex support. + * Makefile.in (dist): Generate flex and bison outputs + for distribution. + +Thu May 14 17:17:59 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in: get BISON definition right. + +Fri May 8 07:47:08 1992 K. Richard Pixley (rich@cygnus.com) + + * sanity.sh: default TMPDIR to ".". + +Thu May 7 12:34:50 1992 Roland H. Pesch (pesch@fowanton.cygnus.com) + + * binutils.texi: add doc for ar command language. + +Wed May 6 18:05:36 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * arparse.y: make END call ar_end + * arsup.c (ar_end): added, deletes temp file if archive session + aborted. + + +Wed May 6 11:08:53 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in: use bison & flex from ../ if they exist. Also, + FLEX->LEX. + + * sanity.sh: remove temporary directory when finished. + +Tue May 5 12:00:58 1992 Per Bothner (bothner@rtl.cygnus.com) + + * Makefile.in: Bump to version 1.97. + * ar.c: Declare errno for machines that need it. + +Mon May 4 23:29:51 1992 John Gilmore (gnu@cygnus.com) + + * objdump.c (display_info): Handle error cases without coredump. + Close the dummy temporary file we open in the loop. + * Makefile.in (arsup.o): Add kludge to build with Sun Make. + +Fri May 1 16:20:23 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: added test-install target. + + * sanity.sh: new file. + + * Makefile.in: use sanity test on make check. + +Tue Apr 21 13:38:37 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: rework CFLAGS so that they can be passed on the + command line to make. Remove MINUS_G. Default CFLAGS to -g. + +Wed Apr 15 14:33:07 1992 Steve Chamberlain (sac@thepub.cygnus.com) + + * arsup.c, arsup.h, arparse.y, arlex.l: support for archive + scripting language. + +Fri Mar 6 21:54:53 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: added check target. + +Thu Mar 5 21:35:49 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in: added clean-info target. + +Tue Mar 3 15:36:37 1992 K. Richard Pixley (rich@rtl.cygnus.com) + + * Makefile.in: remove $(COPY_PROG) from PROGS. It shouldn't be + installed. added tooldir and program_prefix. + +Wed Feb 26 18:04:40 1992 K. Richard Pixley (rich@cygnus.com) + + * Makefile.in, configure.in: removed traces of namesubdir, + -subdirs, $(subdir), $(unsubdir), some rcs triggers. Forced + copyrights to '92, changed some from Cygnus to FSF. + +Sun Feb 16 12:53:02 1992 Per Bothner (bothner at cygnus.com) + + * Makefile.in: Bump version to 1.96, and remove -beta + suffix from distribution name. + * m68k-pinsn.c: New macro COERCE_SIGNED_CHAR to extract + the signed value of a character (even if chars are unsigned). + * sparc-pinsn.c: Add new operand types. + +Thu Feb 6 12:14:19 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + * objdump.c (disassemble_data): don't print a section's contents + if it's not loadable (eg bss) + +Tue Jan 28 11:11:06 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + * m68k-pinsn.c (print_insn_arg): fixed so that -ve branch + displacements don't get printed as large +ve ones. + +Fri Jan 24 14:47:53 1992 Steve Chamberlain (sac at rtl.cygnus.com) + + * copy.c, nm.c, objdump.c, size.c : changed to use the + new reloc scheme. + + +Mon Dec 30 18:34:41 1991 Per Bothner (bothner at cygnus.com) + + * bucomm.c (print_arelt_descr): Tweek the output format + so that 'ar tv' output follows Posix 1003.2/D11. + Output is now also identical to Sun's (except __.SYMDEF). + +Mon Dec 30 06:09:53 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Make `make' output more readable. + +Wed Dec 18 15:04:45 1991 Per Bothner (bothner at cygnus.com) + + * Makefile.in: Bump to version 1.94. + +Wed Dec 11 16:48:09 1991 Steve Chamberlain (sac at cygnus.com) + + * ar.c: added "b" to fopens for dos + * configdj.bat, makefile.dos new files from DJ + +Tue Dec 10 04:07:26 1991 K. Richard Pixley (rich at rtl.cygnus.com) + + * Makefile.in: infodir belongs in datadir. + +Sat Dec 7 17:09:37 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + * bucomm.h: created to hold prototypes of bucomm.c + * objdump.h: created to hold prototyes of objdump.c + * am29k-pinsn.c: include objdump.h + * ar.c: include bucomm.h, get ar.h from the right place and + include libbfd.h + * bucomm.c: defunize bfd_fatal + * copy.c: include bucomm.h, lint. + * i960-pinsn.h: include bucomm.h + * m68k-pinsn.h: lint + * nm.c: include bucomm.h, lint + * objdump.c: lint + * sparc-pinsn.c: include objdump.h + + + +Fri Dec 6 23:02:14 1991 K. Richard Pixley (rich at rtl.cygnus.com) + + * Makefile.in: added standards.text support. install using + INSTALL_PROGRAM and INSTALL_DATA. + + * configure.in: configure now does all of it's work from objdir so + make file existence tests against ${srcdir}. + +Thu Dec 5 22:46:22 1991 K. Richard Pixley (rich at rtl.cygnus.com) + + * Makefile.in: idestdir and ddestdir go away. Added copyrights + and shift gpl to v2. Added ChangeLog if it didn't exist. docdir + and mandir now keyed off datadir by default. + +Wed Dec 4 22:42:03 1991 Per Bothner (bothner at cygnus.com) + + * Makefile.in: Bump to version 1.93. + * Makefile.in: Add make-strip.o:maybe-strip.c dependency + for make versions that provide half-baked VPATH-support (e.g. Sun's). + * size.c: Improvements suggested by + "david d [zoo] zuhn" : + - Don't emit (Berkeley) headers if no files were found. + - Return a non-zero return code on failure. + +Sat Nov 30 21:34:19 1991 Steve Chamberlain (sac at rtl.cygnus.com) + + Changes due to include file renaming: + * am29k-pinsn.c: a29k-opcode.h -> opcode/a29k.h + * sparc-pinsn.c: sparc-opcode.h -> opcode/sparc.h + * m68k-pinsn.c: m68k-opcode.h -> opcode/m68k.h + * nm.c: stab.gnu.h -> aout/stab_gnu.h + +Tue Nov 19 19:20:43 1991 Per Bothner (bothner at cygnus.com) + + * README: Mention MINIMIZE flag for bfd's make. + +Mon Nov 18 12:05:37 1991 Per Bothner (bothner at cygnus.com) + + * README: Various improvements. + +Sun Nov 17 23:40:59 1991 Per Bothner (bothner at cygnus.com) + + * Makefile.in: Bump to version 1.92. + * version.c, Makefile.in: Get version string from Makefile. + * copy.c, is-strip.c, not-strip.c, maybe-strip.c, Makefile.in: + Make the same change that we earlier did for ar/ranlib: + Generate two different binaries for strip and copy and use + a global variable with different values to distinguish + ostrip from copy. (-1 means to use argv[0] to decide, + so you can get the old behavior, but it is no longer the default). + * copy.c (copy_file): Set EXEC_P of output bfd if input is so. + * copy.c (main): If is_strip==-1, compare last 5 chars + of argv[0], not the whole path. + * copy.c (main): Return 0, not 1. + * copy.c (setup_sections): Fix due to change in bfd_make_section + now failing if asked for a duplicate section. + * strip.c, ostrip.c: Removed obsolete files. + * ar.c, not-ranlib.c, maybe-ranlib.c: + Change encoding of is_ranlib variable to be consistent + with is_strip for strip.copy (i.e -1 to means use argv[0]). + +Thu Nov 14 20:11:02 1991 Per Bothner (bothner at cygnus.com) + + * version.c (program_version): Update to version 1.92. + +Tue Nov 12 16:17:53 1991 Per Bothner (bothner at cygnus.com) + + * ar.c (get_pos_bfd): Previous fix was missing a "break". + +Thu Nov 7 08:55:56 1991 Steve Chamberlain (sac at cygnus.com) + + * am29k-pinsn.c: Fixed bug in mtacc, dmac and fmac instruction + encodings. (Thaks to David Wood) + +Sun Nov 3 14:50:23 1991 Per Bothner (bothner at cygnus.com) + + * Makefile.in ($(DIST_NAME).tar.Z), TODO: Various fixes. + * ar.c (get_pos_bfd): Fix to handling of before/after + positioning options. + * bucomm.c (fatal): MISSING_VFPRINTF is no longer an issue, + since libiberty contains vfprintf etc if otherwise missing. + * m68k-pinsn.c (print_insn_arg): Support BB/BW/BL + type operands, as used by branch instructions. + * nm.c: Delegate printing of symbols to BFD, + by using bfd_print_symbol to do the formatting. + +Mon Oct 28 11:20:47 1991 Steve Chamberlain (steve at cygnus.com) + + * ar.c (write_archive.c): added unlink before rename since some + systems can't rename onto an existant file. + +Mon Oct 21 09:47:23 1991 Steve Chamberlain (steve at rtl.cygnus.com) + + * nm.c: now doesn't crash if a symbol with no section and no + SEC_ABS appears. + +Thu Oct 17 15:25:50 1991 Per Bothner (bothner at cygnus.com) + + * Makefile.in, version.c: Bump to version 1.91. + +Wed Oct 16 11:45:36 1991 Per Bothner (bothner at cygnus.com) + + * Makefile.in, ar.c, bucomm.c, copy.c, cplus-dem.c, filemode.c, + i960-pinsn.c, m68k-pinsn.c, nm.c, objdump.c, size.c, sparc-pinsn.c, + * strip.c: Add or update Copyright notice. + * TODO: Add note on 'nm -a'. + * version.c: Update version number to 1.90. + * Makefile.in: Fix making of documentation for dist. + +Tue Oct 15 00:17:17 1991 Per Bothner (bothner at cygnus.com) + + * README: New file. + * Makefile.in: New kludgy rules for making a tarfile. + * Makefile.in: Fix bindir path. + +Mon Oct 14 17:34:29 1991 Roland H. Pesch (pesch at cygnus.com) + + * Makefile.in: add targets binutils.mm, binutils.me + +Fri Oct 11 22:44:21 1991 John Gilmore (gnu at cygnus.com) + + * Makefile.in: Avoid Sun Make VPATH bugs by adding dependencies. + +Fri Oct 11 12:51:33 1991 Roland H. Pesch (pesch at cygnus.com) + + * Makefile.in: add target "binutils.ms" + + * binutils.texinfo: minor restructuring for texi2roff comfort. + +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() + get defined first. + * Makefile.in: Use -I. to get sysdep.h. + +Wed Oct 9 22:42:56 1991 Per Bothner (bothner at cygnus.com) + + * nm.c (print_symbols): Handle NULL name field of symbol. + * Makefile.in: Removed spurious comment. + +Tue Oct 8 16:55:03 1991 Roland H. Pesch (pesch at cygnus.com) + + * binutils.texinfo: minor typos, phrasing, formatting fixes. + +Tue Oct 8 15:13:20 1991 Per Bothner (bothner at cygnus.com) + + * configure.in: Get host file from ../bfd/config, not config. + * config/*: Remove config directory and its files. + +Tue Oct 8 13:58:59 1991 Roland H. Pesch (pesch at cygnus.com) + + * Makefile.in: new targets binutils.dvi, binutils.info + + * binutils.texinfo: remove most remaining FIXME's, delete + references to __.SYMDEF by name + + +Tue Oct 8 10:23:44 1991 Steve Chamberlain (steve at cygnus.com) + + * objdump.c (print_address) Print addresses nicely. + +Mon Oct 7 11:31:05 1991 Per Bothner (bothner at cygnus.com) + + * ar.c, Makefile.in, new files {is,not,maybe}-ranlib.c: + Make two different binaries for ar and ranlib, instead of + distinguishing them at run time using argv[0]. + (Old behavior is still available if you "make ar_with_ranlib", + but it is not the default.) + * ranlib.sh (new): An alternative one-line + shell implementation of ranlib. + +Fri Oct 4 21:49:44 1991 John Gilmore (gnu at cygnus.com) + + * objdump.c: Cope with renames of a few BFD types & enums. + +Fri Oct 4 19:08:09 1991 Roland H. Pesch (pesch at cygnus.com) + + * binutils.texinfo: add new file (rudimentary docn) + +Mon Sep 30 12:30:39 1991 Per Bothner (bothner at cygnus.com) + + * config/hmake-news: Add new file (for Sony NEWSOS3). + * bucomm.c (fatal): Conditionally compile fatal() depending on + MISSING_VFPRINTF, and don't confuse the issue with NO_VARARGS. + * objdump.c (dump_headers): Trivial output format change. + * objdump.c (display_info): Loop over integers, not enums, + to appease old compilers. + +Mon May 20 16:14:07 1991 Steve Chamberlain (steve at cygint.cygnus.com) + + *objdump.c *nm.c *copy.c: Changed some types to work with 64 bit + object files. + +Thu May 16 16:06:55 1991 Steve Chamberlain (steve at cygint.cygnus.com) + from bother + * objdump.c (print_address): Make disasembled output more + consistent with gdb and as: Add 0x when printing hex. + Don't print extra leading zeros. + Attempt to not print "filename.o". + * objdump.c: Add some enum-to-int casts to accomodate old compilers. + + +Fri May 3 22:21:44 1991 John Gilmore (gnu at cygint.cygnus.com) + + * copy.c: Change =& constructs to = &, since they confuse older + C compilers. + + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/gnu/dist/toolchain/binutils/ChangeLog-9899 b/gnu/dist/toolchain/binutils/ChangeLog-9899 new file mode 100644 index 000000000000..22f21e2f4faf --- /dev/null +++ b/gnu/dist/toolchain/binutils/ChangeLog-9899 @@ -0,0 +1,1908 @@ +1999-12-28 Nick Clifton + + * readelf.c: Update with new constants added by Oct 4, 1999 + ELF ABI draft. + (guess_is_rela): Add new machine codes, but leave + rel type undetermined. + (get_machine_name): Add new machine codes. + (get_section_type_name): Add new section types. + (get_elf_section_flags): New function: Decode section flags. + (process_section_headers): Call get_elf_section_flags() in + order to decode flags in section header. + (get_dynamic_flags): New function: Decode dynamic section + flags. + (process_dynamic_section): Display flags (if present). + (get_symbol_type): Add STT_COMMON. + (get_symbol_visibility): New function: Decode a symbol's + visibility. + (process_symbol_table): Call get_symbol_visibility(). + (get_note_type): Add NT_PRXFPREGS. + +1999-12-26 Ian Lance Taylor + + * strings.c (main): Correct handling of numeric argument. + +1999-12-23 Andrew Haley + + * dlltool.c (mtable): mcore how_jtab_roff is 4 bytes into the + jtab; was 8. + +1999-12-17 Nick Clifton + + * dlltool.c (mtable): Stop compile time warnings about missing + initialisers. + (yyerror): Stop compile time warnings about unused paramater. + (INIT_SEC_DATA): New macro: initialise an entry in the secdata + array. + (secdata): Stop ccompile time warnings about uninitialised + fields. + (dtab): Stop compile time warnings about unused parameter. + (long_options): Stop compile time warning about missing + initialiser. + +1999-12-10 Nick Clifton + + * readelf.c (print_vma): Support native 64bit ELF systems. + +1999-12-09 Nick Clifton + + * dlltool.c (mtable): Add epoc-arm specific entry. + Make default arm entry pass -mpacs-26 to assembler. + (flush_page): Do not mangle null entries. + +1999-12-07 H . J . Lu hjl@valinux.com + + * readelf.c: Fix compile time warnings. Support more than 999 + symbols. + +1999-12-03 Nick Clifton + + * readelf.c (enum print_mode): New type. + (print_vma): New function. + (dump_relocations): Use print_vma to display bfd_vma values. + (process_file_header): Use print_vma to display bfd_vma values. + (process_program_headers): Use print_vma to display bfd_vma values. + (process_section_headers): Use print_vma to display bfd_vma values. + (dynamic_segment_parisc_val): Use print_vma to display bfd_vma values. + (process_dynamic_segment): Use print_vma to display bfd_vma values. + (process_symbol_table): Use print_vma to display bfd_vma values. + (process_mips_specific): Use print_vma to display bfd_vma values. + +1999-11-25 Fred Fish + + * readelf.c (process_note): Change arg from Elf_External_Note + to Elf32_Internal_Note, which also turns the function body + into little more than a call to printf. + (process_corefile_note_segment): Substantially rewritten + to properly handle case where target and host are different + endianness, handle note sections with padding, and add some + cruft to handle notes with unterminated name data. + +1999-11-22 Nick Clifton + + * objcopy.c (copy_usage): Reformat. + (strip_usage): Reformat. + +1999-11-21 Nick Clifton + + * objdump.c (usage): Overhaul output: One line per switch. + Textual description of each switch. Distinguish between + optional switches and required switches. + (long_options): Add 'g', 'G' and 'z' short options. + (main): Distinguish between optional switches and required + switches. + + * binutils.texi: Add -g -G and -z short options for + --debugging, --stabs and --disassemble-zeroes. + +1999-11-03 Nick Clifton + + * dlltool.c (flush_page): Clip short values to prevent warnings + from the assembler. + Change default mcore machine name to 'mcore-le' and rename + big-endian version to 'mcore-be'. + +1999-10-27 Fred Fish + + * objdump.c (display_bfd): Break into two functions. The + actual dumping code moves to dump_bfd. If bfd is not + unambiguously recognized as a bfd_object, attempt to dump + it as a bfd_core. + (dump_bfd): New function. + +1999-10-26 Nick Clifton + + * dlltool.c (assemble_file): Remove spurious test of exp_name. + +1999-10-22 Nick Clifton + + * dlltool.c (struct mac): Add new field 'how_default_as_switches'. + (mtable): Initialise new field. Some machines have a non empty + string for this field. + (HOW_BFD_TARGET): Undefine and replace with... + (HOW_BFD_READ_TARGET): New macro: bfd target to use when opening a + file for reading. This is set to 0 so that any recognisable bfd + format can be read. + (HOW_BFD_WRITE_TARGET): New macro: bfd target to use when opening + a file for writing. This is set to the target machine type. + (ASM_SWITCHES): New macro: default switches to use when assembling + a file. + (assemble_file): New function: Assemble a source file into a + destination object file. + (gen_exp_file): Use assemble_file to create the exp file. + (make_one_lib_file): Use assemble_file to create the lib file. + Open output file use HOW_BFD_WRITE_TARGET and input files using + HOW_BFD_READ_TARGET. + (make_head): Use assemble_file to create the head file. + (make_tail): Use assemble_file to create the tail file. + (gen_lib_file): Open output file use HOW_BFD_WRITE_TARGET. + +1999-10-15 Ian Lance Taylor + + * ar.c (normalize): Fix full_pathname code. + +1999-10-08 Ben Elliston + + * binutils.texi: Some rewording and clarifications. + +1999-09-15 Ulrich Drepper + + * readelf.c (dynamic_segment_parisc_val): Print 0 for DLD_FLAGS if + the value is zero. + (process_symbol_table): Don't print histogram if hash table is empty. + +1999-09-15 Ulrich Drepper + + * readelf.c (get_parisc_dynamic_type): Handle DT_HP_GST_* values. + +1999-09-02 Ulrich Drepper + + * readelf.c (get_symbol_type): Add support for HPUX and PARISC + specific symbol types. + + * readelf.c: Add HPUX and PARISC extensions to dynamic and program + header table printing. + + * readelf.c (get_machine_flags): Add handling of PARISC. + +1999-09-29 Mumit Khan + + * dlltool.c (scan_drectve_symbols): Handle type tags in exported + symbols. + (scan_filtered_symbols): Likewise. + +1999-09-19 Ian Lance Taylor + + * resrc.c (write_rc_rcdata): Fix local variable shadowing + problem. If RCDATA_BUFFER data can be read as strings, modify + code to print the strings as comments. + * resres.c: Add casts to avoid warnings. + (write_res_data, read_res_data): Don't put the program name in the + error message; fatal already puts it there. + +1999-09-14 Michael Meissner + + * configure.in (Canonicalization of target names): Remove adding + ${CONFIG_SHELL} in front of $ac_config_sub, since autoconfig 2.14 + generates $ac_config_sub with a ${CONFIG_SHELL} already. + * configure: Regenerate. + +1999-09-12 Ian Lance Taylor + + * ar.c (main): Clear output_file if we don't change the archive. + (delete_members, replace_members): Likewise. + +1999-09-12 Donn Terry + + * objdump.c (dump_headers): If wide_output, print Flags header. + + * objdump.c (dump_section_header): Print any comdat information. + + * objcopy.c (parse_flags): Handle "noload", "debug", and "share". + * binutils.texi, objcopy.1: Document new flags. + + * ar.c (counted_name_mode): New static variable. + (counted_name_counter): New static variable. + (map_over_members): Handle counted mode. + (usage): Mention N modifier. + (main): Handle N modifier. + (delete_members): Handle counted mode. + * binutils.texi, ar.1: Document N modifier. + + * ar.c (print_contents): Change printing of member name for + POSIX.2 conformance. + + * ar.c (output_filename): Make const. + (open_inarch): If creating a new empty archive, set + output_filename. + +1999-09-12 Ian Lance Taylor + + * ar.c (full_pathname): New static variable. + (map_over_members): Call normalize on command line parameter. + (usage): Mention P modifier. + (normalize): If full_pathname is true, don't do anything. + (main): Accept P modifier. + (delete_members): Call normalize on command line parameter. + * binutils.texi, ar.1: Document P modifier. + +1999-09-09 Andreas Schwab + + * binutils.texi: Add info dir entries for all programs described + here. Fix arguments of @var to not contain punctuation. + +1999-09-06 Donn Terry + + * nm.c (print_symbol_info_bsd): Check for 'w' as well as 'U'. + (print_symbol_info_sysv): Likewise. + (print_symbol_info_posix): Likewise. + +1999-09-04 Steve Chamberlain + + * readelf.c: Include "elf/pj.h". + (dump_relocations): Handle EM_PJ. + (get_machine_name): Likewise. + (get_machine_flags): Likewise. + +1999-08-31 Scott Bambrough + + * readelf.c (get_note_type): New function: Decode the e_type + value of a note. + (process_note): New function: Display the contents of a core note. + (process_corefile_note_segment): New function. + (process_corefile_note_segments): New function. + (process_corefile_contents): New function. + (process_file): Add call to process_corefile_contents. + (parse_args): Add parsing of -n/--notes command line switch. + (usage): Document new command line switch. + + * binutils.texi: Documemnt new command line switch to readelf. + +1999-08-31 Ian Lance Taylor + + * binutils.texi (Bug Reporting): Clarify that large files should + not be sent to bug-gnu-utils. + +1999-08-28 Stephane Carrez + + * readelf.c (process_extended_line_op): New parameter pointer_size, + read the address according to pointer_size. + (debug_line_pointer_size): New global to indicate the + size of address in .debug_line section. + (debug_displays, prescan_debug_info): Prescan the .debug_info section + to record the size of address in `debug_line_pointer_size'. + (process_section_contents): Before dumping any section, execute + the pre-scan operation defined for some debug sections. + +1999-08-27 Jim Wilson + + * readelf.c (display_debug_lines): Use i-1 not i in standard_opcodes + access. + (display_debug_aranges): New local excess. Use for calculating padding + and add that into ranges. Break from loop only if length is also 0. + +1999-08-27 Jim Wilson + + * readelf.c (display_debug_lines, case DW_LNS_const_add_pc): Multiply + adv by info.li_min_insn_length. + +1999-08-26 Jakub Jelinek + + * readelf.c (get_sparc64_dynamic_type): New function. + (get_dynamic_type): Use it. + +1999-08-26 Jim Wilson + + * readelf.c (display_debug_lines, case default): Change second line + setting adv to use = not +=. + +1999-08-19 Nick Clifton + + * dlltool.c: Added more examples to the comment at the start. + +1999-08-18 Nick Clifton + + * dlltool.c (make_head): Only emit interworking directive if + necessary. + +Thu Jul 15 22:44:21 1999 Hans-Peter Nilsson + + * readelf.c (process_abbrev_section): Handle standard-conforming + single zero at the end of the section. + +1999-08-09 Ian Lance Taylor + + * objdump.c (exit_status): New static variable. + (nonfatal): New static function. + (disassemble_data): Set exit_status on error. + (read_section_stabs): Likewise. + (display_bfd): Likewise. Call nonfatal rather than bfd_nonfatal. + (display_file): Call nonfatal rather than bfd_nonfatal. + (display_target_list, display_info_table): Likewise. + (main): Return exit_status rather than 0. + +1999-08-08 Ian Lance Taylor + + * objdump.c (dump_section_header): Update for renaming of + SEC_SHORT to SEC_SMALL_DATA. Print SEC_SHARED flag. + + From Eli Zaretskii : + * binutils.texi: Document cxxfilt as MS-DOS name for c++filt. + + * configure.in: Define and substitute DEMANGLER_NAME. + * Makefile.am (DEMANGLER_PROG): Set to cxxfilt. + (man_MANS): Use DEMANGLER_NAME rather than DEMANGLER_PROG. + (bin_PROGRAMS): Remove $(DEMANGLER_PROG). + (noinst_PROGRAMS): Add $(DEMANGLER_PROG). + (cxxfilt_SOURCES): Rename from c__filt_SOURCES. + (cxxfilt_LDADD): Rename from c__filt_LDADD. + ($(DEMANGLER_NAME).1): Rename from $(DEMANGLER_PROG).1. Use + DEMANGLER_NAME rather than DEMANGLER_PROG in substitution. + (MOSTLYCLEANFILES): Use DEMANGLER_NAME rather than + DEMANGLER_PROG. + (install-exec-local): When installing noinst_PROGRAMS, change + cxxfilt to $(DEMANGLER_NAME). + * configure, Makefile.in: Rebuild. + + * Makefile.am: Rename .dep* files to DEP*. Change DEP variable to + MKDEP. + * Makefile.in: Rebuild. + +1999-08-05 Donn Terry + + * Makefile.am (YACC): If bison is not in the source tree, use + @YACC@ rather than bison -y. + (LEX): If flex is not in the source tree, use @LEX@ rather than + flex. + * configure.in: Build dlltool for i[3-6]86-*-interix. + * Makefile.in, configure: Rebuild. + +1999-07-21 Ian Lance Taylor + + From Mark Elbrecht: + * configure.bat: Remove; obsolete. + +1999-07-16 Jakub Jelinek + + * readelf.c (get_machine_flags): Print EF_SPARC_SUN_US3. + +1999-07-15 Ian Lance Taylor + + * configure.in: Bump version number to 2.9.5. + * configure: Rebuild. + +1999-07-14 Richard Henderson + + * objdump.c (dump_section_header): Print SEC_SHORT. + +1999-07-11 Ian Lance Taylor + + * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED + as appropriate. Add variable initializations. Add casts. + * objdump.c (disassemble_bytes): Change j to bfd_vma. + * readelf.c (process_syminfo): Change i to unsigned int. + (display_debug_info): Change abbrev_number to unsigned long. + (process_mips_specific): Change fcnt to size_t. + +1999-07-09 Nick Clifton + + * readelf.c: Only support decoding 64bit ELF files if the compiler + supports a 64 bit data type. + Add -I equivalent for --histogram. + Add -A command-line option to display architecture specific information. + +1999-07-08 Jakub Jelinek + + * readelf.c (guess_is_rela): Sparcv9 and v8plus use rela. + (dump_relocations): Use ELF64_R_TYPE_ID for Sparc, for R_SPARC_OLO10 + print the secondary addend. + (get_machine_flags): Print Sparc machine flags. + (get_symbol_type): Print STT_REGISTER. + +1999-07-08 Ian Lance Taylor + + * stabs.c (parse_stab_type): Fix handling of template names with + template parameters containing `::'. + (stab_demangle_type): Handle a qualified name in a pointer to + member. + +1999-06-23 Ian Lance Taylor + + * Makefile.am (dlltool_SOURCES): Add dyn-string.c. + * Makefile.in: Rebuild. + +1999-06-23 Mumit Khan + + * configure.in (HAVE_EXECUTABLE_SUFFIX): Define. + * dlltool.c (look_for_prog): Use HAVE_EXECUTABLE_SUFFIX. + * dllwrap.c (look_for_prog): Likewise. + * resrc.c (look_for_default): Likewise. + * configure, config.in: Rebuild. + +1999-06-22 Ian Lance Taylor + + Based on patches from Mumit Khan : + * configure.in: Define EXECUTABLE_SUFFIX. + * dlltool.c: Include "dyn-string.h". Include based on + ANSI_PROTOTYPES, not __STDC__. + (outfile): Remove. + (gen_exp_file): Change uses of outfile to use alloca. + (make_one_lib_file, make_head, make_tail): Likewise. + (gen_lib_file): Likewise. + (look_for_prog): New static function. + (deduce_name): Rewrite to use look_for_prog. + (mcore_elf_gen_out_file): Use dyn_string_t rather than outfile. + * dllwrap.c: Don't include , , , + , or . Include and either + or . + (driver_name): Initialize to NULL, not "gcc". + (dlltool_name): Initialize to NULL, not "dlltool". + (display, inform, look_for_prog, deduce_name): New static + functions. + (usage): Mention -mno-cygwin. + (OPTION_MNO_CYGWIN): Define. + (main): Handle -mno-cygwin. Deduce driver_name and dlltool_name. + * resrc.c (look_for_default): Make static. Remove unused local + path. Check using EXECUTABLE_SUFFIX. + (read_rc_file): Allocate enough space to hold EXECUTABLE_SUFFIX. + * Makefile.am: Rebuild dependencies. + (dllwrap_LDADD): Add $(INTLLIBS). + * configure, Makefile.in, config.in: Rebuild. + +Mon Jun 21 16:49:11 1999 Jeffrey A Law (law@cygnus.com) + + * readelf.c (dump_relocations): Use elf_hppa_reloc_type instead of + elf32_hppa_reloc_type. + +1999-06-17 Nick Clifton + + * dlltool.c (mcore_elf_gen_out_file): Link object files with the + .exp file, not the .lib file. + +Fri Jun 18 20:17:51 1999 Mumit Khan + + * deflex.l: Accept single-character symbol names. + +1999-06-16 Nick Clifton + + * readelf.c (get_symbol_type): Detect ARM symbols typed as Thumb + functions. + +1999-06-14 Nick Clifton + + * objdump.c (disassembler_options): New variable. + (usage): Document new -M/--disassembler-options option. + (long_options): Add --disassembler-options. + (disassemble_data): Initialise disassembler_options field of + disassembler_info structure. + (main): Add parsing of -M option. + + * binutils.texi: Document new command line switch to objdump. + + * NEWS: Describe new command line switch to objdump. + + +Mon Jun 14 10:27:54 1999 Andreas Schwab + + * binutils.texi: Fix typos. + +1999-06-13 Ian Lance Taylor + + * objdump.c (disassemble_bytes): If the disassembler returns an + error, print out anything it may have printed to the buffer. From + H.J. Lu . + + * defparse.y (explist): Remove separate expline to eliminate + shift/reduce conflict. + + From Kai-Uwe Rommel : + * defparse.y: Add tokens NONSHARED, SINGLE, MULTIPLE, + INITINSTANCE, INITGLOBAL, TERMINSTANCE, and TERMGLOBAL. + (command): Add option_list after LIBRARY. + (attr): Accept and ignore NONSHARED, SINGLE, and MULTIPLE. + (option_list, option): New nonterminals. + * deflex.l: Recognize NONSHARED, SINGLE, MULTIPLE, INITINSTANCE, + INITGLOBAL, TERMINSTANCE, and TERMGLOBAL. + +1999-06-12 Ian Lance Taylor + + * ar.c (O_BINARY): Define as 0 if not defined. + (ranlib_touch): Open file with O_BINARY. + + * rename.c (O_BINARY): Define as 0 if not defined. + (simple_copy): Open files with O_BINARY. + + Based on patch from H. Peter Anvin : + * objcopy.c (struct section_list): Add copy field. + (sections_copied): New static variable. + (copy_options): Add "only-section". + (copy_usage): Mention -j and --only-section. + (find_section_list): Initialize copy field. + (is_strip_section): Check for copying sections. + (copy_object): Check sections_copied when calling filter_symbols. + (setup_section): Check for copying sections. + (copy_section): Likewise. + (copy_main): Handle -j/--only-section. + * binutils.texi, objcopy.1: Document -j/--only-section. + + * configure.in: If frexp is not available, check in -lm. + * configure: Rebuild. + + * readelf.c (get_elf_class): Use correct printf format for type. + (get_data_encoding): Likewise. + (get_osabi_name): Likewise. + (process_file_header): Don't pass an extra argument to printf. + (process_dynamic_segment): Cast dynamic_size to long before + printing. + (decode_location_expression): Cast byte_get to long before + printing. + +Wed Jun 9 11:40:16 1999 Andreas Schwab + + * readelf.c (dump_section): Cast values from byte_get to + [unsigned] long for printing, in case it is wider than long. + (display_block): Likewise. + (read_and_display_attr): Likewise. + (decode_location_expression): Likewise. Don't depend on + evaluation order. + +Mon Jun 7 12:14:57 1999 Andreas Schwab + + * windres.c (usage): Fix typo. + +1999-06-04 Nick Clifton + + * readelf.c: Use 64bit wide fields in internal strcutures even if + targetting a 32bit architecture. + (dump_relocations): Take a new parameter - the number of symbols + in the symbol table. + +1999-06-04 Nick Clifton + + * readelf.c: Add support for 64bit ELF files. + +1999-06-03 Nick Clifton + + * dlltool.c (mcore_elf_gen_out_file): Use constants for temporary + file names. + +Wed Jun 2 12:34:36 1999 Richard Henderson + + * dlltool.c (gen_exp_file): Revert 19990411 change. + +Mon May 31 09:56:22 1999 Andreas Schwab + + * readelf.c (process_relocs): Determine type of reloc from + DT_PLTREL and from section type. + +1999-05-29 Nick Clifton + + * readelf.c (get_elf_class): Display unknown class number. + (get_data_encoding): Display unknown encoding number. + (get_osabi_name): Display unknown ABI number. + (process_file_header): Display unknown version number. + +1999-05-29 Nick Clifton + + * readelf.c (dump_relocations): Fix typo. + +1999-05-28 Nick Clifton + + * readelf.c (dump_relocations): Add extra parameter: is_rela to + specify the kind of relocations to be dumped. Call guess_is_rela + if this parameter has a value of UNKNOWN. + (guess_is_rela): New function: Guess the kind of reloc being used + baced on the machine number. + (process_relocs): Determine type of reloc before calling + dump_relocations. + +1999-05-28 Ian Lance Taylor + + * readelf.c: Include "elf/i960.h". + (dump_relocations): Handle EM_960. + +Thu May 27 11:58:33 1999 Andreas Schwab + + * objcopy.c (copy_archive): Preserve dates of archive members if + requested. + + * readelf.c (dump_relocations): Always print the addend on RELA + systems even if there is no symbol. + (process_program_headers): Reset dynamic_size before looping + through the program headers. + (process_version_sections): Cast sh_offset to unsigned long for + printing in case bfd_vma is wider. + (process_symbol_table): Use get_symbol_index_type when printing + st_shndx. + +1999-05-17 DJ Delorie + + * windres.c: add verbose option + (main): process verbose option + * resrc.c (look_for_default): new. Look for the default + preprocessor in a given location. + (read_rc_file): for foo/bar-windres, look for foo/bar-gcc, + foo/gcc (in case of foo/windres), and then gcc (the old default). + +1999-05-16 Nick Clifton + + * dlltool.c (deduce_name): New function: Deduce name of program to + run. + (mcore_elf_out_file): New variable: Name of mcore-elf output file. + (mcore_elf_linker): New variable: Name of linker to use. + (mcore_elf_linker_flags): New variable: Linker flags to pass. + (scan_obj_file): Cache filenames if necessary. + (usage): Document new command line options. + (main): Support new command line options: -M (generate an + mcore-elf output file) -L (name of linker to use) -F (flags to + pass to linker). + (mcore_elf_cache_filename): Store a filename in a cache. + (mcore_elf_gen_out_file): New function: Generate an output file + per the mcore-elf spec. + +1999-05-15 Nick Clifton + + * configure.in (BUILD_MISC): Build dlltool for mcore + * configure: Regenerate. + * dlltool.c: Update example in comment. + (DLLTOOL_MCORE): Define. + (DLLTOOL_MCORE_ELF): Define. + (DRECTVE_SECTION_NAME): Define. + (mcore_be_jtab, mcore_le_jtab): Binary for performing an mcore + jump to address. + (mtable): Add entries for mcore variants. + (rvaafter, rvabefore, asm_prefix): Add mcore suppport. + (scan_drectve_symbols): Use DRECTVE_SECTION_NAME. + (make_head, make_tail): Cope if file cannot be created. + (usage): Improve layout. + +1999-05-13 DJ Delorie + + * rclex.l: add code to suppress certain output from cpp, replace + all returns with MAYBE_RETURN + (MAYBE_RETURN): new, implement the suppression by returning + IGNORED_TOKEN as needed. + (cpp_line): remember which file we're in, mark data from included + *.h files for suppression. + * rcparse.y (input): allow IGNORED_TOKEN outside of known constructs + +1999-05-10 DJ Delorie + + * windres.c (quot): Quote shell metacharacters in a string + (main): quote parameters to cpp that might have metacharacters in + them. Allow -D as an alias for --define to allow for sharing make + macros with gcc. + + * objdump.c (dump_reloc_set): don't core if howto->name is NULL + + * Makefile.am: Give rescoff.c a cpu-specific -D so it can set + the correct BFD. + * Makefile.in: ditto + * rescoff.c (write_coff_file): Set the correct BFD + +1999-05-06 Ian Lance Taylor + + * rename.c (smart_rename): Fix test of whether file exists. + +1999-05-06 Nick Clifton + + * objdump.c (disassemble_data): Set display_endian based on target + endianism. + +1999-05-05 Catherine Moore + + * dlltool.c (interwork): Remove. + (arm_interwork_jtab): Use bx insn. + (thumb_jtab): Likewise. + (MARM_INTERWORK): New machine type. + (rvaafter): Handle it. + (rvabefore) Likewise. + (asm_prefix): Likewise. + (gen_exp_type): Check machine type instead of + interwork flag. + (make_one_lib_file): Likewise. + (make_head): Likewise. + (make_tail): Likewise. + (usage): Update machine types. + (main): Remove -interwork support. + +1999-05-05 Catherine Moore + + * readelf.c (get_machine_flags): Check for EF_CPU32. + (get_data_encoding): Fix typo. + +1999-04-26 Tom Tromey + + * aclocal.m4, configure: Updated for new version of libtool. + +1999-04-18 Ian Lance Taylor + + * stabs.c (parse_stab_range_type): Correct parenthesization in + BFD64 case. + + * readelf.c (get_section_type_name): Use correct types in printf + formats. + (process_relocs): Likewise. + (process_dynamic_segment): Likewise. + (process_symbol_table): Likewise. + (process_mips_specific): Likewise. + +Tue Apr 13 21:22:00 1999 Catherine Moore + + * dlltool.c (make_one_lib_file): Mark thumb functions as + C_THUMBEXTFUNC. + +1999-04-11 Richard Henderson + + * bucomm.h (environ): Declare it, if needed. + (alloca) [C_ALLOCA]: Don't use gcc's builtin or . + * configure.in (environ): Detect declaration. + * nm.c (main): Don't declare environ. + * configure, config.in: Rebuild. + + * dlltool.c (gen_exp_file): Pad out the .reloc section to a + 32-byte boundary with dummy relocations, to make the BeOS loader + happy. Patch from Bob Manson . + +1999-04-08 Tom Tromey + + * binutils.texi (c++filt): Updated for -j/--java, and hp/edg + formats. + +1999-04-08 Nick Clifton + + * readelf.c: Add ability to decode new constants found in April 25 + 1998 Draft of System V ABI spec. + +1999-04-06 Ian Lance Taylor + + * bucomm.h (LC_MESSAGES): Never define. + * addr2line.c (main): Don't pass LC_MESSAGES to setlocale if the + system does not define it. + * ar.c (main): Likewise. + * coffdump.c (main): Likewise. + * dlltool.c (main): Likewise. + * nlmconv.c (main): Likewise. + * nm.c (main): Likewise. + * objcopy.c (main): Likewise. + * objdump.c (main): Likewise. + * size.c (main): Likewise. + * srconv.c (main): Likewise. + * strings.c (main): Likewise. + * sysdump.c (main): Likewise. + * windres.c (main): Likewise. + * readelf.c (main): Call locale setting functions. + +1999-04-05 Nick Clifton + + * readelf.c (decode_location_expression): Fix DW_OP_const8{s|u} + decodes. + +1999-04-04 Ian Lance Taylor + + * rename.c: New file, copied out of objcopy.c with a few changes. + * bucomm.h (set_times, smart_rename): Declare. + * ar.c: Don't include . + (extract_file): Call set_times rather than utime. + (write_archive): Call smart_rename rather than unlink and rename. + * objcopy.c: Don't include . + (simple_copy, smart_rename, set_times): Move to rename.c. + (strip_main): Update smart_rename call for new parameter. + (copy_main): Likewise. + * Makefile.am: Rebuild dependencies. + (CFILES): Add rename.c. + (objcopy_SOURCES, strip_new_SOURCES): Add rename.c. + (ar_SOURCES, ranlib_SOURCES): Add rename.c. + * Makefile.in: Rebuild. + + * Makefile.am: Rebuild dependencies. + (EXTRA_PROGRAMS): Remove backslash which troubles current version + of automake. + * Makefile.in: Rebuild. + + * dllwrap.c (main): Expect correct type in format string. + * resres.c: Include "bfd.h", "bucomm.h", "libiberty.h", and + . Don't include and . + (write_res_file): Remove unused locals e and i. + (read_resource_entry): Remove unused locals rtype and n. + (read_unistring): Remove unused local n. + +1999-04-03 Ian Lance Taylor + + * arparse.y: Declare yylex. + * objdump.c (disassemble_bytes): Initialize bytes. Add comment + for incorrect use of bytes. + * readelf.c: Change many formats to avoid warnings. + +1999-04-01 Nick Clifton + + * readelf.c (reset_state_machine): New function. Resets the + registers of the source line number state machine. + (process_extended_line_op): Use state machine. + (display_debug_lines): Use state machine. Handle multiple line + number blocks within the same section. + +1999-03-29 Jason Merrill + + * readelf.c (process_extended_line_op): end_sequence also resets + the line number. + (display_debug_lines): advance_line takes a signed operand. + (read_and_display_attr): Print refs as <%x>, addresses as %#x, + others as %d. Handle other location expression attributes. + (display_debug_info): Handle nesting. Always print the offset. + +1999-03-23 Ian Lance Taylor + + * objcopy.c (filter_symbols): When checking whether to keep a + symbol, check the BFD section symbol for a symbol with + BSF_SECTION_SYM set. + +1999-03-10 Ulrich Drepper + + * readelf.c (process_dynamic_segment): Print new Solaris dynamic + section entries. Correct printing of DT_POSFLAG_1 and DT_FLAGS_1. + +1999-03-10 Nick Clifton + + * readelf.c (request_dump): New function. + Removed arbitary limit on the number of sections that can be + dumped. + +Wed Mar 10 15:10:14 1999 Stan Cox + + * dlltool.c (make_one_lib_file): Use %05d to output the stub name so + order in the import library is preserved. + +1999-02-19 Nick Clifton + + * readelf.c: Fix compile time warings. + +1999-02-17 DJ Delorie + + * resbin.c (res_to_bin_versioninfo): Instead of entering a value + length of zero in a version info string, enter the appropriate + length. + +Tue Feb 16 16:00:33 1999 Ian Lance Taylor + + * configure.in: Require autoconf 2.13. Change AM_PROG_INSTALL to + AC_PROG_INSTALL. Add comments for AC_DEFINE calls. + * acconfig.h: Remove. + * aclocal.m4: Rebuild. + * configure: Rebuild. + * Makefile.in: Rebuild. + * config.in: Rebuild. + +1999-02-02 Nick Clifton + + * readelf.c (read_and_display_attr): Add display of basic type + encodings. + (display_debug_aranges): New function: Display the contents of a + .debug_aranges section. + (display_debug_info): Dump tags found after compunit entry. + + * binutils.texi: Fixed bug in readelf documentation. + +Mon Feb 1 12:38:01 1999 Catherine Moore + + * readelf.c (dump_relocations): Handle EM_ARM as REL. + +1999-01-29 Nick Clifton + + * readelf.c (process_symbol_table): Do not produce a histogram of + bucket chains if none were found. + +1999-01-27 Nick Clifton + + * version.c: Add 1999 copyright. + + * binutils.texi (readelf): Document new command line options + --debug-dump and --histogram. + + * readelf.c: Add ability to display contents of some or all of the + Dwarf2 debug sections. {Work only partially completed}. + (display_debug_section): New function. + (display_debug_info): New function. + (display_debug_not_supported): New function. + (display_debug_line): New function. + (display_debug_abbrev): New function. + (process_abbrev_section): New function. + (read_leb128): New function. + (process_extended_line_op): New function. + (get_TAG_name): New function. + (get_AT_name): New function. + (get_FORM_name): New function. + (free_abbrevs): New function. + (add_abbrev): New function. + (add_abbrev_attr): New function. + (read_and_display_attr): New function. + (display_block): New function. + +Thu Jan 14 23:36:11 1999 Jeffrey A Law (law@cygnus.com) + + * coffdump.c (xcalloc): Remove, in libiberty now. + * srconv.c (xcalloc): Likewise. + * sysdump.c (xcalloc): Likewise. + +1999-01-14 Nick Clifton + + * readelf.c (process_section_headers): Omit trailing space at end + of section header contents line. + +Wed Dec 16 17:20:05 1998 Doug Evans + + * aclocal.m4: Regenerate. + +Mon Dec 14 12:55:36 1998 Jim Wilson + + * dllwrap.c: Include bfd.h and bucomm.h. Move getopt.h include + after libiberty.h include. + +Tue Dec 8 16:29:43 1998 Ian Lance Taylor + + * objdump.1: Fix typo (-d to -D). From Nokubi Hirotaka + . + +Sun Dec 6 13:28:09 1998 Ian Lance Taylor + + * objdump.c (SFILE): Add size field. + (objdump_sprintf): Merge both versions into one. Increase buffer + size as needed to avoid overflow. + (disassemble_bytes): Change buf from 1000 bytes to 50. Change + initialization and use of sfile to match changes to + objdump_sprintf. + + * strip.1: Fix typo (-V to -v). From Issei Hirayama + . + +1998-12-03 Ulrich Drepper + + * readelf.c (process_dynamic_segment): Improve output format for + various DT_* values. + +1998-12-02 Ulrich Drepper + + * readelf.c (process_mips_specific): Print .conflict section + content. + + * readelf.c (process_mips_specific): Print l_flags in liblist in + textual form. + +1998-11-30 Nick Clifton + + * ar.c (extract_file): Add some paranoia checks for negatively + sized files. + +Tue Nov 24 09:39:24 1998 Nick Clifton + + * stabs.c (DIR_SEPARATOR): Define as '\\' if WIN32 is defined. + +Tue Nov 17 10:25:26 1998 Nick Clifton + + * Makefile.in: Regenerate. + +Mon Nov 16 19:17:23 1998 Dave Brolley + + * po/binutils.pot: Regenerate. + +Mon Nov 16 10:18:53 1998 Nick Clifton + + * Makefile.am: Regernated dependencies. + * aclocal.m4: Regenerated. + * configure: Regenerated. + +Sat Nov 14 14:50:56 1998 Ian Lance Taylor + + * debug.c (debug_name_type): Correct return type from false to + DEBUG_TYPE_NULL. + +Sat Nov 14 14:48:21 1998 Andreas Schwab + + * objdump.c (disassemble_data): Skip over relocs below start + address. + +Tue Nov 10 15:31:52 1998 Nick Clifton + + * Makefile.am: Add dependency of readelf.c on elf/fr30.h + * Makefile.in: Regenerate. + +Wed Nov 4 16:25:55 1998 Nick Clifton + + * readelf.c: Add support for the FR30. + +Mon Nov 2 14:59:33 1998 Geoffrey Noer + + * configure.in: detect cygwin* instead of cygwin32* + * configure: regenerate + +Fri Oct 30 15:14:49 1998 Geoffrey Noer + + * dllwrap.c: change all references to cygwin32_ to cygwin_, + change Cygwin target def to CYGWIN. + +Wed Oct 28 10:31:19 1998 Nick Clifton + + * objdump.c (disassemble_data): Replace 'unsigned long' with + 'bfd_vma'. + +Tue Oct 27 14:39:00 1998 Nick Clifton + + * objdump.c (disassemble_bytes): Applied this patch from Philip + Blundell : Make address variables unsigned to + avoid problems when disassembling code at high-bit-set addresses. + +Mon Oct 26 14:07:59 1998 Mumit Khan + + * dllwrap.c (strhash): New function. + (main): Use it to supply image base if not supplied by user. + (program_version): Up to 0.2.4. + +Mon Oct 26 14:07:59 1998 Mumit Khan + + * dlltool.c (add_stdcall_alias): New global. + (long_options): Add --add-stdcall-alias option. + (main): Handle it. + (scan_drectve_symbols): Add alias if --add-stdcall-alias is + specified. + (scan_filtered_symbols): Likewise. + (gen_def_file): Output alias for stdcall syms if appropriate. + + * binutils.texi (dlltool): Document --add-stdcall-alias option. + + * dllwrap.c (long_options): Add --add-stdcall-alias option. + (main): Handle it. + + * defparse.y (opt_name): Allow "." in name. + * dlltool.c (def_name): Set dll_name from NAME entry in def file. + (def_library): Set dll_name from LIBRARY entry in def file. + +Mon Oct 26 14:07:59 1998 Mumit Khan + + * dllwrap.c (long_options): --implib synonym for --output-lib. + (main): Pass --export-all to dlltool only if specified. + (program_version): Up to 0.2.3. + +Mon Oct 26 14:07:59 1998 Mumit Khan + + * dllwrap.c (mybasename): New function. + (main): Run dlltool to create export definition file and import + library file if necessary. + Change exp_file_name so that it's based on the dll name. + +Sun Oct 25 10:37:45 1998 Mumit Khan + + * dlltool.c (scan_all_symbols): Fix patch error. + +Fri Oct 16 22:56:20 1998 Felix Lee + + * nm.c (display_rel_file): fix "no symbols" messages. + * objdump.c (slurp_symtab): ditto. + * po/POTFILES.in, po/binutils.pot: rebuilt + +Mon Oct 12 14:28:03 1998 Nick Clifton + + * readelf.c (dump_relocations): Rename field from Value to Info to + match name of field in ELF structures. + +Thu Oct 8 15:33:08 1998 Geoffrey Noer + + * configure.in: call AC_EXEEXT instead of AM_EXEEXT and + AM_CYGWIN32. + * aclocal.m4: remove local AM_EXEEXT/AM_CYGWIN32 macros. + * configure: regenerate + +Thu Oct 8 15:33:08 1998 Geoffrey Noer + + From Mumit Khan : + * dlltool.c (scan_all_symbols): Don't re-export symbols exported + by other DLLs. + +Thu Oct 8 15:33:08 1998 Geoffrey Noer + + * Makefile.am (BUILD_DLLWRAP): Add. + (BUILD_DLLWRAP, DLLWRAP_PROG): Add. + (bin_PROGRAMS): Add dllwrap. + * Makefile.in: regenerate with automake + + From Mumit Khan : + * dllwrap.c: New file from dllhelpers v0.2.1. + (print_version): New function. + (long_options): Add --version. + (main): Handle. + * dyn-string.h, dyn-string.c: New files from egcs-1.1/gcc. + * configure.in (BUILD_DLLWRAP): Add. + * configure: Regenerate. + +Tue Oct 6 18:20:10 1998 Geoffrey Noer + + * Makefile.am (windres_SOURCES): Add resres.c. + (windres_OBJECTS): Add resres.o. + * Makefile.in: regenerate with automake + + From Anders Norlander . + * resres.c: New file. Implementation of read_res_file and + write_res_file functions for windres. + * rcparse.y: Handle CONTROL's with named classes. + * resbin.c: Bug in res_to_bin_dialog and bin_to_res_dialog + when dialog is extended: The version and signature fields should + be reversed (despite what the docs say). Id is 32 bits long in + extended dialogs. + * resrc.c (write_rc_dialog): properly print controls with named + classes. + * windres.c (read_res_file, write_res_file): Remove stubs. + * resres.c (write_res): Rename RT_ACCELERATORS to RT_ACCELERATOR. + +Sun Oct 4 20:34:42 1998 Ian Lance Taylor + + From Nokubi Hirotaka : + * objcopy.1: Fix typo in --remove-leading-char docs. + * objdump.1: Fix formatting in --stabs docs. + +Sat Sep 19 23:33:56 1998 Ian Lance Taylor + + * rcparse.y (memflags_move): Correct recursion. + +1998-09-10 Ulrich Drepper + + * readelf.c (process_symbol_table): Print in histogram how many + symbols are covered by the current chain length. + +Sun Sep 6 16:15:47 1998 Nick Clifton + + * readelf.c (process_section_contents): Do not try to dump empty + sections. + +Sat Sep 5 19:17:10 1998 Mumit Khan + + * dlltool.c (scan_all_symbols): Don't re-export symbols exported + by other DLLs. + +1998-09-02 14:50 Ulrich Drepper + + * readelf.c (process_dynamic_segment): Print DT_* value only if + do_dynamic. + (do_histogram): New variable. + (options): New long option histogram. Set do_histogram if this + option is used. + (usage): Document --histogram. + (parse_args): Handle 0 return value from getopt_long. Enable + do_histogram for -a. + (process_symbol_table): Read hash table also if only do_histogram. + Add code to print hash table histogram. + +1998-08-25 16:45 Ulrich Drepper + + * readelf.c (process_dynamic_segment): Read syminfo section if + available. + (process_syminfo): New function. Print syminfo information. + (process_file): Call process_syminfo and free syminfo data at the end. + +Wed Aug 19 16:19:51 1998 Ian Lance Taylor + + * dlltool.c (usage): Add file parameter. Change all callers. + (main): Don't treat '?' as a special case in getopt return. + + * binutils.texi (dlltool): Document new options. Add some uses of + @var. + +Wed Aug 19 16:19:07 1998 Mumit Khan + + * dlltool.c (gen_def_file): Plug memory leak. Don't print + demangled name if it is NULL. + + Support for exporting all symbols to an output export def file: + * dlltool.c ({export_all_symbols, no_default_excludes, + no_default_excludes, excludes}): New file static variables. + (struct string_list): Type to hold list of symbols to exclude. + (scan_drectve_symbols): Renamed from scan_open_obj_file. + (scan_filtered_symbols): New static function. + (add_excludes): New static function. + (match_exclude): New static function. + (set_default_excludes): New static function. + (filter_symbols): New static function. + (scan_all_symbols): New static function. + (scan_open_obj_file): New static function. + (usage): Document new options. + (long_options): Add new options. + (main): Handle new options. + +1998-07-31 21:24 Ulrich Drepper + + * readelf.c (process_program_headers): Print p_offset value with + six hex digits. + (dynamic_segment_mips_val): Add support for DT_MIPS_FLAGS, + DT_MIPS_IVERSION, and DT_MIPS_TIME_STAMP. + (process_mips_specific): Also print seconds of time stamp. + +Fri Jul 31 10:04:23 1998 Catherine Moore + + * readelf.c (dump_relocations): EM_ARM uses rela relocs. + +1998-07-30 16:25 Ulrich Drepper + + * readelf.c (get_dynamic_type): Don't used gettext on the names. + Add new DT_* values from Solaris. Don't print nuemric value in + case of an unknown entry. + (process_dynamic_segment): Handle new DT_* entries. Print numeric + values in decimal, not hex. + +Fri Jul 24 16:28:57 1998 Jeff Holcomb + + * readelf.c (get_dynamic_type): Remove empty default from switch + statement. + +Fri Jul 24 16:28:12 1998 Ian Lance Taylor + + * Makefile.am (install-exec-local): Don't remove the file before + checking whether $(bindir) == $(tooldir)/bin. From Maciej + W. Rozycki . + * Makefile.in: Rebuild. + +Fri Jul 24 09:38:59 1998 Nick Clifton + + * objcopy.c: Removed spurious inclusion of elf/internal.h and + elf-bfd.h. + +1998-07-22 Ulrich Drepper + + * readelf.c: Consistantly use elf_ prefix for *_reloc_type + functions. + +Wed Jul 22 16:29:12 1998 Nick Clifton + + * readelf.c (dump_relocations): Add dumps of HPPA and ARC + relocations. + + (process_relocs): Do not abort if no string table can be found. + +1998-07-22 14:58 Ulrich Drepper + + * readelf.c: Remove definition of functions to return relocation + symbol strings. They now get implicitly defined when include the + system specific ELF header. + +1998-07-22 13:51 Ulrich Drepper + + * readelf.c: Before include system specific ELF header define + START_RELOC_NUMBERS, RELOC_NUMBER, and END_RELOC_NUMBERS. For now + used for ppc, mips, and mn10300. + +Wed Jul 22 10:26:32 1998 Nick Clifton + + * readelf.c (dump_relocations): Display number of unrecognised + relocations. + +1998-07-21 13:13 Ulrich Drepper + + * readelf.c: Use symbolic names of relocation entries for the various + architectures. Correct more layout details. + Print names of MIPS specific section types. Print Alpha, ARM, and + MIPS relocation type names. + +1998-07-20 Vladimir N. Makarov + + * objcopy.c (filter_symbols): Add code for strip all symbols case. + (copy_objects): Strip all case is now processed also through + filter_symbols. No marking symbols used in relocations when strip + all symbols case. + (copy_section): When strip all symbols case, remove relocations + which are not in keep strip specific list. + (strip_main): Remove guard `strip_specific_list == NULL' for + setting up strip all symbols by default. + +Mon Jul 20 12:51:16 1998 Andreas Schwab + + * addr2line.c (find_address_in_section): Only consider a section + if the pc value is completely contained within it. + (translate_addresses): Don't crash if functionname or filename are + null. + +1998-07-20 07:45 Ulrich Drepper + + * readelf.c (process_symbol_table): Fix little alignment problem + in printed table header. + +1998-07-20 07:14 Ulrich Drepper + + * readelf.c: Correct reading of .dynamic section. + (dynamic_section): Now a global variable. + (process_mips_fpe_exception, process_mips_specific, + process_arch_specific): New functions. + (get_file_header): Call process_arch_specific. + +1998-07-19 15:15 Ulrich Drepper + + * readelf.c: Fix several versioning related bugs. Produce nicer + output. + Add support for processor specific information on MIPS. + +Fri Jul 10 15:57:58 1998 Nick Clifton + + * readelf.c: Switch prototypes from unsigned short to unsigned + int. + +Fri Jul 10 16:17:50 1998 Ian Lance Taylor + + From Christian Holland : + * ieee.c (parse_ieee): Initialize info.global_vars and + info.global_types. + (parse_ieee_atn): Ignore register lifetime information reportedly + emitted by MRI compiler. + +Thu Jul 9 13:08:01 1998 Ian Lance Taylor + + * Makefile.am (MAINTAINERCLEANFILES): Define. + * Makefile.in: Rebuild. + +Tue Jul 7 21:48:54 1998 Jeffrey A Law (law@cygnus.com) + + * readelf.c (byte_get): Use PARAMS in prototype. + (error): Make it work with non-ANSI compilers. + (warn): Likewise. + (get_ver_flags): Don't use an ANSI prototype in the definition. + +Tue Jul 7 13:26:13 1998 Ian Lance Taylor + + * objcopy.c (filter_bytes): Set size correctly if the size of the + section is not an even multiple of the interleave. Based on patch + from Brion Stone . + +Thu Jul 2 14:01:34 1998 Klaus Kaempf + + * configure.com: Add vax/vms support. + * makefile.vms-in: Renamed from makefile.vms. Add substitutions + now done by configure.com. + +Wed Jul 1 20:43:52 1998 Ian Lance Taylor + + * stabs.c (parse_stab_range_type): Handle 4 and 8 byte signed + integers with real upper bounds. Handle a lower bound one larger + than the upper bound as a signed integer. Handle 8 byte signed + integers. + (stab_demangle_template): Optionally return the demangled name of + the template. + (stab_demangle_qualified): Treat a template name as a tagged + type. + (stab_demangle_fund_type): Likewise. + +Wed Jul 1 16:29:50 1998 Nick Clifton + + * objcopy.c: Minor formatting improvements. + * readelf.c: Minor output formatting improvement. + +Wed Jul 1 14:23:48 1998 Ian Lance Taylor + + * rclex.l: Add casts and change types to avoid warnings. + * rcparse.y: Likewise. + * resbin.c: Likewise. + * rescoff.c: Likewise. + * resrc.c: Likewise. + + * Makefile.am: Rebuild dependencies. + (HFILES): Remove readelf.h. + * Makefile.in: Rebuild. + + Based on patches from Andrew Kozin + : + * winduni.h: New file, from windres.h. + * winduni.c: New file, from windres.c. + * windres.c: Move Unicode functions into winduni.c. + * windres.h: Move Unicode declarations into winduni.h. Include + winduni.h. + (RT_ACCELERATOR): Rename from RT_ACCELERATORS to match Windows + macro. Change all uses. + (RT_PLUGPLAY, RT_VXD): Correct values. + * Makefile.am (HFILES): Add windres.h. + (CFILES): Add winduni.c. + (windres_SOURCES): Add winduni.c. + +Mon Jun 29 17:01:21 1998 Nick Clifton + + * readelf.c: Use BFD Internal and External Elf structures. + * readelf.h: Removed - no longer needed. + * Makefile.in: Remove readelf.c's dependency upon readelf.h. + +1998-06-26 Vladimir N. Makarov + + * objcopy.c (strip_main): keep_specific_list == NULL as additional + condition to set up strip all symbols by default. + (copy_archive): don't change archive when error in object files of + the archive. + +Wed Jun 24 17:53:47 1998 Ian Lance Taylor + + * stabs.c (parse_number): Sign extend negative values correctly if + bfd_vma is larger than unsigned long. + +Tue Jun 23 14:55:05 1998 Mike Stump + + * Makefile.am (install-exec-local): Don't let EXEEXT interfere + with the program transform name. + * Makefile.in: Rebuild. + +Tue Jun 23 11:08:53 1998 Nick Clifton + + * readelf.c: Rewrite to use fopen/fread ratehr than mmap. + + Add --section-headers command line switch, which is an alias for + --sections. + + Incorporate improvemnts made by Andreas Schwab + including output + formatting and version info display. + + * binutils.texi: Document --section-headers switch to readelf. + +Mon Jun 22 18:28:19 1998 Ian Lance Taylor + + * readelf.c: Include bfd.h and bucomm.h before system header + files. + (parse_args): Change type of c from char to int. + +Sun Jun 14 14:26:28 1998 Nick Clifton + + * readelf.c (usage): Write to stdout, not stderr. + +Fri Jun 12 13:33:51 1998 Tom Tromey + + * po/Make-in (all-yes): Depend on .pot file if maintainer mode + enabled. + ($(PACKAGE).pot): Unconditionally depend on POTFILES. + +Fri Jun 12 16:06:15 1998 Michael Meissner + + * readelf.c (get_ppc_rel_type): New PowerPC support. + (dump_relocations): PowerPC uses RELA relocations. + (get_machine_name): Spell PowerPC correctly. + (get_file_type): Change unsigned short parameter to unsigned. + (get_machine_name): Ditto. + (get_machine_data): Return whether big endian or little endian. + (get_machine_flags): Interpret PowerPC, M32R, and MIPS flags. + (process_elf_header): Print endian-ess. Convert all numeric + formats to long or unsigned long. Print out machine specific flag + bits. + (process_section_headers): Increase name by 3 columns and decrease + type by the same so that .gcc_except_table fits in the space. + + * readelf.h: Include elf/ppc.h, elf/mips.h, and elf/m32r.h to get + machine specific flag bits. + +Thu Jun 11 17:54:26 1998 Nick Clifton + + * readelf.c: Remove extraneous #includes. Fix warnings produced + by -Wall when compiling under Linux. + + * Makefile.am (readelf_LDADD): Add $(LIBIBERTY). + +Thu Jun 11 18:30:20 1998 Ian Lance Taylor + + * stabs.c (struct stab_handle): Add self_crossref field. + (parse_stab_string): If a tag is a cross reference to itself, + don't define it in the tags list. + (parse_stab_type): Set info->self_crossref. + + * debug.c (struct debug_type_real_list): Define. + (debug_get_real_type): Add list parameter. Change all callers. + Check for circularity to avoid crashing when it occurs. + +Thu Jun 11 14:48:32 1998 Nick Clifton + + * readelf.c: New file: Display contents of ELF format file. + * readelf.h: New file: Header file for readelf.c + * Makefile.am: Add rules to build readelf. + * Makefile.in: Rebuilt. + * binutils.texi: Document readelf. + * NEWS: Mention inclusion of readelf into binutils. + * po/POTFILES.in; Rebuilt. + +Fri Jun 5 18:43:40 1998 Ian Lance Taylor + + * objcopy.c (setup_section): Adjust the section size if copy_byte + is >= 0. + (copy_section): Do not call bfd_set_section_size. + +Thu Jun 4 09:12:27 1998 Nick Clifton + + * objcopy.c (copy_usage): Add missing \n\ from help description. + +Wed Jun 3 19:31:33 1998 Ian Lance Taylor + + * Makefile.am (YACC): Correct bison -L option. + * Makefile.in: Rebuild. + + * binutils.texi, objdump.1: Document -p/--private-headers. + +Wed Jun 3 12:09:40 1998 Nick Clifton + + * objcopy.c: Add new command line options: --change-section-lma + and --change-section-vma. Rename old command line option + --adjust-section-vma to --change-section-address. Rename + --adjust-vma to --change-addresses and --adjust-start to + --change-start. Provide aliases to support the old versions of + these command line options. + + Change the names of macros and enum elements to upper case to + match the GNU coding standard. + + Replace calls to fprintf (stderr,...) with calls to fatal () or + non_fatal () as appropriate. + + * objcopy.1: Document command line option changes. + * binutils.texi: Document command line option changes. + + * bucomm.h: New exported funtion from bucomm.c: non_fatal(). + * bucomm.c (non_fatal): New exported function. Just like fatal() + except that it returns rather than calling xexit(). + + (bfd_check_format_matches): Call fatal() rather than bfd_fatal(). + + (check_matching_formats): Fix C formating. + + (parse_vma): Call fatal(). + +Mon Jun 1 18:26:40 1998 Ian Lance Taylor + + From Yuli Barcohen : + * debug.c (debug_type_samep): Avoid endless loops comparing + function and method parameter types. + +Fri May 22 14:02:42 1998 Ian Lance Taylor + + * dlltool.c (dump_iat): Comment out; not used. + (display): Rename from tell. Change all callers. + +Thu May 14 14:00:56 1998 Nick Clifton + + * dlltool.c: Add support for Thumb DLLs. Add support for + interworking between ARM and Thumb programs and DLLs. Tidy the + code. + + * binutils.texi: Document dlltool. + + * configure: Build dlltool for thumb-pe targets. + + * version.c (print_version): Include 1998 in copyright strings. + + * stabs.c (parse_stab): Support Win32 style directory separators. + +Sun May 10 22:34:44 1998 Jeffrey A Law (law@cygnus.com) + + * po/Make-in (install-info): New target. + +Fri May 8 10:33:13 1998 Nick Clifton + + * ar.c (usage): Extend information provided about command line + options. + +Wed May 6 15:28:51 1998 Klaus Kaempf + + * makefile.vms: Run dec c with /nodebug. Pass CC value when + calling make. + +Tue May 5 15:19:00 1998 Nick Clifton + + * configure: Build dlltool for thumb-pe target. + * configure.in: Build dlltool for thumb-pe target. + +Sun May 3 22:04:49 1998 Ian Lance Taylor + + * Makefile.am (EXTRA_PROGRAMS): Change $(SRCONV_PROG) to sysconf + sysdump coffdump to avoid extra $(EXEEXT). + * Makefile.in: Rebuild. + +Wed Apr 29 22:22:55 1998 Geoffrey Noer + + * configure.in: Stop appending EXEEXT to the end of + SRCONV_PROG (wrong because that variable may contain multiple + programs) + * Makefile.am: instead, add EXEEXTs to each SRCONV_PROG + program + * Makefile.in: regenerate + * configure: regenerate + +Tue Apr 28 19:14:34 1998 Tom Tromey + + * addr2line.c (main): Conditionally call setlocale. + * windres.c (main): Likewise. + * sysdump.c (main): Likewise. + * strings.c (main): Likewise. + * srconv.c (main): Likewise. + * size.c (main): Likewise. + * objdump.c (main): Likewise. + * objcopy.c (main): Likewise. + * nm.c (main): Likewise. + * nlmconv.c (main): Likewise. + * dlltool.c (main): Likewise. + * coffdump.c (main): Likewise. + * ar.c (main): Likewise. + * bucomm.h: Include if HAVE_LOCALE_H. + (LC_MESSAGES): Now can be defined even when ENABLE_NLS. + +Tue Apr 28 10:33:07 1998 Bill Moyer + + Add support for IMPORTS: + * defparse.y (impline): Add IMPORTS syntaxes. + * dlltool.c (ifunctype, iheadtype): New typedefs. + (import_list): New static variable. + (append_import): New static function. + (def_import): Add an entry to import_list. + (generate_idata_ofile): New static function. + (gen_exp_file): Call generate_idata_ofile. + * dlltool.h (def_import): Update declaration. + +Mon Apr 27 16:39:22 1998 Ian Lance Taylor + + * configure.in: Change version number to 2.9.4 + * configure: Rebuild. + +Wed Apr 22 16:00:35 1998 Tom Tromey + + * po/Make-in (MKINSTALLDIRS): Don't look in $(top_srcdir). + +Wed Apr 22 00:33:56 1998 Tom Tromey + + * Makefile.am (INCLUDES): Search intl dirs for headers; define + LOCALEDIR. + * addr2line.c (main): Call setlocale, bindtextdomain, textdomain. + * ar.c (main): Likewise. + * coffdump.c (main): Likewise. + * dlltool.c (main): Likewise. + * nlmconv.c (main): Likewise. + * nm.c (main): Likewise. + * objcopy.c (main): Likewise. + * objdump.c (main): Likewise. + * size.c (main): Likewise. + * srconv.c (main): Likewise. + * strings.c (main): Likewise. + * sysdump.c (main): Likewise. + * windres.c (main): Likewise. + +Tue Apr 21 22:13:08 1998 Tom Tromey + + * Many files: Added gettext invocations around user-visible + strings. + * bucomm.h: Added gettext-related includes and defines. + * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY, + HAVE_LC_MESSAGES): Define. + * configure.in: Call CY_GNU_GETTEXT. Create po/Makefile.in and + po/Makefile. Use AM_PROG_LEX. + * Makefile.am (SUBDIRS): New macro. + (POTFILES): Likewise. + (po/POTFILES.in): New target. + (LDADD): Added INTLLIBS. + (objdump_LDADD): Likewise. + (c__filt_LDADD): Likewise. + (ar_LDADD): Likewise. + (ranlib_LDADD): Likewise. + (dlltool_LDADD): Likewise. + (windres_LDADD): Likewise. + * po/Make-in, po/POTFILES.in, po/binutils.pot: New files. + +Tue Apr 21 16:07:18 1998 Stanislav Brabec + + * objcopy.c (preserve_dates): New file static variable. + (smart_rename): If preserve_dates, call set_times when copying. + (strip_main): Remove preserve_dates local variable. + (copy_main): Likewise. + +Tue Apr 7 15:41:15 1998 Ian Lance Taylor + + * Makefile.am (DISTSTUFF): Add defparse.h, defparse.c, rclex.c, + rcparse.h, and rcparse.c + * Makefile.in: Rebuild. + +Mon Apr 6 16:24:35 1998 Ian Lance Taylor + + * Makefile.am (PROGS): Move $(ADDR2LINE_PROG) to end, so that + Makefile.in doesn't have an empty continuation line. + (bin_PROGRAMS): Likewise. + * Makefile.in: Rebuild. + +Fri Apr 3 14:48:42 1998 Ian Lance Taylor + + * Makefile.am (DISTCLEANFILES): Add site.exp and site.bak. + (MOSTLYCLEANFILES): Add binutils.log, binutils.sum, and abcdefgh*. + (mostlyclean-local): New target. + * Makefile.in: Rebuild. + +Wed Apr 1 15:54:16 1998 Ian Lance Taylor + + From Zack Weinberg and H.J. Lu + : + * ar.c (usage): Mention S modifier. + (main): Add S modifier. + * ar.1, binutils.texi: Document S modifier. + +Wed Apr 1 13:11:23 1998 Andreas Schwab + + * binutils.texi: Use @itemx for a secondary item in a table. + +Tue Mar 31 18:44:13 1998 Ian Lance Taylor + + * dep-in.sed: Add rule to remove @OBJDIR@. + * Makefile.am (dep.sed): Substitute for @OBJDIR@. + * Makefile.in: Rebuild. + +Mon Mar 30 12:47:18 1998 Ian Lance Taylor + + * configure.in: Set version to 2.9.1. + * configure: Rebuild. + + * Branched binutils 2.9. + + * Makefile.am (DISTCLEANFILES): Remove defparse.h, arparse.h, + rcparse.h, and nlmheader.h. + * Makefile.in: Rebuild. + +Sat Mar 28 17:39:27 1998 Ian Lance Taylor + + * Makefile.am (MOSTLYCLEANFILES): Define. + * Makefile.in: Rebuild. + + Fix some gcc -Wall warnings: + * nlmconv.c (main): Add casts to avoid warnings. + (alpha_mangle_relocs): Likewise. + * objdump.c (dump_section_stabs): Likewise. + * size.c (print_sysv_format): Likewise. + * srcconv.c (wr_ob): Likewise. + * wrstabs.c (stab_modify_type): Likewise. + (stab_variable): Likewise. + * nlmconv.c (main): Initialize variables to avoid warnings. + * nm.c (sort_symbols_by_size): Likewise. + * objdump.c (disassemble_bytes): Likewise. + * wrstabs.c (stab_end_class_type): Likewise. + * coffgrok.c (do_sections_p2): Change j to unsigned int. + (do_lines): Change l to unsigned int. + * nlmheader.y (yylex): Change i to unsigned int. + * nm.c (print_symbol): Change j to long. + * size.c (lprint_number): Comment out. + * srconv.c (wr_ob): Change i to bfd_size_type. + * sysdump.c (unit_info_list): Comment out. + (object_body_list, program_structure, debug_list): Likewise. + * sysinfo.y (yyerror): Return value. + +Thu Mar 26 17:06:51 1998 Richard Henderson + + * defparse.y (explist): Allow epsilon. + Suggestion from Jonathan-Harris@psion.com. + +Thu Mar 26 16:59:09 1998 Richard Henderson + + * coffgrok.c (do_sections_p1): Use the section's lma instead of vma + for the benefit of prom loaders. + +Wed Mar 25 13:05:39 1998 Ian Lance Taylor + + Based on patch from H.J. Lu : + * Makefile.am (DISTSTUFF): New variable. + (diststuff): New target. + (DISTCLEANFILES): New variable. + * Makefile.in: Rebuild. + +Tue Mar 24 19:33:08 1998 Ian Lance Taylor + + * rclex.l: Accept { and } as synonyms for BEGIN and END. + +Fri Mar 20 19:18:08 1998 Ian Lance Taylor + + * aclocal.m4, configure: Rebuild with libtool 1.2. + +Tue Feb 24 13:07:50 1998 Doug Evans + + * objdump.c (disassemble_data): Delete "++place" after call to + find_symbol_for_address. Set disasm_info.symbols to array of + symbols at the current address. + +Wed Feb 18 23:39:46 1998 Richard Henderson + + * Makefile.am (install-exec-local): Install properly when ln + fails or tooldir == prefix. + +Tue Feb 17 18:40:55 1998 Richard Henderson + + * objcopy.c (compare_section_lma): Rename from _vma. + (copy_object): Gap fill based on LMA not VMA. + * binutils.texi: Update and clarify. + * objcopy.1: Likewise. + +Tue Feb 17 20:34:11 1998 Ian Lance Taylor + + * dlltool.c (gen_exp_file): Generate _imp__%s as well as __imp_%s, + for Microsoft compatibility. + (make_one_lib_file): Likewise. + + * dlltool.c (make_one_lib_file): Don't add 1 to hint. + +Fri Feb 13 16:37:44 1998 Ian Lance Taylor + + * Makefile.am (AUTOMAKE_OPTIONS): Define. + * configure, Makefile.in, aclocal.m4: Rebuild with automake 1.2e. + +Thu Feb 12 14:13:46 1998 Ian Lance Taylor + + * deflex.l: Accept '?' in symbol names, for VC++ mangled names. + From Mikey . + + * addr2line.c (usage): Update bug-gnu-utils address. + * ar.c (usage): Likewise. + * nlmconv.c (show_usage): Likewise. + * nm.c (usage): Likewise. + * objcopy.c (copy_usage): Likewise. + (strip_usage): Likewise. + * objdump.c (usage): Likewise. + * size.c (usage): Likewise. + * strings.c (usage): Likewise. + * windres.c (usage): Likewise. + * binutils.texi (Bug Reporting): Likewise. + +Sat Feb 7 15:36:24 1998 Ian Lance Taylor + + * configure, aclocal.m4: Rebuild with new libtool. + +Thu Feb 5 12:21:13 1998 Ian Lance Taylor + + * configure, Makefile.in, aclocal.m4: Rebuild with new libtool. + +Fri Jan 30 19:16:28 1998 Doug Evans + + * Makefile.am (CC_FOR_TARGET,nlmcomv.o): Change program_transform_name + to transform. + * Makefile.in: Regenerate. + +Thu Jan 29 16:24:04 1998 Mumit Khan + + * dlltool.c: Define exit status macros for _WIN32 but not + __CYGWIN32__. + (gen_lib_file): Check for exit status of unlink. + * resrc.c: Define popen and pclose if _WIN32 but not + __CYGWIN32__. + +Wed Jan 28 17:45:46 1998 Ian Lance Taylor + + * configure.in: Remove vfork check. + * nlmconv.c: Never include vfork.h. + * aclocal.m4, configure, Makefile.in, config.in: Rebuild. + +Wed Jan 28 17:43:02 1998 J.J. van der Heijden + + * objcopy.c (copy_archive): Only pass one argument to mkdir if + _WIN32 but not __CYGWIN32__. + (smart_rename): Add code for _WIN32 (not __CYGWIN32__), to cope + with different rename behaviour and lack of chown. + + * configure.in: Check for mingw32 when deciding whether to build + dlltool. + * dlltool.c: Never include vfork.h. + (run): Use pexecute rather than vfork. + (gen_lib_file): Check for errors from bfd_set_archive_head and + bfd_close. Close all the BFDs in the archive before deleting the + temporary files. + +Thu Jan 22 16:22:55 1998 Fred Fish + + * objdump.c (disassemble_bytes): Add flag INSN_HAS_RELOC to tell + disassembly function there is a reloc on this line. + +Wed Jan 14 15:29:43 1998 Richard Henderson + + * srconv.c (sh, h8300): Delete variables. + (addrsize, toolname, rnames): New variables. + (writeINT): Use addrsize. + (wr_un): Use toolname. + (wr_hd): Set up addrsize et al properly for h8300[hs]. + (walk_tree_symbol): Zero dsy. Use rnames. + (wr_un, wr_hd, wr_ob, wr_du): Use proper bfd access macros. + * sysdump.c (sh, h8300): Delete variables. + (addrsize): New variable. + (getINT): Use it. + (getone): Initialize it. + (getBITS): Range check on MAX. + +For older changes see ChangeLog-9197 + +Local Variables: +mode: change-log +left-margin: 8 +fill-column: 74 +version-control: never +End: diff --git a/gnu/dist/toolchain/binutils/MAINTAINERS b/gnu/dist/toolchain/binutils/MAINTAINERS new file mode 100644 index 000000000000..427dd3acdf7c --- /dev/null +++ b/gnu/dist/toolchain/binutils/MAINTAINERS @@ -0,0 +1,78 @@ + ========= 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. + + --------- Blanket Write Privs --------- + +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 ------------- + +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. + +If you have CGEN related problems you can send email to; + + cgen@sources.redhat.com + +The current CGEN maintainers are: + + Doug Evans, Ben Elliston, Frank Eigler + + --------- 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.] diff --git a/gnu/dist/toolchain/binutils/Makefile.am b/gnu/dist/toolchain/binutils/Makefile.am index a6eb22aa99d7..1ddf2f7fc5e5 100644 --- a/gnu/dist/toolchain/binutils/Makefile.am +++ b/gnu/dist/toolchain/binutils/Makefile.am @@ -19,6 +19,9 @@ YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bis YFLAGS = -d LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi` +WARN_CFLAGS = @WARN_CFLAGS@ +AM_CFLAGS = $(WARN_CFLAGS) + # these two are almost the same program AR_PROG=ar RANLIB_PROG=ranlib @@ -168,6 +171,9 @@ nm_new_SOURCES = nm.c $(BULIBS) objdump_SOURCES = objdump.c prdbg.c $(DEBUG_SRCS) $(BULIBS) objdump_LDADD = $(OPCODES) $(BFDLIB) $(LIBIBERTY) $(INTLLIBS) +objdump.o:objdump.c + $(COMPILE) -c $(OBJDUMP_DEFS) $(srcdir)/objdump.c + underscore.c: stamp-under ; @true stamp-under: Makefile @@ -284,8 +290,13 @@ DISTCLEANFILES = stamp-under sysinfo underscore.c sysroff.c sysroff.h \ DEP: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h rm -f DEP1 $(MAKE) MKDEP="$(MKDEP)" DEP1 - sed -f dep.sed < DEP1 > $@ - echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> $@ + sed -f dep.sed < DEP1 > DEPA + echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> DEPA + if grep ' /' DEPA > /dev/null 2> /dev/null; then \ + echo 'make DEP failed!'; exit 1; \ + else \ + mv -f DEPA $@; \ + fi DEP1: $(CFILES) $(GENERATED_CFILES) echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > DEP2 @@ -339,7 +350,7 @@ MOSTLYCLEANFILES = sysinfo $(DEMANGLER_NAME).1 binutils.log binutils.sum \ mostlyclean-local: -rm -rf tmpdir -CLEANFILES = dep.sed DEP DEP1 DEP2 +CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 .PHONY: install-exec-local @@ -374,13 +385,13 @@ addr2line.o: addr2line.c ../bfd/bfd.h $(INCDIR)/ansidecl.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 + 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)/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)/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 \ @@ -391,13 +402,13 @@ debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ansidecl.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)/demangle.h $(INCDIR)/dyn-string.h \ - dlltool.h + $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h $(INCDIR)/demangle.h \ + $(INCDIR)/dyn-string.h dlltool.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)/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 @@ -408,13 +419,14 @@ nlmconv.o: nlmconv.c ../bfd/bfd.h $(INCDIR)/ansidecl.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)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ranlib.h \ - $(INCDIR)/demangle.h $(INCDIR)/libiberty.h + $(INCDIR)/getopt.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ranlib.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h not-ranlib.o: not-ranlib.c not-strip.o: not-strip.c objcopy.o: objcopy.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/progress.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h budbg.h + $(INCDIR)/fopen-same.h $(INCDIR)/getopt.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 \ @@ -479,14 +491,15 @@ readelf.o: readelf.c ../bfd/bfd.h $(INCDIR)/ansidecl.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)/elf/pj.h $(INCDIR)/elf/avr.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.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 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 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)/dyn-string.h + $(INCDIR)/fopen-same.h $(INCDIR)/getopt.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 underscore.o: underscore.c diff --git a/gnu/dist/toolchain/binutils/Makefile.in b/gnu/dist/toolchain/binutils/Makefile.in index f4178de276a9..1b2a2969db9f 100644 --- a/gnu/dist/toolchain/binutils/Makefile.in +++ b/gnu/dist/toolchain/binutils/Makefile.in @@ -74,11 +74,15 @@ BUILD_WINDRES = @BUILD_WINDRES@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ DATADIRNAME = @DATADIRNAME@ DEMANGLER_NAME = @DEMANGLER_NAME@ DLLTOOL = @DLLTOOL@ DLLTOOL_DEFS = @DLLTOOL_DEFS@ EXEEXT = @EXEEXT@ +GCJ = @GCJ@ +GCJFLAGS = @GCJFLAGS@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ GT_NO = @GT_NO@ @@ -96,10 +100,13 @@ 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@ @@ -121,6 +128,9 @@ YACC = `if [ -f ../bison/bison ]; then echo ../bison/bison -y -L$(srcdir)/../bis YFLAGS = -d LEX = `if [ -f ../flex/flex ]; then echo ../flex/flex; else echo @LEX@; fi` +WARN_CFLAGS = @WARN_CFLAGS@ +AM_CFLAGS = $(WARN_CFLAGS) + # these two are almost the same program AR_PROG = ar RANLIB_PROG = ranlib @@ -151,7 +161,8 @@ DLLWRAP_PROG = dllwrap SRCONV_PROG = srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT) -man_MANS = ar.1 nm.1 objdump.1 ranlib.1 size.1 strings.1 strip.1 objcopy.1 addr2line.1 nlmconv.1 $(DEMANGLER_NAME).1 +man_MANS = ar.1 nm.1 objdump.1 ranlib.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@ @@ -173,15 +184,24 @@ MKDEP = gcc -MM INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) @HDEFINES@ -I$(srcdir)/../intl -I../intl -DLOCALEDIR="\"$(prefix)/share/locale\"" -HFILES = arsup.h bucomm.h budbg.h coffgrok.h debug.h nlmconv.h dlltool.h windres.h winduni.h +HFILES = arsup.h bucomm.h budbg.h coffgrok.h debug.h nlmconv.h dlltool.h \ + windres.h winduni.h GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h rcparse.h -CFILES = addr2line.c ar.c arsup.c bucomm.c coffdump.c coffgrok.c debug.c dlltool.c filemode.c ieee.c is-ranlib.c is-strip.c maybe-ranlib.c maybe-strip.c nlmconv.c nm.c not-ranlib.c not-strip.c objcopy.c objdump.c prdbg.c rdcoff.c rddbg.c size.c srconv.c stabs.c strings.c sysdump.c version.c wrstabs.c windres.c resrc.c rescoff.c resbin.c winduni.c readelf.c resres.c dllwrap.c rename.c +CFILES = addr2line.c ar.c arsup.c bucomm.c coffdump.c coffgrok.c debug.c \ + dlltool.c filemode.c ieee.c is-ranlib.c is-strip.c maybe-ranlib.c \ + maybe-strip.c nlmconv.c nm.c not-ranlib.c not-strip.c \ + objcopy.c objdump.c prdbg.c rdcoff.c rddbg.c size.c srconv.c \ + stabs.c strings.c sysdump.c version.c wrstabs.c \ + windres.c resrc.c rescoff.c resbin.c winduni.c readelf.c \ + resres.c dllwrap.c rename.c -GENERATED_CFILES = underscore.c arparse.c arlex.c sysroff.c sysinfo.c syslex.c defparse.c deflex.c nlmheader.c rcparse.c rclex.c +GENERATED_CFILES = \ + underscore.c arparse.c arlex.c sysroff.c sysinfo.c syslex.c \ + defparse.c deflex.c nlmheader.c rcparse.c rclex.c DEBUG_SRCS = rddbg.c debug.c stabs.c ieee.c rdcoff.c @@ -198,12 +218,29 @@ LIBIBERTY = ../libiberty/libiberty.a POTFILES = $(CFILES) $(DEBUG_SRCS) $(HFILES) -EXPECT = `if [ -f $$r/../expect/expect ] ; then echo $$r/../expect/expect ; else echo expect ; fi` +EXPECT = `if [ -f $$r/../expect/expect ] ; then \ + echo $$r/../expect/expect ; \ + else echo expect ; fi` -RUNTEST = `if [ -f ${srcdir}/../dejagnu/runtest ] ; then echo ${srcdir}/../dejagnu/runtest ; else echo runtest ; fi` +RUNTEST = `if [ -f ${srcdir}/../dejagnu/runtest ] ; then \ + echo ${srcdir}/../dejagnu/runtest ; \ + else echo runtest ; fi` -CC_FOR_TARGET = ` if [ -f $$r/../gcc/xgcc ] ; then if [ -f $$r/../newlib/Makefile ] ; then echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; else echo $$r/../gcc/xgcc -B$$r/../gcc/; fi; else if [ "@host@" = "@target@" ] ; then echo $(CC); else echo gcc | sed '$(transform)'; fi; fi` +CC_FOR_TARGET = ` \ + if [ -f $$r/../gcc/xgcc ] ; then \ + if [ -f $$r/../newlib/Makefile ] ; then \ + echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \ + else \ + echo $$r/../gcc/xgcc -B$$r/../gcc/; \ + fi; \ + else \ + if [ "@host@" = "@target@" ] ; then \ + echo $(CC); \ + else \ + echo gcc | sed '$(transform)'; \ + fi; \ + fi` info_TEXINFOS = binutils.texi @@ -248,25 +285,29 @@ sysdump_SOURCES = sysdump.c $(BULIBS) nlmconv_SOURCES = nlmconv.c nlmheader.y $(BULIBS) -windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l winduni.c resres.c $(BULIBS) +windres_SOURCES = windres.c resrc.c rescoff.c resbin.c rcparse.y rclex.l \ + winduni.c resres.c $(BULIBS) windres_LDADD = $(BFDLIB) $(LIBIBERTY) @LEXLIB@ $(INTLLIBS) dllwrap_SOURCES = dllwrap.c version.c dllwrap_LDADD = $(LIBIBERTY) $(INTLLIBS) -DISTSTUFF = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c +DISTSTUFF = arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h \ + syslex.c deflex.c defparse.h defparse.c rclex.c rcparse.h rcparse.c -DISTCLEANFILES = stamp-under sysinfo underscore.c sysroff.c sysroff.h site.exp site.bak +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 $(DEMANGLER_NAME).1 binutils.log binutils.sum \ + abcdefgh* -CLEANFILES = dep.sed DEP DEP1 DEP2 +CLEANFILES = dep.sed DEP DEPA DEP1 DEP2 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs CONFIG_HEADER = config.h @@ -283,72 +324,88 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ -nlmconv_OBJECTS = nlmconv.o nlmheader.o bucomm.o version.o filemode.o +nlmconv_OBJECTS = nlmconv.$(OBJEXT) nlmheader.$(OBJEXT) \ +bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT) nlmconv_LDADD = $(LDADD) nlmconv_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a nlmconv_LDFLAGS = -srconv_OBJECTS = srconv.o coffgrok.o bucomm.o version.o filemode.o +srconv_OBJECTS = srconv.$(OBJEXT) coffgrok.$(OBJEXT) bucomm.$(OBJEXT) \ +version.$(OBJEXT) filemode.$(OBJEXT) srconv_LDADD = $(LDADD) srconv_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a srconv_LDFLAGS = -sysdump_OBJECTS = sysdump.o bucomm.o version.o filemode.o +sysdump_OBJECTS = sysdump.$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) \ +filemode.$(OBJEXT) sysdump_LDADD = $(LDADD) sysdump_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a sysdump_LDFLAGS = -coffdump_OBJECTS = coffdump.o coffgrok.o bucomm.o version.o filemode.o +coffdump_OBJECTS = coffdump.$(OBJEXT) coffgrok.$(OBJEXT) \ +bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT) coffdump_LDADD = $(LDADD) coffdump_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a coffdump_LDFLAGS = -dlltool_OBJECTS = dlltool.o defparse.o deflex.o bucomm.o version.o \ -filemode.o +dlltool_OBJECTS = dlltool.$(OBJEXT) defparse.$(OBJEXT) deflex.$(OBJEXT) \ +bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT) dlltool_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a dlltool_LDFLAGS = -windres_OBJECTS = windres.o resrc.o rescoff.o resbin.o rcparse.o \ -rclex.o winduni.o resres.o bucomm.o version.o filemode.o +windres_OBJECTS = windres.$(OBJEXT) resrc.$(OBJEXT) rescoff.$(OBJEXT) \ +resbin.$(OBJEXT) rcparse.$(OBJEXT) rclex.$(OBJEXT) winduni.$(OBJEXT) \ +resres.$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT) windres_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a windres_LDFLAGS = -dllwrap_OBJECTS = dllwrap.o version.o +dllwrap_OBJECTS = dllwrap.$(OBJEXT) version.$(OBJEXT) dllwrap_DEPENDENCIES = ../libiberty/libiberty.a dllwrap_LDFLAGS = -size_OBJECTS = size.o bucomm.o version.o filemode.o +size_OBJECTS = size.$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) \ +filemode.$(OBJEXT) size_LDADD = $(LDADD) size_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a size_LDFLAGS = -objdump_OBJECTS = objdump.o prdbg.o rddbg.o debug.o stabs.o ieee.o \ -rdcoff.o bucomm.o version.o filemode.o +objdump_OBJECTS = objdump.$(OBJEXT) prdbg.$(OBJEXT) rddbg.$(OBJEXT) \ +debug.$(OBJEXT) stabs.$(OBJEXT) ieee.$(OBJEXT) rdcoff.$(OBJEXT) \ +bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT) objdump_DEPENDENCIES = ../opcodes/libopcodes.la ../bfd/libbfd.la \ ../libiberty/libiberty.a objdump_LDFLAGS = -ar_OBJECTS = arparse.o arlex.o ar.o not-ranlib.o arsup.o rename.o \ -bucomm.o version.o filemode.o +ar_OBJECTS = arparse.$(OBJEXT) arlex.$(OBJEXT) ar.$(OBJEXT) \ +not-ranlib.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) bucomm.$(OBJEXT) \ +version.$(OBJEXT) filemode.$(OBJEXT) ar_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a ar_LDFLAGS = -strings_OBJECTS = strings.o bucomm.o version.o filemode.o +strings_OBJECTS = strings.$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) \ +filemode.$(OBJEXT) strings_LDADD = $(LDADD) strings_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a strings_LDFLAGS = -ranlib_OBJECTS = ar.o is-ranlib.o arparse.o arlex.o arsup.o rename.o \ -bucomm.o version.o filemode.o +ranlib_OBJECTS = ar.$(OBJEXT) is-ranlib.$(OBJEXT) arparse.$(OBJEXT) \ +arlex.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) bucomm.$(OBJEXT) \ +version.$(OBJEXT) filemode.$(OBJEXT) ranlib_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a ranlib_LDFLAGS = -objcopy_OBJECTS = objcopy.o not-strip.o rename.o rddbg.o debug.o \ -stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +objcopy_OBJECTS = objcopy.$(OBJEXT) not-strip.$(OBJEXT) \ +rename.$(OBJEXT) rddbg.$(OBJEXT) debug.$(OBJEXT) stabs.$(OBJEXT) \ +ieee.$(OBJEXT) rdcoff.$(OBJEXT) wrstabs.$(OBJEXT) bucomm.$(OBJEXT) \ +version.$(OBJEXT) filemode.$(OBJEXT) objcopy_LDADD = $(LDADD) objcopy_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a objcopy_LDFLAGS = -addr2line_OBJECTS = addr2line.o bucomm.o version.o filemode.o +addr2line_OBJECTS = addr2line.$(OBJEXT) bucomm.$(OBJEXT) \ +version.$(OBJEXT) filemode.$(OBJEXT) addr2line_LDADD = $(LDADD) addr2line_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a addr2line_LDFLAGS = -readelf_OBJECTS = readelf.o version.o +readelf_OBJECTS = readelf.$(OBJEXT) version.$(OBJEXT) readelf_DEPENDENCIES = ../libiberty/libiberty.a readelf_LDFLAGS = -nm_new_OBJECTS = nm.o bucomm.o version.o filemode.o +nm_new_OBJECTS = nm.$(OBJEXT) bucomm.$(OBJEXT) version.$(OBJEXT) \ +filemode.$(OBJEXT) nm_new_LDADD = $(LDADD) nm_new_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a nm_new_LDFLAGS = -strip_new_OBJECTS = objcopy.o is-strip.o rename.o rddbg.o debug.o \ -stabs.o ieee.o rdcoff.o wrstabs.o bucomm.o version.o filemode.o +strip_new_OBJECTS = objcopy.$(OBJEXT) is-strip.$(OBJEXT) \ +rename.$(OBJEXT) rddbg.$(OBJEXT) debug.$(OBJEXT) stabs.$(OBJEXT) \ +ieee.$(OBJEXT) rdcoff.$(OBJEXT) wrstabs.$(OBJEXT) bucomm.$(OBJEXT) \ +version.$(OBJEXT) filemode.$(OBJEXT) strip_new_LDADD = $(LDADD) strip_new_DEPENDENCIES = ../bfd/libbfd.la ../libiberty/libiberty.a strip_new_LDFLAGS = @@ -380,14 +437,14 @@ configure.in deflex.c defparse.c nlmheader.c rclex.c rcparse.c DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = tar +TAR = gtar GZIP_ENV = --best SOURCES = $(nlmconv_SOURCES) $(srconv_SOURCES) $(sysdump_SOURCES) $(coffdump_SOURCES) $(dlltool_SOURCES) $(windres_SOURCES) $(dllwrap_SOURCES) $(size_SOURCES) $(objdump_SOURCES) $(ar_SOURCES) $(strings_SOURCES) $(ranlib_SOURCES) $(objcopy_SOURCES) $(addr2line_SOURCES) $(readelf_SOURCES) $(nm_new_SOURCES) $(strip_new_SOURCES) $(cxxfilt_SOURCES) OBJECTS = $(nlmconv_OBJECTS) $(srconv_OBJECTS) $(sysdump_OBJECTS) $(coffdump_OBJECTS) $(dlltool_OBJECTS) $(windres_OBJECTS) $(dllwrap_OBJECTS) $(size_OBJECTS) $(objdump_OBJECTS) $(ar_OBJECTS) $(strings_OBJECTS) $(ranlib_OBJECTS) $(objcopy_OBJECTS) $(addr2line_OBJECTS) $(readelf_OBJECTS) $(nm_new_OBJECTS) $(strip_new_OBJECTS) $(cxxfilt_OBJECTS) all: all-redirect .SUFFIXES: -.SUFFIXES: .S .c .dvi .info .l .lo .o .ps .s .texi .texinfo .txi .y +.SUFFIXES: .S .c .dvi .info .l .lo .o .obj .ps .s .texi .texinfo .txi .y $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) cd $(top_srcdir) && $(AUTOMAKE) --cygnus Makefile @@ -468,6 +525,11 @@ maintainer-clean-noinstPROGRAMS: .c.o: $(COMPILE) -c $< +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + .s.o: $(COMPILE) -c $< @@ -476,6 +538,7 @@ maintainer-clean-noinstPROGRAMS: mostlyclean-compile: -rm -f *.o core *.core + -rm -f *.$(OBJEXT) clean-compile: @@ -1036,6 +1099,9 @@ check-DEJAGNU: site.exp installcheck: /bin/sh $(srcdir)/sanity.sh $(bindir) +objdump.o:objdump.c + $(COMPILE) -c $(OBJDUMP_DEFS) $(srcdir)/objdump.c + underscore.c: stamp-under ; @true stamp-under: Makefile @@ -1116,8 +1182,13 @@ diststuff: $(DISTSTUFF) info DEP: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h rm -f DEP1 $(MAKE) MKDEP="$(MKDEP)" DEP1 - sed -f dep.sed < DEP1 > $@ - echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> $@ + sed -f dep.sed < DEP1 > DEPA + echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> DEPA + if grep ' /' DEPA > /dev/null 2> /dev/null; then \ + echo 'make DEP failed!'; exit 1; \ + else \ + mv -f DEPA $@; \ + fi DEP1: $(CFILES) $(GENERATED_CFILES) echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > DEP2 @@ -1199,13 +1270,13 @@ addr2line.o: addr2line.c ../bfd/bfd.h $(INCDIR)/ansidecl.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 + 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)/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)/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 \ @@ -1216,13 +1287,13 @@ debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ansidecl.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)/demangle.h $(INCDIR)/dyn-string.h \ - dlltool.h + $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h $(INCDIR)/demangle.h \ + $(INCDIR)/dyn-string.h dlltool.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)/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 @@ -1233,13 +1304,14 @@ nlmconv.o: nlmconv.c ../bfd/bfd.h $(INCDIR)/ansidecl.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)/aout/stab_gnu.h $(INCDIR)/aout/stab.def $(INCDIR)/aout/ranlib.h \ - $(INCDIR)/demangle.h $(INCDIR)/libiberty.h + $(INCDIR)/getopt.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \ + $(INCDIR)/aout/ranlib.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h not-ranlib.o: not-ranlib.c not-strip.o: not-strip.c objcopy.o: objcopy.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ $(INCDIR)/progress.h bucomm.h config.h $(INCDIR)/bin-bugs.h \ - $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h budbg.h + $(INCDIR)/fopen-same.h $(INCDIR)/getopt.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 \ @@ -1304,14 +1376,15 @@ readelf.o: readelf.c ../bfd/bfd.h $(INCDIR)/ansidecl.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)/elf/pj.h $(INCDIR)/elf/avr.h bucomm.h config.h \ - $(INCDIR)/bin-bugs.h $(INCDIR)/fopen-same.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 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 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)/dyn-string.h + $(INCDIR)/fopen-same.h $(INCDIR)/getopt.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 underscore.o: underscore.c diff --git a/gnu/dist/toolchain/binutils/NEWS b/gnu/dist/toolchain/binutils/NEWS index 746c2cc3d4c5..62f858f59b7a 100644 --- a/gnu/dist/toolchain/binutils/NEWS +++ b/gnu/dist/toolchain/binutils/NEWS @@ -1,5 +1,17 @@ -*- text -*- +* Add support for ARM v5t and v5te architectures and Intel's XScale ARM + extenstions. + +* Add --srec-len and --srec-forceS3 command line switch to objcopy. + By Luciano Gemme. + +* Support for the MIPS32, by Anders Norlander. + +* Support for the i860, by Jason Eckhardt. + +* Support for CRIS (Axis Communications ETRAX series). + Changes in binutils 2.10: * New command line switch to objdump --file-start-context which shows the diff --git a/gnu/dist/toolchain/binutils/README b/gnu/dist/toolchain/binutils/README index 4b2d27724499..9157a145ebce 100644 --- a/gnu/dist/toolchain/binutils/README +++ b/gnu/dist/toolchain/binutils/README @@ -111,7 +111,7 @@ with gdb-4.x) may also be of help. Reporting bugs ============== -Send bug reports and patches to bug-gnu-utils@gnu.org. Always mention +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. diff --git a/gnu/dist/toolchain/binutils/acinclude.m4 b/gnu/dist/toolchain/binutils/acinclude.m4 index 71b09b9f6ac7..7ffc031dee40 100644 --- a/gnu/dist/toolchain/binutils/acinclude.m4 +++ b/gnu/dist/toolchain/binutils/acinclude.m4 @@ -1 +1,32 @@ sinclude(../bfd/acinclude.m4) + +dnl sinclude(../libtool.m4) already included in bfd/acinclude.m4 +dnl The lines below arrange for aclocal not to bring libtool.m4 +dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake +dnl to add a definition of LIBTOOL to Makefile.in. +ifelse(yes,no,[ +AC_DEFUN([AM_PROG_LIBTOOL],) +AC_SUBST(LIBTOOL) +]) + +dnl sinclude(../gettext.m4) already included in bfd/acinclude.m4 +ifelse(yes,no,[ +AC_DEFUN([CY_WITH_NLS],) +AC_SUBST(INTLLIBS) +]) + +## Replacement for AC_PROG_LEX and AC_DECL_YYTEXT +## by Alexandre Oliva + +## We need to override the installed aclocal/lex.m4 because of a bug in +## this definition in the recommended automake snapshot of 000227: +## There were double-quotes around ``$missing_dir/missing flex'' which was +## bad since aclocal wraps it in double-quotes. + +dnl AM_PROG_LEX +dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT +AC_DEFUN(AM_PROG_LEX, +[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1) +AC_CHECK_PROGS(LEX, flex lex, [$missing_dir/missing flex]) +AC_PROG_LEX +AC_DECL_YYTEXT]) diff --git a/gnu/dist/toolchain/binutils/aclocal.m4 b/gnu/dist/toolchain/binutils/aclocal.m4 index 2d62d712078c..37c162a1d437 100644 --- a/gnu/dist/toolchain/binutils/aclocal.m4 +++ b/gnu/dist/toolchain/binutils/aclocal.m4 @@ -12,6 +12,48 @@ dnl PARTICULAR PURPOSE. sinclude(../bfd/acinclude.m4) +dnl sinclude(../libtool.m4) already included in bfd/acinclude.m4 +dnl The lines below arrange for aclocal not to bring libtool.m4 +dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake +dnl to add a definition of LIBTOOL to Makefile.in. +ifelse(yes,no,[ +AC_DEFUN([AM_PROG_LIBTOOL],) +AC_SUBST(LIBTOOL) +]) + +dnl sinclude(../gettext.m4) already included in bfd/acinclude.m4 +ifelse(yes,no,[ +AC_DEFUN([CY_WITH_NLS],) +AC_SUBST(INTLLIBS) +]) + +#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"]) + ] +) + + +dnl AM_PROG_LEX +dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT +AC_DEFUN(AM_PROG_LEX, +[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1) +AC_CHECK_PROGS(LEX, flex lex, [$missing_dir/missing flex]) +AC_PROG_LEX +AC_DECL_YYTEXT]) + # 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. @@ -104,415 +146,6 @@ else fi AC_SUBST($1)]) - -# serial 40 AC_PROG_LIBTOOL -AC_DEFUN(AC_PROG_LIBTOOL, -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl - -# Save cache, so that ltconfig can load it -AC_CACHE_SAVE - -# Actually configure libtool. ac_aux_dir is where install-sh is found. -CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ -LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ -LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ -DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ -${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ -|| AC_MSG_ERROR([libtool configure failed]) - -# Reload cache, that may have been modified by ltconfig -AC_CACHE_LOAD - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log -]) - -AC_DEFUN(AC_LIBTOOL_SETUP, -[AC_PREREQ(2.13)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_RANLIB])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_NM])dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -dnl - -case "$target" in -NONE) lt_target="$host" ;; -*) lt_target="$target" ;; -esac - -# Check for any special flags to pass to ltconfig. -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" -ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], -[libtool_flags="$libtool_flags --enable-dlopen"]) -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[libtool_flags="$libtool_flags --enable-win32-dll"]) -AC_ARG_ENABLE(libtool-lock, - [ --disable-libtool-lock avoid locking (might break parallel builds)]) -test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" -test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case "$lt_target" in -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; - -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -]) -esac -]) - -# AC_LIBTOOL_DLOPEN - enable checks for dlopen support -AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) - -# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's -AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) - -# AC_ENABLE_SHARED - implement the --enable-shared flag -# Usage: AC_ENABLE_SHARED[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_SHARED, [dnl -define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(shared, -changequote(<<, >>)dnl -<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_shared=yes ;; -no) enable_shared=no ;; -*) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl -]) - -# AC_DISABLE_SHARED - set the default shared flag to --disable-shared -AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no)]) - -# AC_ENABLE_STATIC - implement the --enable-static flag -# Usage: AC_ENABLE_STATIC[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_STATIC, [dnl -define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(static, -changequote(<<, >>)dnl -<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_static=yes ;; -no) enable_static=no ;; -*) - enable_static=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_static=AC_ENABLE_STATIC_DEFAULT)dnl -]) - -# AC_DISABLE_STATIC - set the default static flag to --disable-static -AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no)]) - - -# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag -# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl -define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(fast-install, -changequote(<<, >>)dnl -<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_fast_install=yes ;; -no) enable_fast_install=no ;; -*) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl -]) - -# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install -AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no)]) - -# AC_PROG_LD - find the path to the GNU or non-GNU linker -AC_DEFUN(AC_PROG_LD, -[AC_ARG_WITH(gnu-ld, -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$ac_cv_prog_gcc" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - ac_prog=`($CC -print-prog-name=ld) 2>&5` - case "$ac_prog" in - # Accept absolute paths. -changequote(,)dnl - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' -changequote([,])dnl - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(ac_cv_path_LD, -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - 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" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" -else - ac_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$ac_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_PROG_LD_GNU -]) - -AC_DEFUN(AC_PROG_LD_GNU, -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - ac_cv_prog_gnu_ld=yes -else - ac_cv_prog_gnu_ld=no -fi]) -]) - -# AC_PROG_NM - find the path to a BSD-compatible name lister -AC_DEFUN(AC_PROG_NM, -[AC_MSG_CHECKING([for BSD-compatible nm]) -AC_CACHE_VAL(ac_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - ac_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 - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -B" - break - elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -p" - break - else - ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm -fi]) -NM="$ac_cv_path_NM" -AC_MSG_RESULT([$NM]) -]) - -# AC_CHECK_LIBM - check for math library -AC_DEFUN(AC_CHECK_LIBM, -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case "$lt_target" in -*-*-beos* | *-*-cygwin*) - # These system don't have libm - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, main, LIBM="-lm") - ;; -esac -]) - -# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl convenience library, adds --enable-ltdl-convenience to -# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor -# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed -# to be `${top_builddir}/libltdl'. Make sure you start DIR with -# '${top_builddir}/' (note the single quotes!) if your package is not -# flat, and, if you're not using automake, define top_builddir as -# appropriate in the Makefiles. -AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case "$enable_ltdl_convenience" in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la - INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) -]) - -# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl installable library, and adds --enable-ltdl-install to -# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor -# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed -# to be `${top_builddir}/libltdl'. Make sure you start DIR with -# '${top_builddir}/' (note the single quotes!) if your package is not -# flat, and, if you're not using automake, define top_builddir as -# appropriate in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, main, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la - INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - INCLTDL= - fi -]) - -dnl old names -AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl -AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl -AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl -AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl -AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl -AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl -AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl - -dnl This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL])dnl - # Like AC_CONFIG_HEADER, but automatically create stamp file. AC_DEFUN(AM_CONFIG_HEADER, @@ -536,360 +169,6 @@ for am_file in <<$1>>; do done<<>>dnl>>) changequote([,]))]) - -dnl AM_PROG_LEX -dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT -AC_DEFUN(AM_PROG_LEX, -[missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1) -AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex") -AC_PROG_LEX -AC_DECL_YYTEXT]) - -# This file is derived from `gettext.m4'. The difference is that the -# included macros assume Cygnus-style source and build trees. - -# Macro to add for using GNU gettext. -# Ulrich Drepper , 1995. -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -# serial 3 - -AC_DEFUN(CY_WITH_NLS, - [AC_MSG_CHECKING([whether NLS is requested]) - dnl Default is enabled NLS - AC_ARG_ENABLE(nls, - [ --disable-nls do not use Native Language Support], - USE_NLS=$enableval, USE_NLS=yes) - AC_MSG_RESULT($USE_NLS) - AC_SUBST(USE_NLS) - - USE_INCLUDED_LIBINTL=no - - dnl If we use NLS figure out what method - if test "$USE_NLS" = "yes"; then - AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested]) - AC_MSG_CHECKING([whether included gettext is requested]) - AC_ARG_WITH(included-gettext, - [ --with-included-gettext use the GNU gettext library included here], - nls_cv_force_use_gnu_gettext=$withval, - nls_cv_force_use_gnu_gettext=no) - AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) - - nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" - if test "$nls_cv_force_use_gnu_gettext" != "yes"; then - dnl User does not insist on using GNU NLS library. Figure out what - dnl to use. If gettext or catgets are available (in this order) we - dnl use this. Else we have to fall back to GNU NLS library. - dnl catgets is only used if permitted by option --with-catgets. - nls_cv_header_intl= - nls_cv_header_libgt= - CATOBJEXT=NONE - - AC_CHECK_HEADER(libintl.h, - [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, - [AC_TRY_LINK([#include ], [return (int) gettext ("")], - gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) - - if test "$gt_cv_func_gettext_libc" != "yes"; then - AC_CHECK_LIB(intl, bindtextdomain, - [AC_CACHE_CHECK([for gettext in libintl], - gt_cv_func_gettext_libintl, - [AC_TRY_LINK([], [return (int) gettext ("")], - gt_cv_func_gettext_libintl=yes, - gt_cv_func_gettext_libintl=no)])]) - fi - - if test "$gt_cv_func_gettext_libc" = "yes" \ - || test "$gt_cv_func_gettext_libintl" = "yes"; then - AC_DEFINE(HAVE_GETTEXT, 1, - [Define as 1 if you have gettext and don't want to use GNU gettext.]) - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl - if test "$MSGFMT" != "no"; then - AC_CHECK_FUNCS(dcgettext) - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) - AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; - return _nl_msg_cat_cntr], - [CATOBJEXT=.gmo - DATADIRNAME=share], - [CATOBJEXT=.mo - DATADIRNAME=lib]) - INSTOBJEXT=.mo - fi - fi - ]) - - dnl In the standard gettext, we would now check for catgets. - dnl However, we never want to use catgets for our releases. - - if test "$CATOBJEXT" = "NONE"; then - dnl Neither gettext nor catgets in included in the C library. - dnl Fall back on GNU gettext library. - nls_cv_use_gnu_gettext=yes - fi - fi - - if test "$nls_cv_use_gnu_gettext" = "yes"; then - dnl Mark actions used to generate GNU NLS library. - INTLOBJS="\$(GETTOBJS)" - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) - AC_SUBST(MSGFMT) - USE_INCLUDED_LIBINTL=yes - CATOBJEXT=.gmo - INSTOBJEXT=.mo - DATADIRNAME=share - INTLDEPS='$(top_builddir)/../intl/libintl.a' - INTLLIBS=$INTLDEPS - LIBS=`echo $LIBS | sed -e 's/-lintl//'` - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - dnl Test whether we really found GNU xgettext. - if test "$XGETTEXT" != ":"; then - dnl If it is no GNU xgettext we define it as : so that the - dnl Makefiles still can work. - if $XGETTEXT --omit-header /dev/null 2> /dev/null; then - : ; - else - AC_MSG_RESULT( - [found xgettext programs is not GNU xgettext; ignore it]) - XGETTEXT=":" - fi - fi - - # We need to process the po/ directory. - POSUB=po - else - DATADIRNAME=share - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - # If this is used in GNU gettext we have to set USE_NLS to `yes' - # because some of the sources are only built for this goal. - if test "$PACKAGE" = gettext; then - USE_NLS=yes - USE_INCLUDED_LIBINTL=yes - fi - - dnl These rules are solely for the distribution goal. While doing this - dnl we only have to keep exactly one list of the available catalogs - dnl in configure.in. - for lang in $ALL_LINGUAS; do - GMOFILES="$GMOFILES $lang.gmo" - POFILES="$POFILES $lang.po" - done - - dnl Make all variables we use known to autoconf. - AC_SUBST(USE_INCLUDED_LIBINTL) - AC_SUBST(CATALOGS) - AC_SUBST(CATOBJEXT) - AC_SUBST(DATADIRNAME) - AC_SUBST(GMOFILES) - AC_SUBST(INSTOBJEXT) - AC_SUBST(INTLDEPS) - AC_SUBST(INTLLIBS) - AC_SUBST(INTLOBJS) - AC_SUBST(POFILES) - AC_SUBST(POSUB) - ]) - -AC_DEFUN(CY_GNU_GETTEXT, - [AC_REQUIRE([AC_PROG_MAKE_SET])dnl - AC_REQUIRE([AC_PROG_CC])dnl - AC_REQUIRE([AC_PROG_RANLIB])dnl - AC_REQUIRE([AC_ISC_POSIX])dnl - AC_REQUIRE([AC_HEADER_STDC])dnl - AC_REQUIRE([AC_C_CONST])dnl - AC_REQUIRE([AC_C_INLINE])dnl - AC_REQUIRE([AC_TYPE_OFF_T])dnl - AC_REQUIRE([AC_TYPE_SIZE_T])dnl - AC_REQUIRE([AC_FUNC_ALLOCA])dnl - AC_REQUIRE([AC_FUNC_MMAP])dnl - - AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ -unistd.h values.h sys/param.h]) - AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ -__argz_count __argz_stringify __argz_next]) - - if test "${ac_cv_func_stpcpy+set}" != "set"; then - AC_CHECK_FUNCS(stpcpy) - fi - if test "${ac_cv_func_stpcpy}" = "yes"; then - AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function]) - fi - - AM_LC_MESSAGES - CY_WITH_NLS - - if test "x$CATOBJEXT" != "x"; then - if test "x$ALL_LINGUAS" = "x"; then - LINGUAS= - else - AC_MSG_CHECKING(for catalogs to be installed) - NEW_LINGUAS= - for lang in ${LINGUAS=$ALL_LINGUAS}; do - case "$ALL_LINGUAS" in - *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; - esac - done - LINGUAS=$NEW_LINGUAS - AC_MSG_RESULT($LINGUAS) - fi - - dnl Construct list of names of catalog files to be constructed. - if test -n "$LINGUAS"; then - for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done - fi - fi - - dnl The reference to in the installed file - dnl must be resolved because we cannot expect the users of this - dnl to define HAVE_LOCALE_H. - if test $ac_cv_header_locale_h = yes; then - INCLUDE_LOCALE_H="#include " - else - INCLUDE_LOCALE_H="\ -/* The system does not provide the header . Take care yourself. */" - fi - AC_SUBST(INCLUDE_LOCALE_H) - - dnl Determine which catalog format we have (if any is needed) - dnl For now we know about two different formats: - dnl Linux libc-5 and the normal X/Open format - if test -f $srcdir/po2tbl.sed.in; then - if test "$CATOBJEXT" = ".cat"; then - AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) - - dnl Transform the SED scripts while copying because some dumb SEDs - dnl cannot handle comments. - sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed - fi - dnl po2tbl.sed is always needed. - sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ - $srcdir/po2tbl.sed.in > po2tbl.sed - fi - - dnl In the intl/Makefile.in we have a special dependency which makes - dnl only sense for gettext. We comment this out for non-gettext - dnl packages. - if test "$PACKAGE" = "gettext"; then - GT_NO="#NO#" - GT_YES= - else - GT_NO= - GT_YES="#YES#" - fi - AC_SUBST(GT_NO) - AC_SUBST(GT_YES) - - MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" - AC_SUBST(MKINSTALLDIRS) - - dnl *** For now the libtool support in intl/Makefile is not for real. - l= - AC_SUBST(l) - - dnl Generate list of files to be processed by xgettext which will - dnl be included in po/Makefile. But only do this if the po directory - dnl exists in srcdir. - if test -d $srcdir/po; then - test -d po || mkdir po - if test "x$srcdir" != "x."; then - if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then - posrcprefix="$srcdir/" - else - posrcprefix="../$srcdir/" - fi - else - posrcprefix="../" - fi - rm -f po/POTFILES - sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ - < $srcdir/po/POTFILES.in > po/POTFILES - fi - ]) - -# Search path for a program which passes the given test. -# Ulrich Drepper , 1996. -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -# serial 1 - -dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, -dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) -AC_DEFUN(AM_PATH_PROG_WITH_TEST, -[# Extract the first word of "$2", so it can be a program name with args. -set dummy $2; ac_word=[$]2 -AC_MSG_CHECKING([for $ac_word]) -AC_CACHE_VAL(ac_cv_path_$1, -[case "[$]$1" in - /*) - ac_cv_path_$1="[$]$1" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in ifelse([$5], , $PATH, [$5]); do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if [$3]; then - ac_cv_path_$1="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" -dnl If no 4th arg is given, leave the cache variable unset, -dnl so AC_PATH_PROGS will keep looking. -ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" -])dnl - ;; -esac])dnl -$1="$ac_cv_path_$1" -if test -n "[$]$1"; then - AC_MSG_RESULT([$]$1) -else - AC_MSG_RESULT(no) -fi -AC_SUBST($1)dnl -]) - -# Check whether LC_MESSAGES is available in . -# Ulrich Drepper , 1995. -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -# serial 1 - -AC_DEFUN(AM_LC_MESSAGES, - [if test $ac_cv_header_locale_h = yes; then - AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, - [AC_TRY_LINK([#include ], [return LC_MESSAGES], - am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) - if test $am_cv_val_LC_MESSAGES = yes; then - AC_DEFINE(HAVE_LC_MESSAGES, 1, - [Define if your locale.h file contains LC_MESSAGES.]) - fi - fi]) - # Add --enable-maintainer-mode option to configure. # From Jim Meyering diff --git a/gnu/dist/toolchain/binutils/addr2line.1 b/gnu/dist/toolchain/binutils/addr2line.1 index 87ce103f8e32..f8dde89be594 100644 --- a/gnu/dist/toolchain/binutils/addr2line.1 +++ b/gnu/dist/toolchain/binutils/addr2line.1 @@ -1,6 +1,6 @@ -.\" Copyright (c) 1997 Free Software Foundation +.\" Copyright (c) 1997, 2000 Free Software Foundation .\" See COPYING for conditions for redistribution -.TH addr2line 1 "27 March 1997" "Cygnus Solutions" "GNU Development Tools" +.TH addr2line 1 "27 March 1997" "Free Software Foundation" "GNU Development Tools" .de BP .sp .ti \-.2i @@ -125,3 +125,379 @@ info\c .I The GNU Binary Utilities\c \&, Roland H. Pesch (October 1991). + +.SH COPYING +Copyright (c) 1993, 94, 95, 96, 97, 98, 1999, 2000 Free Software Foundation, Inc. +.PP +This document is distributed under the terms of the GNU Free +Documentation License, version 1.1. That license is described in the +sources for this manual page, but it is not displayed here in order to +make this manual more consise. Copies of this license can also be +obtained from: http://www.gnu.org/copyleft/. + +\" .SH 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. +\" .PP +\" 0. PREAMBLE +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 1. APPLICABILITY AND DEFINITIONS +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 2. VERBATIM COPYING +\" .PP +\" 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. +\" .PP +\" You may also lend copies, under the same conditions stated above, and +\" you may publicly display copies. +\" .PP +\" 3. COPYING IN QUANTITY +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 4. MODIFICATIONS +\" .PP +\" 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: +\" .PP +\" 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. +\" .PP +\" 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). +\" .PP +\" C. State on the Title page the name of the publisher of the +\" Modified Version, as the publisher. +\" .PP +\" D. Preserve all the copyright notices of the Document. +\" .PP +\" E. Add an appropriate copyright notice for your modifications +\" adjacent to the other copyright notices. +\" .PP +\" 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. +\" Preserve in that license notice the full lists of Invariant Sections +\" and required Cover Texts given in the Document's license notice. +\" .PP +\" H. Include an unaltered copy of this License. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" M. Delete any section entitled "Endorsements". Such a section +\" may not be included in the Modified Version. +\" .PP +\" N. Do not retitle any existing section as "Endorsements" +\" or to conflict in title with any Invariant Section. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 5. COMBINING DOCUMENTS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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." +\" .PP + +\" 6. COLLECTIONS OF DOCUMENTS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 7. AGGREGATION WITH INDEPENDENT WORKS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 8. TRANSLATION +\" .PP +\" 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. +\" .PP + +\" 9. TERMINATION +\" .PP +\" 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. +\" .PP + +\" 10. FUTURE REVISIONS OF THIS LICENSE +\" .PP +\" 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/. +\" .PP +\" 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. +\" .PP + +\" ADDENDUM: How to use this License for your documents +\" .PP +\" 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: +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. diff --git a/gnu/dist/toolchain/binutils/addr2line.c b/gnu/dist/toolchain/binutils/addr2line.c index 20c7eef437c0..ef01f4780cce 100644 --- a/gnu/dist/toolchain/binutils/addr2line.c +++ b/gnu/dist/toolchain/binutils/addr2line.c @@ -1,6 +1,6 @@ /* addr2line.c -- convert addresses to line number and function name Copyright 1997, 98, 99, 2000 Free Software Foundation, Inc. - Contributed by Ulrich Lauther + Contributed by Ulrich Lauther This file is part of GNU Binutils. @@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* Derived from objdump.c and nm.c by Ulrich.Lauther@zfe.siemens.de +/* Derived from objdump.c and nm.c by Ulrich.Lauther@mchp.siemens.de Usage: addr2line [options] addr addr ... @@ -51,7 +51,7 @@ static asymbol **syms; /* Symbol table. */ static struct option long_options[] = { {"basenames", no_argument, NULL, 's'}, - {"demangle", no_argument, NULL, 'C'}, + {"demangle", optional_argument, NULL, 'C'}, {"exe", required_argument, NULL, 'e'}, {"functions", no_argument, NULL, 'f'}, {"target", required_argument, NULL, 'b'}, @@ -75,7 +75,7 @@ usage (stream, status) { fprintf (stream, _("\ Usage: %s [-CfsHV] [-b bfdname] [--target=bfdname]\n\ - [-e executable] [--exe=executable] [--demangle]\n\ + [-e executable] [--exe=executable] [--demangle[=style]]\n\ [--basenames] [--functions] [addr addr ...]\n"), program_name); list_supported_targets (program_name, stream); @@ -271,7 +271,7 @@ main (argc, argv) int argc; char **argv; { - char *filename; + const char *filename; char *target; int c; @@ -301,6 +301,17 @@ main (argc, argv) break; case 'C': do_demangle = true; + 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; case 'e': filename = optarg; diff --git a/gnu/dist/toolchain/binutils/ar.1 b/gnu/dist/toolchain/binutils/ar.1 index cd71a407b371..d7b2caff8e64 100644 --- a/gnu/dist/toolchain/binutils/ar.1 +++ b/gnu/dist/toolchain/binutils/ar.1 @@ -1,6 +1,6 @@ -.\" Copyright (c) 1991, 1992, 1993, 1995, 1998, 1999 Free Software Foundation +.\" Copyright (c) 1991, 1992, 1993, 1995, 1998, 1999, 2000 Free Software Foundation .\" See section COPYING for conditions for redistribution -.TH ar 1 "1999" "Cygnus Solutions" "GNU Development Tools" +.TH ar 1 "1999" "Free Software Foundation" "GNU Development Tools" .de BP .sp .ti \-.2i @@ -515,19 +515,377 @@ The GNU Binary Utilities\c \&. .SH COPYING -Copyright (c) 1991, 1992, 1993, 1995, 1998, 1999 Free Software Foundation, Inc. +Copyright (c) 1991, 1992, 1993, 1995, 1998, 1999, 2000 Free Software Foundation, Inc. .PP -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. -.PP -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. -.PP -Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be included in -translations approved by the Free Software Foundation instead of in -the original English. +This document is distributed under the terms of the GNU Free +Documentation License, version 1.1. That license is described in the +sources for this manual page, but it is not displayed here in order to +make this manual more consise. Copies of this license can also be +obtained from: http://www.gnu.org/copyleft/. + +\" .SH 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. +\" .PP +\" 0. PREAMBLE +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 1. APPLICABILITY AND DEFINITIONS +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 2. VERBATIM COPYING +\" .PP +\" 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. +\" .PP +\" You may also lend copies, under the same conditions stated above, and +\" you may publicly display copies. +\" .PP +\" 3. COPYING IN QUANTITY +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 4. MODIFICATIONS +\" .PP +\" 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: +\" .PP +\" 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. +\" .PP +\" 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). +\" .PP +\" C. State on the Title page the name of the publisher of the +\" Modified Version, as the publisher. +\" .PP +\" D. Preserve all the copyright notices of the Document. +\" .PP +\" E. Add an appropriate copyright notice for your modifications +\" adjacent to the other copyright notices. +\" .PP +\" 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. +\" Preserve in that license notice the full lists of Invariant Sections +\" and required Cover Texts given in the Document's license notice. +\" .PP +\" H. Include an unaltered copy of this License. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" M. Delete any section entitled "Endorsements". Such a section +\" may not be included in the Modified Version. +\" .PP +\" N. Do not retitle any existing section as "Endorsements" +\" or to conflict in title with any Invariant Section. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 5. COMBINING DOCUMENTS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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." +\" .PP + +\" 6. COLLECTIONS OF DOCUMENTS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 7. AGGREGATION WITH INDEPENDENT WORKS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 8. TRANSLATION +\" .PP +\" 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. +\" .PP + +\" 9. TERMINATION +\" .PP +\" 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. +\" .PP + +\" 10. FUTURE REVISIONS OF THIS LICENSE +\" .PP +\" 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/. +\" .PP +\" 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. +\" .PP + +\" ADDENDUM: How to use this License for your documents +\" .PP +\" 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: +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. diff --git a/gnu/dist/toolchain/binutils/ar.c b/gnu/dist/toolchain/binutils/ar.c index d67f4b379292..fe5709f56a49 100644 --- a/gnu/dist/toolchain/binutils/ar.c +++ b/gnu/dist/toolchain/binutils/ar.c @@ -250,7 +250,7 @@ usage (help) if (! is_ranlib) { /* xgettext:c-format */ - fprintf (s, _("Usage: %s [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] archive-file file...\n"), + fprintf (s, _("Usage: %s [-X32_64] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] archive-file file...\n"), program_name); /* xgettext:c-format */ fprintf (s, _(" %s -M [ filename) + if (filename == NULL || (bslash != NULL && bslash > filename)) filename = bslash; if (filename == NULL && file[0] != '\0' && file[1] == ':') - filename = file + 1; + filename = file + 1; } #endif if (filename != (char *) NULL) @@ -392,7 +393,7 @@ main (argc, argv) { /* We could have foo/bar\\baz, or foo\\bar, or d:bar. */ char *bslash = strrchr (program_name, '\\'); - if (bslash > temp) + if (temp == NULL || (bslash != NULL && bslash > temp)) temp = bslash; if (temp == NULL && program_name[0] != '\0' && program_name[1] == ':') temp = program_name + 1; @@ -431,6 +432,17 @@ main (argc, argv) xatexit (remove_output); + /* Ignored for (partial) AIX compatibility. On AIX, + the -X option can be used to ignore certain kinds + of object files in the archive (the 64-bit objects + or the 32-bit objects). GNU ar always looks at all + kinds of objects in an archive. */ + while (argc > 1 && strcmp (argv[1], "-X32_64") == 0) + { + argv++; + argc--; + } + if (is_ranlib) { boolean touch = false; @@ -812,7 +824,8 @@ print_contents (abfd) fatal (_("internal stat error on %s"), bfd_get_filename (abfd)); if (verbose) - printf ("\n<%s>\n\n", bfd_get_filename (abfd)); + /* xgettext:c-format */ + printf (_("\n\n\n"), bfd_get_filename (abfd)); bfd_seek (abfd, 0, SEEK_SET); diff --git a/gnu/dist/toolchain/binutils/arlex.c b/gnu/dist/toolchain/binutils/arlex.c index 776599a98d01..8f2e95884a3c 100644 --- a/gnu/dist/toolchain/binutils/arlex.c +++ b/gnu/dist/toolchain/binutils/arlex.c @@ -1,7 +1,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /cvs/src/src/binutils/Attic/arlex.c,v 1.1.2.1 2000/05/29 14:08:52 pb Exp $ + * $Header: /cvs/src/src/binutils/Attic/arlex.c,v 1.1.4.1 2001/03/12 15:40:34 pb Exp $ */ #define FLEX_SCANNER diff --git a/gnu/dist/toolchain/binutils/binutils.info b/gnu/dist/toolchain/binutils/binutils.info index ee48dd55088e..6f49feac86a6 100644 --- a/gnu/dist/toolchain/binutils/binutils.info +++ b/gnu/dist/toolchain/binutils/binutils.info @@ -20,55 +20,50 @@ START-INFO-DIR-ENTRY * dlltool: (binutils)dlltool. Create files needed to build and use DLLs END-INFO-DIR-ENTRY - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free + Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided also -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. + 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".  Indirect: -binutils.info-1: 1845 -binutils.info-2: 49762 -binutils.info-3: 96952 +binutils.info-1: 1680 +binutils.info-2: 51584 +binutils.info-3: 99084  Tag Table: (Indirect) -Node: Top1845 -Node: ar3096 -Node: ar cmdline5270 -Node: ar scripts13109 -Node: nm18788 -Node: objcopy25758 -Node: objdump38585 -Node: ranlib49013 -Node: size49762 -Node: strings52493 -Node: strip54318 -Node: c++filt57283 -Ref: c++filt-Footnote-160140 -Node: addr2line60246 -Node: nlmconv62652 -Node: windres65256 -Node: dlltool70308 -Node: readelf79649 -Node: Selecting The Target System82799 -Node: Target Selection83816 -Node: Architecture Selection86517 -Node: Linker Emulation Selection87748 -Node: Reporting Bugs88626 -Node: Bug Criteria89377 -Node: Bug Reporting89923 -Node: Index96952 +Node: Top1680 +Node: ar3177 +Node: ar cmdline5351 +Node: ar scripts13479 +Node: nm19158 +Node: objcopy26576 +Node: objdump40217 +Node: ranlib50835 +Node: size51584 +Node: strings54315 +Node: strip56140 +Node: c++filt59105 +Ref: c++filt-Footnote-162042 +Node: addr2line62148 +Node: nlmconv64743 +Node: windres67347 +Node: dlltool72399 +Node: readelf81740 +Node: Selecting The Target System84908 +Node: Target Selection85925 +Node: Architecture Selection88626 +Node: Linker Emulation Selection89857 +Node: Reporting Bugs90735 +Node: Bug Criteria91511 +Node: Bug Reporting92057 +Node: GNU Free Documentation License99084 +Node: Index117512  End Tag Table diff --git a/gnu/dist/toolchain/binutils/binutils.info-1 b/gnu/dist/toolchain/binutils/binutils.info-1 index 2bbcd85ba5aa..1ff320a10457 100644 --- a/gnu/dist/toolchain/binutils/binutils.info-1 +++ b/gnu/dist/toolchain/binutils/binutils.info-1 @@ -20,21 +20,15 @@ START-INFO-DIR-ENTRY * dlltool: (binutils)dlltool. Create files needed to build and use DLLs END-INFO-DIR-ENTRY - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free + Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided also -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. + 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".  File: binutils.info, Node: Top, Next: ar, Up: (dir) @@ -43,7 +37,11 @@ Introduction ************ This brief manual contains preliminary documentation for the GNU -binary utilities (collectively version 2.10.1): +binary utilities (collectively version 2.11): + + 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: @@ -64,6 +62,7 @@ binary utilities (collectively version 2.10.1): * 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  @@ -123,7 +122,7 @@ File: binutils.info, Node: ar cmdline, Next: ar scripts, Up: ar Controlling `ar' on the command line ==================================== - ar [-]P[MOD [RELPOS] [COUNT]] ARCHIVE [MEMBER...] + ar [-X32_64] [-]P[MOD [RELPOS] [COUNT]] ARCHIVE [MEMBER...] When you use `ar' in the Unix style, `ar' insists on at least two arguments to execute: one keyletter specifying the _operation_ @@ -312,6 +311,12 @@ to specify variations on an operation's behavior: `V' This modifier shows the version number of `ar'. + `ar' ignores an initial option spelt `-X32_64', for compatibility +with AIX. The behaviour produced by this option is the default for GNU +`ar'. `ar' does not support any of the other `-X' options; in +particular, it does not support `-X32' which is the default for AIX +`ar'. +  File: binutils.info, Node: ar scripts, Prev: ar cmdline, Up: ar @@ -461,14 +466,14 @@ nm ** nm [ -a | --debug-syms ] [ -g | --extern-only ] - [ -B ] [ -C | --demangle ] [ -D | --dynamic ] + [ -B ] [ -C | --demangle[=STYLE] ] [ -D | --dynamic ] [ -s | --print-armap ] [ -A | -o | --print-file-name ] [ -n | -v | --numeric-sort ] [ -p | --no-sort ] [ -r | --reverse-sort ] [ --size-sort ] [ -u | --undefined-only ] [ -t RADIX | --radix=RADIX ] [ -P | --portability ] [ --target=BFDNAME ] [ -f FORMAT | --format=FORMAT ] - [ --defined-only ] [-l | --line-numbers ] - [ --no-demangle ] [ -V | --version ] [ --help ] [ OBJFILE... ] + [ --defined-only ] [-l | --line-numbers ] [ --no-demangle ] + [ -V | --version ] [ -X 32_64 ] [ --help ] [ OBJFILE... ] GNU `nm' lists the symbols from object files OBJFILE.... If no object files are listed as arguments, `nm' assumes the file `a.out'. @@ -574,11 +579,13 @@ equivalent. The same as `--format=bsd' (for compatibility with the MIPS `nm'). `-C' -`--demangle' +`--demangle[=STYLE]' Decode ("demangle") low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, - this makes C++ function names readable. *Note c++filt::, for more - information on demangling. + 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. *Note c++filt::, for more information on demangling. `--no-demangle' Do not demangle low-level symbol names. This is the default. @@ -662,6 +669,12 @@ equivalent. `--version' Show the version number of `nm' and exit. +`-X' + This option is ignored for compatibility with the AIX version of + `nm'. It takes one parameter which must be the string `32_64'. + The default mode of AIX `nm' corresponds to `-X 32', which is not + supported by GNU `nm'. + `--help' Show a summary of the options to `nm' and exit. @@ -695,6 +708,7 @@ objcopy [ --set-section-flags SECTION=FLAGS ] [ --add-section SECTIONNAME=FILENAME ] [ --change-leading-char ] [ --remove-leading-char ] + [ --srec-len=IVAL ] [ --srec-forceS3 ] [ --redefine-sym OLD=NEW ] [ --weaken ] [ -v | --verbose ] [ -V | --version ] [ --help ] INFILE [OUTFILE] @@ -703,7 +717,10 @@ objcopy another. `objcopy' uses the GNU 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 -`objcopy' is controlled by command-line options. +`objcopy' is controlled by command-line options. Note that `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. `objcopy' creates temporary files to do its translations and deletes them afterward. `objcopy' uses BFD to do all its translation work; it @@ -726,6 +743,11 @@ to use `-S' to remove sections containing debugging information. In some cases `-R' will be useful to remove sections which contain information that is not needed by the binary file. + Note - `objcopy' is not able to change the endianness of its input +files. If the input format has an endianness, (some formats do not), +`objcopy' can only copy the inputs into file formats that have the same +endianness or which have no endianness (eg `srec'). + `INFILE' `OUTFILE' The input and output files, respectively. If you do not specify @@ -940,6 +962,15 @@ information that is not needed by the binary file. because it always changes the symbol name when appropriate, regardless of the object file format of the output file. +`--srec-len=IVAL' + Meaningful only for srec output. Set the maximum length of the + Srecords being produced to IVAL. This length covers both address, + data and crc fields. + +`--srec-forceS3' + Meaningful only for srec output. Avoid generation of S1/S2 + records, creating S3-only record format. + `--redefine-sym OLD=NEW' Change the name of a symbol OLD, to NEW. This can be useful when one is trying link two things together for which you have no @@ -972,7 +1003,7 @@ objdump objdump [ -a | --archive-headers ] [ -b BFDNAME | --target=BFDNAME ] - [ -C | --demangle ] + [ -C | --demangle[=STYLE] ] [ -d | --disassemble ] [ -D | --disassemble-all ] [ -z | --disassemble-zeroes ] @@ -1049,11 +1080,13 @@ equivalent. At least one option from the list for more information. `-C' -`--demangle' +`--demangle[=STYLE]' Decode ("demangle") low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, - this makes C++ function names readable. *Note c++filt::, for more - information on demangling. + 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. *Note c++filt::, for more information on demangling. `-G' diff --git a/gnu/dist/toolchain/binutils/binutils.info-2 b/gnu/dist/toolchain/binutils/binutils.info-2 index 5395d1d3faf8..8422d1e6528d 100644 --- a/gnu/dist/toolchain/binutils/binutils.info-2 +++ b/gnu/dist/toolchain/binutils/binutils.info-2 @@ -20,21 +20,15 @@ START-INFO-DIR-ENTRY * dlltool: (binutils)dlltool. Create files needed to build and use DLLs END-INFO-DIR-ENTRY - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free + Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided also -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. + 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".  File: binutils.info, Node: size, Next: strings, Prev: readelf, Up: Top @@ -347,6 +341,9 @@ output. All results are printed on the standard output. `edg' the one used by the EDG compiler + `gnu-new-abi' + the one used by the GNU compiler with the new ABI. + `--help' Print a summary of the options to `c++filt' and exit. @@ -376,7 +373,7 @@ addr2line ********* addr2line [ -b BFDNAME | --target=BFDNAME ] - [ -C | --demangle ] + [ -C | --demangle[=STYLE ] [ -e FILENAME | --exe=FILENAME ] [ -f | --functions ] [ -s | --basename ] [ -H | --help ] [ -V | --version ] @@ -420,11 +417,13 @@ equivalent. BFDNAME. `-C' -`--demangle' +`--demangle[=STYLE]' Decode ("demangle") low-level symbol names into user-level names. Besides removing any initial underscore prepended by the system, - this makes C++ function names readable. *Note c++filt::, for more - information on demangling. + 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. *Note c++filt::, for more information on demangling. `-e FILENAME' `--exe=FILENAME' @@ -898,7 +897,7 @@ readelf [ -V | --version-info] [ -D | --use-dynamic] [ -x | --hex-dump=] - [ -w[liapr] | --debug-dump[=info,=line,=abbrev,=pubnames,=ranges]] + [ -w[liaprf] | --debug-dump[=info,=line,=abbrev,=pubnames,=ranges,=frames]] [ --histogram] [ -v | --version] [ -H | --help] @@ -976,8 +975,8 @@ equivalent. At least one option besides `-v' or `-H' must be given. Displays the contents of the indicated section as a hexadecimal dump. -`-w[liapr]' -`--debug-dump[=line,=info,=abbrev,=pubnames,=ranges]' +`-w[liaprf]' +`--debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=frames]' 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 @@ -1211,7 +1210,7 @@ In particular, it consists of `EMUL' in `config/TARGET.mt'  -File: binutils.info, Node: Reporting Bugs, Next: Index, Prev: Selecting The Target System, Up: Top +File: binutils.info, Node: Reporting Bugs, Next: GNU Free Documentation License, Prev: Selecting The Target System, Up: Top Reporting Bugs ************** @@ -1265,7 +1264,7 @@ organization, we recommend you contact that organization first. individuals in the file `etc/SERVICE' in the GNU Emacs distribution. In any event, we also recommend that you send bug reports for the -binary utilities to `bug-gnu-utils@gnu.org'. +binary utilities to `bug-binutils@gnu.org'. The fundamental principle of reporting bugs usefully is this: *report all the facts*. If you are not sure whether to state a fact or @@ -1318,7 +1317,7 @@ to respond to them_ except to chide the sender to report bugs properly. 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 `bug-gnu-utils@gnu.org' is a mailing list, so you should avoid + that `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. diff --git a/gnu/dist/toolchain/binutils/binutils.info-3 b/gnu/dist/toolchain/binutils/binutils.info-3 index 4de1e8e001a5..f64b47e5cad6 100644 --- a/gnu/dist/toolchain/binutils/binutils.info-3 +++ b/gnu/dist/toolchain/binutils/binutils.info-3 @@ -20,24 +20,368 @@ START-INFO-DIR-ENTRY * dlltool: (binutils)dlltool. Create files needed to build and use DLLs END-INFO-DIR-ENTRY - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free + Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. - Permission is granted to make and distribute verbatim copies of this -manual provided the copyright notice and this permission notice are -preserved on all copies. - - Permission is granted to copy and distribute modified versions of -this manual under the conditions for verbatim copying, provided also -that the entire resulting derived work is distributed under the terms -of a permission notice identical to this one. - - Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions. + 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".  -File: binutils.info, Node: Index, Prev: Reporting Bugs, Up: Top +File: binutils.info, Node: GNU Free Documentation License, Next: Index, Prev: Reporting Bugs, Up: Top + +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: + + 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". + + 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. + + +File: binutils.info, Node: Index, Prev: GNU Free Documentation License, Up: Top Index ***** @@ -107,6 +451,7 @@ Index * extract from archive: ar cmdline. * fatal signal: Bug Criteria. * file name: nm. +* GNU Free Documentation License: GNU Free Documentation License. * header information, all: objdump. * input .def file: dlltool. * input file name: nm. diff --git a/gnu/dist/toolchain/binutils/binutils.texi b/gnu/dist/toolchain/binutils/binutils.texi index c2232e3026c3..41146635c19b 100644 --- a/gnu/dist/toolchain/binutils/binutils.texi +++ b/gnu/dist/toolchain/binutils/binutils.texi @@ -26,11 +26,14 @@ END-INFO-DIR-ENTRY @end ifinfo @ifinfo -Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. +Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. + 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". @ignore Permission is granted to process this file through TeX and print the @@ -39,14 +42,6 @@ notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore - -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided also that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions. @end ifinfo @synindex ky cp @@ -54,10 +49,10 @@ into another language, under the above conditions for modified versions. @c This file documents the GNU binary utilities "ar", "ld", "objcopy", @c "objdump", "nm", "size", "strings", "strip", "readelf" and "ranlib". @c -@c Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. +@c Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. @c @c This text may be freely distributed under the terms of the GNU -@c General Public License. +@c Free Documentation License. @c @setchapternewpage odd @@ -79,19 +74,15 @@ into another language, under the above conditions for modified versions. @end tex @vskip 0pt plus 1filll -Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. +Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 1998, 2000, 2001 Free Software Foundation, Inc. -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. + 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 and distribute modified versions of this -manual under the conditions for verbatim copying, provided also that -the entire resulting derived work is distributed under the terms of a -permission notice identical to this one. - -Permission is granted to copy and distribute translations of this manual -into another language, under the above conditions for modified versions. @end titlepage @node Top @@ -148,6 +139,10 @@ 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 @@ -166,6 +161,7 @@ Create the files needed to build and use Dynamic Link Libraries * 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 @@ -234,7 +230,7 @@ program. @section Controlling @code{ar} on the command line @smallexample -ar [-]@var{p}[@var{mod} [@var{relpos}] [@var{count}]] @var{archive} [@var{member}@dots{}] +ar [-X32_64] [-]@var{p}[@var{mod} [@var{relpos}] [@var{count}]] @var{archive} [@var{member}@dots{}] @end smallexample @cindex Unix compatibility, @code{ar} @@ -451,6 +447,12 @@ when the modifier @samp{v} is appended. This modifier shows the version number of @code{ar}. @end table +@code{ar} ignores an initial option spelt @code{-X32_64}, for +compatibility with AIX. The behaviour produced by this option is the +default for GNU @code{ar}. @code{ar} does not support any of the other +@code{-X} options; in particular, it does not support @code{-X32} +which is the default for AIX @code{ar}. + @node ar scripts @section Controlling @code{ar} with a script @@ -630,14 +632,14 @@ The @sc{gnu} linker @code{ld} is now described in a separate manual. @smallexample nm [ -a | --debug-syms ] [ -g | --extern-only ] - [ -B ] [ -C | --demangle ] [ -D | --dynamic ] + [ -B ] [ -C | --demangle[=@var{style}] ] [ -D | --dynamic ] [ -s | --print-armap ] [ -A | -o | --print-file-name ] [ -n | -v | --numeric-sort ] [ -p | --no-sort ] [ -r | --reverse-sort ] [ --size-sort ] [ -u | --undefined-only ] [ -t @var{radix} | --radix=@var{radix} ] [ -P | --portability ] [ --target=@var{bfdname} ] [ -f @var{format} | --format=@var{format} ] - [ --defined-only ] [-l | --line-numbers ] - [ --no-demangle ] [ -V | --version ] [ --help ] [ @var{objfile}@dots{} ] + [ --defined-only ] [-l | --line-numbers ] [ --no-demangle ] + [ -V | --version ] [ -X 32_64 ] [ --help ] [ @var{objfile}@dots{} ] @end smallexample @sc{gnu} @code{nm} lists the symbols from object files @var{objfile}@dots{}. @@ -754,12 +756,14 @@ listed. The same as @samp{--format=bsd} (for compatibility with the MIPS @code{nm}). @item -C -@itemx --demangle +@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. @xref{c++filt}, for more information -on demangling. +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. @@ -853,6 +857,12 @@ Display only defined symbols for each object file. @itemx --version Show the version number of @code{nm} and exit. +@item -X +This option is ignored for compatibility with the AIX version of +@code{nm}. It takes one parameter which must be the string +@code{32_64}. The default mode of AIX @code{nm} corresponds +to @code{-X 32}, which is not supported by @sc{gnu} @code{nm}. + @item --help Show a summary of the options to @code{nm} and exit. @end table @@ -885,6 +895,7 @@ objcopy [ -F @var{bfdname} | --target=@var{bfdname} ] [ --set-section-flags @var{section}=@var{flags} ] [ --add-section @var{sectionname}=@var{filename} ] [ --change-leading-char ] [ --remove-leading-char ] + [ --srec-len=@var{ival} ] [ --srec-forceS3 ] [ --redefine-sym @var{old}=@var{new} ] [ --weaken ] [ -v | --verbose ] [ -V | --version ] [ --help ] @var{infile} [@var{outfile}] @@ -895,6 +906,9 @@ file to another. @code{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 @code{objcopy} is controlled by command-line options. +Note that @code{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. @code{objcopy} creates temporary files to do its translations and deletes them afterward. @code{objcopy} uses @sc{bfd} to do all its @@ -917,6 +931,11 @@ use @samp{-S} to remove sections containing debugging information. In some cases @samp{-R} will be useful to remove sections which contain information that is not needed by the binary file. +Note - @code{objcopy} is not able to change the endianness of its input +files. If the input format has an endianness, (some formats do not), +@code{objcopy} can only copy the inputs into file formats that have the +same endianness or which have no endianness (eg @samp{srec}). + @table @code @item @var{infile} @itemx @var{outfile} @@ -1137,6 +1156,15 @@ different conventions for symbol names. This is different from 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 @@ -1170,7 +1198,7 @@ Show a summary of the options to @code{objcopy}. @smallexample objdump [ -a | --archive-headers ] [ -b @var{bfdname} | --target=@var{bfdname} ] - [ -C | --demangle ] + [ -C | --demangle[=@var{style}] ] [ -d | --disassemble ] [ -D | --disassemble-all ] [ -z | --disassemble-zeroes ] @@ -1255,12 +1283,14 @@ formats available with the @samp{-i} option. @xref{Target Selection}, for more information. @item -C -@itemx --demangle +@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. @xref{c++filt}, for more information -on demangling. +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 @@ -1856,6 +1886,8 @@ the one specified by the C++ Annotated Reference Manual 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 @@ -1891,7 +1923,7 @@ c++filt @var{option} @var{symbol} @smallexample addr2line [ -b @var{bfdname} | --target=@var{bfdname} ] - [ -C | --demangle ] + [ -C | --demangle[=@var{style} ] [ -e @var{filename} | --exe=@var{filename} ] [ -f | --functions ] [ -s | --basename ] [ -H | --help ] [ -V | --version ] @@ -1938,12 +1970,14 @@ Specify that the object-code format for the object files is @var{bfdname}. @item -C -@itemx --demangle +@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. @xref{c++filt}, for more information -on demangling. +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} @@ -2449,7 +2483,7 @@ readelf [ -a | --all ] [ -V | --version-info] [ -D | --use-dynamic] [ -x | --hex-dump=] - [ -w[liapr] | --debug-dump[=info,=line,=abbrev,=pubnames,=ranges]] + [ -w[liaprf] | --debug-dump[=info,=line,=abbrev,=pubnames,=ranges,=frames]] [ --histogram] [ -v | --version] [ -H | --help] @@ -2537,8 +2571,8 @@ symbols section. @itemx --hex-dump= Displays the contents of the indicated section as a hexadecimal dump. -@item -w[liapr] -@itemx --debug-dump[=line,=info,=abbrev,=pubnames,=ranges] +@item -w[liaprf] +@itemx --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=frames] 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. @@ -2871,7 +2905,7 @@ individuals in the file @file{etc/SERVICE} in the @sc{gnu} Emacs distribution. In any event, we also recommend that you send bug reports for the binary -utilities to @samp{bug-gnu-utils@@gnu.org}. +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 @@ -2932,7 +2966,7 @@ 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-gnu-utils@@gnu.org} is a mailing list, so you should avoid +@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. @@ -3020,6 +3054,370 @@ 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 diff --git a/gnu/dist/toolchain/binutils/bucomm.h b/gnu/dist/toolchain/binutils/bucomm.h index c6dc26a1f09f..e9d675e31ae1 100644 --- a/gnu/dist/toolchain/binutils/bucomm.h +++ b/gnu/dist/toolchain/binutils/bucomm.h @@ -138,12 +138,11 @@ void *alloca (); # define N_(String) (String) # endif #else -/* Stubs that do something close enough. */ -# define textdomain(String) (String) -# define gettext(String) (String) -# define dgettext(Domain,Message) (Message) -# define dcgettext(Domain,Message,Type) (Message) -# define bindtextdomain(Domain,Directory) (Domain) +# define gettext(Msgid) (Msgid) +# define dgettext(Domainname, Msgid) (Msgid) +# define dcgettext(Domainname, Msgid, Category) (Msgid) +# define textdomain(Domainname) while (0) /* nothing */ +# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ # define _(String) (String) # define N_(String) (String) #endif diff --git a/gnu/dist/toolchain/binutils/coffgrok.c b/gnu/dist/toolchain/binutils/coffgrok.c index 8c4e6c9c98e5..3486c5f89d43 100644 --- a/gnu/dist/toolchain/binutils/coffgrok.c +++ b/gnu/dist/toolchain/binutils/coffgrok.c @@ -245,7 +245,7 @@ static struct coff_line * do_lines (i, name) int i; - char *name; + char *name ATTRIBUTE_UNUSED; { struct coff_line *res = (struct coff_line *) xcalloc (sizeof (struct coff_line), 1); asection *s; diff --git a/gnu/dist/toolchain/binutils/config.in b/gnu/dist/toolchain/binutils/config.in index 7b70d16d867e..8a0e1c575179 100644 --- a/gnu/dist/toolchain/binutils/config.in +++ b/gnu/dist/toolchain/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 diff --git a/gnu/dist/toolchain/binutils/config.texi b/gnu/dist/toolchain/binutils/config.texi index 4c75b6221634..a9ad8485564f 100644 --- a/gnu/dist/toolchain/binutils/config.texi +++ b/gnu/dist/toolchain/binutils/config.texi @@ -1 +1 @@ -@set VERSION 2.10.1 +@set VERSION 2.11 diff --git a/gnu/dist/toolchain/binutils/configure b/gnu/dist/toolchain/binutils/configure index f454df57fbf9..bfadf4746145 100755 --- a/gnu/dist/toolchain/binutils/configure +++ b/gnu/dist/toolchain/binutils/configure @@ -21,10 +21,14 @@ ac_help="$ac_help --with-gnu-ld assume the C compiler uses GNU ld [default=no]" ac_help="$ac_help --disable-libtool-lock avoid locking (might break parallel builds)" +ac_help="$ac_help + --with-pic try to use only PIC/non-PIC objects [default=use both]" ac_help="$ac_help --enable-targets alternative target configurations" ac_help="$ac_help --enable-commonbfdlib build shared BFD/opcodes/libiberty library" +ac_help="$ac_help + --enable-build-warnings Enable build-time compiler warnings if gcc is used" ac_help="$ac_help --disable-nls do not use Native Language Support" ac_help="$ac_help @@ -49,6 +53,7 @@ program_suffix=NONE program_transform_name=s,x,x, silent= site= +sitefile= srcdir= target=NONE verbose= @@ -163,6 +168,7 @@ 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 @@ -333,6 +339,11 @@ 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=*) @@ -498,12 +509,16 @@ fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +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 fi +else + CONFIG_SITE="$sitefile" fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then @@ -541,6 +556,68 @@ else ac_n= ac_c='\c' ac_t= fi +echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 +echo "configure:561: checking for Cygwin environment" >&5 +if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_cygwin=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_cygwin=no +fi +rm -f conftest* +rm -f conftest* +fi + +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 +if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_mingw32=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_mingw32=no +fi +rm -f conftest* +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_mingw32" 1>&6 +MINGW32= +test "$ac_cv_mingw32" = yes && MINGW32=yes ac_aux_dir= @@ -590,7 +667,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:594: checking host system type" >&5 +echo "configure:671: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -611,7 +688,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$host" 1>&6 echo $ac_n "checking target system type""... $ac_c" 1>&6 -echo "configure:615: checking target system type" >&5 +echo "configure:692: checking target system type" >&5 target_alias=$target case "$target_alias" in @@ -629,7 +706,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$ac_t""$target" 1>&6 echo $ac_n "checking build system type""... $ac_c" 1>&6 -echo "configure:633: checking build system type" >&5 +echo "configure:710: checking build system type" >&5 build_alias=$build case "$build_alias" in @@ -651,249 +728,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:658: 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:734: 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="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:688: 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:739: 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:771: 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 782 "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:753: \"$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:813: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross - -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:818: checking whether we are using GNU C" >&5 -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:846: 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:878: 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 + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -907,7 +784,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:911: checking for a BSD compatible install" >&5 +echo "configure:788: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -960,7 +837,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 -echo "configure:964: checking whether build environment is sane" >&5 +echo "configure:841: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -1017,7 +894,7 @@ test "$program_suffix" != NONE && test "$program_transform_name" = "" && program_transform_name="s,x,x," echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1021: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:898: 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 @@ -1046,7 +923,7 @@ fi PACKAGE=binutils -VERSION=2.10.1 +VERSION=2.11 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; } @@ -1063,7 +940,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:1067: checking for working aclocal" >&5 +echo "configure:944: checking for working aclocal" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1076,7 +953,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:1080: checking for working autoconf" >&5 +echo "configure:957: checking for working autoconf" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1089,7 +966,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:1093: checking for working automake" >&5 +echo "configure:970: checking for working automake" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1102,7 +979,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:1106: checking for working autoheader" >&5 +echo "configure:983: checking for working autoheader" >&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -1115,7 +992,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:1119: checking for working makeinfo" >&5 +echo "configure:996: 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. @@ -1198,36 +1075,228 @@ else enable_fast_install=yes fi -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 +# 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:1205: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then +echo "configure:1082: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" + ac_cv_prog_CC="gcc" break fi done IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" fi fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 else echo "$ac_t""no" 1>&6 fi +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:1112: 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:1163: 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:1195: 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 1206 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:1211: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then + ac_cv_prog_cc_cross=no + else + ac_cv_prog_cc_cross=yes + fi +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_prog_cc_works=no +fi +rm -fr conftest* +ac_ext=c +# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +cross_compiling=$ac_cv_prog_cc_cross + +echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 +if test $ac_cv_prog_cc_works = no; then + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } +fi +echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +echo "configure:1237: 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:1242: 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:1270: checking whether ${CC-cc} accepts -g" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + echo 'void f(){}' > conftest.c +if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi + # Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval="$with_gnu_ld" @@ -1240,8 +1309,14 @@ ac_prog=ld if test "$ac_cv_prog_gcc" = yes; then # Check if gcc -print-prog-name=ld gives a path. echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 -echo "configure:1244: checking for ld used by GCC" >&5 - ac_prog=`($CC -print-prog-name=ld) 2>&5` +echo "configure:1313: checking for ld used by GCC" >&5 + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac case "$ac_prog" in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) @@ -1264,10 +1339,10 @@ echo "configure:1244: 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:1268: checking for GNU ld" >&5 +echo "configure:1343: checking for GNU ld" >&5 else echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 -echo "configure:1271: checking for non-GNU ld" >&5 +echo "configure:1346: checking for non-GNU ld" >&5 fi if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1302,7 +1377,7 @@ 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:1306: checking if the linker ($LD) is GNU ld" >&5 +echo "configure:1381: checking if the linker ($LD) is GNU ld" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1315,10 +1390,23 @@ fi fi echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 +with_gnu_ld=$ac_cv_prog_gnu_ld +echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6 +echo "configure:1398: 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 + lt_cv_ld_reload_flag='-r' +fi + +echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6 +reload_flag=$lt_cv_ld_reload_flag +test -n "$reload_flag" && reload_flag=" $reload_flag" + echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 -echo "configure:1322: checking for BSD-compatible nm" >&5 +echo "configure:1410: checking for BSD-compatible nm" >&5 if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1329,18 +1417,20 @@ else IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then + tmp_nm=$ac_dir/${ac_tool_prefix}nm + if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored - if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -B" + # 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" break - elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -p" + 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" break else - ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but + ac_cv_path_NM=${ac_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 @@ -1354,7 +1444,7 @@ NM="$ac_cv_path_NM" echo "$ac_t""$NM" 1>&6 echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:1358: checking whether ln -s works" >&5 +echo "configure:1448: 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 @@ -1374,12 +1464,484 @@ else echo "$ac_t""no" 1>&6 fi +echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6 +echo "configure:1469: 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 + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [regex]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given egrep regex. +# 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 "$target" in -NONE) lt_target="$host" ;; -*) lt_target="$target" ;; +case "$host_os" in +aix4*) + lt_cv_deplibs_check_method=pass_all + ;; + +beos*) + lt_cv_deplibs_check_method=pass_all + ;; + +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_file_magic_test_file=/shlib/libc.so + ;; + +cygwin* | mingw* |pw32*) + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +freebsd* ) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + 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_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +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' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + +irix5* | irix6*) + 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 + *-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" + ;; + esac + lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*` + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux-gnu*) + case "$host_cpu" in + alpha* | 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_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then : + 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*` + fi + ;; + +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' + lt_cv_file_magic_test_file=/shlib/libc.so + lt_cv_deplibs_check_method=pass_all + ;; + +sco3.2v5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + lt_cv_file_magic_test_file=/lib/libc.so + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + 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*` + ;; + esac + ;; esac +fi + +echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6 +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method + +echo $ac_n "checking for object suffix""... $ac_c" 1>&6 +echo "configure:1612: 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:1618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + for ac_file in conftest.*; do + case $ac_file in + *.c) ;; + *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; + esac + done +else + { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_objext" 1>&6 +OBJEXT=$ac_cv_objext +ac_objext=$ac_cv_objext + + + +echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +echo "configure:1638: checking for executable suffix" >&5 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$CYGWIN" = yes || test "$MINGW32" = yes; then + ac_cv_exeext=.exe +else + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= + if { (eval echo configure:1648: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj | *.ilk | *.pdb) ;; + *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; + esac + done + else + { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } + fi + rm -f conftest* + test x"${ac_cv_exeext}" = x && ac_cv_exeext=no +fi +fi + +EXEEXT="" +test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} +echo "$ac_t""${ac_cv_exeext}" 1>&6 +ac_exeext=$EXEEXT + +if test $host != $build; then + ac_tool_prefix=${host_alias}- +else + ac_tool_prefix= +fi + +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! + +# Only perform the check for file, if the check method requires it +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:1681: 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 + /*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; + ?:/*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. + ;; + *) + ac_save_MAGIC_CMD="$MAGIC_CMD" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="/usr/bin:$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + 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 + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + egrep "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$ac_save_ifs" + MAGIC_CMD="$ac_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$ac_t""$MAGIC_CMD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo $ac_n "checking for file""... $ac_c" 1>&6 +echo "configure:1743: 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 + /*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; + ?:/*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path. + ;; + *) + ac_save_MAGIC_CMD="$MAGIC_CMD" + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="/usr/bin:$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + 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 + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + egrep "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$ac_save_ifs" + MAGIC_CMD="$ac_save_MAGIC_CMD" + ;; +esac +fi + +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + echo "$ac_t""$MAGIC_CMD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +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:1814: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_RANLIB"; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1846: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + RANLIB=":" +fi +fi + +# 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:1881: 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 + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +STRIP="$ac_cv_prog_STRIP" +if test -n "$STRIP"; then + echo "$ac_t""$STRIP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +if test -z "$ac_cv_prog_STRIP"; then +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:1913: 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 + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_STRIP="strip" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":" +fi +fi +STRIP="$ac_cv_prog_STRIP" +if test -n "$STRIP"; then + echo "$ac_t""$STRIP" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +else + STRIP=":" +fi +fi + + # Check for any special flags to pass to ltconfig. libtool_flags="--cache-file=$cache_file" test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" @@ -1398,13 +1960,24 @@ fi test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" +# Check whether --with-pic or --without-pic was given. +if test "${with_pic+set}" = set; then + withval="$with_pic" + pic_mode="$withval" +else + pic_mode=default +fi + +test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic" +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 "$lt_target" in +case "$host" in *-*-irix6*) # Find out which ABI we are using. - echo '#line 1407 "configure"' > conftest.$ac_ext - if { (eval echo configure:1408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + echo '#line 1980 "configure"' > conftest.$ac_ext + if { (eval echo configure:1981: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then case "`/usr/bin/file conftest.o`" in *32-bit*) LD="${LD-ld} -32" @@ -1425,19 +1998,27 @@ case "$lt_target" in SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 -echo "configure:1429: checking whether the C compiler needs -belf" >&5 +echo "configure:2002: checking whether the C compiler needs -belf" >&5 if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else - cat > conftest.$ac_ext < conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2022: \"$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 @@ -1447,6 +2028,13 @@ else lt_cv_cc_needs_belf=no fi rm -f 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 + fi echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 @@ -1510,12 +2098,14 @@ rm -f confcache # Actually configure libtool. ac_aux_dir is where install-sh is found. -CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ -LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ -LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ -DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ +AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ +MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \ +AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \ +objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \ +deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \ ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ +$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \ || { echo "configure: error: libtool configure failed" 1>&2; exit 1; } # Reload cache, that may have been modified by ltconfig @@ -1529,7 +2119,7 @@ fi # This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' @@ -1539,6 +2129,12 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool' exec 5>>./config.log + + + + + + # Check whether --enable-targets or --disable-targets was given. if test "${enable_targets+set}" = set; then enableval="$enable_targets" @@ -1559,6 +2155,29 @@ if test "${enable_commonbfdlib+set}" = set; then esac fi +build_warnings="-W -Wall" +# Check whether --enable-build-warnings or --disable-build-warnings was given. +if test "${enable_build_warnings+set}" = set; then + enableval="$enable_build_warnings" + case "${enableval}" in + yes) ;; + no) build_warnings="-w";; + ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${build_warnings} ${t}";; + *,) t=`echo "${enableval}" | sed -e "s/,/ /g"` + build_warnings="${t} ${build_warnings}";; + *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;; +esac +if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then + echo "Setting warning flags = $build_warnings" 6>&1 +fi +fi +WARN_CFLAGS="" +if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then + WARN_CFLAGS="${build_warnings}" +fi + + @@ -1573,7 +2192,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:1577: checking for $ac_word" >&5 +echo "configure:2196: 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 @@ -1603,7 +2222,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:1607: checking for $ac_word" >&5 +echo "configure:2226: 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 @@ -1654,7 +2273,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:1658: checking for $ac_word" >&5 +echo "configure:2277: 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 @@ -1686,7 +2305,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1690: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:2309: 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. @@ -1697,12 +2316,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1701 "configure" +#line 2320 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2325: \"$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 @@ -1728,12 +2347,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:1732: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:2351: 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:1737: checking whether we are using GNU C" >&5 +echo "configure:2356: 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 @@ -1742,7 +2361,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1746: \"$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:2365: \"$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 @@ -1761,7 +2380,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:1765: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:2384: 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 @@ -1798,7 +2417,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:1802: checking for $ac_word" >&5 +echo "configure:2421: 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 @@ -1829,7 +2448,7 @@ done test -n "$YACC" || YACC="yacc" echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1833: checking how to run the C preprocessor" >&5 +echo "configure:2452: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1844,13 +2463,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:1854: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2473: \"$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 : @@ -1861,13 +2480,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:1871: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2490: \"$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 : @@ -1878,13 +2497,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:1888: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2507: \"$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 : @@ -1914,7 +2533,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:1918: checking for $ac_word" >&5 +echo "configure:2537: 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 @@ -1942,12 +2561,12 @@ fi test -n "$LEX" && break done -test -n "$LEX" || LEX=""$missing_dir/missing flex"" +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:1951: checking for $ac_word" >&5 +echo "configure:2570: 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 @@ -1981,7 +2600,7 @@ then *) ac_lib=l ;; esac echo $ac_n "checking for yywrap in -l$ac_lib""... $ac_c" 1>&6 -echo "configure:1985: checking for yywrap in -l$ac_lib" >&5 +echo "configure:2604: 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 @@ -1989,7 +2608,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:2623: \"$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 @@ -2023,7 +2642,7 @@ fi fi echo $ac_n "checking lex output file root""... $ac_c" 1>&6 -echo "configure:2027: checking lex output file root" >&5 +echo "configure:2646: 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 @@ -2044,7 +2663,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:2048: checking whether yytext is a pointer" >&5 +echo "configure:2667: 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 @@ -2056,14 +2675,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:2686: \"$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 @@ -2086,13 +2705,43 @@ fi ALL_LINGUAS= +# 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:2712: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2091: checking for ANSI C header files" >&5 +echo "configure:2740: 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 @@ -2100,7 +2749,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2104: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2753: \"$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* @@ -2117,7 +2766,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 @@ -2135,7 +2784,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 @@ -2156,7 +2805,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2167,7 +2816,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2191,18 +2840,18 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2195: checking for working const" >&5 +echo "configure:2844: 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:2898: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2266,21 +2915,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2270: checking for inline" >&5 +echo "configure:2919: 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:2933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2306,12 +2955,12 @@ EOF esac echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2310: checking for off_t" >&5 +echo "configure:2959: 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 @@ -2339,12 +2988,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:2343: checking for size_t" >&5 +echo "configure:2992: 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 @@ -2374,19 +3023,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:2378: checking for working alloca.h" >&5 +echo "configure:3027: 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() { -void *p = alloca(2 * sizeof(int)); +char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:2390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3039: \"$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 @@ -2407,12 +3056,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:2411: checking for alloca" >&5 +echo "configure:3060: 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:3093: \"$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 @@ -2472,12 +3121,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:2476: checking whether alloca needs Cray hooks" >&5 +echo "configure:3125: 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:2506: checking for $ac_func" >&5 +echo "configure:3155: 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:3183: \"$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 @@ -2557,7 +3206,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:2561: checking stack direction for C alloca" >&5 +echo "configure:3210: 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 @@ -2565,7 +3214,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:3237: \"$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 @@ -2609,17 +3258,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:2613: checking for $ac_hdr" >&5 +echo "configure:3262: 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:2623: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3272: \"$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* @@ -2648,12 +3297,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2652: checking for $ac_func" >&5 +echo "configure:3301: 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:3329: \"$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 @@ -2701,7 +3350,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2705: checking for working mmap" >&5 +echo "configure:3354: 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 @@ -2709,7 +3358,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext < #include #include -#include -#include - -#ifdef 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 @@ -2799,7 +3445,7 @@ main() /* * First, make a file with some known garbage in it. */ - data = (char*)malloc(pagesize); + data = malloc(pagesize); if (!data) exit(1); for (i = 0; i < pagesize; ++i) @@ -2820,7 +3466,7 @@ main() fd = open("conftestmmap", O_RDWR); if (fd < 0) exit(1); - data2 = (char*)malloc(2 * pagesize); + data2 = malloc(2 * pagesize); if (!data2) exit(1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); @@ -2838,7 +3484,7 @@ main() */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; - data3 = (char*)malloc(pagesize); + data3 = malloc(pagesize); if (!data3) exit(1); if (read(fd, data3, pagesize) != pagesize) @@ -2852,7 +3498,7 @@ main() } EOF -if { (eval echo configure:2856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3502: \"$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 @@ -2880,17 +3526,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:2884: checking for $ac_hdr" >&5 +echo "configure:3530: 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:2894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3540: \"$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* @@ -2920,12 +3566,12 @@ done __argz_count __argz_stringify __argz_next do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2924: checking for $ac_func" >&5 +echo "configure:3570: 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:3598: \"$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 @@ -2977,12 +3623,12 @@ done for ac_func in stpcpy do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2981: checking for $ac_func" >&5 +echo "configure:3627: 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:3655: \"$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 @@ -3039,19 +3685,19 @@ EOF if test $ac_cv_header_locale_h = yes; then echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 -echo "configure:3043: checking for LC_MESSAGES" >&5 +echo "configure:3689: 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:3055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3701: \"$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 @@ -3072,7 +3718,7 @@ EOF fi fi echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:3076: checking whether NLS is requested" >&5 +echo "configure:3722: 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" @@ -3092,7 +3738,7 @@ fi EOF echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 -echo "configure:3096: checking whether included gettext is requested" >&5 +echo "configure:3742: 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" @@ -3111,17 +3757,17 @@ fi ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 -echo "configure:3115: checking for libintl.h" >&5 +echo "configure:3761: 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:3125: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3771: \"$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* @@ -3138,19 +3784,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:3142: checking for gettext in libc" >&5 +echo "configure:3788: 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:3154: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3800: \"$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 @@ -3166,7 +3812,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:3170: checking for bindtextdomain in -lintl" >&5 +echo "configure:3816: 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 @@ -3174,7 +3820,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:3835: \"$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 @@ -3201,19 +3847,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:3205: checking for gettext in libintl" >&5 +echo "configure:3851: 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:3863: \"$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 @@ -3241,7 +3887,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:3245: checking for $ac_word" >&5 +echo "configure:3891: 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 @@ -3275,12 +3921,12 @@ fi for ac_func in dcgettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3279: checking for $ac_func" >&5 +echo "configure:3925: 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:3953: \"$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 @@ -3330,7 +3976,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:3334: checking for $ac_word" >&5 +echo "configure:3980: 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 @@ -3366,7 +4012,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:3370: checking for $ac_word" >&5 +echo "configure:4016: 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 @@ -3398,7 +4044,7 @@ else fi cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* CATOBJEXT=.gmo DATADIRNAME=share @@ -3438,7 +4084,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:3442: checking for $ac_word" >&5 +echo "configure:4088: 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 @@ -3472,7 +4118,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:3476: checking for $ac_word" >&5 +echo "configure:4122: 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 @@ -3508,7 +4154,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:3512: checking for $ac_word" >&5 +echo "configure:4158: 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 @@ -3598,7 +4244,7 @@ fi LINGUAS= else echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 -echo "configure:3602: checking for catalogs to be installed" >&5 +echo "configure:4248: checking for catalogs to be installed" >&5 NEW_LINGUAS= for lang in ${LINGUAS=$ALL_LINGUAS}; do case "$ALL_LINGUAS" in @@ -3626,17 +4272,17 @@ echo "configure:3602: 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:3630: checking for linux/version.h" >&5 +echo "configure:4276: 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:3640: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4286: \"$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* @@ -3699,7 +4345,7 @@ fi echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 -echo "configure:3703: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo "configure:4349: 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" @@ -3721,72 +4367,10 @@ fi MAINT=$MAINTAINER_MODE_TRUE -echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:3726: checking for Cygwin environment" >&5 -if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_cygwin=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_cygwin=no -fi -rm -f conftest* -rm -f conftest* -fi - -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:3759: checking for mingw32 environment" >&5 -if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_mingw32=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_mingw32=no -fi -rm -f conftest* -rm -f conftest* -fi - -echo "$ac_t""$ac_cv_mingw32" 1>&6 -MINGW32= -test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:3790: checking for executable suffix" >&5 +echo "configure:4374: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3796,10 +4380,10 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:3800: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:4384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in - *.c | *.o | *.obj) ;; + *.c | *.o | *.obj | *.ilk | *.pdb) ;; *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; esac done @@ -3839,7 +4423,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:3843: checking for $ac_word" >&5 +echo "configure:4427: 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 @@ -3878,7 +4462,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:3882: checking for a BSD compatible install" >&5 +echo "configure:4466: 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 @@ -3945,7 +4529,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:3949: checking for build system executable suffix" >&5 +echo "configure:4533: 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 @@ -3980,17 +4564,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:3984: checking for $ac_hdr" >&5 +echo "configure:4568: 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:3994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4578: \"$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* @@ -4017,12 +4601,12 @@ fi done echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 -echo "configure:4021: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo "configure:4605: 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 @@ -4038,7 +4622,7 @@ wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } EOF -if { (eval echo configure:4042: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_sys_wait_h=yes else @@ -4061,19 +4645,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:4065: checking for working alloca.h" >&5 +echo "configure:4649: 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() { -void *p = alloca(2 * sizeof(int)); +char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:4077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4661: \"$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 @@ -4094,12 +4678,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:4098: checking for alloca" >&5 +echo "configure:4682: 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:4715: \"$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 @@ -4159,12 +4743,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:4163: checking whether alloca needs Cray hooks" >&5 +echo "configure:4747: 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:4193: checking for $ac_func" >&5 +echo "configure:4777: 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:4805: \"$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 @@ -4244,7 +4828,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:4248: checking stack direction for C alloca" >&5 +echo "configure:4832: 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 @@ -4252,7 +4836,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:4859: \"$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 @@ -4295,12 +4879,12 @@ fi for ac_func in sbrk utimes setmode do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:4299: checking for $ac_func" >&5 +echo "configure:4883: 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:4911: \"$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 @@ -4351,14 +4935,14 @@ done # Some systems have frexp only in -lm, not in -lc. echo $ac_n "checking for library containing frexp""... $ac_c" 1>&6 -echo "configure:4355: checking for library containing frexp" >&5 +echo "configure:4939: 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:4957: \"$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 @@ -4380,7 +4964,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:4979: \"$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 @@ -4413,19 +4997,19 @@ else : fi echo $ac_n "checking for time_t in time.h""... $ac_c" 1>&6 -echo "configure:4417: checking for time_t in time.h" >&5 +echo "configure:5001: 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:4429: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_decl_time_t_time_h=yes else @@ -4446,19 +5030,19 @@ EOF fi echo $ac_n "checking for time_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:4450: checking for time_t in sys/types.h" >&5 +echo "configure:5034: 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:4462: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5046: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_decl_time_t_types_h=yes else @@ -4481,12 +5065,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:4485: checking for utime.h" >&5 +echo "configure:5069: 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 @@ -4497,7 +5081,7 @@ int main() { struct utimbuf s; ; return 0; } EOF -if { (eval echo configure:4501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5085: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bu_cv_header_utime_h=yes else @@ -4518,12 +5102,12 @@ EOF fi echo $ac_n "checking whether fprintf must be declared""... $ac_c" 1>&6 -echo "configure:4522: checking whether fprintf must be declared" >&5 +echo "configure:5106: 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 < @@ -4544,7 +5128,7 @@ int main() { char *(*pfn) = (char *(*)) fprintf ; return 0; } EOF -if { (eval echo configure:4548: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5132: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_fprintf=no else @@ -4565,12 +5149,12 @@ EOF fi echo $ac_n "checking whether strstr must be declared""... $ac_c" 1>&6 -echo "configure:4569: checking whether strstr must be declared" >&5 +echo "configure:5153: 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 < @@ -4591,7 +5175,7 @@ int main() { char *(*pfn) = (char *(*)) strstr ; return 0; } EOF -if { (eval echo configure:4595: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5179: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_strstr=no else @@ -4612,12 +5196,12 @@ EOF fi echo $ac_n "checking whether sbrk must be declared""... $ac_c" 1>&6 -echo "configure:4616: checking whether sbrk must be declared" >&5 +echo "configure:5200: 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 < @@ -4638,7 +5222,7 @@ int main() { char *(*pfn) = (char *(*)) sbrk ; return 0; } EOF -if { (eval echo configure:4642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5226: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_sbrk=no else @@ -4659,12 +5243,12 @@ EOF fi echo $ac_n "checking whether getenv must be declared""... $ac_c" 1>&6 -echo "configure:4663: checking whether getenv must be declared" >&5 +echo "configure:5247: 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 < @@ -4685,7 +5269,7 @@ int main() { char *(*pfn) = (char *(*)) getenv ; return 0; } EOF -if { (eval echo configure:4689: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5273: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_getenv=no else @@ -4706,12 +5290,12 @@ EOF fi echo $ac_n "checking whether environ must be declared""... $ac_c" 1>&6 -echo "configure:4710: checking whether environ must be declared" >&5 +echo "configure:5294: 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 < @@ -4732,7 +5316,7 @@ int main() { char *(*pfn) = (char *(*)) environ ; return 0; } EOF -if { (eval echo configure:4736: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:5320: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* bfd_cv_decl_needed_environ=no else @@ -4787,6 +5371,7 @@ DLLTOOL_DEFS= BUILD_WINDRES= BUILD_DLLWRAP= BUILD_MISC= +OBJDUMP_DEFS= for targ in $target $canon_targets do @@ -4818,6 +5403,11 @@ do *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;; esac case $targ in + arm-epoc-pe*) + BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM" + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + ;; arm-*pe* | arm-*-wince) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" @@ -4828,6 +5418,9 @@ do DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' ;; + arm*-* | xscale-* | strongarm-* | d10v-*) + OBJDUMP_DEFS="-DDISASSEMBLER_NEEDS_RELOCS" + ;; i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386" @@ -4875,6 +5468,7 @@ done + cat >> confdefs.h <&1 +fi])dnl +WARN_CFLAGS="" +if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then + WARN_CFLAGS="${build_warnings}" +fi +AC_SUBST(WARN_CFLAGS) + AM_CONFIG_HEADER(config.h:config.in) if test -z "$target" ; then @@ -150,6 +171,7 @@ DLLTOOL_DEFS= BUILD_WINDRES= BUILD_DLLWRAP= BUILD_MISC= +OBJDUMP_DEFS= for targ in $target $canon_targets do @@ -183,6 +205,11 @@ changequote([,])dnl *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;; esac case $targ in + arm-epoc-pe*) + BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' + DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM" + BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' + ;; arm-*pe* | arm-*-wince) BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)' DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" @@ -193,6 +220,9 @@ changequote([,])dnl DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM" BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)' ;; + arm*-* | xscale-* | strongarm-* | d10v-*) + OBJDUMP_DEFS="-DDISASSEMBLER_NEEDS_RELOCS" + ;; changequote(,)dnl i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*) changequote([,])dnl @@ -241,6 +271,7 @@ AC_SUBST(DLLTOOL_DEFS) AC_SUBST(BUILD_WINDRES) AC_SUBST(BUILD_DLLWRAP) AC_SUBST(BUILD_MISC) +AC_SUBST(OBJDUMP_DEFS) AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.]) diff --git a/gnu/dist/toolchain/binutils/deflex.c b/gnu/dist/toolchain/binutils/deflex.c index f5ba0c2b5e71..31af50905fab 100644 --- a/gnu/dist/toolchain/binutils/deflex.c +++ b/gnu/dist/toolchain/binutils/deflex.c @@ -1,7 +1,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /cvs/src/src/binutils/Attic/deflex.c,v 1.1.2.1 2000/05/29 14:08:52 pb Exp $ + * $Header: /cvs/src/src/binutils/Attic/deflex.c,v 1.1.4.1 2001/03/12 15:40:35 pb Exp $ */ #define FLEX_SCANNER diff --git a/gnu/dist/toolchain/binutils/dlltool.c b/gnu/dist/toolchain/binutils/dlltool.c index b618b9699465..e989f0c7d52e 100644 --- a/gnu/dist/toolchain/binutils/dlltool.c +++ b/gnu/dist/toolchain/binutils/dlltool.c @@ -383,8 +383,12 @@ static FILE *output_def; static FILE *base_file; #ifdef DLLTOOL_ARM +#ifdef DLLTOOL_ARM_EPOC +static const char *mname = "arm-epoc"; +#else static const char *mname = "arm"; #endif +#endif #ifdef DLLTOOL_I386 static const char *mname = "i386"; @@ -605,7 +609,7 @@ mtable[] = , { #define MARM_EPOC 9 - "arm", ".byte", ".short", ".long", ".asciz", "@", + "arm-epoc", ".byte", ".short", ".long", ".asciz", "@", "ldr\tip,[pc]\n\tldr\tpc,[ip]\n\t.long", ".global", ".space", ".align\t2",".align\t4", "", "epoc-pe-arm-little", bfd_arch_arm, @@ -726,6 +730,7 @@ rvaafter (machine) case MMCORE_LE: case MMCORE_ELF: case MMCORE_ELF_LE: + case MARM_EPOC: break; default: /* xgettext:c-format */ @@ -750,6 +755,7 @@ rvabefore (machine) case MMCORE_LE: case MMCORE_ELF: case MMCORE_ELF_LE: + case MARM_EPOC: return ".rva\t"; default: /* xgettext:c-format */ @@ -773,6 +779,7 @@ asm_prefix (machine) case MMCORE_LE: case MMCORE_ELF: case MMCORE_ELF_LE: + case MARM_EPOC: break; case M386: return "_"; diff --git a/gnu/dist/toolchain/binutils/dllwrap.c b/gnu/dist/toolchain/binutils/dllwrap.c index 637fa52fc17f..291abfde4623 100644 --- a/gnu/dist/toolchain/binutils/dllwrap.c +++ b/gnu/dist/toolchain/binutils/dllwrap.c @@ -857,10 +857,10 @@ main (argc, argv) dlltool_cmdline = dyn_string_new (cmdline_len); if (verbose) { - dyn_string_append (dlltool_cmdline, " -v"); + dyn_string_append_cstr (dlltool_cmdline, " -v"); } - dyn_string_append (dlltool_cmdline, " --dllname "); - dyn_string_append (dlltool_cmdline, dll_name); + dyn_string_append_cstr (dlltool_cmdline, " --dllname "); + dyn_string_append_cstr (dlltool_cmdline, dll_name); for (i = 1; i < argc; ++i) { @@ -868,10 +868,10 @@ main (argc, argv) { char *arg = saved_argv[i]; int quote = (strchr (arg, ' ') || strchr (arg, '\t')); - dyn_string_append (dlltool_cmdline, + dyn_string_append_cstr (dlltool_cmdline, (quote) ? " \"" : " "); - dyn_string_append (dlltool_cmdline, arg); - dyn_string_append (dlltool_cmdline, + dyn_string_append_cstr (dlltool_cmdline, arg); + dyn_string_append_cstr (dlltool_cmdline, (quote) ? "\"" : ""); } } @@ -894,9 +894,9 @@ main (argc, argv) break; } } - dyn_string_append (driver_cmdline, driver_flags); - dyn_string_append (driver_cmdline, " -o "); - dyn_string_append (driver_cmdline, dll_file_name); + dyn_string_append_cstr (driver_cmdline, driver_flags); + dyn_string_append_cstr (driver_cmdline, " -o "); + dyn_string_append_cstr (driver_cmdline, dll_file_name); if (! entry_point || strlen (entry_point) == 0) { @@ -915,10 +915,10 @@ main (argc, argv) break; } } - dyn_string_append (driver_cmdline, " -Wl,-e,"); - dyn_string_append (driver_cmdline, entry_point); - dyn_string_append (dlltool_cmdline, " --exclude-symbol="); - dyn_string_append (dlltool_cmdline, + dyn_string_append_cstr (driver_cmdline, " -Wl,-e,"); + dyn_string_append_cstr (driver_cmdline, entry_point); + dyn_string_append_cstr (dlltool_cmdline, " --exclude-symbol="); + dyn_string_append_cstr (dlltool_cmdline, (entry_point[0] == '_') ? entry_point+1 : entry_point); if (! image_base_str || strlen (image_base_str) == 0) @@ -929,12 +929,12 @@ main (argc, argv) image_base_str = tmpbuf; } - dyn_string_append (driver_cmdline, " -Wl,--image-base,"); - dyn_string_append (driver_cmdline, image_base_str); + dyn_string_append_cstr (driver_cmdline, " -Wl,--image-base,"); + dyn_string_append_cstr (driver_cmdline, image_base_str); if (verbose) { - dyn_string_append (driver_cmdline, " -v"); + dyn_string_append_cstr (driver_cmdline, " -v"); } for (i = 1; i < argc; ++i) @@ -943,10 +943,10 @@ main (argc, argv) { char *arg = saved_argv[i]; int quote = (strchr (arg, ' ') || strchr (arg, '\t')); - dyn_string_append (driver_cmdline, + dyn_string_append_cstr (driver_cmdline, (quote) ? " \"" : " "); - dyn_string_append (driver_cmdline, arg); - dyn_string_append (driver_cmdline, + dyn_string_append_cstr (driver_cmdline, arg); + dyn_string_append_cstr (driver_cmdline, (quote) ? "\"" : ""); } } @@ -963,15 +963,15 @@ main (argc, argv) step_pre1 = dyn_string_new (1024); - dyn_string_append (step_pre1, dlltool_cmdline->s); + dyn_string_append_cstr (step_pre1, dlltool_cmdline->s); if (export_all) { - dyn_string_append (step_pre1, " --export-all --exclude-symbol="); - dyn_string_append (step_pre1, + dyn_string_append_cstr (step_pre1, " --export-all --exclude-symbol="); + dyn_string_append_cstr (step_pre1, "_cygwin_dll_entry@12,DllMainCRTStartup@12,DllMain@12,DllEntryPoint@12"); } - dyn_string_append (step_pre1, " --output-def "); - dyn_string_append (step_pre1, def_file_name); + dyn_string_append_cstr (step_pre1, " --output-def "); + dyn_string_append_cstr (step_pre1, def_file_name); for (i = 1; i < argc; ++i) { @@ -983,10 +983,10 @@ main (argc, argv) && (arg[len-1] == 'o' || arg[len-1] == 'a')) { int quote = (strchr (arg, ' ') || strchr (arg, '\t')); - dyn_string_append (step_pre1, + dyn_string_append_cstr (step_pre1, (quote) ? " \"" : " "); - dyn_string_append (step_pre1, arg); - dyn_string_append (step_pre1, + dyn_string_append_cstr (step_pre1, arg); + dyn_string_append_cstr (step_pre1, (quote) ? "\"" : ""); } } @@ -998,8 +998,8 @@ main (argc, argv) dyn_string_delete (step_pre1); } - dyn_string_append (dlltool_cmdline, " --def "); - dyn_string_append (dlltool_cmdline, def_file_name); + dyn_string_append_cstr (dlltool_cmdline, " --def "); + dyn_string_append_cstr (dlltool_cmdline, def_file_name); if (verbose) { @@ -1036,18 +1036,18 @@ main (argc, argv) dyn_string_t step1 = dyn_string_new (driver_cmdline->length + strlen (base_file_name) + 20); - dyn_string_append (step1, "-Wl,--base-file,"); + dyn_string_append_cstr (step1, "-Wl,--base-file,"); quote = (strchr (base_file_name, ' ') || strchr (base_file_name, '\t')); - dyn_string_append (step1, + dyn_string_append_cstr (step1, (quote) ? "\"" : ""); - dyn_string_append (step1, base_file_name); - dyn_string_append (step1, + dyn_string_append_cstr (step1, base_file_name); + dyn_string_append_cstr (step1, (quote) ? "\"" : ""); if (driver_cmdline->length) { - dyn_string_append (step1, " "); - dyn_string_append (step1, driver_cmdline->s); + dyn_string_append_cstr (step1, " "); + dyn_string_append_cstr (step1, driver_cmdline->s); } if (run (driver_name, step1->s)) @@ -1087,28 +1087,28 @@ main (argc, argv) + strlen (exp_file_name) + 20); - dyn_string_append (step2, "--base-file "); + dyn_string_append_cstr (step2, "--base-file "); quote = (strchr (base_file_name, ' ') || strchr (base_file_name, '\t')); - dyn_string_append (step2, + dyn_string_append_cstr (step2, (quote) ? "\"" : ""); - dyn_string_append (step2, base_file_name); - dyn_string_append (step2, + dyn_string_append_cstr (step2, base_file_name); + dyn_string_append_cstr (step2, (quote) ? "\" " : " "); - dyn_string_append (step2, "--output-exp "); + dyn_string_append_cstr (step2, "--output-exp "); quote = (strchr (exp_file_name, ' ') || strchr (exp_file_name, '\t')); - dyn_string_append (step2, + dyn_string_append_cstr (step2, (quote) ? "\"" : ""); - dyn_string_append (step2, exp_file_name); - dyn_string_append (step2, + dyn_string_append_cstr (step2, exp_file_name); + dyn_string_append_cstr (step2, (quote) ? "\"" : ""); if (dlltool_cmdline->length) { - dyn_string_append (step2, " "); - dyn_string_append (step2, dlltool_cmdline->s); + dyn_string_append_cstr (step2, " "); + dyn_string_append_cstr (step2, dlltool_cmdline->s); } if (run (dlltool_name, step2->s)) @@ -1131,27 +1131,27 @@ main (argc, argv) + strlen (exp_file_name) + strlen (base_file_name) + 20); - dyn_string_append (step3, "-Wl,--base-file,"); + dyn_string_append_cstr (step3, "-Wl,--base-file,"); quote = (strchr (base_file_name, ' ') || strchr (base_file_name, '\t')); - dyn_string_append (step3, + dyn_string_append_cstr (step3, (quote) ? "\"" : ""); - dyn_string_append (step3, base_file_name); - dyn_string_append (step3, + dyn_string_append_cstr (step3, base_file_name); + dyn_string_append_cstr (step3, (quote) ? "\" " : " "); quote = (strchr (exp_file_name, ' ') || strchr (exp_file_name, '\t')); - dyn_string_append (step3, + dyn_string_append_cstr (step3, (quote) ? "\"" : ""); - dyn_string_append (step3, exp_file_name); - dyn_string_append (step3, + dyn_string_append_cstr (step3, exp_file_name); + dyn_string_append_cstr (step3, (quote) ? "\"" : ""); if (driver_cmdline->length) { - dyn_string_append (step3, " "); - dyn_string_append (step3, driver_cmdline->s); + dyn_string_append_cstr (step3, " "); + dyn_string_append_cstr (step3, driver_cmdline->s); } if (run (driver_name, step3->s)) @@ -1172,34 +1172,34 @@ main (argc, argv) + strlen (exp_file_name) + 20); - dyn_string_append (step4, "--base-file "); + dyn_string_append_cstr (step4, "--base-file "); quote = (strchr (base_file_name, ' ') || strchr (base_file_name, '\t')); - dyn_string_append (step4, + dyn_string_append_cstr (step4, (quote) ? "\"" : ""); - dyn_string_append (step4, base_file_name); - dyn_string_append (step4, + dyn_string_append_cstr (step4, base_file_name); + dyn_string_append_cstr (step4, (quote) ? "\" " : " "); - dyn_string_append (step4, "--output-exp "); + dyn_string_append_cstr (step4, "--output-exp "); quote = (strchr (exp_file_name, ' ') || strchr (exp_file_name, '\t')); - dyn_string_append (step4, + dyn_string_append_cstr (step4, (quote) ? "\"" : ""); - dyn_string_append (step4, exp_file_name); - dyn_string_append (step4, + dyn_string_append_cstr (step4, exp_file_name); + dyn_string_append_cstr (step4, (quote) ? "\"" : ""); if (dlltool_cmdline->length) { - dyn_string_append (step4, " "); - dyn_string_append (step4, dlltool_cmdline->s); + dyn_string_append_cstr (step4, " "); + dyn_string_append_cstr (step4, dlltool_cmdline->s); } if (output_lib_file_name) { - dyn_string_append (step4, " --output-lib "); - dyn_string_append (step4, output_lib_file_name); + dyn_string_append_cstr (step4, " --output-lib "); + dyn_string_append_cstr (step4, output_lib_file_name); } if (run (dlltool_name, step4->s)) @@ -1225,16 +1225,16 @@ main (argc, argv) + 20); quote = (strchr (exp_file_name, ' ') || strchr (exp_file_name, '\t')); - dyn_string_append (step5, + dyn_string_append_cstr (step5, (quote) ? "\"" : ""); - dyn_string_append (step5, exp_file_name); - dyn_string_append (step5, + dyn_string_append_cstr (step5, exp_file_name); + dyn_string_append_cstr (step5, (quote) ? "\"" : ""); if (driver_cmdline->length) { - dyn_string_append (step5, " "); - dyn_string_append (step5, driver_cmdline->s); + dyn_string_append_cstr (step5, " "); + dyn_string_append_cstr (step5, driver_cmdline->s); } if (run (driver_name, step5->s)) diff --git a/gnu/dist/toolchain/binutils/ieee.c b/gnu/dist/toolchain/binutils/ieee.c index 27409cc9ae08..52149b2261b5 100644 --- a/gnu/dist/toolchain/binutils/ieee.c +++ b/gnu/dist/toolchain/binutils/ieee.c @@ -1,5 +1,5 @@ /* ieee.c -- Read and write IEEE-695 debugging information. - Copyright (C) 1996, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of GNU Binutils. @@ -410,7 +410,7 @@ ieee_read_optional_number (info, pp, pv, ppresent) } ieee_error (info, *pp - 1, _("invalid number")); - return false; + return false; } /* Read a required string from an IEEE file. */ @@ -563,7 +563,7 @@ ieee_read_expression (info, pp, pv) ieee_error (info, start, _("unknown section")); return false; } - + if (esp - expr_stack >= EXPR_STACK_SIZE) { ieee_error (info, start, _("expression stack overflow")); @@ -4494,7 +4494,7 @@ ieee_start_range (info, low) r->next = info->pending_ranges; info->pending_ranges = r; return true; -} +} /* Finish a range started by ieee_start_range. */ @@ -4927,7 +4927,9 @@ ieee_start_compilation_unit (p, filename) { struct ieee_handle *info = (struct ieee_handle *) p; const char *modname; +#ifdef HAVE_DOS_BASED_FILE_SYSTEM const char *backslash; +#endif char *c, *s; unsigned int nindx; @@ -4939,10 +4941,12 @@ ieee_start_compilation_unit (p, filename) info->filename = filename; modname = strrchr (filename, '/'); +#ifdef HAVE_DOS_BASED_FILE_SYSTEM /* We could have a mixed forward/back slash case. */ - backslash = strrchr (modname, '\\'); - if (backslash > modname) + backslash = strrchr (filename, '\\'); + if (modname == NULL || (backslash != NULL && backslash > modname)) modname = backslash; +#endif if (modname != NULL) ++modname; @@ -5200,15 +5204,20 @@ ieee_add_bb11 (info, sec, low, high) } else { - const char *filename, *modname, *backslash; + const char *filename, *modname; +#ifdef HAVE_DOS_BASED_FILE_SYSTEM + const char *backslash; +#endif char *c, *s; /* Start the enclosing BB10 block. */ filename = bfd_get_filename (info->abfd); modname = strrchr (filename, '/'); - backslash = strrchr (modname, '\\'); - if (backslash > modname) +#ifdef HAVE_DOS_BASED_FILE_SYSTEM + backslash = strrchr (filename, '\\'); + if (modname == NULL || (backslash != NULL && backslash > modname)) modname = backslash; +#endif if (modname != NULL) ++modname; @@ -5838,7 +5847,7 @@ ieee_offset_type (p) which seems pretty important. I'm going to punt this for now. */ return ieee_int_type (p, 4, true); -} +} /* Make a method type. */ @@ -7312,7 +7321,7 @@ ieee_function_parameter (p, name, kind, val) return false; ++info->fnargcount; - return true; + return true; } /* Output pending function parameters. */ diff --git a/gnu/dist/toolchain/binutils/nlmconv.1 b/gnu/dist/toolchain/binutils/nlmconv.1 index cbc3aedd1013..816201740b9a 100644 --- a/gnu/dist/toolchain/binutils/nlmconv.1 +++ b/gnu/dist/toolchain/binutils/nlmconv.1 @@ -1,6 +1,6 @@ -.\" Copyright (c) 1991, 1996 Free Software Foundation +.\" Copyright (c) 1991, 1996, 2000 Free Software Foundation .\" See section COPYING for conditions for redistribution -.TH nlmconv 1 "March 1996" "cygnus support" "GNU Development Tools" +.TH nlmconv 1 "March 1996" "Free Software Foundation" "GNU Development Tools" .de BP .sp .ti \-.2i @@ -92,19 +92,381 @@ The GNU Binary Utilities\c \&, Roland H. Pesch (June 1993). .SH COPYING -Copyright (c) 1993 Free Software Foundation, Inc. +Copyright (c) 1993, 2000 Free Software Foundation, Inc. .PP -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. -.PP -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. -.PP -Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be included in -translations approved by the Free Software Foundation instead of in -the original English. +This document is distributed under the terms of the GNU Free +Documenation License. That license is described in the GNU Free +Documentation License section. + +This document is distributed under the terms of the GNU Free +Documentation License, version 1.1. That license is described in the +sources for this manual page, but it is not displayed here in order to +make this manual more consise. Copies of this license can also be +obtained from: http://www.gnu.org/copyleft/. + +\" .SH 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. +\" .PP +\" 0. PREAMBLE +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 1. APPLICABILITY AND DEFINITIONS +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 2. VERBATIM COPYING +\" .PP +\" 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. +\" .PP +\" You may also lend copies, under the same conditions stated above, and +\" you may publicly display copies. +\" .PP +\" 3. COPYING IN QUANTITY +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 4. MODIFICATIONS +\" .PP +\" 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: +\" .PP +\" 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. +\" .PP +\" 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). +\" .PP +\" C. State on the Title page the name of the publisher of the +\" Modified Version, as the publisher. +\" .PP +\" D. Preserve all the copyright notices of the Document. +\" .PP +\" E. Add an appropriate copyright notice for your modifications +\" adjacent to the other copyright notices. +\" .PP +\" 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. +\" Preserve in that license notice the full lists of Invariant Sections +\" and required Cover Texts given in the Document's license notice. +\" .PP +\" H. Include an unaltered copy of this License. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" M. Delete any section entitled "Endorsements". Such a section +\" may not be included in the Modified Version. +\" .PP +\" N. Do not retitle any existing section as "Endorsements" +\" or to conflict in title with any Invariant Section. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 5. COMBINING DOCUMENTS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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." +\" .PP + +\" 6. COLLECTIONS OF DOCUMENTS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 7. AGGREGATION WITH INDEPENDENT WORKS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 8. TRANSLATION +\" .PP +\" 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. +\" .PP + +\" 9. TERMINATION +\" .PP +\" 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. +\" .PP + +\" 10. FUTURE REVISIONS OF THIS LICENSE +\" .PP +\" 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/. +\" .PP +\" 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. +\" .PP + +\" ADDENDUM: How to use this License for your documents +\" .PP +\" 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: +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. diff --git a/gnu/dist/toolchain/binutils/nlmconv.c b/gnu/dist/toolchain/binutils/nlmconv.c index 26602d7b6a71..450ac1454b8b 100644 --- a/gnu/dist/toolchain/binutils/nlmconv.c +++ b/gnu/dist/toolchain/binutils/nlmconv.c @@ -2086,9 +2086,6 @@ powerpc_mangle_relocs (outbfd, insec, relocs_ptr, reloc_count_ptr, contents, #define LD_NAME "ld" #endif -/* Temporary file name base. */ -static char *temp_filename; - /* The user has specified several input files. Invoke the linker to link them all together, and convert and delete the resulting output file. */ @@ -2137,10 +2134,7 @@ link_inputs (inputs, ld) if (ld == NULL) ld = (char *) LD_NAME; - temp_filename = choose_temp_base (); - - unlink_on_exit = xmalloc (strlen (temp_filename) + 3); - sprintf (unlink_on_exit, "%s.O", temp_filename); + unlink_on_exit = make_temp_file (".O"); argv[0] = ld; argv[1] = (char *) "-Ur"; diff --git a/gnu/dist/toolchain/binutils/nm.1 b/gnu/dist/toolchain/binutils/nm.1 index c2ad99e559a1..dbb116c7b610 100644 --- a/gnu/dist/toolchain/binutils/nm.1 +++ b/gnu/dist/toolchain/binutils/nm.1 @@ -1,6 +1,6 @@ -.\" Copyright (c) 1991 Free Software Foundation +.\" Copyright (c) 1991, 2000 Free Software Foundation .\" See section COPYING for conditions for redistribution -.TH nm 1 "5 November 1991" "cygnus support" "GNU Development Tools" +.TH nm 1 "5 November 1991" "Free Software Foundation" "GNU Development Tools" .de BP .sp .ti \-.2i @@ -212,19 +212,377 @@ The GNU Binary Utilities\c .SH COPYING -Copyright (c) 1991 Free Software Foundation, Inc. +Copyright (c) 1991, 2000 Free Software Foundation, Inc. .PP -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. -.PP -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. -.PP -Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be included in -translations approved by the Free Software Foundation instead of in -the original English. +This document is distributed under the terms of the GNU Free +Documentation License, version 1.1. That license is described in the +sources for this manual page, but it is not displayed here in order to +make this manual more consise. Copies of this license can also be +obtained from: http://www.gnu.org/copyleft/. + +\" .SH 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. +\" .PP +\" 0. PREAMBLE +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 1. APPLICABILITY AND DEFINITIONS +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 2. VERBATIM COPYING +\" .PP +\" 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. +\" .PP +\" You may also lend copies, under the same conditions stated above, and +\" you may publicly display copies. +\" .PP +\" 3. COPYING IN QUANTITY +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 4. MODIFICATIONS +\" .PP +\" 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: +\" .PP +\" 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. +\" .PP +\" 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). +\" .PP +\" C. State on the Title page the name of the publisher of the +\" Modified Version, as the publisher. +\" .PP +\" D. Preserve all the copyright notices of the Document. +\" .PP +\" E. Add an appropriate copyright notice for your modifications +\" adjacent to the other copyright notices. +\" .PP +\" 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. +\" Preserve in that license notice the full lists of Invariant Sections +\" and required Cover Texts given in the Document's license notice. +\" .PP +\" H. Include an unaltered copy of this License. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" M. Delete any section entitled "Endorsements". Such a section +\" may not be included in the Modified Version. +\" .PP +\" N. Do not retitle any existing section as "Endorsements" +\" or to conflict in title with any Invariant Section. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 5. COMBINING DOCUMENTS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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." +\" .PP + +\" 6. COLLECTIONS OF DOCUMENTS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 7. AGGREGATION WITH INDEPENDENT WORKS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 8. TRANSLATION +\" .PP +\" 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. +\" .PP + +\" 9. TERMINATION +\" .PP +\" 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. +\" .PP + +\" 10. FUTURE REVISIONS OF THIS LICENSE +\" .PP +\" 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/. +\" .PP +\" 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. +\" .PP + +\" ADDENDUM: How to use this License for your documents +\" .PP +\" 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: +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. diff --git a/gnu/dist/toolchain/binutils/nm.c b/gnu/dist/toolchain/binutils/nm.c index ad5a00d37701..3695d1e760f1 100644 --- a/gnu/dist/toolchain/binutils/nm.c +++ b/gnu/dist/toolchain/binutils/nm.c @@ -1,5 +1,5 @@ /* nm.c -- Describe symbol table of a rel file. - Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -260,7 +260,7 @@ static bfd *lineno_cache_rel_bfd; static struct option long_options[] = { {"debug-syms", no_argument, &print_debug_syms, 1}, - {"demangle", no_argument, &do_demangle, 1}, + {"demangle", optional_argument, 0, 'C'}, {"dynamic", no_argument, &dynamic, 1}, {"extern-only", no_argument, &external_only, 1}, {"format", required_argument, 0, 'f'}, @@ -297,7 +297,9 @@ usage (stream, status) -a, --debug-syms Display debugger-only symbols\n\ -A, --print-file-name Print name of the input file before every symbol\n\ -B Same as --format=bsd\n\ - -C, --demangle Decode low-level symbol names into user-level names\n\ + -C, --demangle[=STYLE] Decode low-level symbol names into user-level names\n\ + The STYLE, if specified, can be `auto' (the default),\n\ + `gnu', 'lucid', 'arm', 'hp', 'edg' or 'gnu-new-abi'\n\ --no-demangle Do not demangle low-level symbol names\n\ -D, --dynamic Display dynamic symbols instead of normal symbols\n\ --defined-only Display only defined symbols\n\ @@ -319,6 +321,7 @@ usage (stream, status) --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\ \n")); list_supported_targets (program_name, stream); if (status == 0) @@ -407,7 +410,8 @@ main (argc, argv) bfd_init (); set_default_bfd_target (); - while ((c = getopt_long (argc, argv, "aABCDef:glnopPrst:uvV", long_options, (int *) 0)) != EOF) + while ((c = getopt_long (argc, argv, "aABCDef:glnopPrst:uvVX:", + long_options, (int *) 0)) != EOF) { switch (c) { @@ -423,6 +427,17 @@ main (argc, argv) break; case 'C': do_demangle = 1; + 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; case 'D': dynamic = 1; @@ -466,6 +481,17 @@ main (argc, argv) case 'V': show_version = 1; break; + case 'X': + /* Ignored for (partial) AIX compatibility. On AIX, the + argument has values 32, 64, or 32_64, and specfies that + only 32-bit, only 64-bit, or both kinds of objects should + be examined. The default is 32. So plain AIX nm on a + library archive with both kinds of objects will ignore + the 64-bit ones. For GNU nm, the default is and always + has been -X 32_64, and other options are not supported. */ + if (strcmp (optarg, "32_64") != 0) + fatal (_("Only -X 32_64 is supported")); + break; case OPTION_TARGET: /* --target */ target = optarg; @@ -1447,13 +1473,11 @@ print_symbol_info_bsd (info, abfd) { if (bfd_is_undefined_symclass (info->type)) { - printf ("%*s", #ifdef BFD64 - 16, + printf ("%*s", 16, ""); #else - 8, + printf ("%*s", 8, ""); #endif - ""); } else print_value (info->value); diff --git a/gnu/dist/toolchain/binutils/objcopy.1 b/gnu/dist/toolchain/binutils/objcopy.1 index 80ca21664aac..d2eed1514786 100644 --- a/gnu/dist/toolchain/binutils/objcopy.1 +++ b/gnu/dist/toolchain/binutils/objcopy.1 @@ -1,6 +1,6 @@ .\" Copyright (c) 1991, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation .\" See section COPYING for conditions for redistribution -.TH objcopy 1 "05 April 2000" "Cygnus Solutions" "GNU Development Tools" +.TH objcopy 1 "05 April 2000" "Free Software Foundation" "GNU Development Tools" .de BP .sp .ti \-.2i @@ -47,6 +47,8 @@ objcopy \- copy and translate object files .RB "[\|" \-\-add\-section\ \fIsectionname=filename\fR "\|]" .RB "[\|" \-\-change\-leading\-char\fR "\|]" .RB "[\|" \-\-remove\-leading\-char\fR "\|]" +.RB "[\|" \-\-srec\-len=\fIval\fR "\|]" +.RB "[\|" \-\-srec\-forceS3\fR "\|]" .RB "[\|" \-\-redefine\-sym\ \fIold=new\fR "\|]" .RB "[\|" \-\-weaken\fR "\|]" .RB "[\|" \-v\ |\ \-\-verbose\fR "\|]" @@ -282,6 +284,14 @@ with different conventions for symbol names. This is different from \fB\-\-change\-leading\-char\fP because it always changes the symbol name when appropriate, regardless of the object file format of the output .TP +.B \fB\-\-srec\-len=\fIval +Meaningful only for srec output. Set the length of the Srecords to \fIval\fP. +This length covers both the address, data and crc fields. +.TP +.B \fB\-\-srec\-forceS3 +Meaningful only for srec output. Avoid generation of S1/S2 records, creating +S3-only record format. +.TP .B \-\-redefine\-sym\ \fIold=new Change the name of symbol \fIold\fR to \fInew\fR. This can be useful when one is trying link two things together for which you have no @@ -314,19 +324,377 @@ The GNU Binary Utilities\c \&, Roland H. Pesch (June 1993). .SH COPYING -Copyright (c) 1993, 94, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. +Copyright (c) 1993, 94, 95, 96, 97, 98, 1999, 2000 Free Software Foundation, Inc. .PP -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. -.PP -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. -.PP -Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be included in -translations approved by the Free Software Foundation instead of in -the original English. +This document is distributed under the terms of the GNU Free +Documentation License, version 1.1. That license is described in the +sources for this manual page, but it is not displayed here in order to +make this manual more consise. Copies of this license can also be +obtained from: http://www.gnu.org/copyleft/. + +\" .SH 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. +\" .PP +\" 0. PREAMBLE +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 1. APPLICABILITY AND DEFINITIONS +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 2. VERBATIM COPYING +\" .PP +\" 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. +\" .PP +\" You may also lend copies, under the same conditions stated above, and +\" you may publicly display copies. +\" .PP +\" 3. COPYING IN QUANTITY +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 4. MODIFICATIONS +\" .PP +\" 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: +\" .PP +\" 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. +\" .PP +\" 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). +\" .PP +\" C. State on the Title page the name of the publisher of the +\" Modified Version, as the publisher. +\" .PP +\" D. Preserve all the copyright notices of the Document. +\" .PP +\" E. Add an appropriate copyright notice for your modifications +\" adjacent to the other copyright notices. +\" .PP +\" 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. +\" Preserve in that license notice the full lists of Invariant Sections +\" and required Cover Texts given in the Document's license notice. +\" .PP +\" H. Include an unaltered copy of this License. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" M. Delete any section entitled "Endorsements". Such a section +\" may not be included in the Modified Version. +\" .PP +\" N. Do not retitle any existing section as "Endorsements" +\" or to conflict in title with any Invariant Section. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 5. COMBINING DOCUMENTS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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." +\" .PP + +\" 6. COLLECTIONS OF DOCUMENTS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 7. AGGREGATION WITH INDEPENDENT WORKS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 8. TRANSLATION +\" .PP +\" 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. +\" .PP + +\" 9. TERMINATION +\" .PP +\" 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. +\" .PP + +\" 10. FUTURE REVISIONS OF THIS LICENSE +\" .PP +\" 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/. +\" .PP +\" 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. +\" .PP + +\" ADDENDUM: How to use this License for your documents +\" .PP +\" 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: +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. diff --git a/gnu/dist/toolchain/binutils/objdump.1 b/gnu/dist/toolchain/binutils/objdump.1 index ddc153ed8a36..1c2fa612a299 100644 --- a/gnu/dist/toolchain/binutils/objdump.1 +++ b/gnu/dist/toolchain/binutils/objdump.1 @@ -1,6 +1,6 @@ -.\" Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation +.\" Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 1998, 2000 Free Software Foundation .\" See section COPYING for conditions for redistribution -.TH objdump 1 "5 November 1991" "cygnus support" "GNU Development Tools" +.TH objdump 1 "5 November 1991" "Free Software Foundation" "GNU Development Tools" .de BP .sp .ti \-.2i @@ -396,17 +396,376 @@ The GNU Binary Utilities\c .SH COPYING Copyright (c) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. .PP -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. .PP -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. -.PP -Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be included in -translations approved by the Free Software Foundation instead of in -the original English. +This document is distributed under the terms of the GNU Free +Documentation License, version 1.1. That license is described in the +sources for this manual page, but it is not displayed here in order to +make this manual more consise. Copies of this license can also be +obtained from: http://www.gnu.org/copyleft/. + +\" .SH 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. +\" .PP +\" 0. PREAMBLE +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 1. APPLICABILITY AND DEFINITIONS +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 2. VERBATIM COPYING +\" .PP +\" 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. +\" .PP +\" You may also lend copies, under the same conditions stated above, and +\" you may publicly display copies. +\" .PP +\" 3. COPYING IN QUANTITY +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 4. MODIFICATIONS +\" .PP +\" 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: +\" .PP +\" 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. +\" .PP +\" 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). +\" .PP +\" C. State on the Title page the name of the publisher of the +\" Modified Version, as the publisher. +\" .PP +\" D. Preserve all the copyright notices of the Document. +\" .PP +\" E. Add an appropriate copyright notice for your modifications +\" adjacent to the other copyright notices. +\" .PP +\" 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. +\" Preserve in that license notice the full lists of Invariant Sections +\" and required Cover Texts given in the Document's license notice. +\" .PP +\" H. Include an unaltered copy of this License. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" M. Delete any section entitled "Endorsements". Such a section +\" may not be included in the Modified Version. +\" .PP +\" N. Do not retitle any existing section as "Endorsements" +\" or to conflict in title with any Invariant Section. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 5. COMBINING DOCUMENTS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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." +\" .PP + +\" 6. COLLECTIONS OF DOCUMENTS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 7. AGGREGATION WITH INDEPENDENT WORKS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 8. TRANSLATION +\" .PP +\" 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. +\" .PP + +\" 9. TERMINATION +\" .PP +\" 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. +\" .PP + +\" 10. FUTURE REVISIONS OF THIS LICENSE +\" .PP +\" 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/. +\" .PP +\" 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. +\" .PP + +\" ADDENDUM: How to use this License for your documents +\" .PP +\" 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: +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. diff --git a/gnu/dist/toolchain/binutils/po/POTFILES.in b/gnu/dist/toolchain/binutils/po/POTFILES.in index a3a05867fb25..861e0ff68671 100644 --- a/gnu/dist/toolchain/binutils/po/POTFILES.in +++ b/gnu/dist/toolchain/binutils/po/POTFILES.in @@ -14,8 +14,6 @@ debug.h dlltool.c dlltool.h dllwrap.c -dyn-string.c -dyn-string.h filemode.c ieee.c ieee.c diff --git a/gnu/dist/toolchain/binutils/po/binutils.pot b/gnu/dist/toolchain/binutils/po/binutils.pot index ed7ba0c4282b..b497a04a0464 100644 --- a/gnu/dist/toolchain/binutils/po/binutils.pot +++ b/gnu/dist/toolchain/binutils/po/binutils.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2000-04-05 14:09+0930\n" +"POT-Creation-Date: 2001-01-11 12:02-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,12 +18,12 @@ msgstr "" #, c-format msgid "" "Usage: %s [-CfsHV] [-b bfdname] [--target=bfdname]\n" -" [-e executable] [--exe=executable] [--demangle]\n" +" [-e executable] [--exe=executable] [--demangle[=style]]\n" " [--basenames] [--functions] [addr addr ...]\n" msgstr "" -#: addr2line.c:83 ar.c:286 nlmconv.c:1141 nm.c:306 objcopy.c:358 objcopy.c:390 -#: objdump.c:277 readelf.c:1703 size.c:89 strings.c:512 windres.c:737 +#: addr2line.c:83 ar.c:288 nlmconv.c:1119 objcopy.c:373 objcopy.c:405 +#: readelf.c:1876 size.c:91 strings.c:530 windres.c:737 #, c-format msgid "Report bugs to %s\n" msgstr "" @@ -33,264 +33,281 @@ msgstr "" msgid "%s: can not get addresses from archive" msgstr "" -#: ar.c:235 +#: addr2line.c:310 nm.c:436 objdump.c:2857 +#, c-format +msgid "unknown demangling style `%s'" +msgstr "" + +#: ar.c:236 #, c-format msgid "no entry %s in archive\n" msgstr "" -#: ar.c:252 +#: ar.c:253 #, c-format msgid "" -"Usage: %s [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] archive-file " -"file...\n" +"Usage: %s [-X32_64] [-]{dmpqrstx}[abcfilNoPsSuvV] [member-name] [count] " +"archive-file file...\n" msgstr "" -#: ar.c:255 +#: ar.c:256 #, c-format msgid " %s -M [\n" +"\n" +msgstr "" + +#: ar.c:845 ar.c:913 #, c-format msgid "%s is not a valid archive" msgstr "" -#: ar.c:846 +#: ar.c:881 #, c-format msgid "stat returns negative size for %s" msgstr "" -#: ar.c:967 +#: ar.c:1008 #, c-format msgid "%s is not an archive" msgstr "" -#: ar.c:974 +#: ar.c:1015 #, c-format -msgid "%s: creating %s\n" +msgid "creating %s" msgstr "" -#: ar.c:1181 +#: ar.c:1221 #, c-format msgid "No member named `%s'\n" msgstr "" -#: ar.c:1233 +#: ar.c:1273 #, c-format -msgid "%s: no entry %s in archive %s!\n" +msgid "no entry %s in archive %s!" msgstr "" -#: ar.c:1395 +#: ar.c:1434 #, c-format msgid "%s: no archive map to update" msgstr "" -#: arsup.c:87 +#: arsup.c:88 #, c-format msgid "No entry %s in archive.\n" msgstr "" -#: arsup.c:119 +#: arsup.c:120 #, c-format msgid "Can't open file %s\n" msgstr "" -#: arsup.c:167 +#: arsup.c:170 #, c-format msgid "%s: Can't open output archive %s\n" msgstr "" -#: arsup.c:179 +#: arsup.c:182 #, c-format msgid "%s: Can't open input archive %s\n" msgstr "" -#: arsup.c:185 +#: arsup.c:188 #, c-format msgid "%s: file %s is not an archive\n" msgstr "" -#: arsup.c:226 +#: arsup.c:229 #, c-format msgid "%s: no output archive specified yet\n" msgstr "" -#: arsup.c:246 arsup.c:281 arsup.c:317 arsup.c:337 arsup.c:395 +#: arsup.c:249 arsup.c:284 arsup.c:320 arsup.c:340 arsup.c:398 #, c-format msgid "%s: no open output archive\n" msgstr "" -#: arsup.c:254 arsup.c:355 arsup.c:375 +#: arsup.c:257 arsup.c:358 arsup.c:378 #, c-format msgid "%s: can't open file %s\n" msgstr "" -#: arsup.c:302 arsup.c:371 arsup.c:450 +#: arsup.c:305 arsup.c:374 arsup.c:453 #, c-format msgid "%s: can't find module file %s\n" msgstr "" -#: arsup.c:402 +#: arsup.c:405 #, c-format msgid "Current open archive is %s\n" msgstr "" -#: arsup.c:429 +#: arsup.c:432 #, c-format msgid "%s: no open archive\n" msgstr "" -#: bucomm.c:139 +#: bucomm.c:135 #, c-format msgid "can't set BFD default target to `%s': %s" msgstr "" -#: bucomm.c:151 +#: bucomm.c:147 #, c-format msgid "%s: Matching formats:" msgstr "" -#: bucomm.c:168 +#: bucomm.c:164 msgid "Supported targets:" msgstr "" -#: bucomm.c:170 +#: bucomm.c:166 #, c-format msgid "%s: supported targets:" msgstr "" -#: bucomm.c:263 +#: bucomm.c:272 #, c-format msgid "%s: bad number: %s" msgstr "" @@ -305,14 +322,13 @@ msgstr "" msgid "%s: Print a human readable interpretation of a SYSROFF object file\n" msgstr "" -#: coffdump.c:498 srconv.c:1940 sysdump.c:755 +#: coffdump.c:498 srconv.c:1941 sysdump.c:755 #, c-format msgid "GNU %s version %s\n" msgstr "" -#: coffdump.c:516 srconv.c:1977 sysdump.c:775 -#, c-format -msgid "%s: no input file specified\n" +#: coffdump.c:516 srconv.c:1975 sysdump.c:775 +msgid "no input file specified" msgstr "" #: debug.c:653 @@ -412,688 +428,880 @@ msgstr "" msgid "debug_write_type: illegal type encountered" msgstr "" -#: dlltool.c:770 dlltool.c:794 dlltool.c:819 +#: dlltool.c:737 dlltool.c:762 dlltool.c:788 #, c-format -msgid "Internal error: Unknown machine type: %d\n" +msgid "Internal error: Unknown machine type: %d" msgstr "" -#: dlltool.c:856 +#: dlltool.c:825 #, c-format msgid "Can't open def file: %s" msgstr "" -#: dlltool.c:861 +#: dlltool.c:830 #, c-format msgid "Processing def file: %s" msgstr "" -#: dlltool.c:865 +#: dlltool.c:834 msgid "Processed def file" msgstr "" -#: dlltool.c:890 +#: dlltool.c:859 #, c-format -msgid "Syntax error in def file %s:%d\n" +msgid "Syntax error in def file %s:%d" msgstr "" -#: dlltool.c:923 +#: dlltool.c:892 #, c-format msgid "NAME: %s base: %x" msgstr "" -#: dlltool.c:926 -msgid "Can't have LIBRARY and NAME\n" +#: dlltool.c:895 dlltool.c:914 +msgid "Can't have LIBRARY and NAME" msgstr "" -#: dlltool.c:942 +#: dlltool.c:911 #, c-format msgid "LIBRARY: %s base: %x" msgstr "" -#: dlltool.c:945 -#, c-format -msgid "%s: Can't have LIBRARY and NAME\n" -msgstr "" - -#: dlltool.c:1200 resrc.c:271 +#: dlltool.c:1169 resrc.c:271 #, c-format msgid "wait: %s" msgstr "" -#: dlltool.c:1205 resrc.c:276 +#: dlltool.c:1174 dllwrap.c:456 resrc.c:276 #, c-format msgid "subprocess got fatal signal %d" msgstr "" -#: dlltool.c:1211 +#: dlltool.c:1180 dllwrap.c:463 resrc.c:283 #, c-format -msgid "%s exited with status %d\n" +msgid "%s exited with status %d" msgstr "" -#: dlltool.c:1243 +#: dlltool.c:1212 #, c-format -msgid "Sucking in info from %s section in %s\n" +msgid "Sucking in info from %s section in %s" msgstr "" -#: dlltool.c:1367 +#: dlltool.c:1336 #, c-format -msgid "Excluding symbol: %s\n" +msgid "Excluding symbol: %s" msgstr "" -#: dlltool.c:1462 dlltool.c:1473 nm.c:904 nm.c:915 objdump.c:444 objdump.c:461 +#: dlltool.c:1431 dlltool.c:1442 nm.c:946 nm.c:957 objdump.c:443 objdump.c:460 #, c-format -msgid "%s: no symbols\n" +msgid "%s: no symbols" msgstr "" #. FIXME: we ought to read in and block out the base relocations -#: dlltool.c:1500 +#: dlltool.c:1469 #, c-format -msgid "Done reading %s\n" +msgid "Done reading %s" msgstr "" -#: dlltool.c:1511 +#: dlltool.c:1480 #, c-format msgid "Unable to open object file: %s" msgstr "" -#: dlltool.c:1514 +#: dlltool.c:1483 #, c-format msgid "Scanning object file %s" msgstr "" -#: dlltool.c:1529 +#: dlltool.c:1498 #, c-format msgid "Cannot produce mcore-elf dll from archive file: %s" msgstr "" -#: dlltool.c:1621 +#: dlltool.c:1590 msgid "Adding exports to output file" msgstr "" -#: dlltool.c:1666 +#: dlltool.c:1635 msgid "Added exports to output file" msgstr "" -#: dlltool.c:1790 +#: dlltool.c:1759 #, c-format -msgid "Generating export file: %s\n" +msgid "Generating export file: %s" msgstr "" -#: dlltool.c:1795 +#: dlltool.c:1764 #, c-format msgid "Unable to open temporary assembler file: %s" msgstr "" -#: dlltool.c:1798 +#: dlltool.c:1767 #, c-format msgid "Opened temporary file: %s" msgstr "" -#: dlltool.c:2012 +#: dlltool.c:1981 msgid "Generated exports file" msgstr "" -#: dlltool.c:2267 +#: dlltool.c:2236 #, c-format msgid "bfd_open failed open stub file: %s" msgstr "" -#: dlltool.c:2270 +#: dlltool.c:2239 #, c-format msgid "Creating stub file: %s" msgstr "" -#: dlltool.c:2657 +#: dlltool.c:2626 #, c-format msgid "failed to open temporary head file: %s" msgstr "" -#: dlltool.c:2716 +#: dlltool.c:2685 #, c-format msgid "failed to open temporary tail file: %s" msgstr "" -#: dlltool.c:2784 +#: dlltool.c:2753 #, c-format msgid "Can't open .lib file: %s" msgstr "" -#: dlltool.c:2787 +#: dlltool.c:2756 #, c-format -msgid "Creating library file: %s\n" +msgid "Creating library file: %s" msgstr "" -#: dlltool.c:2846 +#: dlltool.c:2815 #, c-format -msgid "cannot delete %s: %s\n" +msgid "cannot delete %s: %s" msgstr "" -#: dlltool.c:2850 +#: dlltool.c:2819 msgid "Created lib file" msgstr "" -#: dlltool.c:2955 +#: dlltool.c:2924 #, c-format -msgid "Warning, ignoring duplicate EXPORT %s %d,%d\n" +msgid "Warning, ignoring duplicate EXPORT %s %d,%d" msgstr "" -#: dlltool.c:2961 +#: dlltool.c:2930 #, c-format msgid "Error, duplicate EXPORT with oridinals: %s" msgstr "" -#: dlltool.c:3088 +#: dlltool.c:3057 msgid "Processing definitions" msgstr "" -#: dlltool.c:3126 +#: dlltool.c:3095 msgid "Processed definitions" msgstr "" #. xgetext:c-format -#: dlltool.c:3137 +#: dlltool.c:3106 dllwrap.c:520 #, c-format msgid "Usage %s \n" msgstr "" #. xgetext:c-format -#: dlltool.c:3139 +#: dlltool.c:3108 #, c-format msgid "" " -m --machine Create as DLL for . [default: %s]\n" msgstr "" -#: dlltool.c:3140 +#: dlltool.c:3109 msgid "" " possible : arm[_interwork], i386, mcore[-elf]{-le|-be}, " "ppc, thumb\n" msgstr "" -#: dlltool.c:3141 +#: dlltool.c:3110 msgid " -e --output-exp Generate an export file.\n" msgstr "" -#: dlltool.c:3142 +#: dlltool.c:3111 msgid " -l --output-lib Generate an interface library.\n" msgstr "" -#: dlltool.c:3143 +#: dlltool.c:3112 msgid " -a --add-indirect Add dll indirects to export file.\n" msgstr "" -#: dlltool.c:3144 +#: dlltool.c:3113 msgid "" " -D --dllname Name of input dll to put into interface lib.\n" msgstr "" -#: dlltool.c:3145 +#: dlltool.c:3114 msgid " -d --input-def Name of .def file to be read in.\n" msgstr "" -#: dlltool.c:3146 +#: dlltool.c:3115 msgid " -z --output-def Name of .def file to be created.\n" msgstr "" -#: dlltool.c:3147 +#: dlltool.c:3116 msgid " --export-all-symbols Export all symbols to .def\n" msgstr "" -#: dlltool.c:3148 +#: dlltool.c:3117 msgid " --no-export-all-symbols Only export listed symbols\n" msgstr "" -#: dlltool.c:3149 +#: dlltool.c:3118 msgid " --exclude-symbols Don't export \n" msgstr "" -#: dlltool.c:3150 +#: dlltool.c:3119 msgid " --no-default-excludes Clear default exclude symbols\n" msgstr "" -#: dlltool.c:3151 +#: dlltool.c:3120 msgid " -b --base-file Read linker generated base file.\n" msgstr "" -#: dlltool.c:3152 +#: dlltool.c:3121 msgid " -x --no-idata4 Don't generate idata$4 section.\n" msgstr "" -#: dlltool.c:3153 +#: dlltool.c:3122 msgid " -c --no-idata5 Don't generate idata$5 section.\n" msgstr "" -#: dlltool.c:3154 +#: dlltool.c:3123 msgid "" " -U --add-underscore Add underscores to symbols in interface " "library.\n" msgstr "" -#: dlltool.c:3155 +#: dlltool.c:3124 msgid " -k --kill-at Kill @ from exported names.\n" msgstr "" -#: dlltool.c:3156 +#: dlltool.c:3125 msgid " -A --add-stdcall-alias Add aliases without @.\n" msgstr "" -#: dlltool.c:3157 +#: dlltool.c:3126 msgid " -S --as Use for assembler.\n" msgstr "" -#: dlltool.c:3158 +#: dlltool.c:3127 msgid " -f --as-flags Pass to the assembler.\n" msgstr "" -#: dlltool.c:3159 +#: dlltool.c:3128 msgid "" " -C --compat-implib Create backward compatible import library.\n" msgstr "" -#: dlltool.c:3160 +#: dlltool.c:3129 msgid "" " -n --no-delete Keep temp files (repeat for extra " "preservation).\n" msgstr "" -#: dlltool.c:3161 +#: dlltool.c:3130 msgid " -v --verbose Be verbose.\n" msgstr "" -#: dlltool.c:3162 +#: dlltool.c:3131 msgid " -V --version Display the program version.\n" msgstr "" -#: dlltool.c:3163 +#: dlltool.c:3132 msgid " -h --help Display this information.\n" msgstr "" -#: dlltool.c:3165 +#: dlltool.c:3134 msgid "" " -M --mcore-elf Process mcore-elf object files into .\n" msgstr "" -#: dlltool.c:3166 +#: dlltool.c:3135 msgid " -L --linker Use as the linker.\n" msgstr "" -#: dlltool.c:3167 +#: dlltool.c:3136 msgid " -F --linker-flags Pass to the linker.\n" msgstr "" -#: dlltool.c:3311 +#: dlltool.c:3280 #, c-format msgid "Unable to open base-file: %s" msgstr "" -#: dlltool.c:3340 +#: dlltool.c:3309 #, c-format msgid "Machine '%s' not supported" msgstr "" -#: dlltool.c:3443 dllwrap.c:215 +#: dlltool.c:3412 dllwrap.c:241 #, c-format msgid "Tried file: %s" msgstr "" -#: dlltool.c:3450 dllwrap.c:222 +#: dlltool.c:3419 dllwrap.c:248 #, c-format msgid "Using file: %s" msgstr "" -#: ieee.c:316 +#: dllwrap.c:335 +#, c-format +msgid "Keeping temporary base file %s" +msgstr "" + +#: dllwrap.c:337 +#, c-format +msgid "Deleting temporary base file %s" +msgstr "" + +#: dllwrap.c:351 +#, c-format +msgid "Keeping temporary exp file %s" +msgstr "" + +#: dllwrap.c:353 +#, c-format +msgid "Deleting temporary exp file %s" +msgstr "" + +#: dllwrap.c:366 +#, c-format +msgid "Keeping temporary def file %s" +msgstr "" + +#: dllwrap.c:368 +#, c-format +msgid "Deleting temporary def file %s" +msgstr "" + +#: dllwrap.c:521 +msgid " Generic options:\n" +msgstr "" + +#: dllwrap.c:522 +msgid " --quiet, -q Work quietly\n" +msgstr "" + +#: dllwrap.c:523 +msgid " --verbose, -v Verbose\n" +msgstr "" + +#: dllwrap.c:524 +msgid " --version Print dllwrap version\n" +msgstr "" + +#: dllwrap.c:525 +msgid " --implib Synonym for --output-lib\n" +msgstr "" + +#: dllwrap.c:526 +#, c-format +msgid " Options for %s:\n" +msgstr "" + +#: dllwrap.c:527 +msgid " --driver-name Defaults to \"gcc\"\n" +msgstr "" + +#: dllwrap.c:528 +msgid " --driver-flags Override default ld flags\n" +msgstr "" + +#: dllwrap.c:529 +msgid " --dlltool-name Defaults to \"dlltool\"\n" +msgstr "" + +#: dllwrap.c:530 +msgid " --entry Specify alternate DLL entry point\n" +msgstr "" + +#: dllwrap.c:531 +msgid " --image-base Specify image base address\n" +msgstr "" + +#: dllwrap.c:532 +msgid " --target i386-cygwin32 or i386-mingw32\n" +msgstr "" + +#: dllwrap.c:533 +msgid " --dry-run Show what needs to be run\n" +msgstr "" + +#: dllwrap.c:534 +msgid " --mno-cygwin Create Mingw DLL\n" +msgstr "" + +#: dllwrap.c:535 +msgid " Options passed to DLLTOOL:\n" +msgstr "" + +#: dllwrap.c:536 +msgid " --machine \n" +msgstr "" + +#: dllwrap.c:537 +msgid " --output-exp Generate export file.\n" +msgstr "" + +#: dllwrap.c:538 +msgid " --output-lib Generate input library.\n" +msgstr "" + +#: dllwrap.c:539 +msgid " --add-indirect Add dll indirects to export file.\n" +msgstr "" + +#: dllwrap.c:540 +msgid " --dllname Name of input dll to put into output lib.\n" +msgstr "" + +#: dllwrap.c:541 +msgid " --def Name input .def file\n" +msgstr "" + +#: dllwrap.c:542 +msgid " --output-def Name output .def file\n" +msgstr "" + +#: dllwrap.c:543 +msgid " --export-all-symbols Export all symbols to .def\n" +msgstr "" + +#: dllwrap.c:544 +msgid " --no-export-all-symbols Only export .drectve symbols\n" +msgstr "" + +#: dllwrap.c:545 +msgid " --exclude-symbols Exclude from .def\n" +msgstr "" + +#: dllwrap.c:546 +msgid " --no-default-excludes Zap default exclude symbols\n" +msgstr "" + +#: dllwrap.c:547 +msgid " --base-file Read linker generated base file\n" +msgstr "" + +#: dllwrap.c:548 +msgid " --no-idata4 Don't generate idata$4 section\n" +msgstr "" + +#: dllwrap.c:549 +msgid " --no-idata5 Don't generate idata$5 section\n" +msgstr "" + +#: dllwrap.c:550 +msgid " -U Add underscores to .lib\n" +msgstr "" + +#: dllwrap.c:551 +msgid " -k Kill @ from exported names\n" +msgstr "" + +#: dllwrap.c:552 +msgid " --add-stdcall-alias Add aliases without @\n" +msgstr "" + +#: dllwrap.c:553 +msgid " --as Use for assembler\n" +msgstr "" + +#: dllwrap.c:554 +msgid " --nodelete Keep temp files.\n" +msgstr "" + +#: dllwrap.c:555 +msgid " Rest are passed unmodified to the language driver\n" +msgstr "" + +#: dllwrap.c:816 +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" +msgstr "" + +#: dllwrap.c:1006 +#, c-format +msgid "DLLTOOL name : %s\n" +msgstr "" + +#: dllwrap.c:1007 +#, c-format +msgid "DLLTOOL options : %s\n" +msgstr "" + +#: dllwrap.c:1008 +#, c-format +msgid "DRIVER name : %s\n" +msgstr "" + +#: dllwrap.c:1009 +#, c-format +msgid "DRIVER options : %s\n" +msgstr "" + +#: ieee.c:317 msgid "unexpected end of debugging information" msgstr "" -#: ieee.c:411 +#: ieee.c:412 msgid "invalid number" msgstr "" -#: ieee.c:470 +#: ieee.c:471 msgid "invalid string length" msgstr "" -#: ieee.c:527 ieee.c:568 +#: ieee.c:528 ieee.c:569 msgid "expression stack overflow" msgstr "" -#: ieee.c:547 +#: ieee.c:548 msgid "unsupported IEEE expression operator" msgstr "" -#: ieee.c:562 +#: ieee.c:563 msgid "unknown section" msgstr "" -#: ieee.c:583 +#: ieee.c:584 msgid "expression stack underflow" msgstr "" -#: ieee.c:597 +#: ieee.c:598 msgid "expression stack mismatch" msgstr "" -#: ieee.c:636 +#: ieee.c:637 msgid "unknown builtin type" msgstr "" -#: ieee.c:781 +#: ieee.c:782 msgid "BCD float type not supported" msgstr "" -#: ieee.c:927 +#: ieee.c:928 msgid "unexpected number" msgstr "" -#: ieee.c:934 +#: ieee.c:935 msgid "unexpected record type" msgstr "" -#: ieee.c:967 +#: ieee.c:968 msgid "blocks left on stack at end" msgstr "" -#: ieee.c:1232 +#: ieee.c:1233 msgid "unknown BB type" msgstr "" -#: ieee.c:1241 +#: ieee.c:1242 msgid "stack overflow" msgstr "" -#: ieee.c:1266 +#: ieee.c:1267 msgid "stack underflow" msgstr "" -#: ieee.c:1380 ieee.c:1452 ieee.c:2151 +#: ieee.c:1381 ieee.c:1453 ieee.c:2152 msgid "illegal variable index" msgstr "" -#: ieee.c:1430 +#: ieee.c:1431 msgid "illegal type index" msgstr "" -#: ieee.c:1440 ieee.c:1477 +#: ieee.c:1441 ieee.c:1478 msgid "unknown TY code" msgstr "" -#: ieee.c:1459 +#: ieee.c:1460 msgid "undefined variable in TY" msgstr "" #. Pascal file name. FIXME. -#: ieee.c:1870 +#: ieee.c:1871 msgid "Pascal file name not supported" msgstr "" -#: ieee.c:1918 +#: ieee.c:1919 msgid "unsupported qualifer" msgstr "" -#: ieee.c:2189 +#: ieee.c:2190 msgid "undefined variable in ATN" msgstr "" -#: ieee.c:2232 +#: ieee.c:2233 msgid "unknown ATN type" msgstr "" #. Reserved for FORTRAN common. -#: ieee.c:2354 +#: ieee.c:2355 msgid "unsupported ATN11" msgstr "" #. We have no way to record this information. FIXME. -#: ieee.c:2381 +#: ieee.c:2382 msgid "unsupported ATN12" msgstr "" -#: ieee.c:2441 +#: ieee.c:2442 msgid "unexpected string in C++ misc" msgstr "" -#: ieee.c:2454 +#: ieee.c:2455 msgid "bad misc record" msgstr "" -#: ieee.c:2497 +#: ieee.c:2498 msgid "unrecognized C++ misc record" msgstr "" -#: ieee.c:2614 +#: ieee.c:2615 msgid "undefined C++ object" msgstr "" -#: ieee.c:2648 +#: ieee.c:2649 msgid "unrecognized C++ object spec" msgstr "" -#: ieee.c:2684 +#: ieee.c:2685 msgid "unsupported C++ object type" msgstr "" -#: ieee.c:2694 +#: ieee.c:2695 msgid "C++ base class not defined" msgstr "" -#: ieee.c:2706 ieee.c:2811 +#: ieee.c:2707 ieee.c:2812 msgid "C++ object has no fields" msgstr "" -#: ieee.c:2725 +#: ieee.c:2726 msgid "C++ base class not found in container" msgstr "" -#: ieee.c:2832 +#: ieee.c:2833 msgid "C++ data member not found in container" msgstr "" -#: ieee.c:2873 ieee.c:3023 +#: ieee.c:2874 ieee.c:3024 msgid "unknown C++ visibility" msgstr "" -#: ieee.c:2907 +#: ieee.c:2908 msgid "bad C++ field bit pos or size" msgstr "" -#: ieee.c:2999 +#: ieee.c:3000 msgid "bad type for C++ method function" msgstr "" -#: ieee.c:3009 +#: ieee.c:3010 msgid "no type information for C++ method function" msgstr "" -#: ieee.c:3048 +#: ieee.c:3049 msgid "C++ static virtual method" msgstr "" -#: ieee.c:3143 +#: ieee.c:3144 msgid "unrecognized C++ object overhead spec" msgstr "" -#: ieee.c:3182 +#: ieee.c:3183 msgid "undefined C++ vtable" msgstr "" -#: ieee.c:3253 +#: ieee.c:3254 msgid "C++ default values not in a function" msgstr "" -#: ieee.c:3293 +#: ieee.c:3294 msgid "unrecognized C++ default type" msgstr "" -#: ieee.c:3324 +#: ieee.c:3325 msgid "reference parameter is not a pointer" msgstr "" -#: ieee.c:3409 +#: ieee.c:3410 msgid "unrecognized C++ reference type" msgstr "" -#: ieee.c:3491 +#: ieee.c:3492 msgid "C++ reference not found" msgstr "" -#: ieee.c:3499 +#: ieee.c:3500 msgid "C++ reference is not pointer" msgstr "" -#: ieee.c:3528 ieee.c:3536 +#: ieee.c:3529 ieee.c:3537 msgid "missing required ASN" msgstr "" -#: ieee.c:3566 ieee.c:3574 +#: ieee.c:3567 ieee.c:3575 msgid "missing required ATN65" msgstr "" -#: ieee.c:3588 +#: ieee.c:3589 msgid "bad ATN65 record" msgstr "" -#: ieee.c:4235 +#: ieee.c:4236 msgid "IEEE numeric overflow: 0x" msgstr "" -#: ieee.c:4281 +#: ieee.c:4282 #, c-format msgid "IEEE string length overflow: %u\n" msgstr "" -#: ieee.c:5315 +#: ieee.c:5324 #, c-format msgid "IEEE unsupported integer type size %u\n" msgstr "" -#: ieee.c:5351 +#: ieee.c:5360 #, c-format msgid "IEEE unsupported float type size %u\n" msgstr "" -#: ieee.c:5387 +#: ieee.c:5396 #, c-format msgid "IEEE unsupported complex type size %u\n" msgstr "" #: nlmconv.c:275 srconv.c:1966 -#, c-format -msgid "%s: input and output files must be different\n" +msgid "input and output files must be different" msgstr "" -#: nlmconv.c:325 -#, c-format -msgid "%s: input file named both on command line and with INPUT\n" +#: nlmconv.c:322 +msgid "input file named both on command line and with INPUT" msgstr "" -#: nlmconv.c:336 -#, c-format -msgid "%s: no input file\n" +#: nlmconv.c:331 +msgid "no input file" msgstr "" -#: nlmconv.c:366 -#, c-format -msgid "%s: no name for output file\n" +#: nlmconv.c:361 +msgid "no name for output file" msgstr "" -#: nlmconv.c:381 -#, c-format -msgid "%s: warning:input and output formats are not compatible\n" +#: nlmconv.c:374 +msgid "warning: input and output formats are not compatible" msgstr "" -#: nlmconv.c:411 +#: nlmconv.c:403 msgid "make .bss section" msgstr "" -#: nlmconv.c:420 +#: nlmconv.c:412 msgid "make .nlmsections section" msgstr "" -#: nlmconv.c:422 +#: nlmconv.c:414 msgid "set .nlmsections flags" msgstr "" -#: nlmconv.c:450 +#: nlmconv.c:442 msgid "set .bss vma" msgstr "" -#: nlmconv.c:457 +#: nlmconv.c:449 msgid "set .data size" msgstr "" -#: nlmconv.c:638 +#: nlmconv.c:629 #, c-format -msgid "%s: warning: symbol %s imported but not in import list\n" +msgid "warning: symbol %s imported but not in import list" msgstr "" -#: nlmconv.c:658 +#: nlmconv.c:649 msgid "set start address" msgstr "" -#: nlmconv.c:707 +#: nlmconv.c:698 #, c-format -msgid "%s: warning: START procedure %s not defined\n" +msgid "warning: START procedure %s not defined" msgstr "" -#: nlmconv.c:710 +#: nlmconv.c:700 #, c-format -msgid "%s: warning: EXIT procedure %s not defined\n" +msgid "warning: EXIT procedure %s not defined" msgstr "" -#: nlmconv.c:714 +#: nlmconv.c:702 #, c-format -msgid "%s: warning: CHECK procedure %s not defined\n" +msgid "warning: CHECK procedure %s not defined" msgstr "" -#: nlmconv.c:736 nlmconv.c:928 +#: nlmconv.c:723 nlmconv.c:912 msgid "custom section" msgstr "" -#: nlmconv.c:757 nlmconv.c:960 +#: nlmconv.c:744 nlmconv.c:941 msgid "help section" msgstr "" -#: nlmconv.c:779 nlmconv.c:979 +#: nlmconv.c:766 nlmconv.c:959 msgid "message section" msgstr "" -#: nlmconv.c:795 nlmconv.c:1012 +#: nlmconv.c:782 nlmconv.c:992 msgid "module section" msgstr "" -#: nlmconv.c:815 nlmconv.c:1029 +#: nlmconv.c:802 nlmconv.c:1008 msgid "rpc section" msgstr "" -#: nlmconv.c:852 +#. There is no place to record this information. +#: nlmconv.c:838 #, c-format -msgid "%s:%s: warning: shared libraries can not have uninitialized data\n" +msgid "%s: warning: shared libraries can not have uninitialized data" msgstr "" -#: nlmconv.c:873 nlmconv.c:1049 +#: nlmconv.c:859 nlmconv.c:1027 msgid "shared section" msgstr "" -#: nlmconv.c:881 -#, c-format -msgid "%s: warning: No version number given\n" +#: nlmconv.c:867 +msgid "warning: No version number given" msgstr "" -#: nlmconv.c:922 nlmconv.c:954 nlmconv.c:973 nlmconv.c:1023 nlmconv.c:1043 +#: nlmconv.c:907 nlmconv.c:936 nlmconv.c:954 nlmconv.c:1003 nlmconv.c:1022 #, c-format -msgid "%s:%s: read: %s\n" +msgid "%s: read: %s" msgstr "" -#: nlmconv.c:946 -#, c-format -msgid "%s: warning: MAP and FULLMAP are not supported; try ld -M\n" +#: nlmconv.c:929 +msgid "warning: MAP and FULLMAP are not supported; try ld -M" msgstr "" -#: nlmconv.c:1121 +#: nlmconv.c:1099 #, c-format msgid "%s: Convert an object file into a NetWare Loadable Module\n" msgstr "" -#: nlmconv.c:1133 +#: nlmconv.c:1111 #, c-format msgid "" "Usage: %s [-dhV] [-I bfdname] [-O bfdname] [-T header-file] [-l linker]\n" @@ -1103,92 +1311,135 @@ msgid "" " [in-file [out-file]]\n" msgstr "" -#: nlmconv.c:1173 +#: nlmconv.c:1151 #, c-format -msgid "%s: support not compiled in for %s\n" +msgid "support not compiled in for %s" msgstr "" -#: nlmconv.c:1216 +#: nlmconv.c:1191 msgid "make section" msgstr "" -#: nlmconv.c:1230 +#: nlmconv.c:1205 msgid "set section size" msgstr "" -#: nlmconv.c:1236 +#: nlmconv.c:1211 msgid "set section alignment" msgstr "" -#: nlmconv.c:1240 +#: nlmconv.c:1215 msgid "set section flags" msgstr "" -#: nlmconv.c:1251 +#: nlmconv.c:1226 msgid "set .nlmsections size" msgstr "" -#: nlmconv.c:1339 nlmconv.c:1347 nlmconv.c:1356 nlmconv.c:1361 +#: nlmconv.c:1314 nlmconv.c:1322 nlmconv.c:1331 nlmconv.c:1336 msgid "set .nlmsection contents" msgstr "" -#: nlmconv.c:1864 +#: nlmconv.c:1839 msgid "stub section sizes" msgstr "" -#: nlmconv.c:1913 +#: nlmconv.c:1888 msgid "writing stub" msgstr "" -#: nlmconv.c:2003 +#: nlmconv.c:1978 #, c-format -msgid "%s: unresolved PC relative reloc against %s\n" +msgid "unresolved PC relative reloc against %s" msgstr "" -#: nlmconv.c:2068 +#: nlmconv.c:2042 #, c-format -msgid "%s: overflow when adjusting relocation against %s\n" +msgid "overflow when adjusting relocation against %s" msgstr "" -#: nlmconv.c:2191 +#: nlmconv.c:2159 #, c-format msgid "%s: execution of %s failed: " msgstr "" -#: nlmconv.c:2206 +#: nlmconv.c:2174 #, c-format -msgid "%s: Execution of %s failed\n" +msgid "Execution of %s failed" msgstr "" #: nm.c:294 #, c-format +msgid "Usage: %s [OPTION]... [FILE]...\n" +msgstr "" + +#: nm.c:295 +msgid "List symbols from FILEs (a.out by default).\n" +msgstr "" + +#: nm.c:296 msgid "" -"Usage: %s [-aABCDglnopPrsuvV] [-t radix] [--radix=radix] [--target=bfdname]\n" -" [--debug-syms] [--extern-only] [--print-armap] [--print-file-name]\n" -" [--numeric-sort] [--no-sort] [--reverse-sort] [--size-sort]\n" -" [--undefined-only] [--portability] [-f {bsd,sysv,posix}]\n" -" [--format={bsd,sysv,posix}] [--demangle] [--no-demangle] [--dynamic]\n" -" [--defined-only] [--line-numbers]\n" -" [--version] [--help]\n" -" [file...]\n" +"\n" +" -a, --debug-syms Display debugger-only symbols\n" +" -A, --print-file-name Print name of the input file before every symbol\n" +" -B Same as --format=bsd\n" +" -C, --demangle[=STYLE] Decode low-level symbol names into user-level " +"names\n" +" The STYLE, if specified, can be `auto' (the " +"default),\n" +" `gnu', 'lucid', 'arm', 'hp', 'edg' or " +"'gnu-new-abi'\n" +" --no-demangle Do not demangle low-level symbol names\n" +" -D, --dynamic Display dynamic symbols instead of normal symbols\n" +" --defined-only Display only defined symbols\n" +" -e (ignored)\n" +" -f, --format=FORMAT Use the output format FORMAT. FORMAT can be " +"`bsd',\n" +" `sysv' or `posix'. The default is `bsd'\n" +" -g, --extern-only Display only external symbols\n" +" -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" +" -o Same as -A\n" +" -p, --no-sort Do not sort the symbols\n" +" -P, --portability Same as --format=posix\n" +" -r, --reverse-sort Reverse the sense of the sort\n" +" -s, --print-armap Include index for symbols from archive members\n" +" --size-sort Sort symbols by size\n" +" -t, --radix=RADIX Use RADIX for printing symbol values\n" +" --target=BFDNAME Specify the target object format as BFDNAME\n" +" -u, --undefined-only Display only undefined symbols\n" +" -V, --version Display this program's version number\n" +" -X 32_64 (ignored)\n" +"\n" msgstr "" -#: nm.c:339 +#: nm.c:328 objdump.c:274 #, c-format -msgid "%s: %s: invalid radix\n" +msgid "Report bugs to %s.\n" msgstr "" -#: nm.c:365 +#: nm.c:361 #, c-format -msgid "%s: %s: invalid output format\n" +msgid "%s: invalid radix" msgstr "" -#: nm.c:492 +#: nm.c:386 #, c-format -msgid "%s: data size %ld\n" +msgid "%s: invalid output format" msgstr "" -#: nm.c:1283 +#: nm.c:493 +msgid "Only -X 32_64 is supported" +msgstr "" + +#: nm.c:535 +#, c-format +msgid "data size %ld" +msgstr "" + +#: nm.c:1325 #, c-format msgid "" "\n" @@ -1197,7 +1448,7 @@ msgid "" "\n" msgstr "" -#: nm.c:1285 +#: nm.c:1327 #, c-format msgid "" "\n" @@ -1206,14 +1457,14 @@ msgid "" "\n" msgstr "" -#: nm.c:1286 nm.c:1340 +#: nm.c:1328 nm.c:1382 msgid "" "Name Value Class Type Size Line " "Section\n" "\n" msgstr "" -#: nm.c:1337 +#: nm.c:1379 #, c-format msgid "" "\n" @@ -1222,7 +1473,7 @@ msgid "" "\n" msgstr "" -#: nm.c:1339 +#: nm.c:1381 #, c-format msgid "" "\n" @@ -1231,22 +1482,22 @@ msgid "" "\n" msgstr "" -#: nm.c:1510 +#: nm.c:1552 msgid "" "\n" "Archive index:\n" msgstr "" -#: objcopy.c:309 +#: objcopy.c:322 #, c-format msgid "Usage: %s in-file [out-file]\n" msgstr "" -#: objcopy.c:310 objcopy.c:368 +#: objcopy.c:323 objcopy.c:383 msgid " The switches are:\n" msgstr "" -#: objcopy.c:311 +#: objcopy.c:324 msgid "" " -I --input-target Assume input file is in format \n" " -O --output-target Create an output file in format " @@ -1308,17 +1559,21 @@ msgid "" " --remove-leading-char Remove leading character from global " "symbols\n" " --redefine-sym = Redefine symbol name to \n" +" --srec-len Restrict the length of generated " +"Srecords\n" +" --srec-forceS3 Restrict the type of generated Srecords " +"to S3\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:367 +#: objcopy.c:382 #, c-format msgid "Usage: %s in-file(s)\n" msgstr "" -#: objcopy.c:369 +#: objcopy.c:384 msgid "" " -I --input-target Assume input file is in format \n" " -O --output-target Create an output file in format " @@ -1343,1266 +1598,1382 @@ msgid "" " -o Place stripped output into \n" msgstr "" -#: objcopy.c:439 +#: objcopy.c:454 #, c-format msgid "unrecognized section flag `%s'" msgstr "" -#: objcopy.c:440 +#: objcopy.c:455 #, c-format msgid "supported flags: %s" msgstr "" -#: objcopy.c:692 +#: objcopy.c:712 #, c-format msgid "%s: Multiple redefinition of symbol \"%s\"" msgstr "" -#: objcopy.c:699 +#: objcopy.c:719 #, c-format msgid "%s: Symbol \"%s\" is target of more than one redefinition" msgstr "" -#: objcopy.c:753 +#: objcopy.c:773 #, c-format msgid "copy from %s(%s) to %s(%s)\n" msgstr "" -#: objcopy.c:772 +#: objcopy.c:792 #, c-format msgid "Warning: Output file cannot represent architecture %s" msgstr "" -#: objcopy.c:799 +#: objcopy.c:819 #, c-format msgid "can't create section `%s': %s" msgstr "" -#: objcopy.c:885 +#: objcopy.c:905 #, c-format msgid "Can't fill gap after %s: %s" msgstr "" -#: objcopy.c:910 +#: objcopy.c:930 #, c-format msgid "Can't add padding to %s: %s" msgstr "" -#: objcopy.c:1048 +#: objcopy.c:1068 #, c-format msgid "%s: error copying private BFD data: %s" msgstr "" -#: objcopy.c:1082 +#: objcopy.c:1102 #, c-format msgid "cannot mkdir %s for archive copying (error: %s)" msgstr "" -#: objcopy.c:1351 +#: objcopy.c:1291 +msgid "making" +msgstr "" + +#: objcopy.c:1300 +msgid "size" +msgstr "" + +#: objcopy.c:1314 +msgid "vma" +msgstr "" + +#: objcopy.c:1340 +msgid "alignment" +msgstr "" + +#: objcopy.c:1349 +msgid "flags" +msgstr "" + +#: objcopy.c:1363 +msgid "private data" +msgstr "" + +#: objcopy.c:1371 #, c-format msgid "%s: section `%s': error in %s: %s" msgstr "" -#: objcopy.c:1625 +#: objcopy.c:1645 #, c-format msgid "%s: can't create debugging section: %s" msgstr "" -#: objcopy.c:1640 +#: objcopy.c:1660 #, c-format msgid "%s: can't set debugging section contents: %s" msgstr "" -#: objcopy.c:1649 +#: objcopy.c:1669 #, c-format msgid "%s: don't know how to write debugging information for %s" msgstr "" -#: objcopy.c:1754 +#: objcopy.c:1775 #, c-format msgid "%s: cannot stat: %s" msgstr "" -#: objcopy.c:1804 +#: objcopy.c:1825 msgid "byte number must be non-negative" msgstr "" -#: objcopy.c:1810 +#: objcopy.c:1831 msgid "interleave must be positive" msgstr "" -#: objcopy.c:1830 objcopy.c:1838 +#: objcopy.c:1851 objcopy.c:1859 #, c-format msgid "%s both copied and removed" msgstr "" -#: objcopy.c:1907 objcopy.c:1977 objcopy.c:2078 objcopy.c:2106 +#: objcopy.c:1928 objcopy.c:1998 objcopy.c:2099 objcopy.c:2127 #, c-format msgid "bad format for %s" msgstr "" -#: objcopy.c:1910 +#: objcopy.c:1931 #, c-format msgid "cannot stat: %s: %s" msgstr "" -#: objcopy.c:1928 +#: objcopy.c:1949 #, c-format msgid "cannot open: %s: %s" msgstr "" -#: objcopy.c:1932 +#: objcopy.c:1953 #, c-format msgid "%s: fread failed" msgstr "" -#: objcopy.c:2046 +#: objcopy.c:2067 #, c-format msgid "Warning: truncating gap-fill from 0x%s to 0x%x" msgstr "" -#: objcopy.c:2140 +#: objcopy.c:2169 msgid "byte number must be less than interleave" msgstr "" -#: objcopy.c:2159 +#: objcopy.c:2188 #, c-format msgid "Cannot stat: %s: %s" msgstr "" -#: objcopy.c:2199 objcopy.c:2213 +#: objcopy.c:2228 objcopy.c:2242 #, c-format msgid "%s %s%c0x%s never used" msgstr "" -#: objdump.c:229 +#: objdump.c:223 #, c-format -msgid "Usage: %s file(s)\n" +msgid "Usage: %s OPTION... FILE...\n" msgstr "" -#: objdump.c:230 -msgid " At least one of the following switches must be given:\n" +#: objdump.c:224 +msgid "Display information from object FILE.\n" msgstr "" -#: objdump.c:231 +#: objdump.c:225 msgid "" -" -a --archive-headers Display archive header information\n" -" -f --file-headers Display the contents of the overall file header\n" -" -p --private-headers Display object format specific file header " -"contents\n" -" -h --[section-]headers Display the contents of the section headers\n" -" -x --all-headers Display the contents of all headers\n" -" -d --disassemble Display assembler contents of executable " -"sections\n" -" -D --disassemble-all Display assembler contents of all sections\n" -" -S --source Intermix source code with disassembly\n" -" -s --full-contents Display the full contents of all sections " -"requested\n" -" -g --debugging Display debug information in object file\n" -" -G --stabs Display the STABS contents of an ELF format file\n" -" -t --syms Display the contents of the symbol table(s)\n" -" -T --dynamic-syms Display the contents of the dynamic symbol table\n" -" -r --reloc Display the relocation entries in the file\n" -" -R --dynamic-reloc Display the dynamic relocation entries in the " -"file\n" -" -V --version Display this program's version number\n" -" -i --info List object formats and architectures supported\n" -" -H --help Display this information\n" +"\n" +" At least one of the following switches must be given:\n" msgstr "" -#: objdump.c:253 +#: objdump.c:226 +msgid "" +" -a, --archive-headers Display archive header information\n" +" -f, --file-headers Display the contents of the overall file header\n" +" -p, --private-headers Display object format specific file header " +"contents\n" +" -h, --[section-]headers Display the contents of the section headers\n" +" -x, --all-headers Display the contents of all headers\n" +" -d, --disassemble Display assembler contents of executable " +"sections\n" +" -D, --disassemble-all Display assembler contents of all sections\n" +" -S, --source Intermix source code with disassembly\n" +" -s, --full-contents Display the full contents of all sections " +"requested\n" +" -g, --debugging Display debug information in object file\n" +" -G, --stabs Display (in raw form) any STABS info in the file\n" +" -t, --syms Display the contents of the symbol table(s)\n" +" -T, --dynamic-syms Display the contents of the dynamic symbol table\n" +" -r, --reloc Display the relocation entries in the file\n" +" -R, --dynamic-reloc Display the dynamic relocation entries in the " +"file\n" +" -V, --version Display this program's version number\n" +" -i, --info List object formats and architectures supported\n" +" -H, --help Display this information\n" +msgstr "" + +#: objdump.c:248 msgid "" "\n" " The following switches are optional:\n" msgstr "" -#: objdump.c:254 +#: objdump.c:249 msgid "" -" -b --target Specify the target object format as " -"\n" -" -m --architecture Specify the target architecture as " -"\n" -" -j --section Only display information for section " -"\n" -" -M --disassembler-options Pass text on to the disassembler\n" +" -b, --target=BFDNAME Specify the target object format as " +"BFDNAME\n" +" -m, --architecture=MACHINE Specify the target architecture as MACHINE\n" +" -j, --section=NAME Only display information for section NAME\n" +" -M, --disassembler-options=OPT Pass text OPT on to the disassembler\n" " -EB --endian=big Assume big endian format when " "disassembling\n" " -EL --endian=little Assume little endian format when " "disassembling\n" " --file-start-context Include context from start of file (with " "-S)\n" -" -l --line-numbers Include line numbers and filenames in " +" -l, --line-numbers Include line numbers and filenames in " "output\n" -" -C --demangle Decode mangled/processed symbol names\n" -" -w --wide Format output for more than 80 columns\n" -" -z --disassemble-zeroes Do not skip blocks of zeroes when " +" -C, --demangle[=STYLE] Decode mangled/processed symbol names\n" +" The STYLE, if specified, can be `auto', " +"'gnu',\n" +" 'lucid', 'arm', 'hp', 'edg', or " +"'gnu-new-abi'\n" +" -w, --wide Format output for more than 80 columns\n" +" -z, --disassemble-zeroes Do not skip blocks of zeroes when " "disassembling\n" -" --start-address Only process data whoes address is >= " -"\n" -" --stop-address Only process data whoes address is <= " -"\n" +" --start-address=ADDR Only process data whoes address is >= ADDR\n" +" --stop-address=ADDR Only process data whoes address is <= ADDR\n" " --prefix-addresses Print complete address alongside " "disassembly\n" " --[no-]show-raw-insn Display hex alongside symbolic disassembly\n" -" --adjust-vma Add to all displayed section " +" --adjust-vma=OFFSET Add OFFSET to all displayed section " "addresses\n" "\n" msgstr "" -#: objdump.c:420 +#: objdump.c:419 msgid "Sections:\n" msgstr "" -#: objdump.c:423 +#: objdump.c:422 msgid "Idx Name Size VMA LMA File off Algn" msgstr "" -#: objdump.c:425 +#: objdump.c:424 msgid "" "Idx Name Size VMA LMA File off " "Algn" msgstr "" -#: objdump.c:429 +#: objdump.c:428 msgid " Flags" msgstr "" -#: objdump.c:479 +#: objdump.c:478 #, c-format -msgid "%s: %s: not a dynamic object\n" +msgid "%s: not a dynamic object" msgstr "" -#: objdump.c:496 +#: objdump.c:494 #, c-format -msgid "%s: %s: No dynamic symbols\n" +msgid "%s: No dynamic symbols" msgstr "" -#: objdump.c:1200 -msgid "Out of virtual memory\n" +#: objdump.c:1197 +msgid "Out of virtual memory" msgstr "" -#: objdump.c:1611 +#: objdump.c:1616 #, c-format -msgid "%s: Can't use supplied machine %s\n" +msgid "Can't use supplied machine %s" msgstr "" -#: objdump.c:1632 +#: objdump.c:1634 #, c-format -msgid "%s: Can't disassemble for architecture %s\n" +msgid "Can't disassemble for architecture %s\n" msgstr "" -#: objdump.c:1709 +#: objdump.c:1716 #, c-format msgid "Disassembly of section %s:\n" msgstr "" -#: objdump.c:1883 +#: objdump.c:1890 #, c-format msgid "" "No %s section present\n" "\n" msgstr "" -#: objdump.c:1890 +#: objdump.c:1897 #, c-format -msgid "%s: %s has no %s section\n" +msgid "%s has no %s section" msgstr "" -#: objdump.c:1904 objdump.c:1916 +#: objdump.c:1911 #, c-format -msgid "%s: Reading %s section of %s failed: %s\n" +msgid "Reading %s section of %s failed: %s" msgstr "" -#: objdump.c:1959 +#: objdump.c:1923 +#, c-format +msgid "Reading %s section of %s failed: %s\n" +msgstr "" + +#: objdump.c:1966 #, c-format msgid "" "Contents of %s section:\n" "\n" msgstr "" -#: objdump.c:2059 +#: objdump.c:2066 #, c-format msgid "architecture: %s, " msgstr "" -#: objdump.c:2062 +#: objdump.c:2069 #, c-format msgid "flags 0x%08x:\n" msgstr "" -#: objdump.c:2075 +#: objdump.c:2082 msgid "" "\n" "start address 0x" msgstr "" -#: objdump.c:2107 +#: objdump.c:2114 #, c-format msgid "" "\n" "%s: file format %s\n" msgstr "" -#: objdump.c:2150 +#: objdump.c:2156 #, c-format -msgid "%s: printing debugging information failed\n" +msgid "%s: printing debugging information failed" msgstr "" -#: objdump.c:2227 +#: objdump.c:2233 #, c-format msgid "In archive %s:\n" msgstr "" -#: objdump.c:2279 +#: objdump.c:2285 #, c-format msgid "Contents of section %s:\n" msgstr "" -#: objdump.c:2788 +#: objdump.c:2798 #, c-format msgid "BFD header file version %s\n" msgstr "" -#: objdump.c:2861 -#, c-format -msgid "%s: unrecognized -E option\n" +#: objdump.c:2882 +msgid "unrecognized -E option" msgstr "" -#: objdump.c:2873 +#: objdump.c:2893 #, c-format -msgid "%s: unrecognized --endian type `%s'\n" +msgid "unrecognized --endian type `%s'" msgstr "" -#: rdcoff.c:204 +#: rdcoff.c:205 #, c-format -msgid "%s: parse_coff_type: Bad type code 0x%x\n" +msgid "parse_coff_type: Bad type code 0x%x" msgstr "" -#: rdcoff.c:423 rdcoff.c:531 rdcoff.c:712 +#: rdcoff.c:423 rdcoff.c:531 rdcoff.c:730 #, c-format -msgid "%s: bfd_coff_get_syment failed: %s\n" +msgid "bfd_coff_get_syment failed: %s" msgstr "" -#: rdcoff.c:439 rdcoff.c:732 +#: rdcoff.c:439 rdcoff.c:750 #, c-format -msgid "%s: bfd_coff_get_auxent failed: %s\n" +msgid "bfd_coff_get_auxent failed: %s" msgstr "" -#: rdcoff.c:798 +#: rdcoff.c:817 #, c-format -msgid "%s: %ld: .bf without preceding function\n" +msgid "%ld: .bf without preceding function" msgstr "" -#: rdcoff.c:848 +#: rdcoff.c:867 #, c-format -msgid "%s: %ld: unexpected .ef\n" +msgid "%ld: unexpected .ef\n" msgstr "" #: rddbg.c:87 #, c-format -msgid "%s: no recognized debugging information\n" +msgid "%s: no recognized debugging information" msgstr "" #: rddbg.c:410 msgid "Last stabs entries before error:\n" msgstr "" -#: readelf.c:303 readelf.c:329 +#: readelf.c:260 +#, c-format +msgid "Unable to seek to start of %s at %x\n" +msgstr "" + +#: readelf.c:268 +#, c-format +msgid "Out of memory allocating %d bytes for %s\n" +msgstr "" + +#: readelf.c:274 +#, c-format +msgid "Unable to read in %d bytes of %s\n" +msgstr "" + +#: readelf.c:284 +#, c-format +msgid "Unable to seek to %x for %s\n" +msgstr "" + +#: readelf.c:289 +#, c-format +msgid "Unable to read data at %x for %s\n" +msgstr "" + +#: readelf.c:304 readelf.c:330 #, c-format msgid "%s: Error: " msgstr "" -#: readelf.c:315 readelf.c:344 +#: readelf.c:316 readelf.c:345 #, c-format msgid "%s: Warning: " msgstr "" -#: readelf.c:394 readelf.c:532 +#: readelf.c:395 readelf.c:533 #, c-format msgid "Unhandled data length: %d\n" msgstr "" -#: readelf.c:591 +#: readelf.c:597 msgid "Don't know about relocations on this machine architecture\n" msgstr "" -#: readelf.c:631 readelf.c:660 readelf.c:692 readelf.c:720 +#: readelf.c:637 readelf.c:666 readelf.c:698 readelf.c:726 msgid "out of memory parsing relocs" msgstr "" -#: readelf.c:738 +#: readelf.c:744 msgid "" " Offset Info Type Symbol's Value Symbol's Name " "Addend\n" msgstr "" -#: readelf.c:741 +#: readelf.c:747 msgid " Offset Info Type Symbol's Value Symbol's Name\n" msgstr "" -#: readelf.c:885 readelf.c:887 +#: readelf.c:907 readelf.c:909 #, c-format msgid "unrecognised: %-7lx" msgstr "" -#: readelf.c:912 +#: readelf.c:934 #, c-format msgid "" msgstr "" -#: readelf.c:1119 +#: readelf.c:1147 #, c-format msgid "Processor Specific: %lx" msgstr "" -#: readelf.c:1138 +#: readelf.c:1166 #, c-format msgid "Operating System specific: %lx" msgstr "" -#: readelf.c:1141 readelf.c:1506 +#: readelf.c:1169 readelf.c:1677 #, c-format msgid ": %lx" msgstr "" -#: readelf.c:1155 +#: readelf.c:1183 msgid "NONE (None)" msgstr "" -#: readelf.c:1156 +#: readelf.c:1184 msgid "REL (Relocatable file)" msgstr "" -#: readelf.c:1157 +#: readelf.c:1185 msgid "EXEC (Executable file)" msgstr "" -#: readelf.c:1158 +#: readelf.c:1186 msgid "DYN (Shared object file)" msgstr "" -#: readelf.c:1159 +#: readelf.c:1187 msgid "CORE (Core file)" msgstr "" -#: readelf.c:1163 +#: readelf.c:1191 #, c-format msgid "Processor Specific: (%x)" msgstr "" -#: readelf.c:1165 +#: readelf.c:1193 #, c-format msgid "OS Specific: (%x)" msgstr "" -#: readelf.c:1167 readelf.c:1244 readelf.c:1638 +#: readelf.c:1195 readelf.c:1281 readelf.c:1811 #, c-format msgid ": %x" msgstr "" -#: readelf.c:1180 +#: readelf.c:1208 msgid "None" msgstr "" -#: readelf.c:1676 +#: readelf.c:1849 msgid "Usage: readelf {options} elf-file(s)\n" msgstr "" -#: readelf.c:1677 +#: readelf.c:1850 msgid " Options are:\n" msgstr "" -#: readelf.c:1678 +#: readelf.c:1851 msgid " -a or --all Equivalent to: -h -l -S -s -r -d -V -A -I\n" msgstr "" -#: readelf.c:1679 +#: readelf.c:1852 msgid " -h or --file-header Display the ELF file header\n" msgstr "" -#: readelf.c:1680 +#: readelf.c:1853 msgid " -l or --program-headers or --segments\n" msgstr "" -#: readelf.c:1681 +#: readelf.c:1854 msgid " Display the program headers\n" msgstr "" -#: readelf.c:1682 +#: readelf.c:1855 msgid " -S or --section-headers or --sections\n" msgstr "" -#: readelf.c:1683 +#: readelf.c:1856 msgid " Display the sections' header\n" msgstr "" -#: readelf.c:1684 +#: readelf.c:1857 msgid " -e or --headers Equivalent to: -h -l -S\n" msgstr "" -#: readelf.c:1685 +#: readelf.c:1858 msgid " -s or --syms or --symbols Display the symbol table\n" msgstr "" -#: readelf.c:1686 +#: readelf.c:1859 msgid " -n or --notes Display the core notes (if present)\n" msgstr "" -#: readelf.c:1687 +#: readelf.c:1860 msgid " -r or --relocs Display the relocations (if present)\n" msgstr "" -#: readelf.c:1688 +#: readelf.c:1861 msgid " -d or --dynamic Display the dynamic segment (if present)\n" msgstr "" -#: readelf.c:1689 +#: readelf.c:1862 msgid " -V or --version-info Display the version sections (if present)\n" msgstr "" -#: readelf.c:1690 +#: readelf.c:1863 msgid "" " -A or --arch-specific Display architecture specific information (if " "any).\n" msgstr "" -#: readelf.c:1691 +#: readelf.c:1864 msgid "" " -D or --use-dynamic Use the dynamic section info when displaying " "symbols\n" msgstr "" -#: readelf.c:1692 +#: readelf.c:1865 msgid " -x or --hex-dump=\n" msgstr "" -#: readelf.c:1693 +#: readelf.c:1866 msgid " Dump the contents of section \n" msgstr "" -#: readelf.c:1694 -msgid " -w[liapr] or --debug-dump[=line,=info,=abbrev,=pubnames,=ranges]\n" +#: readelf.c:1867 +msgid "" +" -w[liaprf] or --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=frames]\n" msgstr "" -#: readelf.c:1695 +#: readelf.c:1868 msgid "" " Display the contents of DWARF2 debug sections\n" msgstr "" -#: readelf.c:1697 +#: readelf.c:1870 msgid " -i or --instruction-dump=\n" msgstr "" -#: readelf.c:1698 +#: readelf.c:1871 msgid "" " Disassemble the contents of section \n" msgstr "" -#: readelf.c:1700 +#: readelf.c:1873 msgid " -I or --histogram Display histogram of bucket list lengths\n" msgstr "" -#: readelf.c:1701 +#: readelf.c:1874 msgid " -v or --version Display the version number of readelf\n" msgstr "" -#: readelf.c:1702 +#: readelf.c:1875 msgid " -H or --help Display this information\n" msgstr "" -#: readelf.c:1720 +#: readelf.c:1893 msgid "Out of memory allocating dump request table." msgstr "" -#: readelf.c:1855 +#: readelf.c:2033 #, c-format msgid "Unrecognised debug option '%s'\n" msgstr "" -#: readelf.c:1880 +#: readelf.c:2058 #, c-format msgid "Invalid option '-%c'\n" msgstr "" -#: readelf.c:1893 +#: readelf.c:2071 msgid "Nothing to do.\n" msgstr "" -#: readelf.c:1906 readelf.c:1923 readelf.c:3493 +#: readelf.c:2084 readelf.c:2101 readelf.c:3740 msgid "none" msgstr "" -#: readelf.c:1907 +#: readelf.c:2085 msgid "ELF32" msgstr "" -#: readelf.c:1908 +#: readelf.c:2086 msgid "ELF64" msgstr "" -#: readelf.c:1910 readelf.c:1927 readelf.c:1946 +#: readelf.c:2088 readelf.c:2105 readelf.c:2133 #, c-format msgid "" msgstr "" -#: readelf.c:1924 +#: readelf.c:2102 msgid "2's complement, little endian" msgstr "" -#: readelf.c:1925 +#: readelf.c:2103 msgid "2's complement, big endian" msgstr "" -#: readelf.c:1940 +#: readelf.c:2118 msgid "UNIX - System V" msgstr "" -#: readelf.c:1941 +#: readelf.c:2119 msgid "UNIX - HP-UX" msgstr "" -#: readelf.c:1942 +#: readelf.c:2120 +msgid "UNIX - NetBSD" +msgstr "" + +#: readelf.c:2121 msgid "UNIX - Linux" msgstr "" -#: readelf.c:1943 +#: readelf.c:2122 +msgid "GNU/Hurd" +msgstr "" + +#: readelf.c:2123 +msgid "UNIX - Solaris" +msgstr "" + +#: readelf.c:2124 +msgid "UNIX - AIX" +msgstr "" + +#: readelf.c:2125 +msgid "UNIX - IRIX" +msgstr "" + +#: readelf.c:2126 +msgid "UNIX - FreeBSD" +msgstr "" + +#: readelf.c:2127 +msgid "UNIX - TRU64" +msgstr "" + +#: readelf.c:2128 +msgid "Novell - Modesto" +msgstr "" + +#: readelf.c:2129 +msgid "UNIX - OpenBSD" +msgstr "" + +#: readelf.c:2130 msgid "Standalone App" msgstr "" -#: readelf.c:1944 +#: readelf.c:2131 msgid "ARM" msgstr "" -#: readelf.c:1961 +#: readelf.c:2148 msgid "Not an ELF file - it has the wrong magic bytes at the start\n" msgstr "" -#: readelf.c:1969 +#: readelf.c:2156 msgid "ELF Header:\n" msgstr "" -#: readelf.c:1970 +#: readelf.c:2157 msgid " Magic: " msgstr "" -#: readelf.c:1974 +#: readelf.c:2161 #, c-format msgid " Class: %s\n" msgstr "" -#: readelf.c:1976 +#: readelf.c:2163 #, c-format msgid " Data: %s\n" msgstr "" -#: readelf.c:1978 +#: readelf.c:2165 #, c-format msgid " Version: %d %s\n" msgstr "" -#: readelf.c:1985 +#: readelf.c:2172 #, c-format msgid " OS/ABI: %s\n" msgstr "" -#: readelf.c:1987 +#: readelf.c:2174 #, c-format msgid " ABI Version: %d\n" msgstr "" -#: readelf.c:1989 +#: readelf.c:2176 #, c-format msgid " Type: %s\n" msgstr "" -#: readelf.c:1991 +#: readelf.c:2178 #, c-format msgid " Machine: %s\n" msgstr "" -#: readelf.c:1993 +#: readelf.c:2180 #, c-format msgid " Version: 0x%lx\n" msgstr "" -#: readelf.c:1996 +#: readelf.c:2183 msgid " Entry point address: " msgstr "" -#: readelf.c:1998 +#: readelf.c:2185 msgid "" "\n" " Start of program headers: " msgstr "" -#: readelf.c:2000 +#: readelf.c:2187 msgid "" " (bytes into file)\n" " Start of section headers: " msgstr "" -#: readelf.c:2002 +#: readelf.c:2189 msgid " (bytes into file)\n" msgstr "" -#: readelf.c:2004 +#: readelf.c:2191 #, c-format msgid " Flags: 0x%lx%s\n" msgstr "" -#: readelf.c:2007 +#: readelf.c:2194 #, c-format msgid " Size of this header: %ld (bytes)\n" msgstr "" -#: readelf.c:2009 +#: readelf.c:2196 #, c-format msgid " Size of program headers: %ld (bytes)\n" msgstr "" -#: readelf.c:2011 +#: readelf.c:2198 #, c-format msgid " Number of program headers: %ld\n" msgstr "" -#: readelf.c:2013 +#: readelf.c:2200 #, c-format msgid " Size of section headers: %ld (bytes)\n" msgstr "" -#: readelf.c:2015 +#: readelf.c:2202 #, c-format msgid " Number of section headers: %ld\n" msgstr "" -#: readelf.c:2017 +#: readelf.c:2204 #, c-format msgid " Section header string table index: %ld\n" msgstr "" -#: readelf.c:2102 +#: readelf.c:2289 msgid "" "\n" "There are no program headers in this file.\n" msgstr "" -#: readelf.c:2108 +#: readelf.c:2295 #, c-format msgid "" "\n" "Elf file type is %s\n" msgstr "" -#: readelf.c:2109 +#: readelf.c:2296 msgid "Entry point " msgstr "" -#: readelf.c:2111 +#: readelf.c:2298 #, c-format msgid "" "\n" "There are %d program headers, starting at offset " msgstr "" -#: readelf.c:2122 readelf.c:2298 readelf.c:2340 readelf.c:2383 readelf.c:2424 -#: readelf.c:2932 readelf.c:2973 readelf.c:3149 readelf.c:4111 readelf.c:4125 -#: readelf.c:7023 readelf.c:7063 +#: readelf.c:2309 readelf.c:2485 readelf.c:2527 readelf.c:2570 readelf.c:2611 +#: readelf.c:3133 readelf.c:3174 readelf.c:3350 readelf.c:4358 readelf.c:4372 +#: readelf.c:7741 readelf.c:7781 msgid "Out of memory\n" msgstr "" -#: readelf.c:2140 +#: readelf.c:2327 #, c-format msgid "" "\n" "Program Header%s:\n" msgstr "" -#: readelf.c:2144 +#: readelf.c:2331 msgid "" " Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n" msgstr "" -#: readelf.c:2148 +#: readelf.c:2335 msgid " Type Offset VirtAddr PhysAddr\n" msgstr "" -#: readelf.c:2150 +#: readelf.c:2337 msgid " FileSiz MemSiz Flags Align\n" msgstr "" -#: readelf.c:2208 +#: readelf.c:2395 msgid "more than one dynamic segment\n" msgstr "" -#: readelf.c:2216 +#: readelf.c:2403 msgid "Unable to find program interpreter name\n" msgstr "" -#: readelf.c:2223 +#: readelf.c:2410 #, c-format msgid "" "\n" " [Requesting program interpreter: %s]" msgstr "" -#: readelf.c:2241 +#: readelf.c:2428 msgid "" "\n" " Section to Segment mapping:\n" msgstr "" -#: readelf.c:2242 +#: readelf.c:2429 msgid " Segment Sections...\n" msgstr "" -#: readelf.c:2505 +#: readelf.c:2693 msgid "" "\n" "There are no sections in this file.\n" msgstr "" -#: readelf.c:2511 +#: readelf.c:2699 #, c-format msgid "There are %d section headers, starting at offset 0x%lx:\n" msgstr "" -#: readelf.c:2551 +#: readelf.c:2739 msgid "File contains multiple dynamic symbol tables\n" msgstr "" -#: readelf.c:2564 +#: readelf.c:2752 msgid "File contains multiple dynamic string tables\n" msgstr "" -#: readelf.c:2591 +#: readelf.c:2786 #, c-format msgid "" "\n" "Section Header%s:\n" msgstr "" -#: readelf.c:2595 +#: readelf.c:2790 msgid "" " [Nr] Name Type Addr Off Size ES Flg Lk " "Inf Al\n" msgstr "" -#: readelf.c:2598 +#: readelf.c:2793 msgid " [Nr] Name Type Address Offset\n" msgstr "" -#: readelf.c:2599 +#: readelf.c:2794 msgid " Size EntSize Flags Link Info Align\n" msgstr "" -#: readelf.c:2646 +#: readelf.c:2841 +msgid "Key to Flags:\n" +msgstr "" + +#: readelf.c:2842 +msgid " W (write), A (alloc), X (execute), M (merge), S (strings)\n" +msgstr "" + +#: readelf.c:2843 +msgid " I (info), L (link order), G (group), x (unknown)\n" +msgstr "" + +#: readelf.c:2844 msgid "" -"Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings)\n" +" O (extra OS processing required) o (OS specific), p (processor specific)\n" msgstr "" -#: readelf.c:2647 -msgid "" -" I (info), L (link order), O (extra OS processing required)\n" -msgstr "" - -#: readelf.c:2648 -msgid " o (os specific), p (processor specific) x (unknown)\n" -msgstr "" - -#: readelf.c:2706 +#: readelf.c:2902 #, c-format msgid "" "\n" "Relocation section at offset 0x%lx contains %ld bytes:\n" msgstr "" -#: readelf.c:2713 +#: readelf.c:2909 msgid "" "\n" "There are no dynamic relocations in this file.\n" msgstr "" -#: readelf.c:2741 +#: readelf.c:2937 msgid "" "\n" "Relocation section " msgstr "" -#: readelf.c:2748 +#: readelf.c:2944 #, c-format msgid " at offset 0x%lx contains %lu entries:\n" msgstr "" -#: readelf.c:2776 +#: readelf.c:2972 msgid "" "\n" "There are no relocations in this file.\n" msgstr "" -#: readelf.c:3026 +#: readelf.c:3227 msgid "" "\n" "There is no dynamic segment in this file.\n" msgstr "" -#: readelf.c:3060 +#: readelf.c:3261 msgid "Unable to seek to end of file!" msgstr "" -#: readelf.c:3069 +#: readelf.c:3270 msgid "Unable to determine the number of symbols to load\n" msgstr "" -#: readelf.c:3099 +#: readelf.c:3300 msgid "Unable to seek to end of file\n" msgstr "" -#: readelf.c:3105 +#: readelf.c:3306 msgid "Unable to determine the length of the dynamic string table\n" msgstr "" -#: readelf.c:3166 +#: readelf.c:3367 #, c-format msgid "" "\n" "Dynamic segment at offset 0x%x contains %ld entries:\n" msgstr "" -#: readelf.c:3169 +#: readelf.c:3370 msgid " Tag Type Name/Value\n" msgstr "" -#: readelf.c:3200 +#: readelf.c:3406 msgid "Auxiliary library" msgstr "" -#: readelf.c:3202 +#: readelf.c:3410 msgid "Filter library" msgstr "" -#: readelf.c:3218 readelf.c:3239 readelf.c:3265 +#: readelf.c:3414 +msgid "Configuration file" +msgstr "" + +#: readelf.c:3418 +msgid "Dependency audit library" +msgstr "" + +#: readelf.c:3422 +msgid "Audit library" +msgstr "" + +#: readelf.c:3440 readelf.c:3466 readelf.c:3492 msgid "Flags:" msgstr "" -#: readelf.c:3220 readelf.c:3241 readelf.c:3267 +#: readelf.c:3442 readelf.c:3468 readelf.c:3494 msgid " None\n" msgstr "" -#: readelf.c:3370 +#: readelf.c:3613 #, c-format msgid "Shared library: [%s]" msgstr "" -#: readelf.c:3373 +#: readelf.c:3616 msgid " program interpreter" msgstr "" -#: readelf.c:3377 +#: readelf.c:3620 #, c-format msgid "Library soname: [%s]" msgstr "" -#: readelf.c:3381 +#: readelf.c:3624 #, c-format msgid "Library rpath: [%s]" msgstr "" -#: readelf.c:3442 +#: readelf.c:3628 +#, c-format +msgid "Library runpath: [%s]" +msgstr "" + +#: readelf.c:3689 #, c-format msgid "Not needed object: [%s]\n" msgstr "" -#: readelf.c:3539 +#: readelf.c:3786 #, c-format msgid "" "\n" "Version definition section '%s' contains %ld entries:\n" msgstr "" -#: readelf.c:3542 +#: readelf.c:3789 msgid " Addr: 0x" msgstr "" -#: readelf.c:3544 readelf.c:3732 +#: readelf.c:3791 readelf.c:3979 #, c-format msgid " Offset: %#08lx Link: %lx (%s)\n" msgstr "" -#: readelf.c:3574 +#: readelf.c:3821 #, c-format msgid " %#06x: Rev: %d Flags: %s" msgstr "" -#: readelf.c:3577 +#: readelf.c:3824 #, c-format msgid " Index: %d Cnt: %d " msgstr "" -#: readelf.c:3588 +#: readelf.c:3835 #, c-format msgid "Name: %s\n" msgstr "" -#: readelf.c:3590 +#: readelf.c:3837 #, c-format msgid "Name index: %ld\n" msgstr "" -#: readelf.c:3605 +#: readelf.c:3852 #, c-format msgid " %#06x: Parent %d: %s\n" msgstr "" -#: readelf.c:3608 +#: readelf.c:3855 #, c-format msgid " %#06x: Parent %d, name index: %ld\n" msgstr "" -#: readelf.c:3627 +#: readelf.c:3874 #, c-format msgid "" "\n" "Version needs section '%s' contains %ld entries:\n" msgstr "" -#: readelf.c:3630 +#: readelf.c:3877 msgid " Addr: 0x" msgstr "" -#: readelf.c:3632 +#: readelf.c:3879 #, c-format msgid " Offset: %#08lx Link to section: %ld (%s)\n" msgstr "" -#: readelf.c:3658 +#: readelf.c:3905 #, c-format msgid " %#06x: Version: %d" msgstr "" -#: readelf.c:3661 +#: readelf.c:3908 #, c-format msgid " File: %s" msgstr "" -#: readelf.c:3663 +#: readelf.c:3910 #, c-format msgid " File: %lx" msgstr "" -#: readelf.c:3665 +#: readelf.c:3912 #, c-format msgid " Cnt: %d\n" msgstr "" -#: readelf.c:3683 +#: readelf.c:3930 #, c-format msgid " %#06x: Name: %s" msgstr "" -#: readelf.c:3686 +#: readelf.c:3933 #, c-format msgid " %#06x: Name index: %lx" msgstr "" -#: readelf.c:3689 +#: readelf.c:3936 #, c-format msgid " Flags: %s Version: %d\n" msgstr "" -#: readelf.c:3727 +#: readelf.c:3974 #, c-format msgid "" "\n" "Version symbols section '%s' contains %d entries:\n" msgstr "" -#: readelf.c:3730 +#: readelf.c:3977 msgid " Addr: " msgstr "" -#: readelf.c:3760 +#: readelf.c:4007 msgid " 0 (*local*) " msgstr "" -#: readelf.c:3764 +#: readelf.c:4011 msgid " 1 (*global*) " msgstr "" -#: readelf.c:3986 +#: readelf.c:4233 msgid "" "\n" "No version information found in this file.\n" msgstr "" -#: readelf.c:4004 readelf.c:4039 +#: readelf.c:4251 readelf.c:4286 #, c-format msgid ": %d" msgstr "" -#: readelf.c:4006 readelf.c:4051 +#: readelf.c:4253 readelf.c:4298 #, c-format msgid ": %d" msgstr "" -#: readelf.c:4008 readelf.c:4054 +#: readelf.c:4255 readelf.c:4301 #, c-format msgid ": %d" msgstr "" -#: readelf.c:4117 +#: readelf.c:4364 msgid "Unable to read in dynamic data\n" msgstr "" -#: readelf.c:4159 +#: readelf.c:4406 msgid "Unable to seek to start of dynamic information" msgstr "" -#: readelf.c:4165 +#: readelf.c:4412 msgid "Failed to read in number of buckets\n" msgstr "" -#: readelf.c:4171 +#: readelf.c:4418 msgid "Failed to read in number of chains\n" msgstr "" -#: readelf.c:4191 +#: readelf.c:4438 msgid "" "\n" "Symbol table for image:\n" msgstr "" -#: readelf.c:4193 +#: readelf.c:4440 msgid " Num Buc: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:4195 +#: readelf.c:4442 msgid " Num Buc: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:4239 +#: readelf.c:4486 #, c-format msgid "" "\n" "Symbol table '%s' contains %lu entries:\n" msgstr "" -#: readelf.c:4243 +#: readelf.c:4490 msgid " Num: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:4245 +#: readelf.c:4492 msgid " Num: Value Size Type Bind Vis Ndx Name\n" msgstr "" -#: readelf.c:4354 +#: readelf.c:4601 msgid "bad dynamic symbol" msgstr "" -#: readelf.c:4413 +#: readelf.c:4660 msgid "" "\n" "Dynamic symbol information is not available for displaying symbols.\n" msgstr "" -#: readelf.c:4425 +#: readelf.c:4672 #, c-format msgid "" "\n" "Histogram for bucket list length (total of %d buckets):\n" msgstr "" -#: readelf.c:4427 +#: readelf.c:4674 msgid " Length Number %% of total Coverage\n" msgstr "" -#: readelf.c:4432 readelf.c:4451 readelf.c:6704 readelf.c:6897 +#: readelf.c:4679 readelf.c:4698 readelf.c:7423 readelf.c:7616 msgid "Out of memory" msgstr "" -#: readelf.c:4500 +#: readelf.c:4747 #, c-format msgid "" "\n" "Dynamic info segment at offset 0x%lx contains %d entries:\n" msgstr "" -#: readelf.c:4503 +#: readelf.c:4750 msgid " Num: Name BoundTo Flags\n" msgstr "" -#: readelf.c:4551 +#: readelf.c:4798 #, c-format msgid "" "\n" "Assembly dump of section %s\n" msgstr "" -#: readelf.c:4574 +#: readelf.c:4821 #, c-format msgid "" "\n" "Section '%s' has no data to dump.\n" msgstr "" -#: readelf.c:4579 +#: readelf.c:4826 #, c-format msgid "" "\n" "Hex dump of section '%s':\n" msgstr "" -#: readelf.c:4731 +#: readelf.c:4978 msgid "badly formed extended line op encountered!" msgstr "" -#: readelf.c:4738 +#: readelf.c:4985 #, c-format msgid " Extended opcode %d: " msgstr "" -#: readelf.c:4743 +#: readelf.c:4990 msgid "" "End of Sequence\n" "\n" msgstr "" -#: readelf.c:4749 +#: readelf.c:4996 #, c-format msgid "set Address to 0x%lx\n" msgstr "" -#: readelf.c:4754 +#: readelf.c:5001 msgid " define new File Table entry\n" msgstr "" -#: readelf.c:4755 readelf.c:4877 +#: readelf.c:5002 readelf.c:5124 msgid " Entry\tDir\tTime\tSize\tName\n" msgstr "" -#: readelf.c:4757 +#: readelf.c:5004 #, c-format msgid " %d\t" msgstr "" -#: readelf.c:4760 readelf.c:4762 readelf.c:4764 readelf.c:4889 readelf.c:4891 -#: readelf.c:4893 +#: readelf.c:5007 readelf.c:5009 readelf.c:5011 readelf.c:5136 readelf.c:5138 +#: readelf.c:5140 #, c-format msgid "%lu\t" msgstr "" -#: readelf.c:4765 +#: readelf.c:5012 #, c-format msgid "" "%s\n" "\n" msgstr "" -#: readelf.c:4769 +#: readelf.c:5016 #, c-format msgid "UNKNOWN: length %d\n" msgstr "" -#: readelf.c:4795 +#: readelf.c:5042 #, c-format msgid "" "\n" @@ -2610,493 +2981,503 @@ msgid "" "\n" msgstr "" -#: readelf.c:4807 +#: readelf.c:5054 msgid "The line info appears to be corrupt - the section is too small\n" msgstr "" -#: readelf.c:4815 +#: readelf.c:5062 msgid "Only DWARF version 2 line info is currently supported.\n" msgstr "" -#: readelf.c:4830 +#: readelf.c:5077 #, c-format msgid " Length: %ld\n" msgstr "" -#: readelf.c:4831 +#: readelf.c:5078 #, c-format msgid " DWARF Version: %d\n" msgstr "" -#: readelf.c:4832 +#: readelf.c:5079 #, c-format msgid " Prolgue Length: %d\n" msgstr "" -#: readelf.c:4833 +#: readelf.c:5080 #, c-format msgid " Minimum Instruction Length: %d\n" msgstr "" -#: readelf.c:4834 +#: readelf.c:5081 #, c-format msgid " Initial value of 'is_stmt': %d\n" msgstr "" -#: readelf.c:4835 +#: readelf.c:5082 #, c-format msgid " Line Base: %d\n" msgstr "" -#: readelf.c:4836 +#: readelf.c:5083 #, c-format msgid " Line Range: %d\n" msgstr "" -#: readelf.c:4837 +#: readelf.c:5084 #, c-format msgid " Opcode Base: %d\n" msgstr "" -#: readelf.c:4846 +#: readelf.c:5093 msgid "" "\n" " Opcodes:\n" msgstr "" -#: readelf.c:4849 +#: readelf.c:5096 #, c-format msgid " Opcode %d has %d args\n" msgstr "" -#: readelf.c:4855 +#: readelf.c:5102 msgid "" "\n" " The Directory Table is empty.\n" msgstr "" -#: readelf.c:4858 +#: readelf.c:5105 msgid "" "\n" " The Directory Table:\n" msgstr "" -#: readelf.c:4862 +#: readelf.c:5109 #, c-format msgid " %s\n" msgstr "" -#: readelf.c:4873 +#: readelf.c:5120 msgid "" "\n" " The File Name Table is empty.\n" msgstr "" -#: readelf.c:4876 +#: readelf.c:5123 msgid "" "\n" " The File Name Table:\n" msgstr "" -#: readelf.c:4884 +#: readelf.c:5131 #, c-format msgid " %d\t" msgstr "" -#: readelf.c:4895 +#: readelf.c:5142 #, c-format msgid "%s\n" msgstr "" #. Now display the statements. -#: readelf.c:4903 +#: readelf.c:5150 msgid "" "\n" " Line Number Statements:\n" msgstr "" -#: readelf.c:4922 +#: readelf.c:5169 msgid " Copy\n" msgstr "" -#: readelf.c:4929 +#: readelf.c:5176 #, c-format msgid " Advance PC by %d to %lx\n" msgstr "" -#: readelf.c:4937 +#: readelf.c:5184 #, c-format msgid " Advance Line by %d to %d\n" msgstr "" -#: readelf.c:4944 +#: readelf.c:5191 #, c-format msgid " Set File Name to entry %d in the File Name Table\n" msgstr "" -#: readelf.c:4952 +#: readelf.c:5199 #, c-format msgid " Set column to %d\n" msgstr "" -#: readelf.c:4959 +#: readelf.c:5206 #, c-format msgid " Set is_stmt to %d\n" msgstr "" -#: readelf.c:4964 +#: readelf.c:5211 msgid " Set basic block\n" msgstr "" -#: readelf.c:4972 +#: readelf.c:5219 #, c-format msgid " Advance PC by constant %d to 0x%lx\n" msgstr "" -#: readelf.c:4980 +#: readelf.c:5227 #, c-format msgid " Advance PC by fixed size amount %d to 0x%lx\n" msgstr "" -#: readelf.c:4988 +#: readelf.c:5235 #, c-format msgid " Special opcode %d: advance Address by %d to 0x%lx" msgstr "" -#: readelf.c:4992 +#: readelf.c:5239 #, c-format msgid " and Line by %d to %d\n" msgstr "" -#: readelf.c:5015 readelf.c:5437 +#: readelf.c:5262 readelf.c:5691 #, c-format msgid "" "Contents of the %s section:\n" "\n" msgstr "" -#: readelf.c:5034 -msgid "Only DWARF 2 pubnames are currently supported" +#: readelf.c:5285 +msgid "Only DWARF 2 pubnames are currently supported\n" msgstr "" -#: readelf.c:5038 +#: readelf.c:5292 #, c-format msgid " Length: %ld\n" msgstr "" -#: readelf.c:5040 +#: readelf.c:5294 #, c-format msgid " Version: %d\n" msgstr "" -#: readelf.c:5042 +#: readelf.c:5296 #, c-format msgid " Offset into .debug_info section: %ld\n" msgstr "" -#: readelf.c:5044 +#: readelf.c:5298 #, c-format msgid " Size of area in .debug_info section: %ld\n" msgstr "" -#: readelf.c:5047 +#: readelf.c:5301 msgid "" "\n" " Offset\tName\n" msgstr "" -#: readelf.c:5129 +#: readelf.c:5383 #, c-format msgid "Unknown TAG value: %lx" msgstr "" -#: readelf.c:5224 +#: readelf.c:5478 #, c-format msgid "Unknown AT value: %lx" msgstr "" -#: readelf.c:5261 +#: readelf.c:5515 #, c-format msgid "Unknown FORM value: %lx" msgstr "" -#: readelf.c:5443 +#: readelf.c:5697 msgid " Number TAG\n" msgstr "" -#: readelf.c:5449 +#: readelf.c:5703 #, c-format msgid " %ld %s [%s]\n" msgstr "" -#: readelf.c:5452 +#: readelf.c:5706 msgid "has children" msgstr "" -#: readelf.c:5452 +#: readelf.c:5706 msgid "no children" msgstr "" -#: readelf.c:5456 +#: readelf.c:5710 #, c-format msgid " %-18s %s\n" msgstr "" -#: readelf.c:5475 +#: readelf.c:5729 #, c-format msgid " %lu byte block: " msgstr "" -#: readelf.c:5939 +#: readelf.c:6036 msgid "(User defined location op)" msgstr "" -#: readelf.c:5941 +#: readelf.c:6038 msgid "(Unknown location op)" msgstr "" -#: readelf.c:6058 +#: readelf.c:6165 #, c-format msgid "Unable to handle FORM: %d" msgstr "" -#: readelf.c:6062 +#: readelf.c:6169 #, c-format msgid "Unrecognised form: %d" msgstr "" -#: readelf.c:6075 +#: readelf.c:6182 msgid "(not inlined)" msgstr "" -#: readelf.c:6076 +#: readelf.c:6183 msgid "(inlined)" msgstr "" -#: readelf.c:6077 +#: readelf.c:6184 msgid "(declared as inline but ignored)" msgstr "" -#: readelf.c:6078 +#: readelf.c:6185 msgid "(declared as inline and inlined)" msgstr "" -#: readelf.c:6079 +#: readelf.c:6186 #, c-format msgid " (Unknown inline attribute value: %lx)" msgstr "" -#: readelf.c:6209 readelf.c:6333 +#: readelf.c:6315 readelf.c:6441 #, c-format msgid "" "The section %s contains:\n" "\n" msgstr "" -#: readelf.c:6231 -msgid "Only version 2 DWARF debug information is currently supported.\n" +#: readelf.c:6337 +#, c-format +msgid " Compilation Unit @ %lx:\n" msgstr "" -#: readelf.c:6235 -msgid " Compilation Unit:\n" -msgstr "" - -#: readelf.c:6236 +#: readelf.c:6338 #, c-format msgid " Length: %ld\n" msgstr "" -#: readelf.c:6237 +#: readelf.c:6339 #, c-format msgid " Version: %d\n" msgstr "" -#: readelf.c:6238 +#: readelf.c:6340 #, c-format msgid " Abbrev Offset: %ld\n" msgstr "" -#: readelf.c:6239 +#: readelf.c:6341 #, c-format msgid " Pointer Size: %d\n" msgstr "" -#: readelf.c:6259 +#: readelf.c:6345 +msgid "Only version 2 DWARF debug information is currently supported.\n" +msgstr "" + +#: readelf.c:6367 msgid "Unable to locate .debug_abbrev section!\n" msgstr "" -#: readelf.c:6299 +#: readelf.c:6407 #, c-format msgid "Unable to locate entry %lu in the abbreviation table\n" msgstr "" -#: readelf.c:6304 +#: readelf.c:6412 #, c-format msgid " <%d><%x>: Abbrev Number: %lu (%s)\n" msgstr "" -#: readelf.c:6352 +#: readelf.c:6462 +msgid "Only DWARF 2 aranges are currently supported.\n" +msgstr "" + +#: readelf.c:6466 #, c-format msgid " Length: %ld\n" msgstr "" -#: readelf.c:6353 +#: readelf.c:6467 #, c-format msgid " Version: %d\n" msgstr "" -#: readelf.c:6354 +#: readelf.c:6468 #, c-format msgid " Offset into .debug_info: %lx\n" msgstr "" -#: readelf.c:6355 +#: readelf.c:6469 #, c-format msgid " Pointer Size: %d\n" msgstr "" -#: readelf.c:6356 +#: readelf.c:6470 #, c-format msgid " Segment Size: %d\n" msgstr "" -#: readelf.c:6358 +#: readelf.c:6472 msgid "" "\n" " Address Length\n" msgstr "" -#: readelf.c:6399 +#: readelf.c:6634 +#, c-format +msgid "The section %s contains:\n" +msgstr "" + +#: readelf.c:7109 #, c-format msgid "Displaying the debug contents of section %s is not yet supported.\n" msgstr "" -#: readelf.c:6461 +#: readelf.c:7173 #, c-format msgid "" "\n" "Section '%s' has no debugging data.\n" msgstr "" -#: readelf.c:6477 +#: readelf.c:7192 #, c-format msgid "Unrecognised debug section: %s\n" msgstr "" -#: readelf.c:6549 +#: readelf.c:7264 msgid "Some sections were not dumped because they do not exist!\n" msgstr "" -#: readelf.c:6728 +#: readelf.c:7447 #, c-format msgid "" "\n" "Section '%s' contains %d entries:\n" msgstr "" -#: readelf.c:6890 +#: readelf.c:7609 msgid "conflict list with without table" msgstr "" -#: readelf.c:6918 +#: readelf.c:7637 #, c-format msgid "" "\n" "Section '.conflict' contains %d entries:\n" msgstr "" -#: readelf.c:6919 +#: readelf.c:7638 msgid " Num: Index Value Name" msgstr "" -#: readelf.c:6944 +#: readelf.c:7663 msgid "NT_PRSTATUS (prstatus structure)" msgstr "" -#: readelf.c:6945 +#: readelf.c:7664 msgid "NT_FPREGSET (floating point registers)" msgstr "" -#: readelf.c:6946 +#: readelf.c:7665 msgid "NT_PRPSINFO (prpsinfo structure)" msgstr "" -#: readelf.c:6947 +#: readelf.c:7666 msgid "NT_TASKSTRUCT (task structure)" msgstr "" -#: readelf.c:6948 +#: readelf.c:7667 msgid "NT_PRXFPREG (user_xfpregs structure)" msgstr "" -#: readelf.c:6949 +#: readelf.c:7668 msgid "NT_PSTATUS (pstatus structure)" msgstr "" -#: readelf.c:6950 +#: readelf.c:7669 msgid "NT_FPREGS (floating point registers)" msgstr "" -#: readelf.c:6951 +#: readelf.c:7670 msgid "NT_PSINFO (psinfo structure)" msgstr "" -#: readelf.c:6952 +#: readelf.c:7671 msgid "NT_LWPSTATUS (lwpstatus_t structure)" msgstr "" -#: readelf.c:6953 +#: readelf.c:7672 msgid "NT_LWPSINFO (lwpsinfo_t structure)" msgstr "" -#: readelf.c:6954 +#: readelf.c:7673 msgid "NT_WIN32PSTATUS (win32_pstatus strcuture)" msgstr "" -#: readelf.c:6956 +#: readelf.c:7675 #, c-format msgid "Unknown note type: (0x%08x)" msgstr "" -#: readelf.c:6994 +#: readelf.c:7713 #, c-format msgid "" "\n" "Notes at offset 0x%08lx with length 0x%08lx:\n" msgstr "" -#: readelf.c:6997 +#: readelf.c:7715 msgid " Owner\t\tData size\tDescription\n" msgstr "" -#: readelf.c:7108 +#: readelf.c:7826 msgid "No note segments present in the core file.\n" msgstr "" -#: readelf.c:7186 +#: readelf.c:7904 msgid "This instance of readelf has been built without support for a\n" msgstr "" -#: readelf.c:7187 +#: readelf.c:7905 msgid "64 bit data type and so it cannot read 64 bit ELF files.\n" msgstr "" -#: readelf.c:7222 +#: readelf.c:7940 #, c-format msgid "Cannot stat input file %s.\n" msgstr "" -#: readelf.c:7229 +#: readelf.c:7947 #, c-format msgid "Input file %s not found.\n" msgstr "" -#: readelf.c:7235 +#: readelf.c:7953 #, c-format msgid "%s: Failed to read file header\n" msgstr "" -#: readelf.c:7249 +#: readelf.c:7967 #, c-format msgid "" "\n" @@ -3325,71 +3706,71 @@ msgstr "" #: rescoff.c:145 #, c-format -msgid "%s: %s: no resource section\n" +msgid "%s: no resource section" msgstr "" -#: rescoff.c:154 +#: rescoff.c:152 msgid "can't read resource section" msgstr "" -#: rescoff.c:180 +#: rescoff.c:178 #, c-format msgid "%s: %s: address out of bounds" msgstr "" -#: rescoff.c:199 +#: rescoff.c:197 msgid "directory" msgstr "" -#: rescoff.c:227 +#: rescoff.c:225 msgid "named directory entry" msgstr "" -#: rescoff.c:236 +#: rescoff.c:234 msgid "directory entry name" msgstr "" -#: rescoff.c:256 +#: rescoff.c:254 msgid "named subdirectory" msgstr "" -#: rescoff.c:264 +#: rescoff.c:262 msgid "named resource" msgstr "" -#: rescoff.c:279 +#: rescoff.c:277 msgid "ID directory entry" msgstr "" -#: rescoff.c:296 +#: rescoff.c:294 msgid "ID subdirectory" msgstr "" -#: rescoff.c:304 +#: rescoff.c:302 msgid "ID resource" msgstr "" -#: rescoff.c:330 +#: rescoff.c:328 msgid "resource type unknown" msgstr "" -#: rescoff.c:333 +#: rescoff.c:331 msgid "data entry" msgstr "" -#: rescoff.c:341 +#: rescoff.c:339 msgid "resource data" msgstr "" -#: rescoff.c:346 +#: rescoff.c:344 msgid "resource data size" msgstr "" -#: rescoff.c:441 +#: rescoff.c:439 msgid "filename required for COFF output" msgstr "" -#: rescoff.c:740 +#: rescoff.c:738 msgid "can't get BFD_RELOC_RVA relocation type" msgstr "" @@ -3408,11 +3789,6 @@ msgstr "" msgid "%s %s: %s" msgstr "" -#: resrc.c:283 -#, c-format -msgid "%s exited with status %d" -msgstr "" - #: resrc.c:308 #, c-format msgid "can't execute `%s': %s" @@ -3442,42 +3818,50 @@ msgstr "" msgid "Using `%s'\n" msgstr "" -#: resrc.c:544 +#: resrc.c:541 #, c-format msgid "%s:%d: %s\n" msgstr "" -#: resrc.c:553 +#: resrc.c:550 #, c-format msgid "%s: unexpected EOF" msgstr "" -#: resrc.c:610 +#: resrc.c:607 #, c-format msgid "%s: read of %lu returned %lu" msgstr "" -#: resrc.c:652 resrc.c:883 resrc.c:1156 resrc.c:1310 +#: resrc.c:649 resrc.c:903 resrc.c:1176 resrc.c:1330 #, c-format msgid "stat failed on bitmap file `%s': %s" msgstr "" -#: resrc.c:705 +#: resrc.c:702 #, c-format msgid "cursor file `%s' does not contain cursor data" msgstr "" -#: resrc.c:737 resrc.c:1027 +#: resrc.c:734 resrc.c:1047 #, c-format msgid "%s: fseek to %lu failed: %s" msgstr "" -#: resrc.c:996 +#: resrc.c:871 +msgid "help ID requires DIALOGEX" +msgstr "" + +#: resrc.c:873 +msgid "control data requires DIALOGEX" +msgstr "" + +#: resrc.c:1016 #, c-format msgid "icon file `%s' does not contain icon data" msgstr "" -#: resrc.c:1515 +#: resrc.c:1535 #, c-format msgid "can't open `%s' for output: %s" msgstr "" @@ -3485,44 +3869,45 @@ msgstr "" #: size.c:79 #, c-format msgid "" -"Usage: %s [-ABdoxV] [--format=berkeley|sysv] [--radix=8|10|16]\n" -" [--target=bfdname] [--version] [--help] [file...]\n" -msgstr "" - -#: size.c:83 -msgid "default is --format=berkeley\n" +"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" msgstr "" #: size.c:85 +msgid "default is --format=berkeley\n" +msgstr "" + +#: size.c:87 msgid "default is --format=sysv\n" msgstr "" -#: size.c:139 +#: size.c:141 #, c-format -msgid "invalid argument to --format: %s\n" +msgid "invalid argument to --format: %s" msgstr "" -#: size.c:166 +#: size.c:168 #, c-format msgid "Invalid radix: %s\n" msgstr "" -#: srconv.c:1879 +#: srconv.c:1880 #, c-format msgid "Usage: %s [-dhVq] in-file [out-file]\n" msgstr "" -#: srconv.c:1886 +#: srconv.c:1887 #, c-format msgid "%s: Convert a COFF object file into a SYSROFF object file\n" msgstr "" -#: srconv.c:2024 +#: srconv.c:2020 #, c-format -msgid "%s: unable to open output file %s\n" +msgid "unable to open output file %s" msgstr "" -#: stabs.c:349 stabs.c:1769 +#: stabs.c:349 stabs.c:1770 msgid "numeric overflow" msgstr "" @@ -3550,84 +3935,84 @@ msgstr "" #. Complain and keep going, so compilers can invent new #. cross-reference types. -#: stabs.c:1306 +#: stabs.c:1307 msgid "unrecognized cross reference type" msgstr "" #. Does this actually ever happen? Is that why we are worrying #. about dealing with it rather than just calling error_type? -#: stabs.c:1861 +#: stabs.c:1862 msgid "missing index type" msgstr "" -#: stabs.c:2188 +#: stabs.c:2189 msgid "unknown virtual character for baseclass" msgstr "" -#: stabs.c:2206 +#: stabs.c:2207 msgid "unknown visibility character for baseclass" msgstr "" -#: stabs.c:2398 +#: stabs.c:2399 msgid "unnamed $vb type" msgstr "" -#: stabs.c:2404 +#: stabs.c:2405 msgid "unrecognized C++ abbreviation" msgstr "" -#: stabs.c:2484 +#: stabs.c:2485 msgid "unknown visibility character for field" msgstr "" -#: stabs.c:2740 +#: stabs.c:2741 msgid "const/volatile indicator missing" msgstr "" -#: stabs.c:2980 +#: stabs.c:2981 #, c-format msgid "No mangling for \"%s\"\n" msgstr "" -#: stabs.c:3293 +#: stabs.c:3294 msgid "Undefined N_EXCL" msgstr "" -#: stabs.c:3381 +#: stabs.c:3382 #, c-format msgid "Type file number %d out of range\n" msgstr "" -#: stabs.c:3386 +#: stabs.c:3387 #, c-format msgid "Type index number %d out of range\n" msgstr "" -#: stabs.c:3473 +#: stabs.c:3474 #, c-format msgid "Unrecognized XCOFF type %d\n" msgstr "" -#: stabs.c:3772 +#: stabs.c:3773 #, c-format msgid "bad mangled name `%s'\n" msgstr "" -#: stabs.c:3868 +#: stabs.c:3869 msgid "no argument types in mangled string\n" msgstr "" -#: strings.c:159 +#: strings.c:177 #, c-format -msgid "%s: invalid number %s\n" +msgid "invalid number %s" msgstr "" -#: strings.c:494 +#: strings.c:513 #, c-format -msgid "%s: invalid integer argument %s\n" +msgid "invalid integer argument %s" msgstr "" -#: strings.c:505 +#: strings.c:523 #, c-format msgid "" "Usage: %s [-afov] [-n min-len] [-min-len] [-t {o,x,d}] [-]\n" @@ -3640,13 +4025,13 @@ msgstr "" msgid "Usage: %s [-hV] in-file\n" msgstr "" -#: sysdump.c:783 +#: sysdump.c:781 #, c-format -msgid "%s: cannot open input file %s\n" +msgid "cannot open input file %s" msgstr "" #: version.c:39 -msgid "Copyright 1997, 1998, 1999 Free Software Foundation, Inc.\n" +msgid "Copyright 1997, 98, 99, 2000 Free Software Foundation, Inc.\n" msgstr "" #: version.c:40 @@ -3679,7 +4064,7 @@ msgstr "" #: windres.c:602 #, c-format -msgid "%s: unknown format type `%s'\n" +msgid "unknown format type `%s'" msgstr "" #: windres.c:603 @@ -3740,17 +4125,17 @@ msgstr "" msgid "no resources" msgstr "" -#: wrstabs.c:366 wrstabs.c:2028 +#: wrstabs.c:366 wrstabs.c:2027 #, c-format -msgid "string_hash_lookup failed: %s\n" +msgid "string_hash_lookup failed: %s" msgstr "" #: wrstabs.c:666 #, c-format -msgid "stab_int_type: bad size %u\n" +msgid "stab_int_type: bad size %u" msgstr "" -#: wrstabs.c:1468 +#: wrstabs.c:1467 #, c-format -msgid "%s: warning: unknown size for field `%s' in struct\n" +msgid "%s: warning: unknown size for field `%s' in struct" msgstr "" diff --git a/gnu/dist/toolchain/binutils/ranlib.1 b/gnu/dist/toolchain/binutils/ranlib.1 index 7efb5c8e8509..9e973c699d9b 100644 --- a/gnu/dist/toolchain/binutils/ranlib.1 +++ b/gnu/dist/toolchain/binutils/ranlib.1 @@ -1,6 +1,6 @@ -.\" Copyright (c) 1991 Free Software Foundation +.\" Copyright (c) 1991, 2000 Free Software Foundation .\" See section COPYING for conditions for redistribution -.TH ranlib 1 "5 November 1991" "cygnus support" "GNU Development Tools" +.TH ranlib 1 "5 November 1991" "Free Software Foundation" "GNU Development Tools" .de BP .sp .ti \-.2i @@ -65,19 +65,377 @@ The GNU Binary Utilities\c .SH COPYING -Copyright (c) 1991 Free Software Foundation, Inc. +Copyright (c) 1991, 2000 Free Software Foundation, Inc. .PP -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. -.PP -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. -.PP -Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be included in -translations approved by the Free Software Foundation instead of in -the original English. +This document is distributed under the terms of the GNU Free +Documentation License, version 1.1. That license is described in the +sources for this manual page, but it is not displayed here in order to +make this manual more consise. Copies of this license can also be +obtained from: http://www.gnu.org/copyleft/. + +\" .SH 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. +\" .PP +\" 0. PREAMBLE +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 1. APPLICABILITY AND DEFINITIONS +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 2. VERBATIM COPYING +\" .PP +\" 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. +\" .PP +\" You may also lend copies, under the same conditions stated above, and +\" you may publicly display copies. +\" .PP +\" 3. COPYING IN QUANTITY +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 4. MODIFICATIONS +\" .PP +\" 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: +\" .PP +\" 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. +\" .PP +\" 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). +\" .PP +\" C. State on the Title page the name of the publisher of the +\" Modified Version, as the publisher. +\" .PP +\" D. Preserve all the copyright notices of the Document. +\" .PP +\" E. Add an appropriate copyright notice for your modifications +\" adjacent to the other copyright notices. +\" .PP +\" 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. +\" Preserve in that license notice the full lists of Invariant Sections +\" and required Cover Texts given in the Document's license notice. +\" .PP +\" H. Include an unaltered copy of this License. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" M. Delete any section entitled "Endorsements". Such a section +\" may not be included in the Modified Version. +\" .PP +\" N. Do not retitle any existing section as "Endorsements" +\" or to conflict in title with any Invariant Section. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 5. COMBINING DOCUMENTS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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." +\" .PP + +\" 6. COLLECTIONS OF DOCUMENTS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 7. AGGREGATION WITH INDEPENDENT WORKS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 8. TRANSLATION +\" .PP +\" 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. +\" .PP + +\" 9. TERMINATION +\" .PP +\" 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. +\" .PP + +\" 10. FUTURE REVISIONS OF THIS LICENSE +\" .PP +\" 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/. +\" .PP +\" 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. +\" .PP + +\" ADDENDUM: How to use this License for your documents +\" .PP +\" 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: +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. diff --git a/gnu/dist/toolchain/binutils/rclex.c b/gnu/dist/toolchain/binutils/rclex.c index b2967bb79d15..be3602e76b1b 100644 --- a/gnu/dist/toolchain/binutils/rclex.c +++ b/gnu/dist/toolchain/binutils/rclex.c @@ -1,7 +1,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /cvs/src/src/binutils/Attic/rclex.c,v 1.1.2.1 2000/05/29 14:08:52 pb Exp $ + * $Header: /cvs/src/src/binutils/Attic/rclex.c,v 1.1.4.1 2001/03/12 15:40:35 pb Exp $ */ #define FLEX_SCANNER diff --git a/gnu/dist/toolchain/binutils/rcparse.c b/gnu/dist/toolchain/binutils/rcparse.c index dff3302b3d9e..63578afd3a5c 100644 --- a/gnu/dist/toolchain/binutils/rcparse.c +++ b/gnu/dist/toolchain/binutils/rcparse.c @@ -196,11 +196,11 @@ typedef union -#define YYFINAL 475 +#define YYFINAL 483 #define YYFLAG -32768 #define YYNTBASE 99 -#define YYTRANSLATE(x) ((unsigned)(x) <= 339 ? yytranslate[x] : 189) +#define YYTRANSLATE(x) ((unsigned)(x) <= 339 ? yytranslate[x] : 191) static const char yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -249,22 +249,23 @@ static const short yyprhs[] = { 0, 192, 200, 204, 208, 213, 217, 218, 221, 222, 226, 227, 231, 232, 236, 237, 241, 242, 246, 247, 251, 263, 276, 289, 303, 304, 308, 309, 313, 314, 318, - 319, 323, 324, 328, 335, 346, 358, 359, 363, 364, - 368, 369, 373, 374, 378, 379, 383, 384, 388, 389, - 393, 394, 398, 399, 403, 404, 421, 429, 439, 450, - 451, 454, 455, 459, 460, 464, 465, 469, 470, 474, - 479, 484, 488, 495, 496, 499, 504, 507, 514, 515, - 519, 522, 524, 526, 528, 530, 532, 534, 541, 542, - 545, 548, 552, 558, 561, 567, 574, 582, 592, 597, - 604, 605, 608, 609, 611, 613, 615, 619, 623, 624, - 631, 632, 636, 641, 648, 653, 660, 661, 668, 675, - 679, 683, 687, 691, 695, 696, 705, 713, 714, 720, - 721, 725, 727, 729, 730, 733, 737, 742, 746, 747, - 750, 751, 754, 756, 758, 760, 762, 764, 766, 768, - 770, 772, 774, 777, 781, 786, 788, 792, 793, 795, - 798, 800, 802, 806, 809, 812, 816, 820, 824, 828, - 832, 836, 840, 844, 847, 849, 851, 855, 858, 862, - 866, 870, 874, 878, 882, 886 + 319, 323, 324, 328, 335, 344, 355, 367, 368, 372, + 373, 377, 378, 382, 383, 387, 388, 392, 393, 397, + 398, 402, 403, 407, 408, 412, 413, 430, 438, 448, + 459, 460, 462, 465, 466, 470, 471, 475, 476, 480, + 481, 485, 490, 495, 499, 506, 507, 510, 515, 518, + 525, 526, 530, 533, 535, 537, 539, 541, 543, 545, + 552, 553, 556, 559, 563, 569, 572, 578, 585, 593, + 603, 608, 615, 616, 619, 620, 622, 624, 626, 630, + 634, 635, 642, 643, 647, 652, 659, 664, 671, 672, + 679, 686, 690, 694, 698, 702, 706, 707, 716, 724, + 725, 731, 732, 736, 738, 740, 742, 745, 748, 751, + 753, 754, 757, 761, 766, 770, 771, 774, 775, 778, + 780, 782, 784, 786, 788, 790, 792, 794, 796, 798, + 801, 805, 810, 812, 816, 817, 819, 822, 824, 826, + 830, 833, 836, 840, 844, 848, 852, 856, 860, 864, + 868, 871, 873, 875, 879, 882, 886, 890, 894, 898, + 902, 906, 910 }; static const short yyrhs[] = { -1, @@ -274,89 +275,92 @@ static const short yyrhs[] = { -1, 151, 0, 99, 100, 156, 0, 99, 100, 159, 0, 99, 100, 160, 0, 99, 100, 165, 0, 99, 100, 168, 0, 99, 100, 169, 0, 99, 100, 84, 0, - 0, 174, 5, 175, 3, 102, 4, 0, 0, 102, - 103, 0, 104, 186, 0, 104, 186, 95, 105, 0, - 80, 0, 187, 0, 106, 0, 105, 95, 106, 0, + 0, 174, 5, 177, 3, 102, 4, 0, 0, 102, + 103, 0, 104, 188, 0, 104, 188, 95, 105, 0, + 80, 0, 189, 0, 106, 0, 105, 95, 106, 0, 105, 106, 0, 6, 0, 7, 0, 8, 0, 9, - 0, 10, 0, 11, 0, 174, 12, 177, 179, 0, - 174, 13, 176, 179, 0, 0, 174, 14, 177, 113, - 187, 183, 183, 183, 110, 114, 3, 116, 4, 0, - 0, 174, 15, 177, 113, 187, 183, 183, 183, 111, - 114, 3, 116, 4, 0, 0, 174, 15, 177, 113, - 187, 183, 183, 183, 183, 112, 114, 3, 116, 4, - 0, 0, 16, 96, 184, 0, 0, 114, 17, 80, - 0, 114, 18, 174, 0, 0, 114, 19, 115, 180, - 0, 114, 16, 184, 0, 114, 41, 184, 95, 80, - 0, 114, 41, 184, 95, 80, 183, 183, 0, 114, - 46, 174, 0, 114, 44, 184, 0, 114, 43, 184, - 183, 0, 114, 45, 184, 0, 0, 116, 117, 0, + 0, 10, 0, 11, 0, 174, 12, 179, 181, 0, + 174, 13, 178, 181, 0, 0, 174, 14, 179, 113, + 189, 185, 185, 185, 110, 114, 3, 116, 4, 0, + 0, 174, 15, 179, 113, 189, 185, 185, 185, 111, + 114, 3, 116, 4, 0, 0, 174, 15, 179, 113, + 189, 185, 185, 185, 185, 112, 114, 3, 116, 4, + 0, 0, 16, 96, 186, 0, 0, 114, 17, 80, + 0, 114, 18, 174, 0, 0, 114, 19, 115, 182, + 0, 114, 16, 186, 0, 114, 41, 186, 95, 80, + 0, 114, 41, 186, 95, 80, 185, 185, 0, 114, + 46, 174, 0, 114, 44, 186, 0, 114, 43, 186, + 185, 0, 114, 45, 186, 0, 0, 116, 117, 0, 0, 20, 118, 139, 0, 0, 21, 119, 139, 0, 0, 22, 120, 139, 0, 0, 38, 121, 139, 0, 0, 23, 122, 139, 0, 0, 24, 123, 139, 0, - 10, 140, 184, 183, 142, 183, 183, 183, 183, 182, - 141, 0, 10, 140, 184, 183, 142, 183, 183, 183, - 183, 183, 183, 141, 0, 10, 140, 184, 95, 80, - 142, 183, 183, 183, 183, 182, 141, 0, 10, 140, - 184, 95, 80, 142, 183, 183, 183, 183, 183, 183, + 10, 140, 186, 185, 142, 185, 185, 185, 185, 184, + 141, 0, 10, 140, 186, 185, 142, 185, 185, 185, + 185, 185, 185, 141, 0, 10, 140, 186, 95, 80, + 142, 185, 185, 185, 185, 184, 141, 0, 10, 140, + 186, 95, 80, 142, 185, 185, 185, 185, 185, 185, 141, 0, 0, 25, 124, 139, 0, 0, 26, 125, 139, 0, 0, 27, 126, 139, 0, 0, 28, 127, - 139, 0, 0, 39, 128, 139, 0, 42, 140, 184, - 183, 183, 141, 0, 42, 140, 184, 183, 183, 183, - 183, 144, 182, 141, 0, 42, 140, 184, 183, 183, - 183, 183, 144, 183, 183, 141, 0, 0, 40, 129, - 139, 0, 0, 29, 130, 139, 0, 0, 30, 131, - 139, 0, 0, 31, 132, 139, 0, 0, 32, 133, - 139, 0, 0, 33, 134, 139, 0, 0, 34, 135, - 139, 0, 0, 35, 136, 139, 0, 0, 36, 137, - 139, 0, 0, 37, 80, 95, 184, 95, 184, 95, - 184, 95, 184, 95, 184, 95, 138, 180, 182, 0, - 140, 184, 183, 183, 183, 183, 141, 0, 140, 184, - 183, 183, 183, 183, 146, 182, 141, 0, 140, 184, - 183, 183, 183, 183, 146, 183, 183, 141, 0, 0, - 80, 95, 0, 0, 3, 161, 4, 0, 0, 95, - 143, 180, 0, 0, 95, 145, 180, 0, 0, 95, - 147, 180, 0, 174, 41, 176, 179, 0, 174, 42, - 176, 179, 0, 43, 184, 183, 0, 174, 46, 175, - 3, 152, 4, 0, 0, 152, 153, 0, 48, 80, - 183, 154, 0, 48, 49, 0, 50, 80, 154, 3, - 152, 4, 0, 0, 154, 95, 155, 0, 154, 155, - 0, 51, 0, 52, 0, 53, 0, 54, 0, 55, - 0, 56, 0, 174, 47, 175, 3, 157, 4, 0, - 0, 157, 158, 0, 48, 80, 0, 48, 80, 183, - 0, 48, 80, 183, 183, 182, 0, 48, 49, 0, - 50, 80, 3, 157, 4, 0, 50, 80, 183, 3, - 157, 4, 0, 50, 80, 183, 183, 3, 157, 4, - 0, 50, 80, 183, 183, 183, 182, 3, 157, 4, - 0, 174, 57, 177, 179, 0, 174, 58, 175, 3, - 161, 4, 0, 0, 162, 163, 0, 0, 164, 0, - 83, 0, 185, 0, 164, 95, 83, 0, 164, 95, - 185, 0, 0, 59, 175, 3, 166, 167, 4, 0, - 0, 167, 184, 80, 0, 167, 184, 95, 80, 0, - 174, 174, 175, 3, 161, 4, 0, 174, 174, 175, - 179, 0, 174, 60, 170, 3, 171, 4, 0, 0, - 170, 61, 184, 183, 183, 183, 0, 170, 62, 184, - 183, 183, 183, 0, 170, 63, 184, 0, 170, 64, - 184, 0, 170, 65, 184, 0, 170, 66, 184, 0, - 170, 67, 184, 0, 0, 171, 68, 3, 71, 3, - 172, 4, 4, 0, 171, 69, 3, 70, 80, 173, - 4, 0, 0, 172, 70, 80, 95, 80, 0, 0, - 173, 183, 183, 0, 187, 0, 81, 0, 0, 175, - 178, 0, 175, 44, 184, 0, 175, 43, 184, 183, - 0, 175, 45, 184, 0, 0, 176, 178, 0, 0, - 177, 178, 0, 72, 0, 73, 0, 74, 0, 75, - 0, 76, 0, 77, 0, 78, 0, 80, 0, 81, - 0, 181, 0, 79, 181, 0, 180, 85, 181, 0, - 180, 85, 79, 181, 0, 82, 0, 97, 184, 98, - 0, 0, 183, 0, 95, 184, 0, 185, 0, 82, - 0, 97, 185, 98, 0, 93, 185, 0, 89, 185, - 0, 185, 90, 185, 0, 185, 91, 185, 0, 185, - 92, 185, 0, 185, 88, 185, 0, 185, 89, 185, - 0, 185, 87, 185, 0, 185, 86, 185, 0, 185, - 85, 185, 0, 95, 187, 0, 188, 0, 82, 0, - 97, 185, 98, 0, 93, 185, 0, 188, 90, 185, - 0, 188, 91, 185, 0, 188, 92, 185, 0, 188, - 88, 185, 0, 188, 89, 185, 0, 188, 87, 185, - 0, 188, 86, 185, 0, 188, 85, 185, 0 + 139, 0, 0, 39, 128, 139, 0, 42, 176, 186, + 185, 185, 141, 0, 42, 176, 186, 185, 185, 185, + 185, 141, 0, 42, 176, 186, 185, 185, 185, 185, + 144, 184, 141, 0, 42, 176, 186, 185, 185, 185, + 185, 144, 185, 185, 141, 0, 0, 40, 129, 139, + 0, 0, 29, 130, 139, 0, 0, 30, 131, 139, + 0, 0, 31, 132, 139, 0, 0, 32, 133, 139, + 0, 0, 33, 134, 139, 0, 0, 34, 135, 139, + 0, 0, 35, 136, 139, 0, 0, 36, 137, 139, + 0, 0, 37, 80, 95, 186, 95, 186, 95, 186, + 95, 186, 95, 186, 95, 138, 182, 184, 0, 140, + 186, 185, 185, 185, 185, 141, 0, 140, 186, 185, + 185, 185, 185, 146, 184, 141, 0, 140, 186, 185, + 185, 185, 185, 146, 185, 185, 141, 0, 0, 80, + 0, 80, 95, 0, 0, 3, 161, 4, 0, 0, + 95, 143, 182, 0, 0, 95, 145, 182, 0, 0, + 95, 147, 182, 0, 174, 41, 178, 181, 0, 174, + 42, 178, 181, 0, 43, 186, 185, 0, 174, 46, + 177, 3, 152, 4, 0, 0, 152, 153, 0, 48, + 80, 185, 154, 0, 48, 49, 0, 50, 80, 154, + 3, 152, 4, 0, 0, 154, 95, 155, 0, 154, + 155, 0, 51, 0, 52, 0, 53, 0, 54, 0, + 55, 0, 56, 0, 174, 47, 177, 3, 157, 4, + 0, 0, 157, 158, 0, 48, 80, 0, 48, 80, + 185, 0, 48, 80, 185, 185, 184, 0, 48, 49, + 0, 50, 80, 3, 157, 4, 0, 50, 80, 185, + 3, 157, 4, 0, 50, 80, 185, 185, 3, 157, + 4, 0, 50, 80, 185, 185, 185, 184, 3, 157, + 4, 0, 174, 57, 179, 181, 0, 174, 58, 177, + 3, 161, 4, 0, 0, 162, 163, 0, 0, 164, + 0, 83, 0, 187, 0, 164, 95, 83, 0, 164, + 95, 187, 0, 0, 59, 177, 3, 166, 167, 4, + 0, 0, 167, 186, 80, 0, 167, 186, 95, 80, + 0, 174, 174, 177, 3, 161, 4, 0, 174, 174, + 177, 181, 0, 174, 60, 170, 3, 171, 4, 0, + 0, 170, 61, 186, 185, 185, 185, 0, 170, 62, + 186, 185, 185, 185, 0, 170, 63, 186, 0, 170, + 64, 186, 0, 170, 65, 186, 0, 170, 66, 186, + 0, 170, 67, 186, 0, 0, 171, 68, 3, 71, + 3, 172, 4, 4, 0, 171, 69, 3, 70, 80, + 173, 4, 0, 0, 172, 70, 80, 95, 80, 0, + 0, 173, 185, 185, 0, 189, 0, 81, 0, 80, + 0, 80, 95, 0, 81, 95, 0, 189, 95, 0, + 175, 0, 0, 177, 180, 0, 177, 44, 186, 0, + 177, 43, 186, 185, 0, 177, 45, 186, 0, 0, + 178, 180, 0, 0, 179, 180, 0, 72, 0, 73, + 0, 74, 0, 75, 0, 76, 0, 77, 0, 78, + 0, 80, 0, 81, 0, 183, 0, 79, 183, 0, + 182, 85, 183, 0, 182, 85, 79, 183, 0, 82, + 0, 97, 186, 98, 0, 0, 185, 0, 95, 186, + 0, 187, 0, 82, 0, 97, 187, 98, 0, 93, + 187, 0, 89, 187, 0, 187, 90, 187, 0, 187, + 91, 187, 0, 187, 92, 187, 0, 187, 88, 187, + 0, 187, 89, 187, 0, 187, 87, 187, 0, 187, + 86, 187, 0, 187, 85, 187, 0, 95, 189, 0, + 190, 0, 82, 0, 97, 187, 98, 0, 93, 187, + 0, 190, 90, 187, 0, 190, 91, 187, 0, 190, + 92, 187, 0, 190, 88, 187, 0, 190, 89, 187, + 0, 190, 87, 187, 0, 190, 86, 187, 0, 190, + 85, 187, 0 }; #endif @@ -371,22 +375,23 @@ static const short yyrline[] = { 0, 435, 448, 452, 456, 460, 466, 468, 478, 486, 489, 496, 499, 506, 509, 516, 522, 529, 532, 539, 542, 553, 562, 575, 586, 593, 596, 603, 606, 613, 616, - 623, 626, 633, 639, 650, 662, 672, 679, 685, 692, - 695, 702, 705, 712, 715, 722, 725, 732, 735, 742, - 745, 752, 755, 762, 765, 768, 782, 795, 806, 817, - 822, 828, 833, 841, 845, 847, 851, 853, 857, 861, - 870, 880, 889, 896, 901, 917, 922, 926, 932, 937, - 941, 947, 952, 956, 960, 964, 968, 976, 983, 988, - 1004, 1009, 1013, 1017, 1021, 1025, 1029, 1033, 1042, 1051, - 1061, 1066, 1072, 1078, 1084, 1093, 1101, 1110, 1123, 1126, - 1129, 1131, 1135, 1144, 1149, 1157, 1164, 1171, 1177, 1183, - 1188, 1193, 1198, 1203, 1216, 1221, 1225, 1231, 1236, 1242, - 1247, 1255, 1261, 1278, 1286, 1292, 1297, 1302, 1311, 1318, - 1328, 1335, 1346, 1352, 1357, 1362, 1367, 1372, 1377, 1386, - 1391, 1407, 1412, 1416, 1420, 1426, 1431, 1439, 1444, 1452, - 1461, 1470, 1475, 1479, 1484, 1489, 1494, 1499, 1504, 1509, - 1514, 1519, 1524, 1534, 1543, 1554, 1559, 1563, 1568, 1573, - 1578, 1583, 1588, 1593, 1598, 1603 + 623, 626, 633, 639, 644, 650, 656, 662, 669, 675, + 682, 685, 692, 695, 702, 705, 712, 715, 722, 725, + 732, 735, 742, 745, 752, 755, 758, 772, 785, 796, + 807, 812, 816, 822, 827, 835, 839, 841, 845, 847, + 851, 855, 864, 874, 883, 890, 895, 911, 916, 920, + 926, 931, 935, 941, 946, 950, 954, 958, 962, 970, + 977, 982, 998, 1003, 1007, 1011, 1015, 1019, 1023, 1027, + 1036, 1045, 1055, 1060, 1066, 1072, 1078, 1087, 1095, 1104, + 1117, 1120, 1123, 1125, 1129, 1138, 1143, 1151, 1158, 1165, + 1171, 1177, 1182, 1187, 1192, 1197, 1210, 1215, 1219, 1225, + 1230, 1236, 1241, 1249, 1255, 1271, 1276, 1280, 1287, 1293, + 1310, 1318, 1324, 1329, 1334, 1343, 1350, 1360, 1367, 1378, + 1384, 1389, 1394, 1399, 1404, 1409, 1418, 1423, 1439, 1444, + 1448, 1452, 1458, 1463, 1471, 1476, 1484, 1493, 1502, 1507, + 1511, 1516, 1521, 1526, 1531, 1536, 1541, 1546, 1551, 1556, + 1566, 1575, 1586, 1591, 1595, 1600, 1605, 1610, 1615, 1620, + 1625, 1630, 1635 }; #endif @@ -415,9 +420,9 @@ static const char * const yytname[] = { "$","error","$undefined.","BEG","END", "menuitem_flag","menuex","menuexitems","menuexitem","messagetable","rcdata", "optrcdata_data","@29","optrcdata_data_int","rcdata_data","stringtable","@30", "string_data","user","versioninfo","fixedverinfo","verblocks","vervals","vertrans", -"id","suboptions","memflags_move_discard","memflags_move","memflag","file_name", -"styleexpr","parennumber","optcnumexpr","cnumexpr","numexpr","sizednumexpr", -"cposnumexpr","posnumexpr","sizedposnumexpr", NULL +"id","resname","resref","suboptions","memflags_move_discard","memflags_move", +"memflag","file_name","styleexpr","parennumber","optcnumexpr","cnumexpr","numexpr", +"sizednumexpr","cposnumexpr","posnumexpr","sizedposnumexpr", NULL }; #endif @@ -430,22 +435,23 @@ static const short yyr1[] = { 0, 114, 114, 114, 114, 114, 116, 116, 118, 117, 119, 117, 120, 117, 121, 117, 122, 117, 123, 117, 117, 117, 117, 117, 124, 117, 125, 117, 126, 117, 127, - 117, 128, 117, 117, 117, 117, 129, 117, 130, 117, - 131, 117, 132, 117, 133, 117, 134, 117, 135, 117, - 136, 117, 137, 117, 138, 117, 139, 139, 139, 140, - 140, 141, 141, 143, 142, 145, 144, 147, 146, 148, - 149, 150, 151, 152, 152, 153, 153, 153, 154, 154, - 154, 155, 155, 155, 155, 155, 155, 156, 157, 157, - 158, 158, 158, 158, 158, 158, 158, 158, 159, 160, - 162, 161, 163, 163, 164, 164, 164, 164, 166, 165, - 167, 167, 167, 168, 168, 169, 170, 170, 170, 170, - 170, 170, 170, 170, 171, 171, 171, 172, 172, 173, - 173, 174, 174, 175, 175, 175, 175, 175, 176, 176, - 177, 177, 178, 178, 178, 178, 178, 178, 178, 179, - 179, 180, 180, 180, 180, 181, 181, 182, 182, 183, - 184, 185, 185, 185, 185, 185, 185, 185, 185, 185, - 185, 185, 185, 186, 187, 188, 188, 188, 188, 188, - 188, 188, 188, 188, 188, 188 + 117, 128, 117, 117, 117, 117, 117, 129, 117, 130, + 117, 131, 117, 132, 117, 133, 117, 134, 117, 135, + 117, 136, 117, 137, 117, 138, 117, 139, 139, 139, + 140, 140, 140, 141, 141, 143, 142, 145, 144, 147, + 146, 148, 149, 150, 151, 152, 152, 153, 153, 153, + 154, 154, 154, 155, 155, 155, 155, 155, 155, 156, + 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, + 159, 160, 162, 161, 163, 163, 164, 164, 164, 164, + 166, 165, 167, 167, 167, 168, 168, 169, 170, 170, + 170, 170, 170, 170, 170, 170, 171, 171, 171, 172, + 172, 173, 173, 174, 174, 175, 175, 175, 176, 176, + 177, 177, 177, 177, 177, 178, 178, 179, 179, 180, + 180, 180, 180, 180, 180, 180, 181, 181, 182, 182, + 182, 182, 183, 183, 184, 184, 185, 186, 187, 187, + 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, + 188, 189, 190, 190, 190, 190, 190, 190, 190, 190, + 190, 190, 190 }; static const short yyr2[] = { 0, @@ -457,302 +463,305 @@ static const short yyr2[] = { 0, 7, 3, 3, 4, 3, 0, 2, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, 11, 12, 12, 13, 0, 3, 0, 3, 0, 3, 0, - 3, 0, 3, 6, 10, 11, 0, 3, 0, 3, - 0, 3, 0, 3, 0, 3, 0, 3, 0, 3, - 0, 3, 0, 3, 0, 16, 7, 9, 10, 0, - 2, 0, 3, 0, 3, 0, 3, 0, 3, 4, - 4, 3, 6, 0, 2, 4, 2, 6, 0, 3, - 2, 1, 1, 1, 1, 1, 1, 6, 0, 2, - 2, 3, 5, 2, 5, 6, 7, 9, 4, 6, - 0, 2, 0, 1, 1, 1, 3, 3, 0, 6, - 0, 3, 4, 6, 4, 6, 0, 6, 6, 3, - 3, 3, 3, 3, 0, 8, 7, 0, 5, 0, - 3, 1, 1, 0, 2, 3, 4, 3, 0, 2, - 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 2, 3, 4, 1, 3, 0, 1, 2, - 1, 1, 3, 2, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 2, 1, 1, 3, 2, 3, 3, - 3, 3, 3, 3, 3, 3 + 3, 0, 3, 6, 8, 10, 11, 0, 3, 0, + 3, 0, 3, 0, 3, 0, 3, 0, 3, 0, + 3, 0, 3, 0, 3, 0, 16, 7, 9, 10, + 0, 1, 2, 0, 3, 0, 3, 0, 3, 0, + 3, 4, 4, 3, 6, 0, 2, 4, 2, 6, + 0, 3, 2, 1, 1, 1, 1, 1, 1, 6, + 0, 2, 2, 3, 5, 2, 5, 6, 7, 9, + 4, 6, 0, 2, 0, 1, 1, 1, 3, 3, + 0, 6, 0, 3, 4, 6, 4, 6, 0, 6, + 6, 3, 3, 3, 3, 3, 0, 8, 7, 0, + 5, 0, 3, 1, 1, 1, 2, 2, 2, 1, + 0, 2, 3, 4, 3, 0, 2, 0, 2, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 3, 4, 1, 3, 0, 1, 2, 1, 1, 3, + 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, + 2, 1, 1, 3, 2, 3, 3, 3, 3, 3, + 3, 3, 3 }; static const short yydefact[] = { 1, - 17, 0, 0, 184, 183, 226, 16, 0, 0, 2, + 17, 0, 0, 191, 185, 233, 16, 0, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, 0, 182, 225, 212, 0, 0, 0, - 0, 211, 0, 228, 0, 184, 191, 189, 191, 191, - 189, 189, 184, 184, 191, 184, 167, 184, 0, 0, - 0, 0, 0, 0, 0, 0, 215, 214, 0, 0, - 122, 0, 0, 0, 0, 0, 0, 0, 0, 159, - 0, 0, 0, 193, 194, 195, 196, 197, 198, 199, - 185, 227, 0, 0, 0, 42, 42, 0, 0, 0, - 0, 0, 0, 0, 0, 236, 235, 234, 232, 233, - 229, 230, 231, 213, 210, 223, 222, 221, 219, 220, - 216, 217, 218, 161, 0, 186, 188, 19, 200, 201, - 192, 34, 190, 35, 0, 0, 0, 120, 121, 124, - 139, 149, 151, 175, 0, 0, 0, 0, 0, 0, - 0, 151, 165, 0, 187, 0, 0, 0, 0, 0, - 0, 0, 153, 0, 0, 0, 170, 171, 172, 173, - 174, 0, 160, 0, 18, 23, 20, 0, 24, 43, - 0, 0, 123, 0, 0, 125, 138, 0, 0, 140, - 150, 155, 152, 154, 156, 166, 0, 0, 0, 0, - 164, 162, 0, 0, 21, 0, 0, 127, 0, 129, - 144, 141, 0, 0, 0, 0, 0, 0, 163, 224, - 0, 36, 38, 129, 0, 142, 139, 0, 157, 158, - 0, 0, 168, 169, 28, 29, 30, 31, 32, 33, - 22, 25, 44, 44, 40, 126, 124, 132, 133, 134, - 135, 136, 137, 0, 131, 208, 0, 139, 0, 178, - 180, 0, 27, 0, 0, 44, 0, 130, 143, 209, - 145, 0, 139, 208, 0, 0, 26, 56, 0, 0, - 0, 47, 0, 0, 0, 0, 0, 56, 0, 128, - 146, 0, 0, 0, 0, 177, 0, 0, 49, 45, - 46, 0, 0, 0, 53, 55, 52, 0, 56, 147, - 139, 176, 0, 181, 37, 110, 58, 60, 62, 66, - 68, 74, 76, 78, 80, 89, 91, 93, 95, 97, - 99, 101, 103, 0, 64, 82, 87, 110, 57, 0, - 206, 0, 48, 202, 0, 54, 39, 0, 0, 0, - 0, 0, 110, 110, 110, 110, 110, 110, 110, 110, - 110, 110, 110, 110, 110, 110, 110, 110, 110, 0, - 110, 110, 110, 0, 203, 0, 0, 50, 41, 148, - 179, 111, 0, 59, 0, 61, 63, 67, 69, 75, - 77, 79, 81, 90, 92, 94, 96, 98, 100, 102, - 104, 0, 65, 83, 88, 0, 207, 0, 204, 0, - 0, 0, 0, 0, 0, 205, 51, 0, 114, 0, - 0, 0, 112, 0, 0, 0, 0, 0, 151, 84, - 0, 0, 115, 0, 0, 0, 0, 0, 0, 0, - 112, 0, 113, 116, 208, 0, 208, 118, 107, 208, - 0, 0, 112, 209, 208, 112, 209, 0, 112, 209, - 0, 117, 85, 112, 112, 209, 70, 112, 119, 108, - 112, 0, 86, 72, 112, 71, 109, 0, 73, 105, - 0, 208, 106, 0, 0 + 13, 14, 15, 0, 184, 232, 219, 0, 0, 0, + 0, 218, 0, 235, 0, 191, 198, 196, 198, 198, + 196, 196, 191, 191, 198, 191, 169, 191, 0, 0, + 0, 0, 0, 0, 0, 0, 222, 221, 0, 0, + 124, 0, 0, 0, 0, 0, 0, 0, 0, 161, + 0, 0, 0, 200, 201, 202, 203, 204, 205, 206, + 192, 234, 0, 0, 0, 42, 42, 0, 0, 0, + 0, 0, 0, 0, 0, 243, 242, 241, 239, 240, + 236, 237, 238, 220, 217, 230, 229, 228, 226, 227, + 223, 224, 225, 163, 0, 193, 195, 19, 207, 208, + 199, 34, 197, 35, 0, 0, 0, 122, 123, 126, + 141, 151, 153, 177, 0, 0, 0, 0, 0, 0, + 0, 153, 167, 0, 194, 0, 0, 0, 0, 0, + 0, 0, 155, 0, 0, 0, 172, 173, 174, 175, + 176, 0, 162, 0, 18, 23, 20, 0, 24, 43, + 0, 0, 125, 0, 0, 127, 140, 0, 0, 142, + 152, 157, 154, 156, 158, 168, 0, 0, 0, 0, + 166, 164, 0, 0, 21, 0, 0, 129, 0, 131, + 146, 143, 0, 0, 0, 0, 0, 0, 165, 231, + 0, 36, 38, 131, 0, 144, 141, 0, 159, 160, + 0, 0, 170, 171, 28, 29, 30, 31, 32, 33, + 22, 25, 44, 44, 40, 128, 126, 134, 135, 136, + 137, 138, 139, 0, 133, 215, 0, 141, 0, 180, + 182, 0, 27, 0, 0, 44, 0, 132, 145, 216, + 147, 0, 141, 215, 0, 0, 26, 56, 0, 0, + 0, 47, 0, 0, 0, 0, 0, 56, 0, 130, + 148, 0, 0, 0, 0, 179, 0, 0, 49, 45, + 46, 0, 0, 0, 53, 55, 52, 0, 56, 149, + 141, 178, 0, 183, 37, 111, 58, 60, 62, 66, + 68, 74, 76, 78, 80, 90, 92, 94, 96, 98, + 100, 102, 104, 0, 64, 82, 88, 0, 57, 0, + 213, 0, 48, 209, 0, 54, 39, 0, 0, 0, + 112, 0, 111, 111, 111, 111, 111, 111, 111, 111, + 111, 111, 111, 111, 111, 111, 111, 111, 111, 0, + 111, 111, 111, 186, 0, 190, 0, 0, 210, 0, + 0, 50, 41, 150, 181, 113, 0, 59, 0, 61, + 63, 67, 69, 75, 77, 79, 81, 91, 93, 95, + 97, 99, 101, 103, 105, 0, 65, 83, 89, 187, + 188, 0, 189, 214, 0, 211, 0, 0, 0, 0, + 0, 0, 212, 51, 0, 116, 0, 0, 0, 114, + 0, 0, 0, 0, 0, 153, 84, 0, 0, 117, + 0, 0, 0, 0, 114, 0, 0, 114, 0, 115, + 118, 85, 215, 0, 215, 120, 108, 215, 0, 0, + 114, 216, 215, 114, 216, 0, 114, 216, 0, 119, + 86, 114, 114, 216, 70, 114, 121, 109, 114, 0, + 87, 72, 114, 71, 110, 0, 73, 106, 0, 215, + 107, 0, 0 }; static const short yydefgoto[] = { 1, 2, 10, 146, 167, 168, 231, 232, 11, 12, 13, 233, 234, 256, 126, 254, 292, 288, 329, 343, 344, 345, 361, 346, 347, 348, 349, 350, 351, 362, 363, - 352, 353, 354, 355, 356, 357, 358, 359, 471, 374, - 375, 420, 410, 415, 435, 442, 440, 448, 14, 15, + 352, 353, 354, 355, 356, 357, 358, 359, 479, 378, + 379, 427, 417, 422, 443, 450, 448, 456, 14, 15, 16, 17, 150, 176, 215, 245, 18, 151, 180, 19, 20, 152, 153, 183, 184, 21, 114, 144, 22, 23, - 94, 154, 265, 266, 24, 33, 85, 84, 81, 122, - 333, 334, 259, 260, 105, 32, 195, 25, 26 + 94, 154, 265, 266, 24, 366, 367, 33, 85, 84, + 81, 122, 333, 334, 259, 260, 105, 32, 195, 25, + 26 }; static const short yypact[] = {-32768, - 39, 284, 231,-32768,-32768,-32768,-32768, 231, 231,-32768, + 31, 240, 241,-32768,-32768,-32768,-32768, 241, 241,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768, 233,-32768, 601,-32768, 231, 231, 231, - -60, 609, 35,-32768, 314,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 231, 231, - 231, 231, 231, 231, 231, 231,-32768,-32768, 577, 231, --32768, 231, 231, 231, 231, 231, 231, 231, 231,-32768, - 231, 231, 231,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768, 209, 604, 604, 234, 234, 604, 604, 259, - 273, 604, 319, 169, 113, 616, 152, 386, -33, -33, --32768,-32768,-32768,-32768,-32768, 616, 152, 386, -33, -33, --32768,-32768,-32768,-32768, -60,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768, -1, 99, 99,-32768,-32768,-32768, --32768,-32768,-32768,-32768, 231, 231, 231, 231, 231, 231, - 231,-32768,-32768, 0,-32768, 1, 231, -60, -60, 92, - 95, 110, 337, 52, -60, -60,-32768,-32768,-32768,-32768, --32768, 124,-32768, 59,-32768,-32768,-32768, 32,-32768,-32768, - -60, -60,-32768, -36, 51,-32768,-32768, 42, 68,-32768, --32768,-32768,-32768, 54, 609,-32768, 150, 161, -60, -60, --32768,-32768, 75, 99, 66, -60, -60,-32768, -60,-32768, --32768, -60, 5, 527, 107, 136, -60, -60,-32768,-32768, - 703,-32768, -60,-32768, 20, -60,-32768, 6,-32768, 609, - 212, 137,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, - 23,-32768,-32768,-32768,-32768, 303,-32768,-32768,-32768,-32768, --32768,-32768,-32768, 664,-32768, -60, 102,-32768, 7,-32768, --32768, 703,-32768, 446, 454,-32768, 115,-32768,-32768,-32768, --32768, 120,-32768, -60, 15, 10,-32768,-32768, 231, 141, - 123,-32768, 231, 231, 231, 231, 123,-32768, 463,-32768, --32768, 121, 219, 221, 143,-32768, -60, 492,-32768,-32768, --32768, -57, 131, -60,-32768,-32768,-32768, 529,-32768,-32768, --32768,-32768, 133,-32768,-32768, 157,-32768,-32768,-32768,-32768, +-32768,-32768,-32768, 68,-32768, 578,-32768, 241, 241, 241, + -73, 586, 169,-32768, 388,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 241, 241, + 241, 241, 241, 241, 241, 241,-32768,-32768, 513, 241, +-32768, 241, 241, 241, 241, 241, 241, 241, 241,-32768, + 241, 241, 241,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768, 215, 581, 581, 268, 268, 581, 581, 232, + 275, 581, 283, 250, 156, 593, 599, 616, 98, 98, +-32768,-32768,-32768,-32768,-32768, 593, 599, 616, 98, 98, +-32768,-32768,-32768,-32768, -73,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768, -61, 290, 290,-32768,-32768,-32768, +-32768,-32768,-32768,-32768, 241, 241, 241, 241, 241, 241, + 241,-32768,-32768, 4,-32768, 5, 241, -73, -73, 9, + 92, 32, 309, 10, -73, -73,-32768,-32768,-32768,-32768, +-32768, 54,-32768, -57,-32768,-32768,-32768, -20,-32768,-32768, + -73, -73,-32768, 39, -9,-32768,-32768, 40, 11,-32768, +-32768,-32768,-32768, 36, 586,-32768, 145, 151, -73, -73, +-32768,-32768, 78, 290, 79, -73, -73,-32768, -73,-32768, +-32768, -73, 16, 365, 106, 108, -73, -73,-32768,-32768, + 686,-32768, -73,-32768, 52, -73,-32768, 17,-32768, 586, + 178, 128,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, + 34,-32768,-32768,-32768,-32768, 314,-32768,-32768,-32768,-32768, +-32768,-32768,-32768, 647,-32768, -73, 95,-32768, 18,-32768, +-32768, 686,-32768, 150, 378,-32768, 112,-32768,-32768,-32768, +-32768, 123,-32768, -73, 6, 29,-32768,-32768, 241, 129, + 281,-32768, 241, 241, 241, 241, 281,-32768, 452,-32768, +-32768, 135, 200, 213, 143,-32768, -73, 479,-32768,-32768, +-32768, 182, 91, -73,-32768,-32768,-32768, 516,-32768,-32768, +-32768,-32768, 130,-32768,-32768, 147,-32768,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768, 177,-32768,-32768,-32768, 157,-32768, 65, --32768, 231, 171,-32768, 184,-32768,-32768, 566, 125, 185, - 172, 231, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 173, - 157, 157, 157, 231,-32768, 190, 98, -60,-32768,-32768, --32768,-32768, 174,-32768, 231,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768, 158,-32768,-32768,-32768, 170,-32768, 73, +-32768, 241, 154,-32768, 160,-32768,-32768, 553, 172, 168, + 161, 241, 147, 147, 147, 147, 147, 147, 147, 147, + 147, 147, 147, 147, 147, 147, 147, 147, 147, 173, + 147, 147, 147, 174, 186,-32768, 241, 187,-32768, 196, + 183, -73,-32768,-32768,-32768,-32768, 201,-32768, 241,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768, 231,-32768,-32768,-32768, -60,-32768, 65,-32768, -60, - 289, 194, -60, 197, -60,-32768,-32768, 194,-32768, -60, - -60, 231, 8, -60, -57, -60, -60, 199,-32768,-32768, - -60, -60, 171, -60, -60, 231, 291, 201, -60, -60, - 9, 202,-32768,-32768, -60, -60, -60,-32768,-32768, -60, - 231, -57, 296, -60, -60, 296, -60, -57, 296, -60, - 205, 171,-32768, 296, 296, -60,-32768, 296, 171,-32768, - 296, 231,-32768,-32768, 296,-32768,-32768, 206,-32768,-32768, - -57, 114,-32768, 321,-32768 +-32768,-32768,-32768,-32768,-32768, 241,-32768,-32768,-32768,-32768, +-32768, -73,-32768,-32768, 73,-32768, -73, 293, 202, -73, + 203, -73,-32768,-32768, 202,-32768, -73, -73, 241, 22, + -73, 182, -73, -73, 205,-32768,-32768, -73, -73, 154, + -73, -73, 241, 297, 26, -73, -73, 27, 208,-32768, +-32768,-32768, -73, -73, -73,-32768,-32768, -73, 241, 182, + 251, -73, -73, 251, -73, 182, 251, -73, 230, 154, +-32768, 251, 251, -73,-32768, 251, 154,-32768, 251, 241, +-32768,-32768, 251,-32768,-32768, 236,-32768,-32768, 182, -11, +-32768, 332,-32768 }; static const short yypgoto[] = {-32768, --32768,-32768,-32768,-32768,-32768,-32768, -211,-32768,-32768,-32768, --32768,-32768,-32768, 232, -219,-32768, -254,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768, -220,-32768,-32768,-32768, +-32768,-32768,-32768, 248, -222,-32768, -262,-32768,-32768,-32768, -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 298, - -285, 176, -85,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768, 88,-32768, 126, 94,-32768, -171,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 289, + 30, 159, -44,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768, 117,-32768, 163, 140,-32768, -171,-32768,-32768, -32768, -141,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, --32768,-32768,-32768,-32768, -22, 215, 46, 158, 493, 452, - -325, -312, -261, 11, -3, -2,-32768, -110,-32768 +-32768,-32768,-32768,-32768, -22,-32768,-32768, 486, -24, 55, + 480, 316, -304, -315, -261, 8, -3, -2,-32768, -122, +-32768 }; -#define YYLAST 720 +#define YYLAST 708 static const short yytable[] = { 31, - 162, 48, 283, 163, 165, 34, 35, 217, 248, 263, - 419, 419, 198, 286, 255, 148, 149, 365, 284, 253, - 342, 330, 237, 298, 331, 57, 58, 59, 225, 226, - 227, 228, 229, 230, 60, 169, 279, 70, 474, 332, - 267, 61, 364, 199, 338, 247, 96, 97, 98, 99, - 100, 101, 102, 103, 399, 186, 67, 68, 69, 106, + 162, 48, 283, 148, 149, 34, 35, 163, 165, 284, + 253, 255, 173, 186, 369, 298, 88, 89, 217, 248, + 263, 60, 192, 169, 426, 57, 58, 59, 426, 426, + 482, 267, 286, 279, 147, 181, 338, 193, 61, 225, + 226, 227, 228, 229, 230, 247, 96, 97, 98, 99, + 100, 101, 102, 103, 237, 406, 174, 191, 175, 106, 107, 108, 109, 110, 111, 112, 113, 115, 116, 117, - 238, 239, 240, 241, 242, 243, 262, 71, 72, 73, - 166, 27, 6, 210, 285, 406, 88, 89, 28, 423, - 201, 282, 29, 8, 147, 173, 30, 9, 177, 60, - 60, 60, 60, 438, 60, 261, 74, 75, 76, 77, - 78, 79, 80, 181, 244, 142, 452, 252, 280, 187, - 188, 202, 459, 281, 300, 145, 194, 191, 370, 339, - 200, 155, 156, 157, 158, 159, 160, 161, 192, 174, - 164, 175, 178, 170, 179, 472, 331, 203, 204, 178, - 185, 179, 205, 193, 209, 71, 72, 73, 171, 172, - 211, 332, 174, 206, 175, 189, 190, 178, 178, 179, - 179, 134, 178, 443, 179, 446, 398, 221, 449, 331, - 6, 196, 197, 455, 74, 75, 76, 77, 78, 79, - 80, 8, 119, 120, 332, 9, 86, 87, 367, 207, - 208, 220, 92, 5, 6, 222, 212, 213, 60, 214, - 473, 118, 216, 218, 250, 8, 251, 223, 224, 9, - 290, 301, 303, 235, 302, 335, 246, 340, 249, 135, - 136, 137, 138, 139, 140, 141, 341, 36, 64, 65, - 66, 67, 68, 69, 37, 38, 39, 40, 291, 125, - 83, 71, 72, 73, 297, 367, 360, 90, 91, 264, - 93, 130, 95, 368, 371, 289, 372, 392, 401, 293, - 294, 295, 296, 41, 42, 131, 287, 427, 43, 44, - 74, 75, 76, 77, 78, 79, 80, 397, 409, 45, - 46, 412, 47, 426, 433, 434, 441, 304, 419, 462, - 470, 71, 72, 73, 336, 74, 75, 76, 77, 78, - 79, 80, 27, 5, 6, 71, 72, 73, 127, 28, - 475, 133, 414, 29, 257, 8, 3, 30, 366, 9, - 74, 75, 76, 77, 78, 79, 80, 258, 373, 236, - 0, 0, 4, 0, 74, 75, 76, 77, 78, 79, - 80, 0, 0, 238, 239, 240, 241, 242, 243, 0, - 396, 71, 72, 73, 5, 6, 0, 7, 408, 0, - 27, 403, 0, 0, 0, 0, 8, 28, 400, 0, - 9, 29, 0, 402, 0, 30, 0, 0, 404, 0, - 74, 75, 76, 77, 78, 79, 80, 244, 62, 63, - 64, 65, 66, 67, 68, 69, 405, 0, 418, 0, - 407, 82, 0, 411, 0, 413, 0, 0, 27, 182, - 416, 417, 432, 421, 422, 28, 424, 425, 0, 29, - 0, 428, 429, 30, 430, 431, 0, 451, 0, 436, - 437, 0, 0, 0, 0, 444, 445, 447, 268, 0, - 450, 0, 0, 0, 454, 456, 278, 458, 468, 0, - 461, 269, 270, 271, 272, 299, 465, 0, 0, 269, - 270, 271, 272, 65, 66, 67, 68, 69, 269, 270, - 271, 272, 0, 0, 0, 0, 273, 0, 274, 275, - 276, 277, 0, 0, 273, 305, 274, 275, 276, 277, - 0, 306, 0, 273, 0, 274, 275, 276, 277, 0, - 0, 307, 308, 309, 310, 311, 312, 313, 314, 315, - 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 337, 328, 0, 0, 124, 0, 306, 128, - 129, 0, 0, 132, 0, 0, 143, 0, 307, 308, + 200, 210, 36, 371, 194, 285, 262, 187, 188, 37, + 38, 39, 40, 60, 166, 27, 6, 198, 201, 413, + 203, 282, 28, 86, 87, 177, 29, 8, 261, 92, + 30, 9, 238, 239, 240, 241, 242, 243, 41, 42, + 60, 60, 60, 43, 44, 280, 60, 430, 199, 202, + 441, 446, 145, 60, 45, 46, 281, 47, 252, 339, + 204, 155, 156, 157, 158, 159, 160, 161, 300, 178, + 164, 179, 178, 170, 179, 460, 244, 205, 5, 6, + 185, 467, 268, 206, 331, 171, 172, 209, 142, 174, + 8, 175, 189, 190, 9, 269, 270, 271, 272, 332, + 178, 70, 179, 211, 480, 374, 221, 222, 196, 197, + 250, 451, 178, 454, 179, 335, 457, 67, 68, 69, + 273, 463, 274, 275, 276, 277, 207, 208, 71, 72, + 73, 220, 301, 212, 213, 368, 214, 251, 290, 216, + 218, 71, 72, 73, 223, 224, 302, 118, 481, 178, + 235, 179, 303, 246, 340, 249, 341, 74, 75, 76, + 77, 78, 79, 80, 130, 119, 120, 360, 371, 372, + 74, 75, 76, 77, 78, 79, 80, 375, 291, 364, + 365, 6, 134, 426, 297, 376, 264, 71, 72, 73, + 330, 405, 8, 331, 331, 289, 9, 396, 400, 293, + 294, 295, 296, 287, 71, 72, 73, 131, 332, 332, + 401, 403, 3, 125, 434, 133, 74, 75, 76, 77, + 78, 79, 80, 404, 304, 408, 416, 419, 4, 433, + 440, 336, 449, 74, 75, 76, 77, 78, 79, 80, + 135, 136, 137, 138, 139, 140, 141, 71, 72, 73, + 5, 6, 27, 7, 470, 71, 72, 73, 370, 28, + 478, 483, 8, 29, 127, 342, 9, 30, 377, 74, + 75, 76, 77, 78, 79, 80, 74, 75, 76, 77, + 78, 79, 80, 257, 74, 75, 76, 77, 78, 79, + 80, 5, 6, 402, 238, 239, 240, 241, 242, 243, + 421, 6, 415, 8, 27, 410, 236, 9, 0, 407, + 278, 28, 8, 258, 409, 29, 9, 0, 0, 30, + 27, 182, 411, 269, 270, 271, 272, 28, 0, 0, + 124, 29, 0, 128, 129, 30, 0, 132, 244, 412, + 143, 0, 0, 0, 414, 425, 0, 418, 273, 420, + 274, 275, 276, 277, 423, 424, 0, 428, 429, 439, + 431, 432, 0, 0, 0, 435, 436, 0, 437, 438, + 0, 0, 0, 444, 445, 459, 27, 219, 0, 0, + 452, 453, 455, 28, 299, 458, 0, 29, 0, 462, + 464, 30, 466, 0, 0, 469, 476, 269, 270, 271, + 272, 473, 62, 63, 64, 65, 66, 67, 68, 69, + 0, 0, 305, 0, 0, 82, 0, 0, 306, 0, + 0, 0, 273, 0, 274, 275, 276, 277, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 327, 369, - 328, 0, 0, 0, 0, 306, 121, 123, 121, 121, - 123, 123, 0, 0, 121, 307, 308, 309, 310, 311, + 319, 320, 321, 322, 323, 324, 325, 326, 327, 337, + 328, 83, 0, 0, 0, 306, 0, 0, 90, 91, + 0, 93, 0, 95, 0, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 327, 439, 328, 27, 219, - 0, 0, 0, 0, 0, 28, 0, 0, 453, 29, - 0, 457, 0, 30, 460, 0, 0, 0, 0, 463, - 464, 0, 0, 466, 0, 0, 467, 0, 0, 0, - 469, 376, 377, 378, 379, 380, 381, 382, 383, 384, - 385, 386, 387, 388, 389, 390, 391, 0, 393, 394, - 395, 62, 63, 64, 65, 66, 67, 68, 69, 0, - 0, 0, 0, 0, 104, 74, 75, 76, 77, 78, - 79, 80, 0, 119, 120, 49, 50, 51, 52, 53, - 54, 55, 56, 62, 63, 64, 65, 66, 67, 68, - 69, 63, 64, 65, 66, 67, 68, 69, 225, 226, - 227, 228, 229, 230, 238, 239, 240, 241, 242, 243 + 322, 323, 324, 325, 326, 327, 373, 328, 0, 0, + 0, 0, 306, 121, 123, 121, 121, 123, 123, 0, + 0, 121, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 442, 328, 0, 447, 62, 63, 64, + 65, 66, 67, 68, 69, 0, 0, 0, 0, 461, + 104, 0, 465, 0, 0, 468, 0, 0, 0, 0, + 471, 472, 0, 0, 474, 0, 0, 475, 0, 0, + 0, 477, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 391, 392, 393, 394, 395, 0, 397, + 398, 399, 74, 75, 76, 77, 78, 79, 80, 0, + 119, 120, 49, 50, 51, 52, 53, 54, 55, 56, + 62, 63, 64, 65, 66, 67, 68, 69, 63, 64, + 65, 66, 67, 68, 69, 64, 65, 66, 67, 68, + 69, 225, 226, 227, 228, 229, 230, 238, 239, 240, + 241, 242, 243, 65, 66, 67, 68, 69 }; static const short yycheck[] = { 3, - 142, 24, 264, 4, 4, 8, 9, 3, 3, 3, - 3, 3, 49, 4, 234, 126, 127, 330, 4, 231, - 306, 79, 3, 278, 82, 28, 29, 30, 6, 7, - 8, 9, 10, 11, 95, 146, 256, 3, 0, 97, - 252, 31, 328, 80, 299, 217, 49, 50, 51, 52, - 53, 54, 55, 56, 367, 4, 90, 91, 92, 62, + 142, 24, 264, 126, 127, 8, 9, 4, 4, 4, + 231, 234, 4, 4, 330, 278, 41, 42, 3, 3, + 3, 95, 80, 146, 3, 28, 29, 30, 3, 3, + 0, 252, 4, 256, 96, 4, 299, 95, 31, 6, + 7, 8, 9, 10, 11, 217, 49, 50, 51, 52, + 53, 54, 55, 56, 3, 371, 48, 4, 50, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, - 51, 52, 53, 54, 55, 56, 248, 43, 44, 45, - 80, 82, 82, 194, 70, 398, 41, 42, 89, 415, - 49, 263, 93, 93, 96, 4, 97, 97, 4, 95, - 95, 95, 95, 95, 95, 4, 72, 73, 74, 75, - 76, 77, 78, 4, 95, 3, 442, 95, 4, 68, - 69, 80, 448, 4, 4, 115, 95, 4, 4, 301, - 80, 135, 136, 137, 138, 139, 140, 141, 80, 48, - 144, 50, 48, 147, 50, 471, 82, 80, 95, 48, - 153, 50, 3, 95, 80, 43, 44, 45, 148, 149, - 95, 97, 48, 3, 50, 155, 156, 48, 48, 50, - 50, 3, 48, 435, 50, 437, 79, 71, 440, 82, - 82, 171, 172, 445, 72, 73, 74, 75, 76, 77, - 78, 93, 80, 81, 97, 97, 39, 40, 85, 189, - 190, 204, 45, 81, 82, 70, 196, 197, 95, 199, - 472, 3, 202, 203, 3, 93, 80, 207, 208, 97, - 80, 3, 80, 213, 4, 95, 216, 95, 218, 61, - 62, 63, 64, 65, 66, 67, 80, 5, 87, 88, - 89, 90, 91, 92, 12, 13, 14, 15, 271, 16, - 36, 43, 44, 45, 277, 85, 80, 43, 44, 249, - 46, 3, 48, 80, 80, 269, 95, 95, 95, 273, - 274, 275, 276, 41, 42, 3, 266, 419, 46, 47, - 72, 73, 74, 75, 76, 77, 78, 98, 95, 57, - 58, 95, 60, 95, 4, 95, 95, 287, 3, 95, - 95, 43, 44, 45, 294, 72, 73, 74, 75, 76, - 77, 78, 82, 81, 82, 43, 44, 45, 87, 89, - 0, 3, 408, 93, 237, 93, 43, 97, 332, 97, - 72, 73, 74, 75, 76, 77, 78, 244, 342, 214, - -1, -1, 59, -1, 72, 73, 74, 75, 76, 77, - 78, -1, -1, 51, 52, 53, 54, 55, 56, -1, - 364, 43, 44, 45, 81, 82, -1, 84, 80, -1, - 82, 375, -1, -1, -1, -1, 93, 89, 368, -1, - 97, 93, -1, 373, -1, 97, -1, -1, 392, -1, - 72, 73, 74, 75, 76, 77, 78, 95, 85, 86, - 87, 88, 89, 90, 91, 92, 396, -1, 412, -1, - 400, 98, -1, 403, -1, 405, -1, -1, 82, 83, - 410, 411, 426, 413, 414, 89, 416, 417, -1, 93, - -1, 421, 422, 97, 424, 425, -1, 441, -1, 429, - 430, -1, -1, -1, -1, 435, 436, 437, 3, -1, - 440, -1, -1, -1, 444, 445, 3, 447, 462, -1, - 450, 16, 17, 18, 19, 3, 456, -1, -1, 16, - 17, 18, 19, 88, 89, 90, 91, 92, 16, 17, - 18, 19, -1, -1, -1, -1, 41, -1, 43, 44, - 45, 46, -1, -1, 41, 4, 43, 44, 45, 46, - -1, 10, -1, 41, -1, 43, 44, 45, 46, -1, - -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 4, 42, -1, -1, 85, -1, 10, 88, - 89, -1, -1, 92, -1, -1, 95, -1, 20, 21, + 80, 194, 5, 85, 95, 70, 248, 68, 69, 12, + 13, 14, 15, 95, 80, 82, 82, 49, 49, 405, + 80, 263, 89, 39, 40, 4, 93, 93, 4, 45, + 97, 97, 51, 52, 53, 54, 55, 56, 41, 42, + 95, 95, 95, 46, 47, 4, 95, 422, 80, 80, + 95, 95, 115, 95, 57, 58, 4, 60, 95, 301, + 95, 135, 136, 137, 138, 139, 140, 141, 4, 48, + 144, 50, 48, 147, 50, 450, 95, 3, 81, 82, + 153, 456, 3, 3, 82, 148, 149, 80, 3, 48, + 93, 50, 155, 156, 97, 16, 17, 18, 19, 97, + 48, 3, 50, 95, 479, 4, 71, 70, 171, 172, + 3, 443, 48, 445, 50, 95, 448, 90, 91, 92, + 41, 453, 43, 44, 45, 46, 189, 190, 43, 44, + 45, 204, 3, 196, 197, 328, 199, 80, 80, 202, + 203, 43, 44, 45, 207, 208, 4, 3, 480, 48, + 213, 50, 80, 216, 95, 218, 80, 72, 73, 74, + 75, 76, 77, 78, 3, 80, 81, 80, 85, 80, + 72, 73, 74, 75, 76, 77, 78, 80, 271, 80, + 81, 82, 3, 3, 277, 95, 249, 43, 44, 45, + 79, 79, 93, 82, 82, 269, 97, 95, 95, 273, + 274, 275, 276, 266, 43, 44, 45, 3, 97, 97, + 95, 95, 43, 16, 426, 3, 72, 73, 74, 75, + 76, 77, 78, 98, 287, 95, 95, 95, 59, 95, + 4, 294, 95, 72, 73, 74, 75, 76, 77, 78, + 61, 62, 63, 64, 65, 66, 67, 43, 44, 45, + 81, 82, 82, 84, 95, 43, 44, 45, 332, 89, + 95, 0, 93, 93, 87, 306, 97, 97, 342, 72, + 73, 74, 75, 76, 77, 78, 72, 73, 74, 75, + 76, 77, 78, 237, 72, 73, 74, 75, 76, 77, + 78, 81, 82, 367, 51, 52, 53, 54, 55, 56, + 415, 82, 80, 93, 82, 379, 214, 97, -1, 372, + 3, 89, 93, 244, 377, 93, 97, -1, -1, 97, + 82, 83, 396, 16, 17, 18, 19, 89, -1, -1, + 85, 93, -1, 88, 89, 97, -1, 92, 95, 402, + 95, -1, -1, -1, 407, 419, -1, 410, 41, 412, + 43, 44, 45, 46, 417, 418, -1, 420, 421, 433, + 423, 424, -1, -1, -1, 428, 429, -1, 431, 432, + -1, -1, -1, 436, 437, 449, 82, 83, -1, -1, + 443, 444, 445, 89, 3, 448, -1, 93, -1, 452, + 453, 97, 455, -1, -1, 458, 470, 16, 17, 18, + 19, 464, 85, 86, 87, 88, 89, 90, 91, 92, + -1, -1, 4, -1, -1, 98, -1, -1, 10, -1, + -1, -1, 41, -1, 43, 44, 45, 46, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 4, - 42, -1, -1, -1, -1, 10, 84, 85, 86, 87, - 88, 89, -1, -1, 92, 20, 21, 22, 23, 24, + 42, 36, -1, -1, -1, 10, -1, -1, 43, 44, + -1, 46, -1, 48, -1, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 431, 42, 82, 83, - -1, -1, -1, -1, -1, 89, -1, -1, 443, 93, - -1, 446, -1, 97, 449, -1, -1, -1, -1, 454, - 455, -1, -1, 458, -1, -1, 461, -1, -1, -1, - 465, 344, 345, 346, 347, 348, 349, 350, 351, 352, - 353, 354, 355, 356, 357, 358, 359, -1, 361, 362, - 363, 85, 86, 87, 88, 89, 90, 91, 92, -1, - -1, -1, -1, -1, 98, 72, 73, 74, 75, 76, - 77, 78, -1, 80, 81, 85, 86, 87, 88, 89, - 90, 91, 92, 85, 86, 87, 88, 89, 90, 91, - 92, 86, 87, 88, 89, 90, 91, 92, 6, 7, - 8, 9, 10, 11, 51, 52, 53, 54, 55, 56 + 35, 36, 37, 38, 39, 40, 4, 42, -1, -1, + -1, -1, 10, 84, 85, 86, 87, 88, 89, -1, + -1, 92, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 435, 42, -1, 438, 85, 86, 87, + 88, 89, 90, 91, 92, -1, -1, -1, -1, 451, + 98, -1, 454, -1, -1, 457, -1, -1, -1, -1, + 462, 463, -1, -1, 466, -1, -1, 469, -1, -1, + -1, 473, 344, 345, 346, 347, 348, 349, 350, 351, + 352, 353, 354, 355, 356, 357, 358, 359, -1, 361, + 362, 363, 72, 73, 74, 75, 76, 77, 78, -1, + 80, 81, 85, 86, 87, 88, 89, 90, 91, 92, + 85, 86, 87, 88, 89, 90, 91, 92, 86, 87, + 88, 89, 90, 91, 92, 87, 88, 89, 90, 91, + 92, 6, 7, 8, 9, 10, 11, 51, 52, 53, + 54, 55, 56, 88, 89, 90, 91, 92 }; /* -*-C-*- Note some compilers choke on comments on `#line' lines. */ #line 3 "/usr/share/misc/bison.simple" @@ -1837,50 +1846,41 @@ case 83: case 84: #line 640 "rcparse.y" { - yyval.dialog_control = define_control (yyvsp[-4].s, yyvsp[-3].il, yyvsp[-2].il, yyvsp[-1].il, 0, 0, CTL_STATIC, - SS_ICON | WS_CHILD | WS_VISIBLE, 0); - if (yyvsp[0].rcdata_item != NULL) - { - if (dialog.ex == NULL) - rcparse_warning (_("control data requires DIALOGEX")); - yyval.dialog_control->data = yyvsp[0].rcdata_item; - } - ; + yyval.dialog_control = define_icon_control (yyvsp[-4].id, yyvsp[-3].il, yyvsp[-2].il, yyvsp[-1].il, 0, 0, 0, yyvsp[0].rcdata_item, + dialog.ex); + ; break;} case 85: -#line 652 "rcparse.y" +#line 646 "rcparse.y" { - yyval.dialog_control = define_control (yyvsp[-8].s, yyvsp[-7].il, yyvsp[-6].il, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, CTL_STATIC, - style, yyvsp[-1].il); - if (yyvsp[0].rcdata_item != NULL) - { - if (dialog.ex == NULL) - rcparse_warning (_("control data requires DIALOGEX")); - yyval.dialog_control->data = yyvsp[0].rcdata_item; - } - ; + yyval.dialog_control = define_icon_control (yyvsp[-6].id, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, 0, 0, 0, yyvsp[0].rcdata_item, + dialog.ex); + ; break;} case 86: -#line 664 "rcparse.y" +#line 652 "rcparse.y" { - yyval.dialog_control = define_control (yyvsp[-9].s, yyvsp[-8].il, yyvsp[-7].il, yyvsp[-6].il, yyvsp[-5].il, yyvsp[-4].il, CTL_STATIC, - style, yyvsp[-2].il); - if (dialog.ex == NULL) - rcparse_warning (_("help ID requires DIALOGEX")); - yyval.dialog_control->help = yyvsp[-1].il; - yyval.dialog_control->data = yyvsp[0].rcdata_item; - ; + yyval.dialog_control = define_icon_control (yyvsp[-8].id, yyvsp[-7].il, yyvsp[-6].il, yyvsp[-5].il, style, yyvsp[-1].il, 0, yyvsp[0].rcdata_item, + dialog.ex); + ; break;} case 87: -#line 673 "rcparse.y" +#line 658 "rcparse.y" +{ + yyval.dialog_control = define_icon_control (yyvsp[-9].id, yyvsp[-8].il, yyvsp[-7].il, yyvsp[-6].il, style, yyvsp[-2].il, yyvsp[-1].il, yyvsp[0].rcdata_item, + dialog.ex); + ; + break;} +case 88: +#line 663 "rcparse.y" { default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; base_style = ES_LEFT | WS_BORDER | WS_TABSTOP; class = CTL_EDIT; ; break;} -case 88: -#line 679 "rcparse.y" +case 89: +#line 669 "rcparse.y" { yyval.dialog_control = yyvsp[0].dialog_control; if (dialog.ex == NULL) @@ -1888,131 +1888,131 @@ case 88: res_string_to_id (&yyval.dialog_control->class, "IEDIT"); ; break;} -case 89: -#line 686 "rcparse.y" +case 90: +#line 676 "rcparse.y" { default_style = LBS_NOTIFY | WS_BORDER; base_style = LBS_NOTIFY | WS_BORDER; class = CTL_LISTBOX; ; break;} -case 90: -#line 692 "rcparse.y" +case 91: +#line 682 "rcparse.y" { yyval.dialog_control = yyvsp[0].dialog_control; ; break;} -case 91: -#line 696 "rcparse.y" +case 92: +#line 686 "rcparse.y" { default_style = SS_LEFT | WS_GROUP; base_style = SS_LEFT; class = CTL_STATIC; ; break;} -case 92: -#line 702 "rcparse.y" +case 93: +#line 692 "rcparse.y" { yyval.dialog_control = yyvsp[0].dialog_control; ; break;} -case 93: -#line 706 "rcparse.y" +case 94: +#line 696 "rcparse.y" { default_style = BS_PUSHBOX | WS_TABSTOP; base_style = BS_PUSHBOX; class = CTL_BUTTON; ; break;} -case 94: -#line 712 "rcparse.y" +case 95: +#line 702 "rcparse.y" { yyval.dialog_control = yyvsp[0].dialog_control; ; break;} -case 95: -#line 716 "rcparse.y" +case 96: +#line 706 "rcparse.y" { default_style = BS_PUSHBUTTON | WS_TABSTOP; base_style = BS_PUSHBUTTON | WS_TABSTOP; class = CTL_BUTTON; ; break;} -case 96: -#line 722 "rcparse.y" +case 97: +#line 712 "rcparse.y" { yyval.dialog_control = yyvsp[0].dialog_control; ; break;} -case 97: -#line 726 "rcparse.y" +case 98: +#line 716 "rcparse.y" { default_style = BS_RADIOBUTTON | WS_TABSTOP; base_style = BS_RADIOBUTTON; class = CTL_BUTTON; ; break;} -case 98: -#line 732 "rcparse.y" +case 99: +#line 722 "rcparse.y" { yyval.dialog_control = yyvsp[0].dialog_control; ; break;} -case 99: -#line 736 "rcparse.y" +case 100: +#line 726 "rcparse.y" { default_style = SS_RIGHT | WS_GROUP; base_style = SS_RIGHT; class = CTL_STATIC; ; break;} -case 100: -#line 742 "rcparse.y" +case 101: +#line 732 "rcparse.y" { yyval.dialog_control = yyvsp[0].dialog_control; ; break;} -case 101: -#line 746 "rcparse.y" +case 102: +#line 736 "rcparse.y" { default_style = SBS_HORZ; base_style = 0; class = CTL_SCROLLBAR; ; break;} -case 102: -#line 752 "rcparse.y" +case 103: +#line 742 "rcparse.y" { yyval.dialog_control = yyvsp[0].dialog_control; ; break;} -case 103: -#line 756 "rcparse.y" +case 104: +#line 746 "rcparse.y" { default_style = BS_3STATE | WS_TABSTOP; base_style = BS_3STATE; class = CTL_BUTTON; ; break;} -case 104: -#line 762 "rcparse.y" +case 105: +#line 752 "rcparse.y" { yyval.dialog_control = yyvsp[0].dialog_control; ; break;} -case 105: -#line 767 "rcparse.y" +case 106: +#line 757 "rcparse.y" { style = WS_CHILD | WS_VISIBLE; ; break;} -case 106: -#line 769 "rcparse.y" +case 107: +#line 759 "rcparse.y" { yyval.dialog_control = define_control (yyvsp[-14].s, yyvsp[-12].il, yyvsp[-10].il, yyvsp[-8].il, yyvsp[-6].il, yyvsp[-4].il, CTL_BUTTON, style, yyvsp[0].il); ; break;} -case 107: -#line 785 "rcparse.y" +case 108: +#line 775 "rcparse.y" { yyval.dialog_control = define_control (yyvsp[-6].s, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, yyvsp[-2].il, yyvsp[-1].il, class, default_style | WS_CHILD | WS_VISIBLE, 0); @@ -2024,8 +2024,8 @@ case 107: } ; break;} -case 108: -#line 797 "rcparse.y" +case 109: +#line 787 "rcparse.y" { yyval.dialog_control = define_control (yyvsp[-8].s, yyvsp[-7].il, yyvsp[-6].il, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, class, style, yyvsp[-1].il); if (yyvsp[0].rcdata_item != NULL) @@ -2036,8 +2036,8 @@ case 108: } ; break;} -case 109: -#line 808 "rcparse.y" +case 110: +#line 798 "rcparse.y" { yyval.dialog_control = define_control (yyvsp[-9].s, yyvsp[-8].il, yyvsp[-7].il, yyvsp[-6].il, yyvsp[-5].il, yyvsp[-4].il, class, style, yyvsp[-2].il); if (dialog.ex == NULL) @@ -2046,74 +2046,80 @@ case 109: yyval.dialog_control->data = yyvsp[0].rcdata_item; ; break;} -case 110: -#line 819 "rcparse.y" +case 111: +#line 809 "rcparse.y" { yyval.s = NULL; ; break;} -case 111: -#line 823 "rcparse.y" +case 112: +#line 813 "rcparse.y" +{ + yyval.s = yyvsp[0].s; + ; + break;} +case 113: +#line 817 "rcparse.y" { yyval.s = yyvsp[-1].s; ; break;} -case 112: -#line 830 "rcparse.y" +case 114: +#line 824 "rcparse.y" { yyval.rcdata_item = NULL; ; break;} -case 113: -#line 834 "rcparse.y" +case 115: +#line 828 "rcparse.y" { yyval.rcdata_item = yyvsp[-1].rcdata.first; ; break;} -case 114: -#line 843 "rcparse.y" +case 116: +#line 837 "rcparse.y" { style = WS_CHILD | WS_VISIBLE; ; break;} -case 116: -#line 849 "rcparse.y" +case 118: +#line 843 "rcparse.y" { style = SS_ICON | WS_CHILD | WS_VISIBLE; ; break;} -case 118: -#line 855 "rcparse.y" +case 120: +#line 849 "rcparse.y" { style = base_style | WS_CHILD | WS_VISIBLE; ; break;} -case 120: -#line 863 "rcparse.y" +case 122: +#line 857 "rcparse.y" { define_font (yyvsp[-3].id, &yyvsp[-1].res_info, yyvsp[0].s); ; break;} -case 121: -#line 872 "rcparse.y" +case 123: +#line 866 "rcparse.y" { define_icon (yyvsp[-3].id, &yyvsp[-1].res_info, yyvsp[0].s); ; break;} -case 122: -#line 882 "rcparse.y" +case 124: +#line 876 "rcparse.y" { language = yyvsp[-1].il | (yyvsp[0].il << 8); ; break;} -case 123: -#line 891 "rcparse.y" +case 125: +#line 885 "rcparse.y" { define_menu (yyvsp[-5].id, &yyvsp[-3].res_info, yyvsp[-1].menuitem); ; break;} -case 124: -#line 898 "rcparse.y" +case 126: +#line 892 "rcparse.y" { yyval.menuitem = NULL; ; break;} -case 125: -#line 902 "rcparse.y" +case 127: +#line 896 "rcparse.y" { if (yyvsp[-1].menuitem == NULL) yyval.menuitem = yyvsp[0].menuitem; @@ -2128,92 +2134,92 @@ case 125: } ; break;} -case 126: -#line 919 "rcparse.y" +case 128: +#line 913 "rcparse.y" { yyval.menuitem = define_menuitem (yyvsp[-2].s, yyvsp[-1].il, yyvsp[0].is, 0, 0, NULL); ; break;} -case 127: -#line 923 "rcparse.y" +case 129: +#line 917 "rcparse.y" { yyval.menuitem = define_menuitem (NULL, 0, 0, 0, 0, NULL); ; break;} -case 128: -#line 927 "rcparse.y" +case 130: +#line 921 "rcparse.y" { yyval.menuitem = define_menuitem (yyvsp[-4].s, 0, yyvsp[-3].is, 0, 0, yyvsp[-1].menuitem); ; break;} -case 129: -#line 934 "rcparse.y" +case 131: +#line 928 "rcparse.y" { yyval.is = 0; ; break;} -case 130: -#line 938 "rcparse.y" +case 132: +#line 932 "rcparse.y" { yyval.is = yyvsp[-2].is | yyvsp[0].is; ; break;} -case 131: -#line 942 "rcparse.y" +case 133: +#line 936 "rcparse.y" { yyval.is = yyvsp[-1].is | yyvsp[0].is; ; break;} -case 132: -#line 949 "rcparse.y" +case 134: +#line 943 "rcparse.y" { yyval.is = MENUITEM_CHECKED; ; break;} -case 133: -#line 953 "rcparse.y" +case 135: +#line 947 "rcparse.y" { yyval.is = MENUITEM_GRAYED; ; break;} -case 134: -#line 957 "rcparse.y" +case 136: +#line 951 "rcparse.y" { yyval.is = MENUITEM_HELP; ; break;} -case 135: -#line 961 "rcparse.y" +case 137: +#line 955 "rcparse.y" { yyval.is = MENUITEM_INACTIVE; ; break;} -case 136: -#line 965 "rcparse.y" +case 138: +#line 959 "rcparse.y" { yyval.is = MENUITEM_MENUBARBREAK; ; break;} -case 137: -#line 969 "rcparse.y" +case 139: +#line 963 "rcparse.y" { yyval.is = MENUITEM_MENUBREAK; ; break;} -case 138: -#line 978 "rcparse.y" +case 140: +#line 972 "rcparse.y" { define_menu (yyvsp[-5].id, &yyvsp[-3].res_info, yyvsp[-1].menuitem); ; break;} -case 139: -#line 985 "rcparse.y" +case 141: +#line 979 "rcparse.y" { yyval.menuitem = NULL; ; break;} -case 140: -#line 989 "rcparse.y" +case 142: +#line 983 "rcparse.y" { if (yyvsp[-1].menuitem == NULL) yyval.menuitem = yyvsp[0].menuitem; @@ -2228,125 +2234,125 @@ case 140: } ; break;} -case 141: -#line 1006 "rcparse.y" +case 143: +#line 1000 "rcparse.y" { yyval.menuitem = define_menuitem (yyvsp[0].s, 0, 0, 0, 0, NULL); ; break;} -case 142: -#line 1010 "rcparse.y" +case 144: +#line 1004 "rcparse.y" { yyval.menuitem = define_menuitem (yyvsp[-1].s, yyvsp[0].il, 0, 0, 0, NULL); ; break;} -case 143: -#line 1014 "rcparse.y" +case 145: +#line 1008 "rcparse.y" { yyval.menuitem = define_menuitem (yyvsp[-3].s, yyvsp[-2].il, yyvsp[-1].il, yyvsp[0].il, 0, NULL); ; break;} -case 144: -#line 1018 "rcparse.y" +case 146: +#line 1012 "rcparse.y" { yyval.menuitem = define_menuitem (NULL, 0, 0, 0, 0, NULL); ; break;} -case 145: -#line 1022 "rcparse.y" +case 147: +#line 1016 "rcparse.y" { yyval.menuitem = define_menuitem (yyvsp[-3].s, 0, 0, 0, 0, yyvsp[-1].menuitem); ; break;} -case 146: -#line 1026 "rcparse.y" +case 148: +#line 1020 "rcparse.y" { yyval.menuitem = define_menuitem (yyvsp[-4].s, yyvsp[-3].il, 0, 0, 0, yyvsp[-1].menuitem); ; break;} -case 147: -#line 1030 "rcparse.y" +case 149: +#line 1024 "rcparse.y" { yyval.menuitem = define_menuitem (yyvsp[-5].s, yyvsp[-4].il, yyvsp[-3].il, 0, 0, yyvsp[-1].menuitem); ; break;} -case 148: -#line 1035 "rcparse.y" +case 150: +#line 1029 "rcparse.y" { yyval.menuitem = define_menuitem (yyvsp[-7].s, yyvsp[-6].il, yyvsp[-5].il, yyvsp[-4].il, yyvsp[-3].il, yyvsp[-1].menuitem); ; break;} -case 149: -#line 1044 "rcparse.y" +case 151: +#line 1038 "rcparse.y" { define_messagetable (yyvsp[-3].id, &yyvsp[-1].res_info, yyvsp[0].s); ; break;} -case 150: -#line 1053 "rcparse.y" +case 152: +#line 1047 "rcparse.y" { define_rcdata (yyvsp[-5].id, &yyvsp[-3].res_info, yyvsp[-1].rcdata.first); ; break;} -case 151: -#line 1062 "rcparse.y" +case 153: +#line 1056 "rcparse.y" { rcparse_rcdata (); ; break;} -case 152: -#line 1066 "rcparse.y" +case 154: +#line 1060 "rcparse.y" { rcparse_normal (); yyval.rcdata = yyvsp[0].rcdata; ; break;} -case 153: -#line 1074 "rcparse.y" +case 155: +#line 1068 "rcparse.y" { yyval.rcdata.first = NULL; yyval.rcdata.last = NULL; ; break;} -case 154: -#line 1079 "rcparse.y" +case 156: +#line 1073 "rcparse.y" { yyval.rcdata = yyvsp[0].rcdata; ; break;} -case 155: -#line 1086 "rcparse.y" -{ - struct rcdata_item *ri; - - ri = define_rcdata_string (yyvsp[0].ss.s, yyvsp[0].ss.length); - yyval.rcdata.first = ri; - yyval.rcdata.last = ri; - ; - break;} -case 156: -#line 1094 "rcparse.y" -{ - struct rcdata_item *ri; - - ri = define_rcdata_number (yyvsp[0].i.val, yyvsp[0].i.dword); - yyval.rcdata.first = ri; - yyval.rcdata.last = ri; - ; - break;} case 157: -#line 1102 "rcparse.y" +#line 1080 "rcparse.y" { struct rcdata_item *ri; ri = define_rcdata_string (yyvsp[0].ss.s, yyvsp[0].ss.length); - yyval.rcdata.first = yyvsp[-2].rcdata.first; - yyvsp[-2].rcdata.last->next = ri; + yyval.rcdata.first = ri; yyval.rcdata.last = ri; ; break;} case 158: -#line 1111 "rcparse.y" +#line 1088 "rcparse.y" +{ + struct rcdata_item *ri; + + ri = define_rcdata_number (yyvsp[0].i.val, yyvsp[0].i.dword); + yyval.rcdata.first = ri; + yyval.rcdata.last = ri; + ; + break;} +case 159: +#line 1096 "rcparse.y" +{ + struct rcdata_item *ri; + + ri = define_rcdata_string (yyvsp[0].ss.s, yyvsp[0].ss.length); + yyval.rcdata.first = yyvsp[-2].rcdata.first; + yyvsp[-2].rcdata.last->next = ri; + yyval.rcdata.last = ri; + ; + break;} +case 160: +#line 1105 "rcparse.y" { struct rcdata_item *ri; @@ -2356,150 +2362,150 @@ case 158: yyval.rcdata.last = ri; ; break;} -case 159: -#line 1125 "rcparse.y" +case 161: +#line 1119 "rcparse.y" { sub_res_info = yyvsp[-1].res_info; ; break;} -case 162: -#line 1132 "rcparse.y" +case 164: +#line 1126 "rcparse.y" { define_stringtable (&sub_res_info, yyvsp[-1].il, yyvsp[0].s); ; break;} -case 163: -#line 1136 "rcparse.y" +case 165: +#line 1130 "rcparse.y" { define_stringtable (&sub_res_info, yyvsp[-2].il, yyvsp[0].s); ; break;} -case 164: -#line 1146 "rcparse.y" +case 166: +#line 1140 "rcparse.y" { define_user_data (yyvsp[-5].id, yyvsp[-4].id, &yyvsp[-3].res_info, yyvsp[-1].rcdata.first); ; break;} -case 165: -#line 1150 "rcparse.y" +case 167: +#line 1144 "rcparse.y" { define_user_file (yyvsp[-3].id, yyvsp[-2].id, &yyvsp[-1].res_info, yyvsp[0].s); ; break;} -case 166: -#line 1159 "rcparse.y" +case 168: +#line 1153 "rcparse.y" { define_versioninfo (yyvsp[-5].id, language, yyvsp[-3].fixver, yyvsp[-1].verinfo); ; break;} -case 167: -#line 1166 "rcparse.y" +case 169: +#line 1160 "rcparse.y" { yyval.fixver = ((struct fixed_versioninfo *) res_alloc (sizeof (struct fixed_versioninfo))); memset (yyval.fixver, 0, sizeof (struct fixed_versioninfo)); ; break;} -case 168: -#line 1172 "rcparse.y" +case 170: +#line 1166 "rcparse.y" { yyvsp[-5].fixver->file_version_ms = (yyvsp[-3].il << 16) | yyvsp[-2].il; yyvsp[-5].fixver->file_version_ls = (yyvsp[-1].il << 16) | yyvsp[0].il; yyval.fixver = yyvsp[-5].fixver; ; break;} -case 169: -#line 1178 "rcparse.y" +case 171: +#line 1172 "rcparse.y" { yyvsp[-5].fixver->product_version_ms = (yyvsp[-3].il << 16) | yyvsp[-2].il; yyvsp[-5].fixver->product_version_ls = (yyvsp[-1].il << 16) | yyvsp[0].il; yyval.fixver = yyvsp[-5].fixver; ; break;} -case 170: -#line 1184 "rcparse.y" +case 172: +#line 1178 "rcparse.y" { yyvsp[-2].fixver->file_flags_mask = yyvsp[0].il; yyval.fixver = yyvsp[-2].fixver; ; break;} -case 171: -#line 1189 "rcparse.y" +case 173: +#line 1183 "rcparse.y" { yyvsp[-2].fixver->file_flags = yyvsp[0].il; yyval.fixver = yyvsp[-2].fixver; ; break;} -case 172: -#line 1194 "rcparse.y" +case 174: +#line 1188 "rcparse.y" { yyvsp[-2].fixver->file_os = yyvsp[0].il; yyval.fixver = yyvsp[-2].fixver; ; break;} -case 173: -#line 1199 "rcparse.y" +case 175: +#line 1193 "rcparse.y" { yyvsp[-2].fixver->file_type = yyvsp[0].il; yyval.fixver = yyvsp[-2].fixver; ; break;} -case 174: -#line 1204 "rcparse.y" +case 176: +#line 1198 "rcparse.y" { yyvsp[-2].fixver->file_subtype = yyvsp[0].il; yyval.fixver = yyvsp[-2].fixver; ; break;} -case 175: -#line 1218 "rcparse.y" +case 177: +#line 1212 "rcparse.y" { yyval.verinfo = NULL; ; break;} -case 176: -#line 1222 "rcparse.y" +case 178: +#line 1216 "rcparse.y" { yyval.verinfo = append_ver_stringfileinfo (yyvsp[-7].verinfo, yyvsp[-4].s, yyvsp[-2].verstring); ; break;} -case 177: -#line 1226 "rcparse.y" +case 179: +#line 1220 "rcparse.y" { yyval.verinfo = append_ver_varfileinfo (yyvsp[-6].verinfo, yyvsp[-2].s, yyvsp[-1].vervar); ; break;} -case 178: -#line 1233 "rcparse.y" +case 180: +#line 1227 "rcparse.y" { yyval.verstring = NULL; ; break;} -case 179: -#line 1237 "rcparse.y" +case 181: +#line 1231 "rcparse.y" { yyval.verstring = append_verval (yyvsp[-4].verstring, yyvsp[-2].s, yyvsp[0].s); ; break;} -case 180: -#line 1244 "rcparse.y" +case 182: +#line 1238 "rcparse.y" { yyval.vervar = NULL; ; break;} -case 181: -#line 1248 "rcparse.y" +case 183: +#line 1242 "rcparse.y" { yyval.vervar = append_vertrans (yyvsp[-2].vervar, yyvsp[-1].il, yyvsp[0].il); ; break;} -case 182: -#line 1257 "rcparse.y" +case 184: +#line 1251 "rcparse.y" { yyval.id.named = 0; yyval.id.u.id = yyvsp[0].il; ; break;} -case 183: -#line 1262 "rcparse.y" +case 185: +#line 1256 "rcparse.y" { char *copy, *s; @@ -2512,8 +2518,47 @@ case 183: free (copy); ; break;} -case 184: -#line 1280 "rcparse.y" +case 186: +#line 1273 "rcparse.y" +{ + yyval.s = yyvsp[0].s; + ; + break;} +case 187: +#line 1277 "rcparse.y" +{ + yyval.s = yyvsp[-1].s; + ; + break;} +case 188: +#line 1281 "rcparse.y" +{ + yyval.s = yyvsp[-1].s; + ; + break;} +case 189: +#line 1289 "rcparse.y" +{ + yyval.id.named = 0; + yyval.id.u.id = yyvsp[-1].il; + ; + break;} +case 190: +#line 1294 "rcparse.y" +{ + char *copy, *s; + + /* It seems that resource ID's are forced to upper case. */ + copy = xstrdup (yyvsp[0].s); + for (s = copy; *s != '\0'; s++) + if (islower ((unsigned char) *s)) + *s = toupper ((unsigned char) *s); + res_string_to_id (&yyval.id, copy); + free (copy); + ; + break;} +case 191: +#line 1312 "rcparse.y" { memset (&yyval.res_info, 0, sizeof (struct res_res_info)); yyval.res_info.language = language; @@ -2521,44 +2566,7 @@ case 184: yyval.res_info.memflags = MEMFLAG_MOVEABLE; ; break;} -case 185: -#line 1287 "rcparse.y" -{ - yyval.res_info = yyvsp[-1].res_info; - yyval.res_info.memflags |= yyvsp[0].memflags.on; - yyval.res_info.memflags &=~ yyvsp[0].memflags.off; - ; - break;} -case 186: -#line 1293 "rcparse.y" -{ - yyval.res_info = yyvsp[-2].res_info; - yyval.res_info.characteristics = yyvsp[0].il; - ; - break;} -case 187: -#line 1298 "rcparse.y" -{ - yyval.res_info = yyvsp[-3].res_info; - yyval.res_info.language = yyvsp[-1].il | (yyvsp[0].il << 8); - ; - break;} -case 188: -#line 1303 "rcparse.y" -{ - yyval.res_info = yyvsp[-2].res_info; - yyval.res_info.version = yyvsp[0].il; - ; - break;} -case 189: -#line 1313 "rcparse.y" -{ - memset (&yyval.res_info, 0, sizeof (struct res_res_info)); - yyval.res_info.language = language; - yyval.res_info.memflags = MEMFLAG_MOVEABLE | MEMFLAG_DISCARDABLE; - ; - break;} -case 190: +case 192: #line 1319 "rcparse.y" { yyval.res_info = yyvsp[-1].res_info; @@ -2566,307 +2574,344 @@ case 190: yyval.res_info.memflags &=~ yyvsp[0].memflags.off; ; break;} -case 191: +case 193: +#line 1325 "rcparse.y" +{ + yyval.res_info = yyvsp[-2].res_info; + yyval.res_info.characteristics = yyvsp[0].il; + ; + break;} +case 194: #line 1330 "rcparse.y" +{ + yyval.res_info = yyvsp[-3].res_info; + yyval.res_info.language = yyvsp[-1].il | (yyvsp[0].il << 8); + ; + break;} +case 195: +#line 1335 "rcparse.y" +{ + yyval.res_info = yyvsp[-2].res_info; + yyval.res_info.version = yyvsp[0].il; + ; + break;} +case 196: +#line 1345 "rcparse.y" { memset (&yyval.res_info, 0, sizeof (struct res_res_info)); yyval.res_info.language = language; - yyval.res_info.memflags = MEMFLAG_MOVEABLE; + yyval.res_info.memflags = MEMFLAG_MOVEABLE | MEMFLAG_DISCARDABLE; ; break;} -case 192: -#line 1336 "rcparse.y" +case 197: +#line 1351 "rcparse.y" { yyval.res_info = yyvsp[-1].res_info; yyval.res_info.memflags |= yyvsp[0].memflags.on; yyval.res_info.memflags &=~ yyvsp[0].memflags.off; ; break;} -case 193: -#line 1348 "rcparse.y" +case 198: +#line 1362 "rcparse.y" +{ + memset (&yyval.res_info, 0, sizeof (struct res_res_info)); + yyval.res_info.language = language; + yyval.res_info.memflags = MEMFLAG_MOVEABLE; + ; + break;} +case 199: +#line 1368 "rcparse.y" +{ + yyval.res_info = yyvsp[-1].res_info; + yyval.res_info.memflags |= yyvsp[0].memflags.on; + yyval.res_info.memflags &=~ yyvsp[0].memflags.off; + ; + break;} +case 200: +#line 1380 "rcparse.y" { yyval.memflags.on = MEMFLAG_MOVEABLE; yyval.memflags.off = 0; ; break;} -case 194: -#line 1353 "rcparse.y" +case 201: +#line 1385 "rcparse.y" { yyval.memflags.on = 0; yyval.memflags.off = MEMFLAG_MOVEABLE; ; break;} -case 195: -#line 1358 "rcparse.y" +case 202: +#line 1390 "rcparse.y" { yyval.memflags.on = MEMFLAG_PURE; yyval.memflags.off = 0; ; break;} -case 196: -#line 1363 "rcparse.y" +case 203: +#line 1395 "rcparse.y" { yyval.memflags.on = 0; yyval.memflags.off = MEMFLAG_PURE; ; break;} -case 197: -#line 1368 "rcparse.y" +case 204: +#line 1400 "rcparse.y" { yyval.memflags.on = MEMFLAG_PRELOAD; yyval.memflags.off = 0; ; break;} -case 198: -#line 1373 "rcparse.y" +case 205: +#line 1405 "rcparse.y" { yyval.memflags.on = 0; yyval.memflags.off = MEMFLAG_PRELOAD; ; break;} -case 199: -#line 1378 "rcparse.y" +case 206: +#line 1410 "rcparse.y" { yyval.memflags.on = MEMFLAG_DISCARDABLE; yyval.memflags.off = 0; ; break;} -case 200: -#line 1388 "rcparse.y" +case 207: +#line 1420 "rcparse.y" { yyval.s = yyvsp[0].s; ; break;} -case 201: -#line 1392 "rcparse.y" +case 208: +#line 1424 "rcparse.y" { yyval.s = yyvsp[0].s; ; break;} -case 202: -#line 1409 "rcparse.y" +case 209: +#line 1441 "rcparse.y" { style |= yyvsp[0].il; ; break;} -case 203: -#line 1413 "rcparse.y" +case 210: +#line 1445 "rcparse.y" { style &=~ yyvsp[0].il; ; break;} -case 204: -#line 1417 "rcparse.y" +case 211: +#line 1449 "rcparse.y" { style |= yyvsp[0].il; ; break;} -case 205: -#line 1421 "rcparse.y" +case 212: +#line 1453 "rcparse.y" { style &=~ yyvsp[0].il; ; break;} -case 206: -#line 1428 "rcparse.y" +case 213: +#line 1460 "rcparse.y" { yyval.il = yyvsp[0].i.val; ; break;} -case 207: -#line 1432 "rcparse.y" +case 214: +#line 1464 "rcparse.y" { yyval.il = yyvsp[-1].il; ; break;} -case 208: -#line 1441 "rcparse.y" +case 215: +#line 1473 "rcparse.y" { yyval.il = 0; ; break;} -case 209: -#line 1445 "rcparse.y" +case 216: +#line 1477 "rcparse.y" { yyval.il = yyvsp[0].il; ; break;} -case 210: -#line 1454 "rcparse.y" +case 217: +#line 1486 "rcparse.y" { yyval.il = yyvsp[0].il; ; break;} -case 211: -#line 1463 "rcparse.y" +case 218: +#line 1495 "rcparse.y" { yyval.il = yyvsp[0].i.val; ; break;} -case 212: -#line 1472 "rcparse.y" +case 219: +#line 1504 "rcparse.y" { yyval.i = yyvsp[0].i; ; break;} -case 213: -#line 1476 "rcparse.y" +case 220: +#line 1508 "rcparse.y" { yyval.i = yyvsp[-1].i; ; break;} -case 214: -#line 1480 "rcparse.y" +case 221: +#line 1512 "rcparse.y" { yyval.i.val = ~ yyvsp[0].i.val; yyval.i.dword = yyvsp[0].i.dword; ; break;} -case 215: -#line 1485 "rcparse.y" +case 222: +#line 1517 "rcparse.y" { yyval.i.val = - yyvsp[0].i.val; yyval.i.dword = yyvsp[0].i.dword; ; break;} -case 216: -#line 1490 "rcparse.y" +case 223: +#line 1522 "rcparse.y" { yyval.i.val = yyvsp[-2].i.val * yyvsp[0].i.val; yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; ; break;} -case 217: -#line 1495 "rcparse.y" +case 224: +#line 1527 "rcparse.y" { yyval.i.val = yyvsp[-2].i.val / yyvsp[0].i.val; yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; ; break;} -case 218: -#line 1500 "rcparse.y" +case 225: +#line 1532 "rcparse.y" { yyval.i.val = yyvsp[-2].i.val % yyvsp[0].i.val; yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; ; break;} -case 219: -#line 1505 "rcparse.y" +case 226: +#line 1537 "rcparse.y" { yyval.i.val = yyvsp[-2].i.val + yyvsp[0].i.val; yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; ; break;} -case 220: -#line 1510 "rcparse.y" +case 227: +#line 1542 "rcparse.y" { yyval.i.val = yyvsp[-2].i.val - yyvsp[0].i.val; yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; ; break;} -case 221: -#line 1515 "rcparse.y" +case 228: +#line 1547 "rcparse.y" { yyval.i.val = yyvsp[-2].i.val & yyvsp[0].i.val; yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; ; break;} -case 222: -#line 1520 "rcparse.y" +case 229: +#line 1552 "rcparse.y" { yyval.i.val = yyvsp[-2].i.val ^ yyvsp[0].i.val; yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; ; break;} -case 223: -#line 1525 "rcparse.y" +case 230: +#line 1557 "rcparse.y" { yyval.i.val = yyvsp[-2].i.val | yyvsp[0].i.val; yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; ; break;} -case 224: -#line 1536 "rcparse.y" +case 231: +#line 1568 "rcparse.y" { yyval.il = yyvsp[0].il; ; break;} -case 225: -#line 1545 "rcparse.y" +case 232: +#line 1577 "rcparse.y" { yyval.il = yyvsp[0].i.val; ; break;} -case 226: -#line 1556 "rcparse.y" +case 233: +#line 1588 "rcparse.y" { yyval.i = yyvsp[0].i; ; break;} -case 227: -#line 1560 "rcparse.y" +case 234: +#line 1592 "rcparse.y" { yyval.i = yyvsp[-1].i; ; break;} -case 228: -#line 1564 "rcparse.y" +case 235: +#line 1596 "rcparse.y" { yyval.i.val = ~ yyvsp[0].i.val; yyval.i.dword = yyvsp[0].i.dword; ; break;} -case 229: -#line 1569 "rcparse.y" +case 236: +#line 1601 "rcparse.y" { yyval.i.val = yyvsp[-2].i.val * yyvsp[0].i.val; yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; ; break;} -case 230: -#line 1574 "rcparse.y" +case 237: +#line 1606 "rcparse.y" { yyval.i.val = yyvsp[-2].i.val / yyvsp[0].i.val; yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; ; break;} -case 231: -#line 1579 "rcparse.y" +case 238: +#line 1611 "rcparse.y" { yyval.i.val = yyvsp[-2].i.val % yyvsp[0].i.val; yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; ; break;} -case 232: -#line 1584 "rcparse.y" +case 239: +#line 1616 "rcparse.y" { yyval.i.val = yyvsp[-2].i.val + yyvsp[0].i.val; yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; ; break;} -case 233: -#line 1589 "rcparse.y" +case 240: +#line 1621 "rcparse.y" { yyval.i.val = yyvsp[-2].i.val - yyvsp[0].i.val; yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; ; break;} -case 234: -#line 1594 "rcparse.y" +case 241: +#line 1626 "rcparse.y" { yyval.i.val = yyvsp[-2].i.val & yyvsp[0].i.val; yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; ; break;} -case 235: -#line 1599 "rcparse.y" +case 242: +#line 1631 "rcparse.y" { yyval.i.val = yyvsp[-2].i.val ^ yyvsp[0].i.val; yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; ; break;} -case 236: -#line 1604 "rcparse.y" +case 243: +#line 1636 "rcparse.y" { yyval.i.val = yyvsp[-2].i.val | yyvsp[0].i.val; yyval.i.dword = yyvsp[-2].i.dword || yyvsp[0].i.dword; @@ -3094,7 +3139,7 @@ yyerrhandle: } return 1; } -#line 1610 "rcparse.y" +#line 1642 "rcparse.y" /* Set the language from the command line. */ diff --git a/gnu/dist/toolchain/binutils/rcparse.y b/gnu/dist/toolchain/binutils/rcparse.y index 03cbbdc5b67e..b67338f9d045 100644 --- a/gnu/dist/toolchain/binutils/rcparse.y +++ b/gnu/dist/toolchain/binutils/rcparse.y @@ -136,11 +136,11 @@ static unsigned long class; %type vertrans %type suboptions memflags_move_discard memflags_move %type memflag -%type id +%type id resref %type exstyle parennumber %type numexpr posnumexpr cnumexpr optcnumexpr cposnumexpr %type acc_options acc_option menuitem_flags menuitem_flag -%type optstringc file_name +%type optstringc file_name resname %type sizednumexpr sizedposnumexpr %left '|' @@ -636,39 +636,29 @@ control: rcparse_warning (_("IEDIT requires DIALOGEX")); res_string_to_id (&$$->class, "HEDIT"); } - | ICON optstringc numexpr cnumexpr cnumexpr opt_control_data - { - $$ = define_control ($2, $3, $4, $5, 0, 0, CTL_STATIC, - SS_ICON | WS_CHILD | WS_VISIBLE, 0); - if ($6 != NULL) - { - if (dialog.ex == NULL) - rcparse_warning (_("control data requires DIALOGEX")); - $$->data = $6; - } - } - | ICON optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr + | ICON resref numexpr cnumexpr cnumexpr opt_control_data + { + $$ = define_icon_control ($2, $3, $4, $5, 0, 0, 0, $6, + dialog.ex); + } + | ICON resref numexpr cnumexpr cnumexpr cnumexpr cnumexpr + opt_control_data + { + $$ = define_icon_control ($2, $3, $4, $5, 0, 0, 0, $8, + dialog.ex); + } + | ICON resref numexpr cnumexpr cnumexpr cnumexpr cnumexpr icon_styleexpr optcnumexpr opt_control_data - { - $$ = define_control ($2, $3, $4, $5, $6, $7, CTL_STATIC, - style, $9); - if ($10 != NULL) - { - if (dialog.ex == NULL) - rcparse_warning (_("control data requires DIALOGEX")); - $$->data = $10; - } - } - | ICON optstringc numexpr cnumexpr cnumexpr cnumexpr cnumexpr + { + $$ = define_icon_control ($2, $3, $4, $5, style, $9, 0, $10, + dialog.ex); + } + | ICON resref numexpr cnumexpr cnumexpr cnumexpr cnumexpr icon_styleexpr cnumexpr cnumexpr opt_control_data - { - $$ = define_control ($2, $3, $4, $5, $6, $7, CTL_STATIC, - style, $9); - if (dialog.ex == NULL) - rcparse_warning (_("help ID requires DIALOGEX")); - $$->help = $10; - $$->data = $11; - } + { + $$ = define_icon_control ($2, $3, $4, $5, style, $9, $10, $11, + dialog.ex); + } | IEDIT { default_style = ES_LEFT | WS_BORDER | WS_TABSTOP; @@ -819,6 +809,10 @@ optstringc: { $$ = NULL; } + | QUOTEDSTRING + { + $$ = $1; + } | QUOTEDSTRING ',' { $$ = $1; @@ -1272,6 +1266,44 @@ id: } ; +/* A resource reference. */ + +resname: + QUOTEDSTRING + { + $$ = $1; + } + | QUOTEDSTRING ',' + { + $$ = $1; + } + | STRING ',' + { + $$ = $1; + } + ; + + +resref: + posnumexpr ',' + { + $$.named = 0; + $$.u.id = $1; + } + | resname + { + char *copy, *s; + + /* It seems that resource ID's are forced to upper case. */ + copy = xstrdup ($1); + for (s = copy; *s != '\0'; s++) + if (islower ((unsigned char) *s)) + *s = toupper ((unsigned char) *s); + res_string_to_id (&$$, copy); + free (copy); + } + ; + /* Generic suboptions. These may appear before the BEGIN in any multiline statement. */ diff --git a/gnu/dist/toolchain/binutils/rdcoff.c b/gnu/dist/toolchain/binutils/rdcoff.c index e1385c7140ee..14f973e19e12 100644 --- a/gnu/dist/toolchain/binutils/rdcoff.c +++ b/gnu/dist/toolchain/binutils/rdcoff.c @@ -99,6 +99,7 @@ static debug_type parse_coff_enum_type static boolean parse_coff_symbol PARAMS ((bfd *, struct coff_types *, asymbol *, long, struct internal_syment *, PTR, debug_type, boolean)); +static boolean external_coff_symbol_p PARAMS ((int sym_class)); /* Return the slot for a type. */ @@ -588,6 +589,7 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type, return false; break; + case C_WEAKEXT: case C_EXT: if (! debug_record_variable (dhandle, bfd_asymbol_name (sym), type, DEBUG_GLOBAL, bfd_asymbol_value (sym))) @@ -656,6 +658,23 @@ parse_coff_symbol (abfd, types, sym, coff_symno, psyment, dhandle, type, return true; } +/* Determine if a symbol has external visibility. */ + +static boolean +external_coff_symbol_p (sym_class) + int sym_class; +{ + switch (sym_class) + { + case C_EXT: + case C_WEAKEXT: + return true; + default: + break; + } + return false; +} + /* This is the main routine. It looks through all the symbols and handles them. */ @@ -767,6 +786,7 @@ parse_coff (abfd, syms, symcount, dhandle) if (syment.n_type == T_NULL) break; /* Fall through. */ + case C_WEAKEXT: case C_EXT: if (ISFCN (syment.n_type)) { @@ -805,7 +825,7 @@ parse_coff (abfd, syms, symcount, dhandle) return false; if (! debug_record_function (dhandle, fnname, type, - fnclass == C_EXT, + external_coff_symbol_p (fnclass), bfd_asymbol_value (sym))) return false; diff --git a/gnu/dist/toolchain/binutils/readelf.c b/gnu/dist/toolchain/binutils/readelf.c index 8858d57fbf7c..d5069251be19 100644 --- a/gnu/dist/toolchain/binutils/readelf.c +++ b/gnu/dist/toolchain/binutils/readelf.c @@ -1,5 +1,5 @@ /* readelf.c -- display contents of an ELF format file - Copyright (C) 1998, 99, 2000 Free Software Foundation, Inc. + Copyright (C) 1998, 99, 2000, 2001 Free Software Foundation, Inc. Originally developed by Eric Youngdale Modifications by Nick Clifton @@ -70,6 +70,10 @@ #include "elf/i960.h" #include "elf/pj.h" #include "elf/avr.h" +#include "elf/ia64.h" +#include "elf/cris.h" +#include "elf/i860.h" +#include "elf/x86-64.h" #include "bucomm.h" #include "getopt.h" @@ -81,6 +85,7 @@ 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; @@ -110,6 +115,7 @@ int do_debug_abbrevs; int do_debug_lines; int do_debug_pubnames; int do_debug_aranges; +int do_debug_frames; int do_arch; int do_notes; int is_32bit_elf; @@ -147,6 +153,7 @@ static const char * get_dynamic_type PARAMS ((unsigned long)); static int dump_relocations PARAMS ((FILE *, unsigned long, unsigned long, Elf_Internal_Sym *, unsigned long, char *, int)); static char * get_file_type PARAMS ((unsigned)); static char * get_machine_name PARAMS ((unsigned)); +static void decode_ARM_machine_flags PARAMS ((unsigned, char [])); static char * get_machine_flags PARAMS ((unsigned, unsigned)); static const char * get_mips_segment_type PARAMS ((unsigned long)); static const char * get_parisc_segment_type PARAMS ((unsigned long)); @@ -193,6 +200,7 @@ static int display_debug_not_supported PARAMS ((Elf32_Internal_Sh static int display_debug_lines 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 unsigned char * process_abbrev_section PARAMS ((unsigned char *, unsigned char *)); static unsigned long read_leb128 PARAMS ((unsigned char *, int *, int)); static int process_extended_line_op PARAMS ((unsigned char *, int, int)); @@ -203,9 +211,9 @@ static char * get_FORM_name PARAMS ((unsigned long)); 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)); +static unsigned char * read_and_display_attr 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)); +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)); @@ -225,7 +233,9 @@ typedef int Elf32_Word; #endif #define UNKNOWN -1 -#define SECTION_NAME(X) (string_table + (X)->sh_name) +#define SECTION_NAME(X) ((X) == NULL ? "" : \ + ((X)->sh_name >= string_table_length \ + ? "" : string_table + (X)->sh_name)) #define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */ @@ -419,15 +429,15 @@ print_vma (vma, mode) case FULL_HEX: printf ("0x"); /* drop through */ - + case LONG_HEX: printf_vma (vma); break; - + case PREFIX_HEX: printf ("0x"); /* drop through */ - + case HEX: #if BFD_HOST_64BIT_LONG printf ("%lx", vma); @@ -448,7 +458,7 @@ print_vma (vma, mode) printf ("++%ld", _bfd_int64_low (vma)); else printf ("%ld", _bfd_int64_low (vma)); -#endif +#endif break; case DEC_5: @@ -460,13 +470,13 @@ print_vma (vma, mode) printf ("++%ld", _bfd_int64_low (vma)); else printf ("%5ld", _bfd_int64_low (vma)); -#endif +#endif break; - + case UNSIGNED: #if BFD_HOST_64BIT_LONG printf ("%lu", vma); -#else +#else if (_bfd_int64_high (vma)) /* ugg */ printf ("++%lu", _bfd_int64_low (vma)); @@ -528,8 +538,8 @@ byte_get_big_endian (field, size) } } +/* Guess the relocation size commonly used by the specific machines. */ -/* Guess the relocation sized based on the sized commonly used by the specific machine. */ static int guess_is_rela (e_machine) unsigned long e_machine; @@ -561,6 +571,11 @@ guess_is_rela (e_machine) case EM_SH: case EM_ALPHA: case EM_MCORE: + case EM_IA_64: + case EM_AVR: + case EM_CRIS: + case EM_860: + case EM_X86_64: return TRUE; case EM_MMA: @@ -862,6 +877,7 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) break; case EM_CYGNUS_ARC: + case EM_ARC: rtype = elf_arc_reloc_type (type); break; @@ -872,6 +888,21 @@ dump_relocations (file, rel_offset, rel_size, symtab, nsyms, strtab, is_rela) case EM_PJ: rtype = elf_pj_reloc_type (type); break; + case EM_IA_64: + rtype = elf_ia64_reloc_type (type); + break; + + case EM_CRIS: + rtype = elf_cris_reloc_type (type); + break; + + case EM_860: + rtype = elf_i860_reloc_type (type); + break; + + case EM_X86_64: + rtype = elf_x86_64_reloc_type (type); + break; } if (rtype == NULL) @@ -1203,7 +1234,7 @@ get_machine_name (e_machine) case EM_SH: return "Hitachi SH"; case EM_SPARCV9: return "Sparc v9"; case EM_TRICORE: return "Siemens Tricore"; - case EM_ARC: return "Argonaut RISC Core"; + case EM_ARC: return "ARC"; case EM_H8_300: return "Hitachi H8/300"; case EM_H8_300H: return "Hitachi H8/300H"; case EM_H8S: return "Hitachi H8S"; @@ -1215,7 +1246,7 @@ get_machine_name (e_machine) 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_ARC: return "ARC"; case EM_CYGNUS_M32R: return "Mitsubishi M32r"; case EM_CYGNUS_V850: return "NEC v850"; case EM_CYGNUS_MN10300: return "mn10300"; @@ -1240,12 +1271,130 @@ 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: 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_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_X86_64: return "Advanced Micro Devices X86-64"; default: sprintf (buff, _(": %x"), e_machine); return buff; } } +static void +decode_ARM_machine_flags (e_flags, buf) + unsigned e_flags; + char buf[]; +{ + unsigned eabi; + int unknown = 0; + + eabi = EF_ARM_EABI_VERSION (e_flags); + e_flags &= ~ EF_ARM_EABIMASK; + + /* Handle "generic" ARM flags. */ + if (e_flags & EF_ARM_RELEXEC) + { + strcat (buf, ", relocatable executable"); + e_flags &= ~ EF_ARM_RELEXEC; + } + + if (e_flags & EF_ARM_HASENTRY) + { + strcat (buf, ", has entry point"); + e_flags &= ~ EF_ARM_HASENTRY; + } + + /* Now handle EABI specific flags. */ + switch (eabi) + { + default: + strcat (buf, ", "); + if (e_flags) + unknown = 1; + break; + + case EF_ARM_EABI_VER1: + 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_INTERWORK. */ + strcat (buf, ", sorted symbol tables"); + break; + + default: + unknown = 1; + break; + } + } + break; + + case EF_ARM_EABI_UNKNOWN: + while (e_flags) + { + unsigned flag; + + /* Process flags one bit at a time. */ + flag = e_flags & - e_flags; + e_flags &= ~ flag; + + switch (flag) + { + case EF_INTERWORK: + strcat (buf, ", interworking enabled"); + break; + + case EF_APCS_26: + strcat (buf, ", uses APCS/26"); + break; + + case EF_APCS_FLOAT: + strcat (buf, ", uses APCS/float"); + break; + + case EF_PIC: + strcat (buf, ", position independent"); + break; + + case EF_ALIGN8: + strcat (buf, ", 8 bit structure alignment"); + break; + + case EF_NEW_ABI: + strcat (buf, ", uses new ABI"); + break; + + case EF_OLD_ABI: + strcat (buf, ", uses old ABI"); + break; + + case EF_SOFT_FLOAT: + strcat (buf, ", software FP"); + break; + + default: + unknown = 1; + break; + } + } + } + + if (unknown) + strcat (buf,", "); +} + static char * get_machine_flags (e_flags, e_machine) unsigned e_flags; @@ -1254,7 +1403,7 @@ get_machine_flags (e_flags, e_machine) static char buf [1024]; buf[0] = '\0'; - + if (e_flags) { switch (e_machine) @@ -1262,6 +1411,10 @@ get_machine_flags (e_flags, e_machine) default: break; + case EM_ARM: + decode_ARM_machine_flags (e_flags, buf); + break; + case EM_68K: if (e_flags & EF_CPU32) strcat (buf, ", cpu32"); @@ -1327,6 +1480,27 @@ get_machine_flags (e_flags, e_machine) 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"); + + switch ((e_flags & EF_MIPS_MACH)) + { + case E_MIPS_MACH_3900: strcat (buf, ", 3900"); break; + case E_MIPS_MACH_4010: strcat (buf, ", 4010"); break; + 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; + } break; case EM_SPARCV9: @@ -1383,7 +1557,7 @@ get_machine_flags (e_flags, e_machine) if (e_flags & EF_PARISC_LAZYSWAP) strcat (buf, ", lazyswap"); break; - + case EM_PJ: if ((e_flags & EF_PICOJAVA_NEWCALLS) == EF_PICOJAVA_NEWCALLS) strcat (buf, ", new calling convention"); @@ -1598,6 +1772,8 @@ get_section_type_name (sh_type) case SHT_INIT_ARRAY: return "INIT_ARRAY"; case SHT_FINI_ARRAY: return "FINI_ARRAY"; case SHT_PREINIT_ARRAY: return "PREINIT_ARRAY"; + case SHT_GROUP: return "GROUP"; + case SHT_SYMTAB_SHNDX: return "SYMTAB SECTION INDICIES"; case SHT_GNU_verdef: return "VERDEF"; case SHT_GNU_verneed: return "VERNEED"; case SHT_GNU_versym: return "VERSYM"; @@ -1691,7 +1867,7 @@ usage () 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[liapr] or --debug-dump[=line,=info,=abbrev,=pubnames,=ranges]\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")); #ifdef SUPPORT_DISASSEMBLY fprintf (stdout, _(" -i or --instruction-dump=\n")); @@ -1851,6 +2027,11 @@ parse_args (argc, argv) do_debug_aranges = 1; break; + case 'f': + case 'F': + do_debug_frames = 1; + break; + default: warn (_("Unrecognised debug option '%s'\n"), optarg); break; @@ -1943,7 +2124,7 @@ get_osabi_name (osabi) case ELFOSABI_LINUX: return _("UNIX - Linux"); case ELFOSABI_HURD: return _("GNU/Hurd"); case ELFOSABI_SOLARIS: return _("UNIX - Solaris"); - case ELFOSABI_MONTEREY: return _("UNIX - Monterey"); + case ELFOSABI_AIX: return _("UNIX - AIX"); case ELFOSABI_IRIX: return _("UNIX - IRIX"); case ELFOSABI_FREEBSD: return _("UNIX - FreeBSD"); case ELFOSABI_TRU64: return _("UNIX - TRU64"); @@ -2001,7 +2182,7 @@ process_file_header () get_machine_name (elf_header.e_machine)); printf (_(" Version: 0x%lx\n"), (unsigned long) elf_header.e_version); - + printf (_(" Entry point address: ")); print_vma ((bfd_vma) elf_header.e_entry, PREFIX_HEX); printf (_("\n Start of program headers: ")); @@ -2009,7 +2190,7 @@ process_file_header () printf (_(" (bytes into file)\n Start of section headers: ")); print_vma ((bfd_vma) elf_header.e_shoff, DEC); printf (_(" (bytes into file)\n")); - + printf (_(" Flags: 0x%lx%s\n"), (unsigned long) elf_header.e_flags, get_machine_flags (elf_header.e_flags, elf_header.e_machine)); @@ -2147,7 +2328,7 @@ process_program_headers (file) { printf (_("\nProgram Header%s:\n"), elf_header.e_phnum > 1 ? "s" : ""); - + if (is_32bit_elf) printf (_(" Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align\n")); @@ -2460,14 +2641,14 @@ get_elf_section_flags (sh_flags) static char buff [32]; * buff = 0; - + while (sh_flags) { bfd_vma flag; flag = sh_flags & - sh_flags; sh_flags &= ~ flag; - + switch (flag) { case SHF_WRITE: strcat (buff, "W"); break; @@ -2478,7 +2659,8 @@ get_elf_section_flags (sh_flags) case SHF_INFO_LINK: strcat (buff, "I"); break; case SHF_LINK_ORDER: strcat (buff, "L"); break; case SHF_OS_NONCONFORMING: strcat (buff, "O"); break; - + case SHF_GROUP: strcat (buff, "G"); break; + default: if (flag & SHF_MASKOS) { @@ -2495,7 +2677,7 @@ get_elf_section_flags (sh_flags) break; } } - + return buff; } @@ -2533,12 +2715,10 @@ process_section_headers (file) if (section->sh_size != 0) { - unsigned long string_table_offset; - - string_table_offset = section->sh_offset; - GET_DATA_ALLOC (section->sh_offset, section->sh_size, string_table, char *, "string table"); + + string_table_length = section->sh_size; } /* Scan the sections for the dynamic symbol table @@ -2578,7 +2758,7 @@ process_section_headers (file) dynamic_strings, char *, "dynamic strings"); } else if ((do_debugging || do_debug_info || do_debug_abbrevs - || do_debug_lines || do_debug_pubnames || do_debug_aranges) + || do_debug_lines || do_debug_pubnames || do_debug_aranges || do_debug_frames) && strncmp (name, ".debug_", 7) == 0) { name += 7; @@ -2589,16 +2769,23 @@ process_section_headers (file) || (do_debug_lines && (strcmp (name, "line") == 0)) || (do_debug_pubnames && (strcmp (name, "pubnames") == 0)) || (do_debug_aranges && (strcmp (name, "aranges") == 0)) + || (do_debug_frames && (strcmp (name, "frame") == 0)) ) request_dump (i, DEBUG_DUMP); } + /* linkonce section to be combined with .debug_info at link time. */ + else if ((do_debugging || do_debug_info) + && strncmp (name, ".gnu.linkonce.wi.", 17) == 0) + request_dump (i, DEBUG_DUMP); + else if (do_debug_frames && strcmp (name, ".eh_frame") == 0) + request_dump (i, DEBUG_DUMP); } if (! do_sections) return 1; printf (_("\nSection Header%s:\n"), elf_header.e_shnum > 1 ? "s" : ""); - + if (is_32bit_elf) printf (_(" [Nr] Name Type Addr Off Size ES Flg Lk Inf Al\n")); @@ -2620,15 +2807,15 @@ process_section_headers (file) if (is_32bit_elf) { print_vma (section->sh_addr, LONG_HEX); - + printf ( " %6.6lx %6.6lx %2.2lx", (unsigned long) section->sh_offset, (unsigned long) section->sh_size, (unsigned long) section->sh_entsize); printf (" %3s ", get_elf_section_flags (section->sh_flags)); - - printf (" %2ld %3lx %ld\n", + + printf ("%2ld %3lx %2ld\n", (unsigned long) section->sh_link, (unsigned long) section->sh_info, (unsigned long) section->sh_addralign); @@ -2642,9 +2829,9 @@ process_section_headers (file) 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, @@ -2652,9 +2839,10 @@ process_section_headers (file) } } - printf (_("Key to Flags: W (write), A (alloc), X (execute), M (merge), S (strings)\n")); - printf (_(" I (info), L (link order), O (extra OS processing required)\n")); - printf (_(" o (os specific), p (processor specific) x (unknown)\n")); + 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")); return 1; } @@ -2904,7 +3092,7 @@ dynamic_segment_parisc_val (entry) first = 0; val ^= flags[cnt].bit; } - + if (val != 0 || first) { if (! first) @@ -2913,7 +3101,7 @@ dynamic_segment_parisc_val (entry) } } break; - + default: print_vma (entry->d_un.d_ptr, PREFIX_HEX); break; @@ -3188,7 +3376,7 @@ process_dynamic_segment (file) { if (do_dynamic) { - const char *dtype; + const char * dtype; putchar (' '); print_vma (entry->d_tag, FULL_HEX); @@ -3205,7 +3393,7 @@ process_dynamic_segment (file) if (do_dynamic) printf ("%s", get_dynamic_flags (entry->d_un.d_val)); break; - + case DT_AUXILIARY: case DT_FILTER: case DT_CONFIG: @@ -3809,7 +3997,8 @@ process_version_sections (file) for (cnt = 0; cnt < total; cnt += 4) { int j, nn; - char *name; + int check_def, check_need; + char * name; printf (" %03x:", cnt); @@ -3828,111 +4017,20 @@ process_version_sections (file) nn = printf ("%4x%c", data [cnt + j] & 0x7fff, data [cnt + j] & 0x8000 ? 'h' : ' '); - if (symbols [cnt + j].st_shndx < SHN_LORESERVE - && section_headers[symbols [cnt + j].st_shndx].sh_type - == SHT_NOBITS) + check_def = 1; + check_need = 1; + if (symbols [cnt + j].st_shndx >= SHN_LORESERVE + || section_headers[symbols [cnt + j].st_shndx].sh_type + != SHT_NOBITS) { - /* We must test both. */ - Elf_Internal_Verneed ivn; - unsigned long offset; - - offset = version_info [DT_VERSIONTAGIDX (DT_VERNEED)] - - loadaddr; - - do - { - Elf_External_Verneed evn; - Elf_External_Vernaux evna; - Elf_Internal_Vernaux ivna; - unsigned long vna_off; - - GET_DATA (offset, evn, "version need"); - - ivn.vn_aux = BYTE_GET (evn.vn_aux); - ivn.vn_next = BYTE_GET (evn.vn_next); - - vna_off = offset + ivn.vn_aux; - - do - { - GET_DATA (vna_off, evna, - "version need aux (1)"); - - ivna.vna_next = BYTE_GET (evna.vna_next); - ivna.vna_other = BYTE_GET (evna.vna_other); - - vna_off += ivna.vna_next; - } - while (ivna.vna_other != data [cnt + j] - && ivna.vna_next != 0); - - if (ivna.vna_other == data [cnt + j]) - { - ivna.vna_name = BYTE_GET (evna.vna_name); - - name = strtab + ivna.vna_name; - nn += printf ("(%s%-*s", - name, - 12 - (int) strlen (name), - ")"); - break; - } - else if (ivn.vn_next == 0) - { - if (data [cnt + j] != 0x8001) - { - Elf_Internal_Verdef ivd; - Elf_External_Verdef evd; - - offset = version_info - [DT_VERSIONTAGIDX (DT_VERDEF)] - - loadaddr; - - do - { - GET_DATA (offset, evd, - "version definition"); - - ivd.vd_next = BYTE_GET (evd.vd_next); - ivd.vd_ndx = BYTE_GET (evd.vd_ndx); - - offset += ivd.vd_next; - } - while (ivd.vd_ndx - != (data [cnt + j] & 0x7fff) - && ivd.vd_next != 0); - - if (ivd.vd_ndx - == (data [cnt + j] & 0x7fff)) - { - Elf_External_Verdaux evda; - Elf_Internal_Verdaux ivda; - - ivd.vd_aux = BYTE_GET (evd.vd_aux); - - GET_DATA (offset + ivd.vd_aux, evda, - "version definition aux"); - - ivda.vda_name = - BYTE_GET (evda.vda_name); - - name = strtab + ivda.vda_name; - nn += - printf ("(%s%-*s", - name, - 12 - (int) strlen (name), - ")"); - } - } - - break; - } - else - offset += ivn.vn_next; - } - while (ivn.vn_next); + if (symbols [cnt + j].st_shndx == SHN_UNDEF) + check_def = 0; + else + check_need = 0; } - else if (symbols [cnt + j].st_shndx == SHN_UNDEF) + + if (check_need + && version_info [DT_VERSIONTAGIDX (DT_VERNEED)]) { Elf_Internal_Verneed ivn; unsigned long offset; @@ -3976,6 +4074,7 @@ process_version_sections (file) name, 12 - (int) strlen (name), ")"); + check_def = 0; break; } @@ -3983,7 +4082,9 @@ process_version_sections (file) } while (ivn.vn_next); } - else if (data [cnt + j] != 0x8001) + + if (check_def && data [cnt + j] != 0x8001 + && version_info [DT_VERSIONTAGIDX (DT_VERDEF)]) { Elf_Internal_Verdef ivd; Elf_External_Verdef evd; @@ -4161,10 +4262,10 @@ get_dynamic_data (file, number) FILE * file; unsigned int number; { - char * e_data; + unsigned char * e_data; int * i_data; - e_data = (char *) malloc (number * 4); + e_data = (unsigned char *) malloc (number * 4); if (e_data == NULL) { @@ -4201,8 +4302,8 @@ process_symbol_table (file) FILE * file; { Elf32_Internal_Shdr * section; - char nb [4]; - char nc [4]; + unsigned char nb [4]; + unsigned char nc [4]; int nbuckets = 0; int nchains = 0; int * buckets = NULL; @@ -4269,7 +4370,7 @@ process_symbol_table (file) print_vma (psym->st_value, LONG_HEX); putchar (' ' ); print_vma (psym->st_size, DEC_5); - + 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))); @@ -4360,7 +4461,8 @@ process_symbol_table (file) if ((vers_data & 0x8000) || vers_data > 1) { - if (is_nobits || ! check_def) + if (version_info [DT_VERSIONTAGIDX (DT_VERNEED)] + && (is_nobits || ! check_def)) { Elf_External_Verneed evn; Elf_Internal_Verneed ivn; @@ -4418,7 +4520,8 @@ process_symbol_table (file) if (check_def) { - if (vers_data != 0x8001) + if (vers_data != 0x8001 + && version_info [DT_VERSIONTAGIDX (DT_VERDEF)]) { Elf_Internal_Verdef ivd; Elf_Internal_Verdaux ivda; @@ -4474,13 +4577,13 @@ process_symbol_table (file) if (do_histogram && buckets != NULL) { - int *lengths; - int *counts; - int hn; - int si; - int maxlength = 0; - int nzero_counts = 0; - int nsyms = 0; + int * lengths; + int * counts; + int hn; + int si; + int maxlength = 0; + int nzero_counts = 0; + int nsyms = 0; printf (_("\nHistogram for bucket list length (total of %d buckets):\n"), nbuckets); @@ -4816,7 +4919,7 @@ process_extended_line_op (data, is_stmt, pointer_size) printf (_(" %d\t"), ++ state_machine_regs.last_file_entry); name = data; - data += strlen (data) + 1; + data += strlen ((char *) data) + 1; printf (_("%lu\t"), read_leb128 (data, & bytes_read, 0)); data += bytes_read; printf (_("%lu\t"), read_leb128 (data, & bytes_read, 0)); @@ -4861,7 +4964,7 @@ display_debug_lines (section, start, file) /* Check the length of the block. */ info.li_length = BYTE_GET (external->li_length); - if (info.li_length > section->sh_size) + if (info.li_length + sizeof (external->li_length) > section->sh_size) { warn (_("The line info appears to be corrupt - the section is too small\n")); @@ -4896,7 +4999,7 @@ display_debug_lines (section, start, file) printf (_(" Line Range: %d\n"), info.li_line_range); printf (_(" Opcode Base: %d\n"), info.li_opcode_base); - end_of_sequence = data + info.li_length + sizeof (info.li_length); + end_of_sequence = data + info.li_length + sizeof (external->li_length); reset_state_machine (info.li_default_is_stmt); @@ -4921,7 +5024,7 @@ display_debug_lines (section, start, file) { printf (_(" %s\n"), data); - data += strlen (data) + 1; + data += strlen ((char *) data) + 1; } } @@ -4938,13 +5041,13 @@ display_debug_lines (section, start, file) while (* data != 0) { - char * name; + unsigned char * name; int bytes_read; printf (_(" %d\t"), ++ state_machine_regs.last_file_entry); name = data; - data += strlen (data) + 1; + data += strlen ((char *) data) + 1; printf (_("%lu\t"), read_leb128 (data, & bytes_read, 0)); data += bytes_read; @@ -5098,7 +5201,7 @@ display_debug_pubnames (section, start, file) warn (_("Only DWARF 2 pubnames are currently supported\n")); warned = 1; } - + continue; } @@ -5121,7 +5224,7 @@ display_debug_pubnames (section, start, file) { data += 4; printf (" %ld\t\t%s\n", offset, data); - data += strlen (data) + 1; + data += strlen ((char *) data) + 1; } } while (offset != 0); @@ -5498,7 +5601,7 @@ display_debug_abbrev (section, start, file) unsigned char * start; FILE * file ATTRIBUTE_UNUSED; { - abbrev_entry * entry; + abbrev_entry * entry; unsigned char * end = start + section->sh_size; printf (_("Contents of the %s section:\n\n"), SECTION_NAME (section)); @@ -5548,500 +5651,336 @@ display_block (data, length) } static void -decode_location_expression (data, pointer_size) +decode_location_expression (data, pointer_size, length) unsigned char * data; unsigned int pointer_size; + unsigned long length; { - unsigned char op; - int bytes_read; - unsigned long uvalue; + unsigned op; + int bytes_read; + unsigned long uvalue; + unsigned char * end = data + length; - op = * data ++; - - switch (op) + while (data < end) { - case DW_OP_addr: - printf ("DW_OP_addr: %lx", (unsigned long) byte_get (data, pointer_size)); - break; - case DW_OP_deref: - printf ("DW_OP_deref"); - break; - case DW_OP_const1u: - printf ("DW_OP_const1u: %lu", (unsigned long) byte_get (data, 1)); - break; - case DW_OP_const1s: - printf ("DW_OP_const1s: %ld", (long) byte_get (data, 1)); - break; - case DW_OP_const2u: - printf ("DW_OP_const2u: %lu", (unsigned long) byte_get (data, 2)); - break; - case DW_OP_const2s: - printf ("DW_OP_const2s: %ld", (long) byte_get (data, 2)); - break; - case DW_OP_const4u: - printf ("DW_OP_const4u: %lu", (unsigned long) byte_get (data, 4)); - break; - case DW_OP_const4s: - printf ("DW_OP_const4s: %ld", (long) byte_get (data, 4)); - break; - case DW_OP_const8u: - printf ("DW_OP_const8u: %lu %lu", (unsigned long) byte_get (data, 4), - (unsigned long) byte_get (data + 4, 4)); - break; - case DW_OP_const8s: - printf ("DW_OP_const8s: %ld %ld", (long) byte_get (data, 4), - (long) byte_get (data + 4, 4)); - break; - case DW_OP_constu: - printf ("DW_OP_constu: %lu", read_leb128 (data, NULL, 0)); - break; - case DW_OP_consts: - printf ("DW_OP_consts: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_dup: - printf ("DW_OP_dup"); - break; - case DW_OP_drop: - printf ("DW_OP_drop"); - break; - case DW_OP_over: - printf ("DW_OP_over"); - break; - case DW_OP_pick: - printf ("DW_OP_pick: %ld", (unsigned long) byte_get (data, 1)); - break; - case DW_OP_swap: - printf ("DW_OP_swap"); - break; - case DW_OP_rot: - printf ("DW_OP_rot"); - break; - case DW_OP_xderef: - printf ("DW_OP_xderef"); - break; - case DW_OP_abs: - printf ("DW_OP_abs"); - break; - case DW_OP_and: - printf ("DW_OP_and"); - break; - case DW_OP_div: - printf ("DW_OP_div"); - break; - case DW_OP_minus: - printf ("DW_OP_minus"); - break; - case DW_OP_mod: - printf ("DW_OP_mod"); - break; - case DW_OP_mul: - printf ("DW_OP_mul"); - break; - case DW_OP_neg: - printf ("DW_OP_neg"); - break; - case DW_OP_not: - printf ("DW_OP_not"); - break; - case DW_OP_or: - printf ("DW_OP_or"); - break; - case DW_OP_plus: - printf ("DW_OP_plus"); - break; - case DW_OP_plus_uconst: - printf ("DW_OP_plus_uconst: %lu", read_leb128 (data, NULL, 0)); - break; - case DW_OP_shl: - printf ("DW_OP_shl"); - break; - case DW_OP_shr: - printf ("DW_OP_shr"); - break; - case DW_OP_shra: - printf ("DW_OP_shra"); - break; - case DW_OP_xor: - printf ("DW_OP_xor"); - break; - case DW_OP_bra: - printf ("DW_OP_bra: %ld", (long) byte_get (data, 2)); - break; - case DW_OP_eq: - printf ("DW_OP_eq"); - break; - case DW_OP_ge: - printf ("DW_OP_ge"); - break; - case DW_OP_gt: - printf ("DW_OP_gt"); - break; - case DW_OP_le: - printf ("DW_OP_le"); - break; - case DW_OP_lt: - printf ("DW_OP_lt"); - break; - case DW_OP_ne: - printf ("DW_OP_ne"); - break; - case DW_OP_skip: - printf ("DW_OP_skip: %ld", (long) byte_get (data, 2)); - break; - case DW_OP_lit0: - printf ("DW_OP_lit0"); - break; - case DW_OP_lit1: - printf ("DW_OP_lit1"); - break; - case DW_OP_lit2: - printf ("DW_OP_lit2"); - break; - case DW_OP_lit3: - printf ("DW_OP_lit3"); - break; - case DW_OP_lit4: - printf ("DW_OP_lit4"); - break; - case DW_OP_lit5: - printf ("DW_OP_lit5"); - break; - case DW_OP_lit6: - printf ("DW_OP_lit6"); - break; - case DW_OP_lit7: - printf ("DW_OP_lit7"); - break; - case DW_OP_lit8: - printf ("DW_OP_lit8"); - break; - case DW_OP_lit9: - printf ("DW_OP_lit9"); - break; - case DW_OP_lit10: - printf ("DW_OP_lit10"); - break; - case DW_OP_lit11: - printf ("DW_OP_lit11"); - break; - case DW_OP_lit12: - printf ("DW_OP_lit12"); - break; - case DW_OP_lit13: - printf ("DW_OP_lit13"); - break; - case DW_OP_lit14: - printf ("DW_OP_lit14"); - break; - case DW_OP_lit15: - printf ("DW_OP_lit15"); - break; - case DW_OP_lit16: - printf ("DW_OP_lit16"); - break; - case DW_OP_lit17: - printf ("DW_OP_lit17"); - break; - case DW_OP_lit18: - printf ("DW_OP_lit18"); - break; - case DW_OP_lit19: - printf ("DW_OP_lit19"); - break; - case DW_OP_lit20: - printf ("DW_OP_lit20"); - break; - case DW_OP_lit21: - printf ("DW_OP_lit21"); - break; - case DW_OP_lit22: - printf ("DW_OP_lit22"); - break; - case DW_OP_lit23: - printf ("DW_OP_lit23"); - break; - case DW_OP_lit24: - printf ("DW_OP_lit24"); - break; - case DW_OP_lit25: - printf ("DW_OP_lit25"); - break; - case DW_OP_lit26: - printf ("DW_OP_lit26"); - break; - case DW_OP_lit27: - printf ("DW_OP_lit27"); - break; - case DW_OP_lit28: - printf ("DW_OP_lit28"); - break; - case DW_OP_lit29: - printf ("DW_OP_lit29"); - break; - case DW_OP_lit30: - printf ("DW_OP_lit30"); - break; - case DW_OP_lit31: - printf ("DW_OP_lit31"); - break; - case DW_OP_reg0: - printf ("DW_OP_reg0"); - break; - case DW_OP_reg1: - printf ("DW_OP_reg1"); - break; - case DW_OP_reg2: - printf ("DW_OP_reg2"); - break; - case DW_OP_reg3: - printf ("DW_OP_reg3"); - break; - case DW_OP_reg4: - printf ("DW_OP_reg4"); - break; - case DW_OP_reg5: - printf ("DW_OP_reg5"); - break; - case DW_OP_reg6: - printf ("DW_OP_reg6"); - break; - case DW_OP_reg7: - printf ("DW_OP_reg7"); - break; - case DW_OP_reg8: - printf ("DW_OP_reg8"); - break; - case DW_OP_reg9: - printf ("DW_OP_reg9"); - break; - case DW_OP_reg10: - printf ("DW_OP_reg10"); - break; - case DW_OP_reg11: - printf ("DW_OP_reg11"); - break; - case DW_OP_reg12: - printf ("DW_OP_reg12"); - break; - case DW_OP_reg13: - printf ("DW_OP_reg13"); - break; - case DW_OP_reg14: - printf ("DW_OP_reg14"); - break; - case DW_OP_reg15: - printf ("DW_OP_reg15"); - break; - case DW_OP_reg16: - printf ("DW_OP_reg16"); - break; - case DW_OP_reg17: - printf ("DW_OP_reg17"); - break; - case DW_OP_reg18: - printf ("DW_OP_reg18"); - break; - case DW_OP_reg19: - printf ("DW_OP_reg19"); - break; - case DW_OP_reg20: - printf ("DW_OP_reg20"); - break; - case DW_OP_reg21: - printf ("DW_OP_reg21"); - break; - case DW_OP_reg22: - printf ("DW_OP_reg22"); - break; - case DW_OP_reg23: - printf ("DW_OP_reg23"); - break; - case DW_OP_reg24: - printf ("DW_OP_reg24"); - break; - case DW_OP_reg25: - printf ("DW_OP_reg25"); - break; - case DW_OP_reg26: - printf ("DW_OP_reg26"); - break; - case DW_OP_reg27: - printf ("DW_OP_reg27"); - break; - case DW_OP_reg28: - printf ("DW_OP_reg28"); - break; - case DW_OP_reg29: - printf ("DW_OP_reg29"); - break; - case DW_OP_reg30: - printf ("DW_OP_reg30"); - break; - case DW_OP_reg31: - printf ("DW_OP_reg31"); - break; - case DW_OP_breg0: - printf ("DW_OP_breg0: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg1: - printf ("DW_OP_breg1: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg2: - printf ("DW_OP_breg2: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg3: - printf ("DW_OP_breg3: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg4: - printf ("DW_OP_breg4: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg5: - printf ("DW_OP_breg5: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg6: - printf ("DW_OP_breg6: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg7: - printf ("DW_OP_breg7: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg8: - printf ("DW_OP_breg8: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg9: - printf ("DW_OP_breg9: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg10: - printf ("DW_OP_breg10: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg11: - printf ("DW_OP_breg11: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg12: - printf ("DW_OP_breg12: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg13: - printf ("DW_OP_breg13: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg14: - printf ("DW_OP_breg14: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg15: - printf ("DW_OP_breg15: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg16: - printf ("DW_OP_breg16: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg17: - printf ("DW_OP_breg17: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg18: - printf ("DW_OP_breg18: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg19: - printf ("DW_OP_breg19: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg20: - printf ("DW_OP_breg20: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg21: - printf ("DW_OP_breg21: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg22: - printf ("DW_OP_breg22: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg23: - printf ("DW_OP_breg23: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg24: - printf ("DW_OP_breg24: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg25: - printf ("DW_OP_breg25: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg26: - printf ("DW_OP_breg26: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg27: - printf ("DW_OP_breg27: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg28: - printf ("DW_OP_breg28: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg29: - printf ("DW_OP_breg29: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg30: - printf ("DW_OP_breg30: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_breg31: - printf ("DW_OP_breg31: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_regx: - printf ("DW_OP_regx: %lu", read_leb128 (data, NULL, 0)); - break; - case DW_OP_fbreg: - printf ("DW_OP_fbreg: %ld", read_leb128 (data, NULL, 1)); - break; - case DW_OP_bregx: - uvalue = read_leb128 (data, &bytes_read, 0); - printf ("DW_OP_bregx: %lu %ld", uvalue, - read_leb128 (data + bytes_read, NULL, 1)); - break; - case DW_OP_piece: - printf ("DW_OP_piece: %lu", read_leb128 (data, NULL, 0)); - break; - case DW_OP_deref_size: - printf ("DW_OP_deref_size: %ld", (long) byte_get (data, 1)); - break; - case DW_OP_xderef_size: - printf ("DW_OP_xderef_size: %ld", (long) byte_get (data, 1)); - break; - case DW_OP_nop: - printf ("DW_OP_nop"); - break; + op = * data ++; - default: - if (op >= DW_OP_lo_user - && op <= DW_OP_hi_user) - printf (_("(User defined location op)")); - else - printf (_("(Unknown location op)")); - break; + switch (op) + { + case DW_OP_addr: + printf ("DW_OP_addr: %lx", + (unsigned long) byte_get (data, pointer_size)); + data += pointer_size; + break; + case DW_OP_deref: + printf ("DW_OP_deref"); + break; + case DW_OP_const1u: + printf ("DW_OP_const1u: %lu", (unsigned long) byte_get (data++, 1)); + break; + case DW_OP_const1s: + printf ("DW_OP_const1s: %ld", (long) byte_get (data++, 1)); + break; + case DW_OP_const2u: + printf ("DW_OP_const2u: %lu", (unsigned long) byte_get (data, 2)); + data += 2; + break; + case DW_OP_const2s: + printf ("DW_OP_const2s: %ld", (long) byte_get (data, 2)); + data += 2; + break; + case DW_OP_const4u: + printf ("DW_OP_const4u: %lu", (unsigned long) byte_get (data, 4)); + data += 4; + break; + case DW_OP_const4s: + printf ("DW_OP_const4s: %ld", (long) byte_get (data, 4)); + data += 4; + break; + case DW_OP_const8u: + printf ("DW_OP_const8u: %lu %lu", (unsigned long) byte_get (data, 4), + (unsigned long) byte_get (data + 4, 4)); + data += 8; + break; + case DW_OP_const8s: + printf ("DW_OP_const8s: %ld %ld", (long) byte_get (data, 4), + (long) byte_get (data + 4, 4)); + data += 8; + break; + case DW_OP_constu: + printf ("DW_OP_constu: %lu", read_leb128 (data, &bytes_read, 0)); + data += bytes_read; + break; + case DW_OP_consts: + printf ("DW_OP_consts: %ld", read_leb128 (data, &bytes_read, 1)); + data += bytes_read; + break; + case DW_OP_dup: + printf ("DW_OP_dup"); + break; + case DW_OP_drop: + printf ("DW_OP_drop"); + break; + case DW_OP_over: + printf ("DW_OP_over"); + break; + case DW_OP_pick: + printf ("DW_OP_pick: %ld", (unsigned long) byte_get (data++, 1)); + break; + case DW_OP_swap: + printf ("DW_OP_swap"); + break; + case DW_OP_rot: + printf ("DW_OP_rot"); + break; + case DW_OP_xderef: + printf ("DW_OP_xderef"); + break; + case DW_OP_abs: + printf ("DW_OP_abs"); + break; + case DW_OP_and: + printf ("DW_OP_and"); + break; + case DW_OP_div: + printf ("DW_OP_div"); + break; + case DW_OP_minus: + printf ("DW_OP_minus"); + break; + case DW_OP_mod: + printf ("DW_OP_mod"); + break; + case DW_OP_mul: + printf ("DW_OP_mul"); + break; + case DW_OP_neg: + printf ("DW_OP_neg"); + break; + case DW_OP_not: + printf ("DW_OP_not"); + break; + case DW_OP_or: + printf ("DW_OP_or"); + break; + case DW_OP_plus: + printf ("DW_OP_plus"); + break; + case DW_OP_plus_uconst: + printf ("DW_OP_plus_uconst: %lu", + read_leb128 (data, &bytes_read, 0)); + data += bytes_read; + break; + case DW_OP_shl: + printf ("DW_OP_shl"); + break; + case DW_OP_shr: + printf ("DW_OP_shr"); + break; + case DW_OP_shra: + printf ("DW_OP_shra"); + break; + case DW_OP_xor: + printf ("DW_OP_xor"); + break; + case DW_OP_bra: + printf ("DW_OP_bra: %ld", (long) byte_get (data, 2)); + data += 2; + break; + case DW_OP_eq: + printf ("DW_OP_eq"); + break; + case DW_OP_ge: + printf ("DW_OP_ge"); + break; + case DW_OP_gt: + printf ("DW_OP_gt"); + break; + case DW_OP_le: + printf ("DW_OP_le"); + break; + case DW_OP_lt: + printf ("DW_OP_lt"); + break; + case DW_OP_ne: + printf ("DW_OP_ne"); + break; + case DW_OP_skip: + printf ("DW_OP_skip: %ld", (long) byte_get (data, 2)); + data += 2; + break; + + case DW_OP_lit0: + case DW_OP_lit1: + case DW_OP_lit2: + case DW_OP_lit3: + case DW_OP_lit4: + case DW_OP_lit5: + case DW_OP_lit6: + case DW_OP_lit7: + case DW_OP_lit8: + case DW_OP_lit9: + case DW_OP_lit10: + case DW_OP_lit11: + case DW_OP_lit12: + case DW_OP_lit13: + case DW_OP_lit14: + case DW_OP_lit15: + case DW_OP_lit16: + case DW_OP_lit17: + case DW_OP_lit18: + case DW_OP_lit19: + case DW_OP_lit20: + case DW_OP_lit21: + case DW_OP_lit22: + case DW_OP_lit23: + case DW_OP_lit24: + case DW_OP_lit25: + case DW_OP_lit26: + case DW_OP_lit27: + case DW_OP_lit28: + case DW_OP_lit29: + case DW_OP_lit30: + case DW_OP_lit31: + printf ("DW_OP_lit%d", op - DW_OP_lit0); + break; + + case DW_OP_reg0: + case DW_OP_reg1: + case DW_OP_reg2: + case DW_OP_reg3: + case DW_OP_reg4: + case DW_OP_reg5: + case DW_OP_reg6: + case DW_OP_reg7: + case DW_OP_reg8: + case DW_OP_reg9: + case DW_OP_reg10: + case DW_OP_reg11: + case DW_OP_reg12: + case DW_OP_reg13: + case DW_OP_reg14: + case DW_OP_reg15: + case DW_OP_reg16: + case DW_OP_reg17: + case DW_OP_reg18: + case DW_OP_reg19: + case DW_OP_reg20: + case DW_OP_reg21: + case DW_OP_reg22: + case DW_OP_reg23: + case DW_OP_reg24: + case DW_OP_reg25: + case DW_OP_reg26: + case DW_OP_reg27: + case DW_OP_reg28: + case DW_OP_reg29: + case DW_OP_reg30: + case DW_OP_reg31: + printf ("DW_OP_reg%d", op - DW_OP_reg0); + break; + + case DW_OP_breg0: + case DW_OP_breg1: + case DW_OP_breg2: + case DW_OP_breg3: + case DW_OP_breg4: + case DW_OP_breg5: + case DW_OP_breg6: + case DW_OP_breg7: + case DW_OP_breg8: + case DW_OP_breg9: + case DW_OP_breg10: + case DW_OP_breg11: + case DW_OP_breg12: + case DW_OP_breg13: + case DW_OP_breg14: + case DW_OP_breg15: + case DW_OP_breg16: + case DW_OP_breg17: + case DW_OP_breg18: + case DW_OP_breg19: + case DW_OP_breg20: + case DW_OP_breg21: + case DW_OP_breg22: + case DW_OP_breg23: + case DW_OP_breg24: + case DW_OP_breg25: + case DW_OP_breg26: + case DW_OP_breg27: + case DW_OP_breg28: + case DW_OP_breg29: + case DW_OP_breg30: + case DW_OP_breg31: + printf ("DW_OP_breg%d: %ld", op - DW_OP_breg0, + read_leb128 (data, &bytes_read, 1)); + data += bytes_read; + break; + + case DW_OP_regx: + printf ("DW_OP_regx: %lu", read_leb128 (data, &bytes_read, 0)); + data += bytes_read; + break; + case DW_OP_fbreg: + printf ("DW_OP_fbreg: %ld", read_leb128 (data, &bytes_read, 1)); + data += bytes_read; + break; + case DW_OP_bregx: + uvalue = read_leb128 (data, &bytes_read, 0); + data += bytes_read; + printf ("DW_OP_bregx: %lu %ld", uvalue, + read_leb128 (data, &bytes_read, 1)); + data += bytes_read; + break; + case DW_OP_piece: + printf ("DW_OP_piece: %lu", read_leb128 (data, &bytes_read, 0)); + data += bytes_read; + break; + case DW_OP_deref_size: + printf ("DW_OP_deref_size: %ld", (long) byte_get (data++, 1)); + break; + case DW_OP_xderef_size: + printf ("DW_OP_xderef_size: %ld", (long) byte_get (data++, 1)); + break; + case DW_OP_nop: + printf ("DW_OP_nop"); + break; + + default: + if (op >= DW_OP_lo_user + && op <= DW_OP_hi_user) + printf (_("(User defined location op)")); + else + printf (_("(Unknown location op)")); + /* No way to tell where the next op is, so just bail. */ + return; + } } } static unsigned char * -read_and_display_attr (attribute, form, data, pointer_size) +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; { unsigned long uvalue = 0; unsigned char * block_start = NULL; int bytes_read; - int is_ref = 0; printf (" %-18s:", get_AT_name (attribute)); switch (form) { - case DW_FORM_ref_addr: - case DW_FORM_ref1: - case DW_FORM_ref2: - case DW_FORM_ref4: - case DW_FORM_ref8: - case DW_FORM_ref_udata: - is_ref = 1; - } + default: + break; - switch (form) - { case DW_FORM_ref_addr: case DW_FORM_addr: uvalue = byte_get (data, pointer_size); - printf (is_ref ? " <%lx>" : " %#lx", uvalue); data += pointer_size; break; @@ -6049,21 +5988,55 @@ read_and_display_attr (attribute, form, data, pointer_size) case DW_FORM_flag: case DW_FORM_data1: uvalue = byte_get (data ++, 1); - printf (is_ref ? " <%lx>" : " %ld", uvalue); break; case DW_FORM_ref2: case DW_FORM_data2: uvalue = byte_get (data, 2); data += 2; - printf (is_ref ? " <%lx>" : " %ld", uvalue); break; case DW_FORM_ref4: case DW_FORM_data4: uvalue = byte_get (data, 4); data += 4; - printf (is_ref ? " <%lx>" : " %ld", uvalue); + break; + + case DW_FORM_sdata: + uvalue = read_leb128 (data, & bytes_read, 1); + data += bytes_read; + break; + + case DW_FORM_ref_udata: + case DW_FORM_udata: + uvalue = read_leb128 (data, & bytes_read, 0); + data += bytes_read; + break; + } + + switch (form) + { + case DW_FORM_ref_addr: + printf (" <#%lx>", uvalue); + break; + + case DW_FORM_ref1: + case DW_FORM_ref2: + case DW_FORM_ref4: + case DW_FORM_ref_udata: + printf (" <%lx>", uvalue + cu_offset); + break; + + case DW_FORM_addr: + printf (" %#lx", uvalue); + + case DW_FORM_flag: + case DW_FORM_data1: + case DW_FORM_data2: + case DW_FORM_data4: + case DW_FORM_sdata: + case DW_FORM_udata: + printf (" %ld", uvalue); break; case DW_FORM_ref8: @@ -6076,48 +6049,31 @@ read_and_display_attr (attribute, form, data, pointer_size) case DW_FORM_string: printf (" %s", data); - data += strlen (data) + 1; - break; - - case DW_FORM_sdata: - uvalue = read_leb128 (data, & bytes_read, 1); - data += bytes_read; - printf (" %ld", (long) uvalue); - break; - - case DW_FORM_ref_udata: - case DW_FORM_udata: - uvalue = read_leb128 (data, & bytes_read, 0); - data += bytes_read; - printf (is_ref ? " <%lx>" : " %ld", uvalue); + data += strlen ((char *) data) + 1; break; case DW_FORM_block: uvalue = read_leb128 (data, & bytes_read, 0); block_start = data + bytes_read; data = display_block (block_start, uvalue); - uvalue = * block_start; break; case DW_FORM_block1: uvalue = byte_get (data, 1); block_start = data + 1; data = display_block (block_start, uvalue); - uvalue = * block_start; break; case DW_FORM_block2: uvalue = byte_get (data, 2); block_start = data + 2; data = display_block (block_start, uvalue); - uvalue = * block_start; break; case DW_FORM_block4: uvalue = byte_get (data, 4); block_start = data + 4; data = display_block (block_start, uvalue); - uvalue = * block_start; break; case DW_FORM_strp: @@ -6147,11 +6103,6 @@ read_and_display_attr (attribute, form, data, pointer_size) } break; - case DW_AT_frame_base: - if (uvalue >= DW_OP_reg0 && uvalue <= DW_OP_reg31) - printf ("(reg %ld)", uvalue - DW_OP_reg0); - break; - case DW_AT_language: switch (uvalue) { @@ -6248,12 +6199,16 @@ read_and_display_attr (attribute, form, data, pointer_size) } break; + case DW_AT_frame_base: case DW_AT_location: case DW_AT_data_member_location: case DW_AT_vtable_elem_location: - printf ("("); - decode_location_expression (block_start, pointer_size); - printf (")"); + if (block_start) + { + printf ("("); + decode_location_expression (block_start, pointer_size, uvalue); + printf (")"); + } break; default: @@ -6282,6 +6237,7 @@ display_debug_info (section, start, file) unsigned char * tags; int i; int level; + unsigned long cu_offset; external = (DWARF2_External_CompUnit *) start; @@ -6291,20 +6247,21 @@ display_debug_info (section, start, file) compunit.cu_pointer_size = BYTE_GET (external->cu_pointer_size); tags = start + sizeof (* external); + cu_offset = start - section_begin; start += compunit.cu_length + sizeof (external->cu_length); + printf (_(" Compilation Unit @ %lx:\n"), cu_offset); + printf (_(" Length: %ld\n"), compunit.cu_length); + printf (_(" Version: %d\n"), compunit.cu_version); + printf (_(" Abbrev Offset: %ld\n"), compunit.cu_abbrev_offset); + printf (_(" Pointer Size: %d\n"), compunit.cu_pointer_size); + if (compunit.cu_version != 2) { warn (_("Only version 2 DWARF debug information is currently supported.\n")); continue; } - printf (_(" Compilation Unit:\n")); - printf (_(" Length: %ld\n"), compunit.cu_length); - printf (_(" Version: %d\n"), compunit.cu_version); - printf (_(" Abbrev Offset: %ld\n"), compunit.cu_abbrev_offset); - printf (_(" Pointer Size: %d\n"), compunit.cu_pointer_size); - if (first_abbrev != NULL) free_abbrevs (); @@ -6376,7 +6333,7 @@ display_debug_info (section, start, file) for (attr = entry->first_attr; attr; attr = attr->next) tags = read_and_display_attr (attr->attribute, attr->form, - tags, + tags, cu_offset, compunit.cu_pointer_size); if (entry->children) @@ -6433,7 +6390,7 @@ display_debug_aranges (section, start, file) ranges = start + sizeof (* external); /* Must pad to an alignment boundary that is twice the pointer size. */ - excess = sizeof (*external) % (2 * arange.ar_pointer_size); + excess = sizeof (* external) % (2 * arange.ar_pointer_size); if (excess) ranges += (2 * arange.ar_pointer_size) - excess; @@ -6462,6 +6419,602 @@ display_debug_aranges (section, start, file) return 1; } +typedef struct Frame_Chunk +{ + struct Frame_Chunk * next; + unsigned char * chunk_start; + int ncols; + /* DW_CFA_{undefined,same_value,offset,register,unreferenced} */ + short int * col_type; + int * col_offset; + char * augmentation; + unsigned int code_factor; + unsigned int data_factor; + unsigned long pc_begin; + unsigned long pc_range; + int cfa_reg; + int cfa_offset; + int ra; +} +Frame_Chunk; + +/* A marker for a col_type that means this column was never referenced + in the frame info. */ +#define DW_CFA_unreferenced (-1) + +static void +frame_need_space (fc, reg) + Frame_Chunk * fc; + int reg; +{ + int prev = fc->ncols; + + if (reg < fc->ncols) + return; + + fc->ncols = reg + 1; + fc->col_type = (short int *) xrealloc (fc->col_type, + fc->ncols * sizeof (short int)); + fc->col_offset = (int *) xrealloc (fc->col_offset, + fc->ncols * sizeof (int)); + + while (prev < fc->ncols) + { + fc->col_type[prev] = DW_CFA_unreferenced; + fc->col_offset[prev] = 0; + prev++; + } +} + +static void +frame_display_row (fc, need_col_headers, max_regs) + Frame_Chunk * fc; + int * need_col_headers; + int * max_regs; +{ + int r; + char tmp[100]; + + if (* max_regs < fc->ncols) + * max_regs = fc->ncols; + + if (* need_col_headers) + { + * need_col_headers = 0; + + printf (" LOC CFA "); + + for (r = 0; r < * max_regs; r++) + if (fc->col_type[r] != DW_CFA_unreferenced) + { + if (r == fc->ra) + printf ("ra "); + else + printf ("r%-4d", r); + } + + printf ("\n"); + } + + printf ("%08x ", (unsigned int) fc->pc_begin); + sprintf (tmp, "r%d%+d", fc->cfa_reg, fc->cfa_offset); + printf ("%-8s ", tmp); + + for (r = 0; r < fc->ncols; r++) + { + if (fc->col_type[r] != DW_CFA_unreferenced) + { + switch (fc->col_type[r]) + { + case DW_CFA_undefined: + strcpy (tmp, "u"); + break; + case DW_CFA_same_value: + strcpy (tmp, "s"); + break; + case DW_CFA_offset: + sprintf (tmp, "c%+d", fc->col_offset[r]); + break; + case DW_CFA_register: + sprintf (tmp, "r%d", fc->col_offset[r]); + break; + default: + strcpy (tmp, "n/a"); + break; + } + printf ("%-5s", tmp); + } + } + printf ("\n"); +} + +#define GET(N) byte_get (start, N); start += N +#define LEB() read_leb128 (start, & length_return, 0); start += length_return +#define SLEB() read_leb128 (start, & length_return, 1); start += length_return + +static int +display_debug_frames (section, start, file) + Elf32_Internal_Shdr * section; + unsigned char * start; + FILE * file ATTRIBUTE_UNUSED; +{ + unsigned char * end = start + section->sh_size; + unsigned char * section_start = start; + Frame_Chunk * chunks = 0; + Frame_Chunk * remembered_state = 0; + Frame_Chunk * rs; + int is_eh = (strcmp (SECTION_NAME (section), ".eh_frame") == 0); + int length_return; + int max_regs = 0; + + printf (_("The section %s contains:\n"), SECTION_NAME (section)); + + while (start < end) + { + unsigned char * saved_start; + unsigned char * block_end; + unsigned long length; + unsigned long cie_id; + Frame_Chunk * fc; + Frame_Chunk * cie; + int need_col_headers = 1; + + saved_start = start; + length = byte_get (start, 4); start += 4; + + if (length == 0) + return 1; + + block_end = saved_start + length + 4; + cie_id = byte_get (start, 4); start += 4; + + printf ("\n%08x %08lx %08lx ", saved_start - section_start, length, cie_id); + + if (is_eh ? (cie_id == 0) : (cie_id == DW_CIE_ID)) + { + fc = (Frame_Chunk *) xmalloc (sizeof (Frame_Chunk)); + memset (fc, 0, sizeof (Frame_Chunk)); + + fc->next = chunks; + chunks = fc; + fc->chunk_start = saved_start; + fc->ncols = 0; + fc->col_type = (short int *) xmalloc (sizeof (short int)); + fc->col_offset = (int *) xmalloc (sizeof (int)); + frame_need_space (fc, max_regs-1); + + start ++; /* version */ + fc->augmentation = start; + + while (* start) + start++; + + start++; /* skip past NUL */ + + if (fc->augmentation[0] == 'z') + { + int xtra; + fc->code_factor = LEB (); + fc->data_factor = SLEB (); + fc->ra = byte_get (start, 1); start += 1; + xtra = LEB (); + printf ("skipping %d extra bytes\n", xtra); + start += xtra; + } + else if (strcmp (fc->augmentation, "eh") == 0) + { + start += 4; + fc->code_factor = LEB (); + fc->data_factor = SLEB (); + fc->ra = byte_get (start, 1); start += 1; + } + else + { + fc->code_factor = LEB (); + fc->data_factor = SLEB (); + fc->ra = byte_get (start, 1); start += 1; + } + cie = fc; + printf ("CIE \"%s\" cf=%d df=%d ra=%d\n", + fc->augmentation, fc->code_factor, fc->data_factor, fc->ra); + + frame_need_space (fc, fc->ra); + } + else + { + unsigned char * look_for; + static Frame_Chunk fde_fc; + + fc = & fde_fc; + memset (fc, 0, sizeof (Frame_Chunk)); + + look_for = is_eh ? start-4-cie_id : (unsigned char *) cie_id; + + fc->pc_begin = byte_get (start, 4); start += 4; + fc->pc_range = byte_get (start, 4); start += 4; + + for (cie=chunks; cie && (cie->chunk_start != look_for); cie = cie->next); + if (!cie) + { + warn ("Invalid CIE pointer %08x in FDE at %08x\n", cie_id, saved_start); + start = block_end; + fc->ncols = 0; + fc->col_type = (short int *) xmalloc (sizeof (short int)); + fc->col_offset = (int *) xmalloc (sizeof (int)); + frame_need_space (fc, max_regs - 1); + cie = fc; + fc->augmentation = ""; + } + else + { + fc->ncols = cie->ncols; + fc->col_type = (short int *) xmalloc (fc->ncols * sizeof (short int)); + fc->col_offset = (int *) xmalloc (fc->ncols * sizeof (int)); + memcpy (fc->col_type, cie->col_type, fc->ncols * sizeof (short int)); + memcpy (fc->col_offset, cie->col_offset, fc->ncols * sizeof (int)); + fc->augmentation = cie->augmentation; + fc->code_factor = cie->code_factor; + fc->data_factor = cie->data_factor; + fc->cfa_reg = cie->cfa_reg; + fc->cfa_offset = cie->cfa_offset; + fc->ra = cie->ra; + frame_need_space (fc, max_regs-1); + } + + if (cie->augmentation[0] == 'z') + { + unsigned long l = LEB (); + start += l; + } + + printf ("FDE cie=%08x pc=%08lx..%08lx\n", + cie->chunk_start-section_start, fc->pc_begin, + fc->pc_begin + fc->pc_range); + } + + /* At this point, fc is the current chunk, cie (if any) is set, and we're + about to interpret instructions for the chunk. */ + + /* This exists for readelf maintainers. */ +#define FDEBUG 0 + + { + /* Start by making a pass over the chunk, allocating storage + and taking note of what registers are used. */ + unsigned char * tmp = start; + + while (start < block_end) + { + unsigned op, opa; + unsigned long reg; + bfd_vma vma; + + op = * start ++; + opa = op & 0x3f; + if (op & 0xc0) + op &= 0xc0; + + /* Warning: if you add any more cases to this switch, be + sure to add them to the corresponding switch below. */ + switch (op) + { + case DW_CFA_advance_loc: + break; + case DW_CFA_offset: + LEB (); + frame_need_space (fc, opa); + fc->col_type[opa] = DW_CFA_undefined; + break; + case DW_CFA_restore: + frame_need_space (fc, opa); + fc->col_type[opa] = DW_CFA_undefined; + break; + case DW_CFA_set_loc: + start += sizeof (vma); + break; + case DW_CFA_advance_loc1: + start += 1; + break; + case DW_CFA_advance_loc2: + start += 2; + break; + case DW_CFA_advance_loc4: + start += 4; + break; + case DW_CFA_offset_extended: + reg = LEB (); LEB (); + frame_need_space (fc, reg); + fc->col_type[reg] = DW_CFA_undefined; + break; + case DW_CFA_restore_extended: + reg = LEB (); + frame_need_space (fc, reg); + fc->col_type[reg] = DW_CFA_undefined; + break; + case DW_CFA_undefined: + reg = LEB (); + frame_need_space (fc, reg); + fc->col_type[reg] = DW_CFA_undefined; + break; + case DW_CFA_same_value: + reg = LEB (); + frame_need_space (fc, reg); + fc->col_type[reg] = DW_CFA_undefined; + break; + case DW_CFA_register: + reg = LEB (); LEB (); + frame_need_space (fc, reg); + fc->col_type[reg] = DW_CFA_undefined; + break; + case DW_CFA_def_cfa: + LEB (); LEB (); + break; + case DW_CFA_def_cfa_register: + LEB (); + break; + case DW_CFA_def_cfa_offset: + LEB (); + break; +#ifndef DW_CFA_GNU_args_size +#define DW_CFA_GNU_args_size 0x2e +#endif + case DW_CFA_GNU_args_size: + LEB (); + break; +#ifndef DW_CFA_GNU_negative_offset_extended +#define DW_CFA_GNU_negative_offset_extended 0x2f +#endif + case DW_CFA_GNU_negative_offset_extended: + reg = LEB (); LEB (); + frame_need_space (fc, reg); + fc->col_type[reg] = DW_CFA_undefined; + + default: + break; + } + } + start = tmp; + } + + /* Now we know what registers are used, make a second pass over + the chunk, this time actually printing out the info. */ + + while (start < block_end) + { + unsigned op, opa; + unsigned long ul, reg, roffs; + long l, ofs; + bfd_vma vma; + + op = * start ++; + opa = op & 0x3f; + if (op & 0xc0) + op &= 0xc0; + + /* Warning: if you add any more cases to this switch, be + sure to add them to the corresponding switch above. */ + switch (op) + { + case DW_CFA_advance_loc: + frame_display_row (fc, &need_col_headers, &max_regs); +#if FDEBUG + printf (" DW_CFA_advance_loc: %08x = %08x + %d*%d\n", + fc->pc_begin + opa * fc->code_factor, fc->pc_begin, opa, fc->code_factor); +#endif + fc->pc_begin += opa * fc->code_factor; + break; + + case DW_CFA_offset: + roffs = LEB (); +#if FDEBUG + printf (" DW_CFA_offset: r%d = cfa[%d*%d]\n", opa, roffs, fc->data_factor); +#endif + fc->col_type[opa] = DW_CFA_offset; + fc->col_offset[opa] = roffs * fc->data_factor; + break; + + case DW_CFA_restore: +#if FDEBUG + printf (" DW_CFA_restore: r%d\n", opa); +#endif + fc->col_type[opa] = cie->col_type[opa]; + fc->col_offset[opa] = cie->col_offset[opa]; + break; + + case DW_CFA_set_loc: + frame_display_row (fc, &need_col_headers, &max_regs); + vma = byte_get (start, sizeof (vma)); start += sizeof (vma); +#if FDEBUG + printf (" DW_CFA_set_loc: %08x\n", vma); +#endif + fc->pc_begin = vma; + break; + + case DW_CFA_advance_loc1: + frame_display_row (fc, &need_col_headers, &max_regs); + ofs = byte_get (start, 1); start += 1; +#if FDEBUG + printf (" DW_CFA_advance_loc1: %08x = %08x + %d*%d\n", + fc->pc_begin + ofs * fc->code_factor, fc->pc_begin, ofs, fc->code_factor); +#endif + fc->pc_begin += ofs * fc->code_factor; + break; + + case DW_CFA_advance_loc2: + frame_display_row (fc, &need_col_headers, &max_regs); + ofs = byte_get (start, 2); start += 2; +#if FDEBUG + printf (" DW_CFA_advance_loc2: %08x = %08x + %d*%d\n", + fc->pc_begin + ofs * fc->code_factor, fc->pc_begin, ofs, fc->code_factor); +#endif + fc->pc_begin += ofs * fc->code_factor; + break; + + case DW_CFA_advance_loc4: + frame_display_row (fc, &need_col_headers, &max_regs); + ofs = byte_get (start, 4); start += 4; +#if FDEBUG + printf (" DW_CFA_advance_loc4: %08x = %08x + %d*%d\n", + fc->pc_begin + ofs * fc->code_factor, fc->pc_begin, ofs, fc->code_factor); +#endif + fc->pc_begin += ofs * fc->code_factor; + break; + + case DW_CFA_offset_extended: + reg = LEB (); + roffs = LEB (); +#if FDEBUG + printf (" DW_CFA_offset_extended: r%d = cfa[%d*%d]\n", reg, roffs, fc->data_factor); +#endif + fc->col_type[reg] = DW_CFA_offset; + fc->col_offset[reg] = roffs * fc->data_factor; + break; + + case DW_CFA_restore_extended: + reg = LEB (); +#if FDEBUG + printf (" DW_CFA_restore_extended: r%d\n", reg); +#endif + fc->col_type[reg] = cie->col_type[reg]; + fc->col_offset[reg] = cie->col_offset[reg]; + break; + + case DW_CFA_undefined: + reg = LEB (); +#if FDEBUG + printf (" DW_CFA_undefined: r%d\n", reg); +#endif + fc->col_type[reg] = DW_CFA_undefined; + fc->col_offset[reg] = 0; + break; + + case DW_CFA_same_value: + reg = LEB (); +#if FDEBUG + printf (" DW_CFA_same_value: r%d\n", reg); +#endif + fc->col_type[reg] = DW_CFA_same_value; + fc->col_offset[reg] = 0; + break; + + case DW_CFA_register: + reg = LEB (); + roffs = LEB (); +#if FDEBUG + printf (" DW_CFA_register: r%d\n", reg); +#endif + fc->col_type[reg] = DW_CFA_register; + fc->col_offset[reg] = roffs; + break; + + case DW_CFA_remember_state: +#if FDEBUG + printf (" DW_CFA_remember_state\n"); +#endif + rs = (Frame_Chunk *) xmalloc (sizeof (Frame_Chunk)); + rs->ncols = fc->ncols; + rs->col_type = (short int *) xmalloc (rs->ncols * sizeof (short int)); + rs->col_offset = (int *) xmalloc (rs->ncols * sizeof (int)); + memcpy (rs->col_type, fc->col_type, rs->ncols); + memcpy (rs->col_offset, fc->col_offset, rs->ncols * sizeof (int)); + rs->next = remembered_state; + remembered_state = rs; + break; + + case DW_CFA_restore_state: +#if FDEBUG + printf (" DW_CFA_restore_state\n"); +#endif + rs = remembered_state; + remembered_state = rs->next; + frame_need_space (fc, rs->ncols-1); + memcpy (fc->col_type, rs->col_type, rs->ncols); + memcpy (fc->col_offset, rs->col_offset, rs->ncols * sizeof (int)); + free (rs->col_type); + free (rs->col_offset); + free (rs); + break; + + case DW_CFA_def_cfa: + fc->cfa_reg = LEB (); + fc->cfa_offset = LEB (); +#if FDEBUG + printf (" DW_CFA_def_cfa: reg %d ofs %d\n", fc->cfa_reg, fc->cfa_offset); +#endif + break; + + case DW_CFA_def_cfa_register: + fc->cfa_reg = LEB (); +#if FDEBUG + printf (" DW_CFA_def_cfa_reg: %d\n", fc->cfa_reg); +#endif + break; + + case DW_CFA_def_cfa_offset: + fc->cfa_offset = LEB (); +#if FDEBUG + printf (" DW_CFA_def_cfa_offset: %d\n", fc->cfa_offset); +#endif + break; + + case DW_CFA_nop: +#if FDEBUG + printf (" DW_CFA_nop\n"); +#endif + break; + +#ifndef DW_CFA_GNU_window_save +#define DW_CFA_GNU_window_save 0x2d +#endif + case DW_CFA_GNU_window_save: +#if FDEBUG + printf (" DW_CFA_GNU_window_save\n"); +#endif + break; + +#ifndef DW_CFA_GNU_args_size +#define DW_CFA_GNU_args_size 0x2e +#endif + case DW_CFA_GNU_args_size: + ul = LEB (); +#if FDEBUG + printf (" DW_CFA_GNU_args_size: %d\n", ul); +#endif + break; + +#ifndef DW_CFA_GNU_negative_offset_extended +#define DW_CFA_GNU_negative_offset_extended 0x2f +#endif + case DW_CFA_GNU_negative_offset_extended: + reg = LEB (); + l = - LEB (); + frame_need_space (fc, reg); +#if FDEBUG + printf (" DW_CFA_GNU_negative_offset_extended: r%d = cfa[%d*%d]\n", reg, l, fc->data_factor); +#endif + fc->col_type[reg] = DW_CFA_offset; + fc->col_offset[reg] = l * fc->data_factor; + break; + + default: + fprintf (stderr, "unsupported or unknown DW_CFA_%d\n", op); + start = block_end; + } + } + + frame_display_row (fc, &need_col_headers, &max_regs); + + start = block_end; + } + + printf ("\n"); + + return 1; +} + +#undef GET +#undef LEB +#undef SLEB static int display_debug_not_supported (section, start, file) @@ -6509,6 +7062,8 @@ debug_displays[] = { ".debug_line", display_debug_lines, NULL }, { ".debug_aranges", display_debug_aranges, NULL }, { ".debug_pubnames", display_debug_pubnames, NULL }, + { ".debug_frame", display_debug_frames, NULL }, + { ".eh_frame", display_debug_frames, NULL }, { ".debug_macinfo", display_debug_not_supported, NULL }, { ".debug_frame", display_debug_not_supported, NULL }, { ".debug_str", display_debug_not_supported, NULL }, @@ -6539,6 +7094,9 @@ display_debug_section (section, file) "debug section data"); /* See if we know how to display the contents of this section. */ + if (strncmp (name, ".gnu.linkonce.wi.", 17) == 0) + name = ".debug_info"; + for (i = NUM_ELEM (debug_displays); i--;) if (strcmp (debug_displays[i].name, name) == 0) { @@ -6775,7 +7333,7 @@ process_mips_specific (file) Elf_External_Options *, "options"); iopt = (Elf_Internal_Options *) malloc ((sect->sh_size / sizeof (eopt)) - * sizeof (*iopt)); + * sizeof (* iopt)); if (iopt == NULL) { error (_("Out of memory")); @@ -6784,7 +7342,7 @@ process_mips_specific (file) offset = cnt = 0; option = iopt; - + while (offset < sect->sh_size) { Elf_External_Options * eoption; @@ -6797,16 +7355,16 @@ process_mips_specific (file) option->info = BYTE_GET (eoption->info); offset += option->size; - + ++option; ++cnt; } printf (_("\nSection '%s' contains %d entries:\n"), - string_table + sect->sh_name, cnt); + SECTION_NAME (sect), cnt); option = iopt; - + while (cnt-- > 0) { size_t len; @@ -6822,8 +7380,8 @@ process_mips_specific (file) if (elf_header.e_machine == EM_MIPS) { /* 32bit form. */ - Elf32_External_RegInfo *ereg; - Elf32_RegInfo reginfo; + Elf32_External_RegInfo * ereg; + Elf32_RegInfo reginfo; ereg = (Elf32_External_RegInfo *) (option + 1); reginfo.ri_gprmask = BYTE_GET (ereg->ri_gprmask); @@ -6940,7 +7498,7 @@ process_mips_specific (file) break; } - len = sizeof (*eopt); + len = sizeof (* eopt); while (len < option->size) if (((char *) option)[len] >= ' ' && ((char *) option)[len] < 0x7f) @@ -6968,7 +7526,7 @@ process_mips_specific (file) return 0; } - iconf = (Elf32_Conflict *) malloc (conflictsno * sizeof (*iconf)); + iconf = (Elf32_Conflict *) malloc (conflictsno * sizeof (* iconf)); if (iconf == NULL) { error (_("Out of memory")); @@ -6977,7 +7535,7 @@ process_mips_specific (file) if (is_32bit_elf) { - GET_DATA_ALLOC (conflicts_offset, conflictsno * sizeof (*econf32), + GET_DATA_ALLOC (conflicts_offset, conflictsno * sizeof (* econf32), econf32, Elf32_External_Conflict *, "conflict"); for (cnt = 0; cnt < conflictsno; ++cnt) @@ -6985,7 +7543,7 @@ process_mips_specific (file) } else { - GET_DATA_ALLOC (conflicts_offset, conflictsno * sizeof (*econf64), + GET_DATA_ALLOC (conflicts_offset, conflictsno * sizeof (* econf64), econf64, Elf64_External_Conflict *, "conflict"); for (cnt = 0; cnt < conflictsno; ++cnt) @@ -7069,8 +7627,7 @@ process_corefile_note_segment (file, offset, length) external = pnotes; printf (_("\nNotes at offset 0x%08lx with length 0x%08lx:\n"), - (unsigned long) offset, - (unsigned long) length); + (unsigned long) offset, (unsigned long) length); printf (_(" Owner\t\tData size\tDescription\n")); while (external < (Elf_External_Note *)((char *) pnotes + length)) @@ -7084,7 +7641,7 @@ process_corefile_note_segment (file, offset, length) inote.descsz = BYTE_GET (external->descsz); inote.descdata = inote.namedata + align_power (inote.namesz, 2); inote.descpos = offset + (inote.descdata - (char *) pnotes); - + external = (Elf_External_Note *)(inote.descdata + align_power (inote.descsz, 2)); /* Verify that name is null terminated. It appears that at least @@ -7094,17 +7651,17 @@ process_corefile_note_segment (file, offset, length) if (inote.namedata[inote.namesz] != '\0') { temp = malloc (inote.namesz + 1); - + if (temp == NULL) { error (_("Out of memory\n")); res = 0; break; } - + strncpy (temp, inote.namedata, inote.namesz); temp[inote.namesz] = 0; - + /* warn (_("'%s' NOTE name not properly null terminated\n"), temp); */ inote.namedata = temp; } @@ -7363,6 +7920,7 @@ process_file (file_name) { free (string_table); string_table = NULL; + string_table_length = 0; } if (dynamic_strings) diff --git a/gnu/dist/toolchain/binutils/resrc.c b/gnu/dist/toolchain/binutils/resrc.c index 8c3c9a74d224..68bc7c40302f 100644 --- a/gnu/dist/toolchain/binutils/resrc.c +++ b/gnu/dist/toolchain/binutils/resrc.c @@ -78,7 +78,7 @@ /* The default preprocessor. */ -#define DEFAULT_PREPROCESSOR "gcc -E -xc-header -DRC_INVOKED" +#define DEFAULT_PREPROCESSOR "gcc -E -xc -DRC_INVOKED" /* We read the directory entries in a cursor or icon file into instances of this structure. */ @@ -498,9 +498,6 @@ read_rc_file (filename, preprocessor, preprocargs, language, use_temp_file) static void close_input_stream () { - if (cpp_pipe != NULL) - pclose (cpp_pipe); - if (istream_type == ISTREAM_FILE) { if (cpp_pipe != NULL) @@ -844,19 +841,42 @@ define_control (text, id, x, y, width, height, class, style, exstyle) n->height = height; n->class.named = 0; n->class.u.id = class; - if (text != NULL) - res_string_to_id (&n->text, text); - else - { - n->text.named = 0; - n->text.u.id = 0; - } + if (text == NULL) + text = ""; + res_string_to_id (&n->text, text); n->data = NULL; n->help = 0; return n; } +struct dialog_control * +define_icon_control (iid, id, x, y, style, exstyle, help, data, ex) + struct res_id iid; + unsigned long id; + unsigned long x; + unsigned long y; + unsigned long style; + unsigned long exstyle; + unsigned long help; + struct rcdata_item *data; + struct dialog_ex *ex; +{ + struct dialog_control *n; + if (style == 0) + style = SS_ICON | WS_CHILD | WS_VISIBLE; + n = define_control (0, id, x, y, 0, 0, CTL_STATIC, style, exstyle); + n->text = iid; + if (help && !ex) + rcparse_warning (_("help ID requires DIALOGEX")); + if (data && !ex) + rcparse_warning (_("control data requires DIALOGEX")); + n->help = help; + n->data = data; + + return n; +} + /* Define a font resource. */ void diff --git a/gnu/dist/toolchain/binutils/srconv.c b/gnu/dist/toolchain/binutils/srconv.c index c317d9807fa4..fb8996b3643b 100644 --- a/gnu/dist/toolchain/binutils/srconv.c +++ b/gnu/dist/toolchain/binutils/srconv.c @@ -224,7 +224,7 @@ writeBARRAY (data, ptr, idx, size, file) barray data; char *ptr; int *idx; - int size; + int size ATTRIBUTE_UNUSED; FILE *file; { int i; @@ -299,7 +299,7 @@ wr_un (ptr, sfile, first, nsecs) struct coff_ofile *ptr; struct coff_sfile *sfile; int first; - int nsecs; + int nsecs ATTRIBUTE_UNUSED; { struct IT_un un; @@ -438,7 +438,7 @@ wr_hd (p) static void wr_sh (p, sec) - struct coff_ofile *p; + struct coff_ofile *p ATTRIBUTE_UNUSED; struct coff_section *sec; { struct IT_sh sh; @@ -453,7 +453,7 @@ wr_sh (p, sec) static void wr_ob (p, section) - struct coff_ofile *p; + struct coff_ofile *p ATTRIBUTE_UNUSED; struct coff_section *section; { bfd_size_type i; @@ -514,7 +514,7 @@ wr_ob (p, section) static void wr_rl (ptr, sec) - struct coff_ofile *ptr; + struct coff_ofile *ptr ATTRIBUTE_UNUSED; struct coff_section *sec; { int nr = sec->nrelocs; @@ -586,7 +586,7 @@ wr_object_body (p) static void wr_dps_start (sfile, section, scope, type, nest) struct coff_sfile *sfile; - struct coff_section *section; + struct coff_section *section ATTRIBUTE_UNUSED; struct coff_scope *scope; int type; int nest; @@ -623,8 +623,8 @@ wr_dps_start (sfile, section, scope, type, nest) static void wr_dps_end (section, scope, type) - struct coff_section *section; - struct coff_scope *scope; + struct coff_section *section ATTRIBUTE_UNUSED; + struct coff_scope *scope ATTRIBUTE_UNUSED; int type; { struct IT_dps dps; @@ -960,7 +960,7 @@ walk_tree_type (sfile, symbol, type, nest) static void walk_tree_symbol (sfile, section, symbol, nest) struct coff_sfile *sfile; - struct coff_section *section; + struct coff_section *section ATTRIBUTE_UNUSED; struct coff_symbol *symbol; int nest; { @@ -1329,7 +1329,7 @@ wr_du (p, sfile, n) static void wr_dus (p, sfile) - struct coff_ofile *p; + struct coff_ofile *p ATTRIBUTE_UNUSED; struct coff_sfile *sfile; { @@ -1373,11 +1373,12 @@ find_base (sfile, section) { return sfile->section[section->number].low; } + static void wr_dln (p, sfile, n) - struct coff_ofile *p; + struct coff_ofile *p ATTRIBUTE_UNUSED; struct coff_sfile *sfile; - int n; + int n ATTRIBUTE_UNUSED; { #if 0 @@ -1517,7 +1518,7 @@ static void wr_globals (p, sfile, n) struct coff_ofile *p; struct coff_sfile *sfile; - int n; + int n ATTRIBUTE_UNUSED; { struct coff_symbol *sy; for (sy = p->symbol_list_head; @@ -1734,7 +1735,7 @@ return scount; static void wr_er (ptr, sfile, first) struct coff_ofile *ptr; - struct coff_sfile *sfile; + struct coff_sfile *sfile ATTRIBUTE_UNUSED; int first; { int idx = 0; @@ -1760,7 +1761,7 @@ wr_er (ptr, sfile, first) static void wr_ed (ptr, sfile, first) struct coff_ofile *ptr; - struct coff_sfile *sfile; + struct coff_sfile *sfile ATTRIBUTE_UNUSED; int first; { struct coff_symbol *s; diff --git a/gnu/dist/toolchain/binutils/stabs.c b/gnu/dist/toolchain/binutils/stabs.c index 5f600354257e..daea30142959 100644 --- a/gnu/dist/toolchain/binutils/stabs.c +++ b/gnu/dist/toolchain/binutils/stabs.c @@ -1,5 +1,6 @@ /* stabs.c -- Parse stabs debugging information - Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright 1995, 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. Written by Ian Lance Taylor . This file is part of GNU Binutils. @@ -33,6 +34,7 @@ #include "demangle.h" #include "debug.h" #include "budbg.h" +#include "filenames.h" /* Meaningless definition needs by aout64.h. FIXME. */ #define BYTES_IN_WORD 4 @@ -40,14 +42,6 @@ #include "aout/aout64.h" #include "aout/stab_gnu.h" -#ifndef DIR_SEPARATOR -#ifdef _WIN32 -#define DIR_SEPARATOR '\\' -#else -#define DIR_SEPARATOR '/' -#endif -#endif - /* The number of predefined XCOFF types. */ #define XCOFF_TYPE_COUNT 34 @@ -568,12 +562,7 @@ parse_stab (dhandle, handle, type, desc, value, string) f = info->so_string; - if ( (string[0] == '/') - || (string[0] == DIR_SEPARATOR) - || ( (DIR_SEPARATOR == '\\') - && (string[1] == ':') - && ( (string[2] == DIR_SEPARATOR) - || (string[2] == '/')))) + if (IS_ABSOLUTE_PATH (string)) info->so_string = xstrdup (string); else info->so_string = concat (info->so_string, string, @@ -706,6 +695,7 @@ parse_stab (dhandle, handle, type, desc, value, string) case N_OBJ: case N_ENDM: case N_MAIN: + case N_WARNING: break; } @@ -1822,7 +1812,7 @@ parse_stab_range_type (dhandle, info, typename, pp, typenums) else if (n3 == (bfd_signed_vma) 0xffffffff) return debug_make_int_type (dhandle, 4, true); #ifdef BFD64 - else if (n3 == ((((bfd_vma) 0xffffffff) << 32) | 0xffffffff)) + else if (n3 == ((((bfd_signed_vma) 0xffffffff) << 32) | 0xffffffff)) return debug_make_int_type (dhandle, 8, true); #endif } diff --git a/gnu/dist/toolchain/binutils/strings.1 b/gnu/dist/toolchain/binutils/strings.1 index 4d33b7996b77..4233630cde7e 100644 --- a/gnu/dist/toolchain/binutils/strings.1 +++ b/gnu/dist/toolchain/binutils/strings.1 @@ -1,6 +1,6 @@ .\" Copyright (c) 1993, 94, 95, 2000 Free Software Foundation .\" See section COPYING for conditions for redistribution -.TH strings 1 "09 March 2000" "cygnus support" "GNU Development Tools" +.TH strings 1 "09 March 2000" "Free Software Foundation" "GNU Development Tools" .de BP .sp .ti \-.2i @@ -133,19 +133,377 @@ The GNU Binary Utilities\c .SH COPYING -Copyright (c) 1993 Free Software Foundation, Inc. +Copyright (c) 1993, 2000 Free Software Foundation, Inc. .PP -Permission is granted to make and distribute verbatim copies of -this manual provided the copyright notice and this permission notice -are preserved on all copies. -.PP -Permission is granted to copy and distribute modified versions of this -manual under the conditions for verbatim copying, provided that the -entire resulting derived work is distributed under the terms of a -permission notice identical to this one. -.PP -Permission is granted to copy and distribute translations of this -manual into another language, under the above conditions for modified -versions, except that this permission notice may be included in -translations approved by the Free Software Foundation instead of in -the original English. +This document is distributed under the terms of the GNU Free +Documentation License, version 1.1. That license is described in the +sources for this manual page, but it is not displayed here in order to +make this manual more consise. Copies of this license can also be +obtained from: http://www.gnu.org/copyleft/. + +\" .SH 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. +\" .PP +\" 0. PREAMBLE +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 1. APPLICABILITY AND DEFINITIONS +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 2. VERBATIM COPYING +\" .PP +\" 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. +\" .PP +\" You may also lend copies, under the same conditions stated above, and +\" you may publicly display copies. +\" .PP +\" 3. COPYING IN QUANTITY +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 4. MODIFICATIONS +\" .PP +\" 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: +\" .PP +\" 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. +\" .PP +\" 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). +\" .PP +\" C. State on the Title page the name of the publisher of the +\" Modified Version, as the publisher. +\" .PP +\" D. Preserve all the copyright notices of the Document. +\" .PP +\" E. Add an appropriate copyright notice for your modifications +\" adjacent to the other copyright notices. +\" .PP +\" 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. +\" Preserve in that license notice the full lists of Invariant Sections +\" and required Cover Texts given in the Document's license notice. +\" .PP +\" H. Include an unaltered copy of this License. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" M. Delete any section entitled "Endorsements". Such a section +\" may not be included in the Modified Version. +\" .PP +\" N. Do not retitle any existing section as "Endorsements" +\" or to conflict in title with any Invariant Section. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 5. COMBINING DOCUMENTS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP +\" 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." +\" .PP + +\" 6. COLLECTIONS OF DOCUMENTS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 7. AGGREGATION WITH INDEPENDENT WORKS +\" .PP +\" 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. +\" .PP +\" 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. +\" .PP + +\" 8. TRANSLATION +\" .PP +\" 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. +\" .PP + +\" 9. TERMINATION +\" .PP +\" 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. +\" .PP + +\" 10. FUTURE REVISIONS OF THIS LICENSE +\" .PP +\" 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/. +\" .PP +\" 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. +\" .PP + +\" ADDENDUM: How to use this License for your documents +\" .PP +\" 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: +\" .PP +\" 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". +\" .PP +\" 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. +\" .PP +\" 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. diff --git a/gnu/dist/toolchain/binutils/strings.c b/gnu/dist/toolchain/binutils/strings.c index 54f29e43abb8..a961e418e2f3 100644 --- a/gnu/dist/toolchain/binutils/strings.c +++ b/gnu/dist/toolchain/binutils/strings.c @@ -77,9 +77,9 @@ #endif #ifdef isascii -#define isgraphic(c) (isascii (c) && isprint (c)) +#define isgraphic(c) (isascii (c) && (isprint (c) || (c) == '\t')) #else -#define isgraphic(c) (isprint (c)) +#define isgraphic(c) (isprint (c) || (c) == '\t') #endif #ifndef errno diff --git a/gnu/dist/toolchain/binutils/sysdump.c b/gnu/dist/toolchain/binutils/sysdump.c index fd2a0ea3e471..1f8a5778caae 100644 --- a/gnu/dist/toolchain/binutils/sysdump.c +++ b/gnu/dist/toolchain/binutils/sysdump.c @@ -131,8 +131,8 @@ barray getBARRAY (ptr, idx, dsize, max) unsigned char *ptr; int *idx; - int dsize; - int max; + int dsize ATTRIBUTE_UNUSED; + int max ATTRIBUTE_UNUSED; { barray res; int i; diff --git a/gnu/dist/toolchain/binutils/syslex.c b/gnu/dist/toolchain/binutils/syslex.c index e0691bf4255d..e909c5505bd1 100644 --- a/gnu/dist/toolchain/binutils/syslex.c +++ b/gnu/dist/toolchain/binutils/syslex.c @@ -1,7 +1,7 @@ /* A lexical scanner generated by flex */ /* Scanner skeleton version: - * $Header: /cvs/src/src/binutils/Attic/syslex.c,v 1.1.2.1 2000/05/29 14:08:52 pb Exp $ + * $Header: /cvs/src/src/binutils/Attic/syslex.c,v 1.1.4.1 2001/03/12 15:40:37 pb Exp $ */ #define FLEX_SCANNER diff --git a/gnu/dist/toolchain/binutils/testsuite/ChangeLog b/gnu/dist/toolchain/binutils/testsuite/ChangeLog index 078f8d53c708..5f12ea70ecd9 100644 --- a/gnu/dist/toolchain/binutils/testsuite/ChangeLog +++ b/gnu/dist/toolchain/binutils/testsuite/ChangeLog @@ -1,13 +1,96 @@ +2001-01-16 Matthew Green + + * binutils-all/readelf.s-64: Match readelf -S output. + +2000-12-09 Nick Clifton + + * binutils-all/objdump.exp (cpus_expected): Add tic54x and + tms320c54x. + +2000-11-28 Hans-Peter Nilsson + + * binutils-all/readelf.s: Adjust to readelf.c formatting changes. + +2000-11-02 Chris Demetriou + + * binutils-all/readelf.exp (regexp_diff): Add code + from gas testsuite to treat "#..." at beginning of line + as an indicator to skip extra non-matching lines at that + location. + (readelf_test): Add support for using a machine-specific + regexp comparison file. + (readelf -S test, readelf -s test): Remove v850*-*-* and + mips*-*-* from list of expected failures. + * binutils-all/readelf.s: Accomodate changes due to + additional sections (and therefore section numbering + differences) on v850*-*-* and mips*-*-* targets. + * binutils-all/readelf.ss: Likewise. + * binutils-all/readelf.ss-mips: New file, which matches + expected output of readelf -s test for mips*-*-*. + +2000-10-25 Hans-Peter Nilsson + + * binutils-all/readelf.exp (-wi test): Add cris-*-* to xfails. + +2000-10-19 Chris Demetriou + + * binutils-all/readelf.exp (readelf_test): Work properly + when multiple targets expect failtures. + (readelf -S test, readelf -s test): Expect mips*-*-* + to fail. + +2000-07-10 Alan Modra + + * lib/utils-lib.exp (default_binutils_assemble): Don't do the hppa + sed fudges for hppa-linux. + +2000-07-01 Frank Ch. Eigler + + * binutils-all/objdump.exp (cpus_expected, cpus_regex): Reorganize + syntax to display more tcl nature. + +2000-06-18 Stephane Carrez + + * binutils-all/objdump.exp (cpus_expected): Recognize m68hc11 and + m68hc12. + +2000-06-18 Nick Clifton + + * binutils-all/readelf.wi: Do not assume the compilation tag to be + unit 1. + + * binutils-all/objcopy.exp: Expect all arm variants to fail the + copying executable test. + +2000-06-14 Hans-Peter Nilsson + + * binutils-all/readelf.exp (regexp_diff): Do not break when a + mismatching line is found. + (readelf_find_size): New. + (readelf_size): New global variable. + (readelf_test): Add newline to send_log of command. + If $srcdir/$subdir/$regexp_file-$readelf_size exists, use it + instead of $srcdir/$subdir/$regexp_file. + (*-*elf test): Fix typo in message. + * binutils-all/readelf.s-64: New. + * binutils-all/readelf.ss-64: New. + +2000-05-02 Alan Modra + + * binutils-all/objcopy.exp (simple copy): Clear xfail for hppa-linux. + + * binutils-all/hppa/objdump.exp: Disable test for elf. + 2000-03-13 Nick Clifton - * binutils-all/readelf.s: Adjust to match noew format of readelf - output. - * binutils-all/readelf.ss: Adjust to match noew format of readelf - output. + * binutils-all/readelf.s: Adjust to match new format of readelf + output. + * binutils-all/readelf.ss: Adjust to match new format of readelf + output. 1999-11-01 Nick Clifton - * binutils-all/objcopy.exp: Expect simple objcopy test for fail + * binutils-all/objcopy.exp: Expect simple objcopy test to fail for COFF based ARM and Thumb ports. Tue Sep 14 00:28:17 1999 Jeffrey A Law (law@cygnus.com) @@ -35,7 +118,7 @@ Sat Aug 28 00:24:27 1999 Jerry Quinn 1999-06-29 Nick Clifton * binutils-all/objdump.exp: Add fr30 and MCore to expected cpus - list. + list. * binutils-all/readelf.r: Do not assume a fixed number of spaces in the output. @@ -56,13 +139,13 @@ Wed Jun 9 11:59:22 1999 Andreas Schwab 1999-03-12 Nick Clifton - * binutils-all/readelf.wi: Remove FR30 specific componnts. + * binutils-all/readelf.wi: Remove FR30 specific components. * binutils-all/readelf.s: Remove RELA specific components. 1999-02-16 Nick Clifton * binutils-all/readelf.s: Do not assume section alignment is 4. - * binutils-all/readelf.r: Do not assume rela's are being used. + * binutils-all/readelf.r: Do not assume rela's are being used. * binutils-all/readelf.exp: disable tests for non ELF based targets. @@ -127,30 +210,30 @@ Fri May 29 14:50:24 1998 Ian Lance Taylor Thu Nov 6 14:32:37 1997 Bob Manson * lib/utils-lib.exp: Temporary definition of target_assemble and - default_target_assemble so that testing can work with older - dejagnu versions. + default_target_assemble so that testing can work with older + dejagnu versions. Wed Sep 24 12:09:15 1997 Bob Manson * binutils-all/objcopy.exp(strip_executable): Make a new copy of - the executable being tested. + the executable being tested. Mon Sep 15 21:25:20 1997 Bob Manson * binutils-all/objcopy.exp: Compile the executables to be tested - on the target with a status wrapper (as necessary). + on the target with a status wrapper (as necessary). * binutils-all/ar.exp: If testing on a remote host, don't bother - looking on the local host for the program being tested. Use the - correct filenames on the remote host. + looking on the local host for the program being tested. Use the + correct filenames on the remote host. * binutils-all/nm.exp: Ditto. * binutils-all/size.exp: Ditto. * binutils-all/objdump.exp: Ditto. - (cpus_expected): Add the target CPU to the regexp of CPUs to be - expected, if it's not already there. + (cpus_expected): Add the target CPU to the regexp of CPUs to be + expected, if it's not already there. Thu Aug 28 09:57:27 1997 Doug Evans @@ -165,7 +248,7 @@ Tue Jun 3 17:12:54 1997 Bob Manson * config/default.exp: Remove expect_before statement. * binutils-all/objcopy.exp: Don't use global exec_output variable; - the output is returned from remote_load instead. + the output is returned from remote_load instead. Mon May 12 22:14:20 1997 Bob Manson @@ -179,14 +262,14 @@ Mon May 12 22:14:20 1997 Bob Manson Wed Apr 30 20:37:51 1997 Bob Manson Changes to support multilib and remote hosted testing, along with - general cleanups and simplifications. + general cleanups and simplifications. * lib/utils-lib.exp(binutil_version): Use remote_exec. (default_binutils_run): Ditto. (default_binutils_assemble): Remove first argument; call - target_compile to actually do the assembly. + target_compile to actually do the assembly. (default_binutils_compile,default_binutils_remove,prune_warnings): - Delete. + Delete. * config/default.exp: Remove AS and ASFLAGS. (binutils_compile,binutils_remove): Delete. @@ -225,7 +308,7 @@ Wed Jan 29 00:16:43 1997 Bob Manson * binutils-all/objdump.exp: Ditto. * binutils-all/size.exp: Ditto. * binutils-all/hppa/objdump.exp: Ditto. - + Wed Oct 16 22:57:59 1996 Jeffrey A Law (law@cygnus.com) @@ -602,9 +685,9 @@ Fri Jul 2 12:41:20 1993 Ian Lance Taylor (ian@cygnus.com) * binutils.all/*.exp: Use -- for long arguments rather than +. -Fri Jun 4 10:52:29 1993 david d `zoo' zuhn (zoo at cirdan.cygnus.com) +Fri Jun 4 10:52:29 1993 david d `zoo' zuhn (zoo@cirdan.cygnus.com) - * configure.in: change srctrigger to Makefile.in + * configure.in: change srctrigger to Makefile.in Wed May 26 17:27:46 1993 Ian Lance Taylor (ian@cygnus.com) @@ -625,9 +708,9 @@ Thu Mar 25 05:38:47 1993 Ken Raeburn (raeburn@kr-pc.cygnus.com) Mon Feb 22 07:54:03 1993 Mike Werner (mtw@poseidon.cygnus.com) - * binutils/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. + * binutils/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. Sun Feb 21 10:55:55 1993 Mike Werner (mtw@poseidon.cygnus.com) diff --git a/gnu/dist/toolchain/binutils/testsuite/binutils-all/hppa/objdump.exp b/gnu/dist/toolchain/binutils/testsuite/binutils-all/hppa/objdump.exp index 2e2155ed6d95..46b0ed0d57c0 100644 --- a/gnu/dist/toolchain/binutils/testsuite/binutils-all/hppa/objdump.exp +++ b/gnu/dist/toolchain/binutils/testsuite/binutils-all/hppa/objdump.exp @@ -29,6 +29,11 @@ if [istarget hppa*w-*-*] then { return } +# elf hppa assembler doesn't support .subspa +if {[istarget *-*-*elf*] || [istarget *-*-linux*]} then { + return +} + if {[which $OBJDUMP] == 0} then { perror "$OBJDUMP does not exist" return diff --git a/gnu/dist/toolchain/binutils/testsuite/binutils-all/objcopy.exp b/gnu/dist/toolchain/binutils/testsuite/binutils-all/objcopy.exp index 1c40e0a6682b..430b7fe578b5 100644 --- a/gnu/dist/toolchain/binutils/testsuite/binutils-all/objcopy.exp +++ b/gnu/dist/toolchain/binutils/testsuite/binutils-all/objcopy.exp @@ -80,7 +80,7 @@ if ![string match "" $got] then { setup_xfail "h8300-*-hms" "h8300-*-coff" setup_xfail "h8500-*-hms" "h8500-*-coff" setup_xfail "hppa*-*-*" - clear_xfail "hppa*-*-*elf*" + clear_xfail "hppa*-*-*elf*" "hppa*-*-linux*" setup_xfail "m88*-*-coff" "m88*-motorola-sysv*" setup_xfail "z8*-*-coff" @@ -473,7 +473,7 @@ proc copy_executable { prog flags test1 test2 } { # mips_elf_sym_is_global. setup_xfail "mips*-*-elf" - setup_xfail "arm*-*-coff" + setup_xfail "*arm*-*-coff" setup_xfail "arm*-*-pe" setup_xfail "thumb*-*-coff" setup_xfail "thumb*-*-pe" diff --git a/gnu/dist/toolchain/binutils/testsuite/binutils-all/objdump.exp b/gnu/dist/toolchain/binutils/testsuite/binutils-all/objdump.exp index 89040fc2e979..63d4fc43b7da 100644 --- a/gnu/dist/toolchain/binutils/testsuite/binutils-all/objdump.exp +++ b/gnu/dist/toolchain/binutils/testsuite/binutils-all/objdump.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc. +# Copyright (C) 1993, 1994, 1995, 1996, 2000 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 @@ -33,14 +33,23 @@ send_user "Version [binutil_version $OBJDUMP]" set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -i"] -set cpus_expected "(a29k|alliant|alpha|arc|arm|convex|d10v|d30v|fr30|h8|hppa|i386|i860|i960|m32r|m68k|m88k|MCore|mips|mn10200|mn10300|ns32k|pj|powerpc|pyramid|romp|rs6000|sh|sparc|tahoe|v850|vax|we32k|z8k|z8001|z8002)" +set cpus_expected [list] +lappend cpus_expected a29k alliant alpha arc arm convex +lappend cpus_expected d10v d30v fr30 h8 hppa i386 i860 i960 +lappend cpus_expected m32r m68hc11 m68hc12 m68k m88k MCore +lappend cpus_expected mips mn10200 mn10300 ns32k pj powerpc pyramid +lappend cpus_expected romp rs6000 sh sparc tahoe tic54x tms320c54x v850 +lappend cpus_expected vax we32k z8k z8001 z8002 # Make sure the target CPU shows up in the list. -if ![regexp $cpus_expected $target_cpu] { - regsub "^\[(\]" "$cpus_expected" "(${target_cpu}|" cpus_expected; -} +lappend cpus_expected ${target_cpu} -set want "BFD header file version.*srec\[^\n\]*\n\[^\n\]*header \[^\n\]*endian\[^\n\]*, data \[^\n\]*endian.*$cpus_expected" +# Create regexp +set cpus_regex "([join $cpus_expected | ])" + +verbose -log "CPU regex: $cpus_regex" + +set want "BFD header file version.*srec\[^\n\]*\n\[^\n\]*header \[^\n\]*endian\[^\n\]*, data \[^\n\]*endian.*$cpus_regex" if [regexp $want $got] then { pass "objdump -i" @@ -64,7 +73,7 @@ if [is_remote host] { set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -f $testfile"] -set want "$testfile:\[ \]*file format.*architecture:\[ \]*${cpus_expected}.*HAS_RELOC.*HAS_SYMS" +set want "$testfile:\[ \]*file format.*architecture:\[ \]*${cpus_regex}.*HAS_RELOC.*HAS_SYMS" if ![regexp $want $got] then { fail "objdump -f" @@ -83,7 +92,14 @@ if ![regexp $want $got all text_name text_size data_name data_size] then { } else { verbose "text name is $text_name size is $text_size" verbose "data name is $data_name size is $data_size" - if {[expr "0x$text_size"] < 8 || [expr "0x$data_size"] < 4} then { + set ets 8 + set eds 4 + # c54x section sizes are in bytes, not octets; adjust accordingly + if [istarget *c54x*-*-*] then { + set ets 4 + set eds 2 + } + if {[expr "0x$text_size"] < $ets || [expr "0x$data_size"] < $eds} then { send_log "sizes too small\n" fail "objdump -h" } else { @@ -126,7 +142,7 @@ if [regexp $want $got] then { set got [binutils_run $OBJDUMP "$OBJDUMPFLAGS -s $testfile"] -set want "$testfile:\[ \]*file format.*Contents.*(text|TEXT|\\\$CODE\\\$)\[^0-9\]*\[ \]*\[0-9a-fA-F\]*\[ \]*(00000001|01000000).*Contents.*(data|DATA)\[^0-9\]*\[ \]*\[0-9a-fA-F\]*\[ \]*(00000002|02000000)" +set want "$testfile:\[ \]*file format.*Contents.*(text|TEXT|\\\$CODE\\\$)\[^0-9\]*\[ \]*\[0-9a-fA-F\]*\[ \]*(00000001|01000000|00000100).*Contents.*(data|DATA)\[^0-9\]*\[ \]*\[0-9a-fA-F\]*\[ \]*(00000002|02000000|00000200)" if [regexp $want $got] then { pass "objdump -s" diff --git a/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.exp b/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.exp index b2f744c7e151..f93e2f5803c8 100644 --- a/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.exp +++ b/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1999 Free Software Foundation, Inc. +# Copyright (C) 1999, 2000 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-dejagnu@prep.ai.mit.edu -# Written by Nick Clifto +# Written by Nick Clifton # Based on scripts written by Ian Lance Taylor # and Ken Raeburn . @@ -76,6 +76,20 @@ proc regexp_diff { file_1 file_2 } { set end_2 1 set diff_pass 1 break + } elseif [ string match "#..." $line_b ] { + if { [gets $file_b line_b] == $eof } { + set end_2 1 + break + } + verbose "looking for \"^$line_b$\"" 3 + while { ![regexp "^$line_b$" "$line_a"] } { + verbose "skipping \"$line_a\"" 3 + if { [gets $file_a line_a] == $eof } { + set end_1 1 + break + } + } + break } if { [gets $file_b line_b] == $eof } { set end_2 1 @@ -103,7 +117,6 @@ proc regexp_diff { file_1 file_2 } { send_log "regexp_diff match failure\n" send_log "regexp \"^$line_b$\"\nline \"$line_a\"\n" set differences 1 - break } } } @@ -120,23 +133,55 @@ proc regexp_diff { file_1 file_2 } { return $differences } +# Find out the size by reading the output of the EI_CLASS field. +# Similar to the test for readelf -h, but we're just looking for the +# EI_CLASS line here. +proc readelf_find_size { binary_file } { + global READELF + global READELFFLAGS + global readelf_size + + set readelf_size "" + set testname "finding out ELF size with readelf -h" + catch "exec $READELF $READELFFLAGS -h $binary_file > readelf.out" got + + if ![string match "" $got] then { + send_log $got + fail $testname + return + } + + if { ! [regexp "\n\[ \]*Class:\[ \]*ELF(\[0-9\]+)\n" \ + [file_contents readelf.out] nil readelf_size] } { + verbose -log "EI_CLASS field not found in output" + verbose -log "output is \n[file_contents readelf.out]" + fail $testname + return + } else { + verbose -log "ELF size is $readelf_size" + } + + pass $testname +} + # Run an individual readelf test. # Basically readelf is run on the binary_file with the given options. # Readelf's output is captured and then compared against the contents -# of the regexp_file. +# of the regexp_file-readelf_size if it exists, else regexp_file. proc readelf_test { options binary_file regexp_file xfails } { global READELF global READELFFLAGS + global readelf_size global srcdir global subdir - send_log "exec $READELF $READELFFLAGS $options $binary_file > readelf.out" + send_log "exec $READELF $READELFFLAGS $options $binary_file > readelf.out\n" catch "exec $READELF $READELFFLAGS $options $binary_file > readelf.out" got - if { [llength $xfails] != 0 } then { - setup_xfail $xfails + foreach xfail $xfails { + setup_xfail $xfail } if ![string match "" $got] then { @@ -145,6 +190,19 @@ proc readelf_test { options binary_file regexp_file xfails } { return } + set target_machine "" + if [istarget "mips*-*-*"] then { + set target_machine mips + } + + if { $target_machine != "" && [file exists $srcdir/$subdir/$regexp_file-$readelf_size-$target_machine] } then { + set regexp_file $regexp_file-$readelf_size-$target_machine + } elseif { $target_machine != "" && [file exists $srcdir/$subdir/$regexp_file-$target_machine] } then { + set regexp_file $regexp_file-$target_machine + } elseif { [file exists $srcdir/$subdir/$regexp_file-$readelf_size] } then { + set regexp_file $regexp_file-$readelf_size + } + if { [regexp_diff readelf.out $srcdir/$subdir/$regexp_file] } then { fail "readelf $options" verbose "output is \n[file_contents readelf.out]" 2 @@ -161,7 +219,7 @@ proc readelf_test { options binary_file regexp_file xfails } { # in the target string, then the target is not an ELF based port. if ![istarget "*-*elf"] then { - verbose "$READELF is only intenteded for ELF targets" 2 + verbose "$READELF is only intended for ELF targets" 2 return } @@ -187,15 +245,13 @@ if ![is_remote host] { set tempfile [remote_download host tmpdir/bintest.o] } -# Run the tests +# First, determine the size, so specific output matchers can be used. +readelf_find_size $tempfile + +# Run the tests. readelf_test -h $tempfile readelf.h {} - -# The v850 fails the next two tests because it creates two special -# sections of its own: .call_table_data and .call_table_text -# The regexp scripts are not expecting these sections... - -readelf_test -S $tempfile readelf.s {v850*-*-*} -readelf_test -s $tempfile readelf.ss {v850*-*-*} +readelf_test -S $tempfile readelf.s {} +readelf_test -s $tempfile readelf.ss {} readelf_test -r $tempfile readelf.r {} @@ -214,4 +270,4 @@ if [is_remote host] { # The xfail targets here do not default to DWARF2 format debug information # The symptom is that the output of 'readelf -wi' is empty. -readelf_test -wi $tempfile readelf.wi {v850*-*-*} +readelf_test -wi $tempfile readelf.wi {v850*-*-* cris-*-*} diff --git a/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.s b/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.s index 89ae0fca49af..9c7c3885fc19 100644 --- a/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.s +++ b/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.s @@ -2,15 +2,21 @@ There are .* section headers, starting at offset .*: Section Headers: \[Nr\] Name Type Addr Off Size ES Flg Lk Inf Al - \[ 0\] NULL 00000000 000000 000000 00 0 0 0 - \[ 1\] .text PROGBITS 00000000 000034 000008 00 AX 0 0 . - \[ 2\] .rel.+text +REL. +0+ 0+.* 00000. 0. . 1 4 - \[ 3\] .data PROGBITS 00000000 00003c 000004 00 WA 0 0 . - \[ 4\] .bss NOBITS 00000000 000040 000000 00 WA 0 0 . - \[ .\] .shstrtab STRTAB 00000000 000040 0000.* 00 0 0 . - \[ .\] .symtab SYMTAB 00000000 0+.* 0+.* 10 7 6 4 - \[ .\] .strtab STRTAB 00000000 0+.* 0+.* 00 0 0 1 -Key to Flags: W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\) - I \(info\), L \(link order\), O \(extra OS processing required\) - o \(os specific\), p \(processor specific\) x \(unknown\) + \[ 0\] NULL 00000000 000000 000000 00 +0 +0 +0 + \[ 1\] .text PROGBITS 00000000 000034 000008 00 +AX +0 +0 +. + \[ 2\] .rel.+text +REL. +0+ 0+.* 00000. 0. +. +1 +4 +# MIPS targets put .rela.text here. +#... + \[ .\] .data PROGBITS 00000000 00003c 000004 00 WA +0 +0 +. + \[ .\] .bss NOBITS 00000000 000040 000000 00 WA +0 +0 +. +# MIPS targets put .reginfo and .mdebug here. +# v850 targets put .call_table_data and .call_table_text here. +#... + \[ .\] .shstrtab STRTAB 00000000 0+.* 0+.* 00 +0 +0 +. + \[ .\] .symtab SYMTAB 00000000 0+.* 0+.* 10 +.. +. +4 + \[..\] .strtab STRTAB 00000000 0+.* 0+.* 00 +0 +0 +1 +Key to Flags: + W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\) + I \(info\), L \(link order\), G \(group\), x \(unknown\) + O \(extra OS processing required\) o \(OS specific\), p \(processor specific\) diff --git a/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.s-64 b/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.s-64 new file mode 100644 index 000000000000..007d727003fb --- /dev/null +++ b/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.s-64 @@ -0,0 +1,25 @@ +There are .* section headers, starting at offset .*: + +Section Headers: + \[Nr\] Name Type Address Offset + Size EntSize Flags Link Info Align + \[ 0\] NULL 0000000000000000 00000000 + 0000000000000000 0000000000000000 0 0 0 + \[ 1\] .text PROGBITS 0000000000000000 00000040 + 00000000000000.. 0000000000000000 AX 0 0 .* + \[ 2\] .rel.+text +REL. +0+ 0+.* + 000000000000001. 000000000000001. . 1 8 + \[ 3\] .data PROGBITS 0000000000000000 000000[45][08] + 0000000000000004 0000000000000000 WA 0 0 .* + \[ 4\] .bss NOBITS 0000000000000000 000000[45][c4] + 0000000000000000 0000000000000000 WA 0 0 .* + \[ 5\] .shstrtab STRTAB 0000000000000000 000000[45][c4] + 00000000000000.. 0000000000000000 0 0 .* + \[ 6\] .symtab SYMTAB 0000000000000000 0+.* + 0+.* 0000000000000018 7 6 8 + \[ 7\] .strtab STRTAB 0000000000000000 0+.* + 0+.* 0000000000000000 0 0 1 +Key to Flags: + W \(write\), A \(alloc\), X \(execute\), M \(merge\), S \(strings\) + I \(info\), L \(link order\), G \(group\), x \(unknown\) + O \(extra OS processing required\) o \(OS specific\), p \(processor specific\) diff --git a/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.ss b/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.ss index 926612d4beca..4c8bf8c874d4 100644 --- a/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.ss +++ b/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.ss @@ -7,7 +7,10 @@ Symbol table '.symtab' contains .* entries: 3: 00000000 0 SECTION LOCAL DEFAULT 4 4: 00000000 0 NOTYPE LOCAL DEFAULT 1 static_text_symbol 5: 00000000 0 NOTYPE LOCAL DEFAULT 3 static_data_symbol +# v850 targets include extra SECTION symbols here for the .call_table_data +# and .call_table_text sections. +#... .* .: 00000000 0 NOTYPE GLOBAL DEFAULT 1 text_symbol .: 00000000 0 NOTYPE GLOBAL DEFAULT UND external_symbol - .: 00000000 0 NOTYPE GLOBAL DEFAULT 3 data_symbol - .: 00000004 4 OBJECT GLOBAL DEFAULT COM common_symbol + ..: 00000000 0 NOTYPE GLOBAL DEFAULT 3 data_symbol + ..: 00000004 4 OBJECT GLOBAL DEFAULT COM common_symbol diff --git a/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.ss-64 b/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.ss-64 new file mode 100644 index 000000000000..b29276d47603 --- /dev/null +++ b/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.ss-64 @@ -0,0 +1,13 @@ + +Symbol table '.symtab' contains .* entries: + Num: Value Size Type Bind Vis Ndx Name + 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND + 1: 0000000000000000 0 SECTION LOCAL DEFAULT 1 + 2: 0000000000000000 0 SECTION LOCAL DEFAULT 3 + 3: 0000000000000000 0 SECTION LOCAL DEFAULT 4 + 4: 0000000000000000 0 NOTYPE LOCAL DEFAULT 1 static_text_symbol + 5: 0000000000000000 0 NOTYPE LOCAL DEFAULT 3 static_data_symbol +.* .: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 1 text_symbol + .: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND external_symbol + .: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 3 data_symbol + .: 0000000000000004 4 OBJECT GLOBAL DEFAULT COM common_symbol diff --git a/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.ss-mips b/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.ss-mips new file mode 100644 index 000000000000..37dbcf66aa2a --- /dev/null +++ b/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.ss-mips @@ -0,0 +1,15 @@ + +Symbol table '.symtab' contains 12 entries: + Num: Value Size Type Bind Vis Ndx Name + 0: 00000000 0 NOTYPE LOCAL DEFAULT UND + 1: 00000000 0 SECTION LOCAL DEFAULT 1 + 2: 00000000 0 SECTION LOCAL DEFAULT 4 + 3: 00000000 0 SECTION LOCAL DEFAULT 5 + 4: 00000000 0 SECTION LOCAL DEFAULT 6 + 5: 00000000 0 SECTION LOCAL DEFAULT 7 + 6: 00000000 0 OBJECT GLOBAL DEFAULT 1 text_symbol + 7: 00000000 0 NOTYPE LOCAL DEFAULT 1 static_text_symbol + 8: 00000000 0 NOTYPE GLOBAL DEFAULT UND external_symbol + 9: 00000000 0 OBJECT GLOBAL DEFAULT 4 data_symbol + 10: 00000000 0 NOTYPE LOCAL DEFAULT 4 static_data_symbol + 11: 00000004 4 OBJECT GLOBAL DEFAULT PRC common_symbol diff --git a/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.wi b/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.wi index e022fff55809..51668a7229a5 100644 --- a/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.wi +++ b/gnu/dist/toolchain/binutils/testsuite/binutils-all/readelf.wi @@ -5,7 +5,7 @@ The section .debug_info contains: Version: 2 Abbrev Offset: 0 Pointer Size: 4 - <.><.*>: Abbrev Number: 1 \(DW_TAG_compile_unit\) + <.><.*>: Abbrev Number: .* \(DW_TAG_compile_unit\) DW_AT_name : .*/testprog.c DW_AT_comp_dir : .*/binutils DW_AT_producer : GNU C .* diff --git a/gnu/dist/toolchain/binutils/testsuite/lib/utils-lib.exp b/gnu/dist/toolchain/binutils/testsuite/lib/utils-lib.exp index e27f21710c9e..de1535dc7040 100644 --- a/gnu/dist/toolchain/binutils/testsuite/lib/utils-lib.exp +++ b/gnu/dist/toolchain/binutils/testsuite/lib/utils-lib.exp @@ -90,10 +90,11 @@ proc default_binutils_assemble { source object } { # This is a hack in that it won't scale well if other targets need # similar transformations to assemble. We'll generalize the hack # if/when other targets need similar handling. - if [istarget "hppa*-*-*" ] then { - send_log "sed -f $srcdir/config/hppa.sed < $source > asm.s\n" - verbose "sed -f $srcdir/config/hppa.sed < $source > asm.s" - catch "exec sed -f $srcdir/config/hppa.sed < $source > asm.s"; + if { [istarget "hppa*-*-*"] && ![istarget "*-*-linux*" ] } then { + set sed_file $srcdir/config/hppa.sed + send_log "sed -f $sed_file < $source > asm.s\n" + verbose "sed -f $sed_file < $source > asm.s" + catch "exec sed -f $sed_file < $source > asm.s"; set source asm.s } diff --git a/gnu/dist/toolchain/binutils/version.c b/gnu/dist/toolchain/binutils/version.c index cb893cf9837e..5bd1907a8136 100644 --- a/gnu/dist/toolchain/binutils/version.c +++ b/gnu/dist/toolchain/binutils/version.c @@ -1,5 +1,5 @@ /* version.c -- binutils version information - Copyright 1991, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. + Copyright 1991, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. This file is part of GNU Binutils. @@ -36,7 +36,7 @@ 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 Free Software Foundation, Inc.\n")); + printf (_("Copyright 1997, 98, 99, 2000, 2001 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/gnu/dist/toolchain/binutils/windres.h b/gnu/dist/toolchain/binutils/windres.h index ba736129828e..8adc1ef35710 100644 --- a/gnu/dist/toolchain/binutils/windres.h +++ b/gnu/dist/toolchain/binutils/windres.h @@ -812,6 +812,10 @@ extern struct dialog_control *define_control PARAMS ((const char *, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)); +extern struct dialog_control *define_icon_control + PARAMS ((struct res_id, unsigned long, unsigned long, + unsigned long, unsigned long, unsigned long, unsigned long, + struct rcdata_item *, struct dialog_ex *)); extern void define_font PARAMS ((struct res_id, const struct res_res_info *, const char *)); extern void define_icon diff --git a/gnu/dist/toolchain/config-ml.in b/gnu/dist/toolchain/config-ml.in index 503f7cf1a182..c968bf0d7191 100644 --- a/gnu/dist/toolchain/config-ml.in +++ b/gnu/dist/toolchain/config-ml.in @@ -280,6 +280,17 @@ arm-*-*) esac done fi + if [ x"$enable_nofmult" = xno ] + then + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *nofmult* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi ;; m68*-*-*) if [ x$enable_softfloat = xno ] @@ -362,6 +373,28 @@ mips*-*-*) esac done fi + case " $multidirs " in + *" mabi=64 "*) + # We will not be able to create libraries with -mabi=64 if + # we cannot even link a trivial program. It usually + # indicates the 64bit libraries are missing. + if echo 'main() {}' > conftest.c && + ${CC-gcc} -mabi=64 conftest.c -o conftest; then + : + else + echo Could not link program with -mabi=64, disabling it. + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *mabi=64* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + rm -f conftest.c conftest + ;; + esac ;; powerpc*-*-* | rs6000*-*-*) if [ x$enable_softfloat = xno ] @@ -442,6 +475,30 @@ powerpc*-*-* | rs6000*-*-*) done fi ;; +sparc*-*-*) + case " $multidirs " in + *" m64 "*) + # We will not be able to create libraries with -m64 if + # we cannot even link a trivial program. It usually + # indicates the 64bit libraries are missing. + if echo 'main() {}' > conftest.c && + ${CC-gcc} -m64 conftest.c -o conftest; then + : + else + echo Could not link program with -m64, disabling it. + old_multidirs="${multidirs}" + multidirs="" + for x in ${old_multidirs}; do + case "$x" in + *m64* ) : ;; + *) multidirs="${multidirs} ${x}" ;; + esac + done + fi + rm -f conftest.c conftest + ;; + esac + ;; esac # Remove extraneous blanks from multidirs. @@ -472,6 +529,8 @@ multi-do: flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \ if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \ CFLAGS="$(CFLAGS) $${flags}" \ + prefix="$(prefix)" \ + exec_prefix="$(exec_prefix)" \ CXXFLAGS="$(CXXFLAGS) $${flags}" \ LIBCFLAGS="$(LIBCFLAGS) $${flags}" \ LIBCXXFLAGS="$(LIBCXXFLAGS) $${flags}" \ @@ -615,7 +674,24 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then echo "pwd: `pwd`" fi - if [ -d ${ml_dir} ]; then true; else mkdir ${ml_dir}; fi + if [ -d ${ml_dir} ]; then true; else + # ``mkdir -p ${ml_dir}'' See also mkinstalldirs. + pathcomp="" + for d in `echo ":${ml_dir}" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`; do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" 1>&2 + mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$? + fi + if test ! -d "$pathcomp"; then + exit $lasterr + fi + pathcomp="$pathcomp/" + done + fi if [ -d ${ml_dir}/${ml_libdir} ]; then true; else mkdir ${ml_dir}/${ml_libdir}; fi # Eg: if ${ml_dir} = m68000/m68881, dotdot = ../../ @@ -666,9 +742,86 @@ if [ -n "${multidirs}" ] && [ -z "${ml_norecursion}" ]; then cd ${ml_dir}/${ml_libdir} if [ -f ${ml_newsrcdir}/configure ]; then - ml_recprog=${ml_newsrcdir}/configure + ml_recprog="${ml_newsrcdir}/configure --cache-file=../config.cache" fi - if eval ${ml_config_shell} ${ml_recprog} \ + + # find compiler flag corresponding to ${ml_dir} + for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do + dir=`echo $i | sed -e 's/;.*$//'` + if [ "${dir}" = "${ml_dir}" ]; then + flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'` + break + fi + done + ml_config_env='CC="${CC_}$flags" CXX="${CXX_}$flags"' + + if [ "${with_target_subdir}" = "." ]; then + CC_=$CC' ' + CXX_=$CXX' ' + else + # Create a regular expression that matches any string as long + # as ML_POPDIR. + popdir_rx=`echo ${ML_POPDIR} | sed 's,.,.,g'` + CC_= + for arg in ${CC}; do + case $arg in + -[BIL]"${ML_POPDIR}"/*) + CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\1/p"`' ' ;; + "${ML_POPDIR}"/*) + CC_="${CC_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; + *) + CC_="${CC_}${arg} " ;; + esac + done + + CXX_= + for arg in ${CXX}; do + case $arg in + -[BIL]"${ML_POPDIR}"/*) + CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(-[BIL]${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X-[BIL]${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; + "${ML_POPDIR}"/*) + CXX_="${CXX_}"`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"`' ' ;; + *) + CXX_="${CXX_}${arg} " ;; + esac + done + + if test "x${LD_LIBRARY_PATH+set}" = xset; then + LD_LIBRARY_PATH_= + for arg in `echo "$LD_LIBRARY_PATH" | tr ':' ' '`; do + case "$arg" in + "${ML_POPDIR}"/*) + arg=`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"` + ;; + esac + if test "x$LD_LIBRARY_PATH_" != x; then + LD_LIBRARY_PATH_=$LD_LIBRARY_PATH_:$arg + else + LD_LIBRARY_PATH_=$arg + fi + done + ml_config_env="$ml_config_env LD_LIBRARY_PATH=$LD_LIBRARY_PATH_" + fi + + if test "x${SHLIB_PATH+set}" = xset; then + SHLIB_PATH_= + for arg in `echo "$SHLIB_PATH" | tr ':' ' '`; do + case "$arg" in + "${ML_POPDIR}"/*) + arg=`echo "X${arg}" | sed -n "s/X\\(${popdir_rx}\\).*/\\1/p"`/${ml_dir}`echo "X${arg}" | sed -n "s/X${popdir_rx}\\(.*\\)/\\1/p"` + ;; + esac + if test "x$SHLIB_PATH_" != x; then + SHLIB_PATH_=$SHLIB_PATH_:$arg + else + SHLIB_PATH_=$arg + fi + done + ml_config_env="$ml_config_env SHLIB_PATH=$SHLIB_PATH_" + fi + fi + + if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \ --with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \ ${ml_arguments} ${ml_srcdiroption} ; then true diff --git a/gnu/dist/toolchain/config.if b/gnu/dist/toolchain/config.if index bcc026908d87..625a4077ec0e 100644 --- a/gnu/dist/toolchain/config.if +++ b/gnu/dist/toolchain/config.if @@ -21,9 +21,15 @@ else if_topsrcdir=${top_srcdir} fi -if [ -f ${if_topsrcdir}/libstdc++/Makefile.in ]; then +if [ "${enable_libstdcxx_v3}" = "yes" ] ; then + libstdcxx_srcdir=${if_topsrcdir}/libstdc++-v3 +else + libstdcxx_srcdir=${if_topsrcdir}/libstdc++ +fi + +if [ -f ${libstdcxx_srcdir}/Makefile.in ]; then # We check libstdc++ for libstdcxx_interface. -libstdcxx_interface=`grep "^INTERFACE" ${if_topsrcdir}/libstdc++/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'` +libstdcxx_interface=`grep "^INTERFACE" ${libstdcxx_srcdir}/Makefile.in | sed 's/INTERFACE[ ]*=[ ]*\(.*\)/\1/'` else libstdcxx_interface= fi diff --git a/gnu/dist/toolchain/config/ChangeLog b/gnu/dist/toolchain/config/ChangeLog index b5746b102f53..920ab3226a89 100644 --- a/gnu/dist/toolchain/config/ChangeLog +++ b/gnu/dist/toolchain/config/ChangeLog @@ -1,3 +1,16 @@ +Fri Jul 14 18:13:23 2000 Mark P Mitchell + + * mh-irix6 (CC): Don't set it. + +2000-06-21 Branko Cibej + + * mh-sparcpic: Use single instead of double quotes. + * mt-sparcpic: Likewise. + +2000-06-19 Syd Polk + + * acinclude.m4: Updated for Incr Tcl 3.0. + 2000-02-23 Linas Vepstas * mh-i370pic: New file. @@ -12,6 +25,10 @@ * mh-aix43: Delete, move to mt-aix43. * mt-aix43: New file. +Tue Sep 7 23:31:01 1999 Linas Vepstas + + * mh-openedition: New file. + 1999-04-07 Michael Meissner * mt-d30v: New file, pass -g -Os -Wa,-C as default options. diff --git a/gnu/dist/toolchain/config/acinclude.m4 b/gnu/dist/toolchain/config/acinclude.m4 index f799ced44dd4..6187b5acdce6 100755 --- a/gnu/dist/toolchain/config/acinclude.m4 +++ b/gnu/dist/toolchain/config/acinclude.m4 @@ -1045,6 +1045,7 @@ dnl AC_SUBST(TCL_COMPAT_OBJS) AC_SUBST(TCL_RANLIB) AC_SUBST(TCL_BUILD_LIB_SPEC) AC_SUBST(TCL_LIB_SPEC) + AC_SUBST(TCL_BIN_DIR) dnl AC_SUBST(TCL_LIB_VERSIONS_OK) dnl not used, don't export to save symbols diff --git a/gnu/dist/toolchain/config/mh-ia64pic b/gnu/dist/toolchain/config/mh-ia64pic new file mode 100644 index 000000000000..92e48d90fbdf --- /dev/null +++ b/gnu/dist/toolchain/config/mh-ia64pic @@ -0,0 +1 @@ +PICFLAG=-fpic diff --git a/gnu/dist/toolchain/config/mh-irix6 b/gnu/dist/toolchain/config/mh-irix6 index 6d25c16b2f45..e79267889630 100644 --- a/gnu/dist/toolchain/config/mh-irix6 +++ b/gnu/dist/toolchain/config/mh-irix6 @@ -1,7 +1,3 @@ # Makefile changes for SGI's running IRIX-6.x. SYSV = -DSYSV RANLIB = true -# Specify the ABI, to ensure that all Irix 6 systems will behave the same. -# Also, using -32 avoids bugs that exist in the n32/n64 support in some -# versions of the SGI compiler. -CC = cc -32 diff --git a/gnu/dist/toolchain/config/mh-openedition b/gnu/dist/toolchain/config/mh-openedition new file mode 100644 index 000000000000..e99ef155fd2b --- /dev/null +++ b/gnu/dist/toolchain/config/mh-openedition @@ -0,0 +1,2 @@ +RANLIB = true +CC = c89 diff --git a/gnu/dist/toolchain/config/mh-sparcpic b/gnu/dist/toolchain/config/mh-sparcpic index f6dbc22e3ca8..e218bb48aa43 100644 --- a/gnu/dist/toolchain/config/mh-sparcpic +++ b/gnu/dist/toolchain/config/mh-sparcpic @@ -1 +1 @@ -PICFLAG=`case "${LIBCFLAGS} ${LIBCXXFLAGS}" in *-fpic* ) echo -fpic ;; * ) echo -fPIC ;; esac` +PICFLAG=`case '${LIBCFLAGS} ${LIBCXXFLAGS}' in *-fpic* ) echo -fpic ;; * ) echo -fPIC ;; esac` diff --git a/gnu/dist/toolchain/config/mt-ia64pic b/gnu/dist/toolchain/config/mt-ia64pic new file mode 100644 index 000000000000..ff9872755757 --- /dev/null +++ b/gnu/dist/toolchain/config/mt-ia64pic @@ -0,0 +1 @@ +PICFLAG_FOR_TARGET=-fpic diff --git a/gnu/dist/toolchain/config/mt-sparcpic b/gnu/dist/toolchain/config/mt-sparcpic index fd0ec271afce..a62b38bd9c1b 100644 --- a/gnu/dist/toolchain/config/mt-sparcpic +++ b/gnu/dist/toolchain/config/mt-sparcpic @@ -1 +1 @@ -PICFLAG_FOR_TARGET=`case "${LIBCFLAGS} ${LIBCXXFLAGS}" in *-fpic* ) echo -fpic ;; * ) echo -fPIC ;; esac` +PICFLAG_FOR_TARGET=`case '${LIBCFLAGS} ${LIBCXXFLAGS}' in *-fpic* ) echo -fpic ;; * ) echo -fPIC ;; esac` diff --git a/gnu/dist/toolchain/configure b/gnu/dist/toolchain/configure index 3e7d8655ac57..57e22d8c11d3 100755 --- a/gnu/dist/toolchain/configure +++ b/gnu/dist/toolchain/configure @@ -86,7 +86,7 @@ subdirs= target_alias=NOTARGET target_makefile_frag= undefs=NOUNDEFS -version="$Revision: 1.5 $" +version="$Revision: 1.11 $" x11=default bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' @@ -237,7 +237,7 @@ do esac enableopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'` - eval "$enableopt='$optarg'" + eval "$enableopt=\$optarg" enableoptions="$enableoptions '$option'" ;; --exec-prefix* | --ex*) @@ -370,7 +370,7 @@ do esac withopt=`echo ${option} | sed 's:^--::;s:=.*$::;s:-:_:g'` - eval $withopt="$optarg" + eval $withopt="\$optarg" withoptions="$withoptions $option" ;; --without-*) @@ -518,7 +518,8 @@ fi configsub=`echo ${progname} | sed 's/configure$/config.sub/'` moveifchange=`echo ${progname} | sed 's/configure$/move-if-change/'` -topsrcdir=`cd \`dirname ${progname}\`; pwd` +## the sed command below emulates the dirname command +topsrcdir=`cd \`echo ${progname} | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'\`; pwd` # this is a hack. sun4 must always be a valid host alias or this will fail. @@ -576,7 +577,6 @@ case "${srcdir}" in fi esac - # default exec_prefix case "${exec_prefixoption}" in "") exec_prefix="\$(prefix)" ;; @@ -902,9 +902,6 @@ do test -n "$DEFAULT_LEX" && break done -# BINUTILS LOCAL: This is included in the default CFLAGS when using gcc. -warn_cflags="-W -Wall" - if [ "${build}" != "${host}" ]; then # If we are doing a Canadian Cross, in which the host and build systems # are not the same, we set reasonable default values for the tools. @@ -915,9 +912,10 @@ if [ "${build}" != "${host}" ]; then tools="${tools} HOST_PREFIX_1 LD LD_FOR_TARGET LEX MAKEINFO NM" tools="${tools} NM_FOR_TARGET RANLIB RANLIB_FOR_TARGET" tools="${tools} WINDRES WINDRES_FOR_TARGET YACC" + tools="${tools} OBJCOPY OBJDUMP" for var in ${tools}; do - if [ -z "`eval 'echo $'"${var}"`" ] && [ -r Makefile ]; then + if eval [ -z \"\$${var}\" ] && [ -r Makefile ]; then sed -n -e ':loop /\\$/ N s/\\\n//g @@ -926,7 +924,7 @@ t loop < Makefile > Makefile.v t=`tail -1 Makefile.v` if [ -n "${t}" ]; then - eval "${var}='${t}'" + eval "${var}=\${t}" fi rm -f Makefile.v fi @@ -938,7 +936,7 @@ t loop AS_FOR_TARGET=${AS_FOR_TARGET-${target_alias}-as} BISON=${BISON-bison} CC=${CC-${host_alias}-gcc} - CFLAGS=${CFLAGS-"-g -O2 ${warn_cflags}"} + CFLAGS=${CFLAGS-"-g -O2"} CXX=${CXX-${host_alias}-c++} CXXFLAGS=${CXXFLAGS-"-g -O2"} CC_FOR_BUILD=${CC_FOR_BUILD-gcc} @@ -958,6 +956,8 @@ t loop RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET-${target_alias}-ranlib} WINDRES=${WINDRES-${host_alias}-windres} WINDRES_FOR_TARGET=${WINDRES_FOR_TARGET-${target_alias}-windres} + OBJCOPY=${OBJCOPY-${host_alias}-objcopy} + OBJDUMP=${OBJDUMP-${host_alias}-objdump} if [ -z "${YACC}" ]; then IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}:" @@ -1008,6 +1008,8 @@ t loop export NM export RANLIB export WINDRES + export OBJCOPY + export OBJDUMP else # If CC is still not set, try to get gcc. if [ -z "${CC}" ]; then @@ -1018,10 +1020,10 @@ else CC="gcc" echo 'void f(){}' > conftest.c if test -z "`${CC} -g -c conftest.c 2>&1`"; then - CFLAGS=${CFLAGS-"-g -O2 ${warn_cflags}"} + CFLAGS=${CFLAGS-"-g -O2"} CXXFLAGS=${CXXFLAGS-"-g -O2"} else - CFLAGS=${CFLAGS-"-O2 ${warn_cflags}"} + CFLAGS=${CFLAGS-"-O2"} CXXFLAGS=${CXXFLAGS-"-O2"} fi rm -f conftest* @@ -1038,10 +1040,10 @@ else *gcc) echo 'void f(){}' > conftest.c if test -z "`${CC} -g -c conftest.c 2>&1`"; then - CFLAGS=${CFLAGS-"-g -O2 ${warn_cflags}"} + CFLAGS=${CFLAGS-"-g -O2"} CXXFLAGS=${CXXFLAGS-"-g -O2"} else - CFLAGS=${CFLAGS-"-O2 ${warn_cflags}"} + CFLAGS=${CFLAGS-"-O2"} CXXFLAGS=${CXXFLAGS-"-O2"} fi rm -f conftest* @@ -1411,6 +1413,7 @@ EOF -e "s:^program_suffix[ ]*=.*$:program_suffix = ${program_suffix}:" \ -e "s:^program_transform_name[ ]*=.*$:program_transform_name = ${program_transform_name}:" \ -e "s|^tooldir[ ]*=.*$|tooldir = ${tooldir}|" \ + -e "s|^build_tooldir[ ]*=.*$|build_tooldir = ${tooldir}|" \ -e "s:^DEFAULT_YACC[ ]*=.*$:DEFAULT_YACC = ${DEFAULT_YACC}:" \ -e "s:^DEFAULT_LEX[ ]*=.*$:DEFAULT_LEX = ${DEFAULT_LEX}:" \ -e "s:^DEFAULT_M4[ ]*=.*$:DEFAULT_M4 = ${DEFAULT_M4}:" \ @@ -1423,7 +1426,7 @@ EOF # tools. if [ "${build}" != "${host}" ]; then for var in ${tools}; do - val=`eval 'echo $'"${var}"` + eval val=\$${var} sed -e "/^${var}[ ]*=/{ :loop1 /\\\\$/ N diff --git a/gnu/dist/toolchain/gas/ChangeLog b/gnu/dist/toolchain/gas/ChangeLog index ce918a5ed5cd..7f6a6292aba9 100644 --- a/gnu/dist/toolchain/gas/ChangeLog +++ b/gnu/dist/toolchain/gas/ChangeLog @@ -1,57 +1,3301 @@ -2000-11-02 Theo Honohan +2001-04-02 Philip Blundell - * config/tc-arm.c (do_msr): Improve error message. + 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. -2000-11-01 Philip Blundell +2001-03-31 Alan Modra - From 2000-08-01 Nick Clifton - * config/tc-arm.c (do_mrs): Fix skip of 'cpsr_all' flag. + * 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. -2000-10-16 Philip Blundell + * cond.c (s_endif): Correct handling of "if .. elseif .." trees. + Don't abort on NULL current_cframe. - * configure.in: Set version number to 2.10.1. +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. -2000-10-14 Philip Blundell +2001-03-19 Alan Modra - From 2000-06-17 Mark Elbrecht + * config/tc-i386.c (md_assemble ): Correct + used register name. - * config/obj-coff.c (obj_coff_weak): Typo fix: Change BFD_ASSEMLER - to BFD_ASSEMBLER. +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. + +001-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-08-30 Matthew Jacob +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-04-14 Matthew Green - - * configure.in: Add NetBSD/sparc ELF and NetBSD/sparc64 support. - * configure: Regenerate. +2000-06-08 James E. Wilson -2000-06-09 Nick Clifton + * 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. - * config/tc-arm.c (cons_fix_new_arm): Assign correct reloc value - for size 1 fixes. +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-22 David O'Brien +2000-05-29 Nick Clifton - * configure.in: Recognize alpha-*-freebsd*. + * 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-26 Scott Bambrough +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 - Port of patch to mainline by Nick Clifton : * config/tc-arm.c (struct asm_psr): Add boolean field distinguishing between CSPR and SPSR. Rename 'number' field to 'field'. @@ -64,65 +3308,103 @@ only once. (md_undefined_name): Mark 'name' parameter as unused, since the COFF target does not use it. - - Port of patch to mainline by Nick Clifton : - * testsuite/gas/arm/arch4t.s: Add tests of new fields - to msr instruction. - * NEWS: Mention change in behaviour when assembling msr - instruction. +2000-05-14 David O'Brien -2000-04-24 Nick Clifton + * 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. - * 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-05-14 Alan Modra -2000-05-29 Philip Blundell + * 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. - * doc/as.texinfo: Update copyright dates. - (Local Labels): Delete misplaced mention of ARM. - * NEWS: Mention ARM ELF support. +2000-05-14 Kazu Hirata -Tue May 23 00:57:05 2000 Hans-Peter Nilsson - - * configure.in (i386-*-freebsd a.out entry): Quote properly. - * configure: Regenerate. - -2000-05-23 Philip Blundell - - * configure.in: Set version to 2.10. - * 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. - - * 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. + * 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. - * doc/as.1: Fix unbalanced brackets. +2000-05-13 Alan Modra - * config/tc-i386.c (comment_chars): Don't use '/' as comment start if - TE_FreeBSD. - (line_comment_chars): Set to '/' if TE_FreeBSD. + * asintl.h (gettext, dgettext, dcgettext, textdomain, + bindtextdomain): Replace defines with those from intl/libgettext.h + to quieten gcc warnings. -1999-07-03 Joel Sherrill + * NEWS: Mention x86 .arch and -q. - * configure.in (*rtems except sh): Move RTEMS targets to elf. - * configure: Regenerate. + * 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 @@ -149,11 +3431,22 @@ Tue May 23 00:57:05 2000 Hans-Peter Nilsson * 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. @@ -163,10 +3456,185 @@ Tue May 23 00:57:05 2000 Hans-Peter Nilsson * 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. @@ -174,6 +3642,9 @@ Tue May 23 00:57:05 2000 Hans-Peter Nilsson 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. @@ -187,18 +3658,114 @@ Tue May 23 00:57:05 2000 Hans-Peter Nilsson * 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'. -2000-04-05 Alexandre Oliva + * 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. + +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. + +Wed Apr 5 22:26:32 2000 J"orn Rennecke + + * config/tc-sh.c (get_operands): There's no third operand if the + first operand is an immediate. + +Wed Apr 5 22:07:19 2000 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. + +Wed Apr 5 06:35:45 2000 Alexandre Oliva * config/tc-sparc.c (sparc_ip): Avoid string pasting. +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 * po/gas.pot: Regenerate. @@ -217,7 +3784,7 @@ Tue May 23 00:57:05 2000 Hans-Peter Nilsson Update dependencies. * Makefile.in: Regenerate. -2000-04-04 Alexandre Oliva +2000-04-03 Alexandre Oliva * config/tc-mn10300.c (md_pseudo_table): Use constant names. (md_begin): Likewise. @@ -234,6 +3801,12 @@ Tue May 23 00:57:05 2000 Hans-Peter Nilsson * 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 @@ -307,7 +3880,7 @@ Tue May 23 00:57:05 2000 Hans-Peter Nilsson 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. + 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. @@ -322,7 +3895,7 @@ Tue May 23 00:57:05 2000 Hans-Peter Nilsson (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 @@ -331,22 +3904,22 @@ Tue May 23 00:57:05 2000 Hans-Peter Nilsson 2000-03-19 Nick Clifton - * config/tc-arm.c (md_apply_fix3): Fix bug detectng overflow of pc + * 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. - + * 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. + Fix compile time warning messages. Thu Mar 16 23:45:16 2000 J"orn Rennecke @@ -393,21 +3966,22 @@ Sat Mar 11 00:01:39 2000 Hans-Peter Nilsson when embedded-pic. * config/tc-mips.c (SWITCH_TABLE): The ELF embedded-pic - implementation doesn't have special handling for switch - statements. + 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. + 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. + 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. + + * 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) @@ -612,7 +4186,7 @@ Sat Mar 11 00:01:39 2000 Hans-Peter Nilsson * 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.am(CPU_DOCS): Add c-i370.texi. * doc/Makefile.in: Regenerate. 2000-02-19 Michael Meissner @@ -625,14 +4199,17 @@ Sat Mar 11 00:01:39 2000 Hans-Peter Nilsson * doc/c-mips.texi (MIPS Opts): Document -mgp32 and -mgp64. -1999-12-30 Andrew Haley +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 @@ -660,10 +4237,10 @@ Sat Mar 11 00:01:39 2000 Hans-Peter Nilsson * 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. + 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. + statement and quell signed vs. unsigned comparison warning. 2000-02-18 Nick Clifton @@ -698,17 +4275,17 @@ Fri Feb 11 14:21:51 2000 Jeffrey A Law (law@cygnus.com) 2000-02-10 Nick Clifton * config/tc-mcore.c (INST_BYTE0): Redefine to handle big and - little endian targets. + little endian targets. (INST_BYTE1): Redefine to handle big and little endian - targets. + targets. (cpu_type): New type: Select between M340 and M210. (parse_psrmod): New function: Parse the PSRCLR and PSRSET - instructions of the M340. + instructions of the M340. (md_assemble): Add support for the MULSH and OPSR classes of - instructions. + instructions. (md_atof): Add support for little endian targets. (md_parse_option): Add support for -EL, -EB and -mcpu command - line switches. + 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. @@ -729,40 +4306,40 @@ Fri Feb 11 14:21:51 2000 Jeffrey A Law (law@cygnus.com) 2000-02-08 Timothy Wall * read.c (s_rept): Call do_repeat, which abstracts the repeat - logic. + logic. (do_repeat): New. Abstract repeat logic so that a "break" can be - implemented. + 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. - + 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. + 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). + 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 @@ -786,7 +4363,7 @@ Fri Feb 11 14:21:51 2000 Jeffrey A Law (law@cygnus.com) 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 @@ -794,14 +4371,15 @@ Fri Feb 11 14:21:51 2000 Jeffrey A Law (law@cygnus.com) 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): + * 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. @@ -813,10 +4391,10 @@ Fri Feb 11 14:21:51 2000 Jeffrey A Law (law@cygnus.com) 2000-01-27 Thomas de Lellis - * config/tc-arm.c (armadjust_symtab): If the assembler is in + * 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. + correct disassembly of Thumb code bounded by non function labels. 2000-01-27 Alan Modra @@ -862,7 +4440,7 @@ Fri Feb 11 14:21:51 2000 Jeffrey A Law (law@cygnus.com) * config/obj-aout.c (OBJ_HEADER): Define. (obj_pseudo_table): Rename to aout_pseudo_table. Init all - fields of sentinel. + 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. @@ -959,13 +4537,13 @@ Fri Feb 11 14:21:51 2000 Jeffrey A Law (law@cygnus.com) 2000-01-13 Clinton Popetz - * config/tc-mips.c (mips_do_align): New function. - * config/tc-mips.h (md_do_align): Define. + * 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 + (ARM-Chars): Correct description of `#'. Mention that `;' is a line separator for Linux. * doc/as.texinfo (Comments): Mention the ARM. @@ -980,4870 +4558,8 @@ Fri Feb 11 14:21:51 2000 Jeffrey A Law (law@cygnus.com) * 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. -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 - hook function when changing sections. - (arm_s_data): Likewise. - -1999-12-14 Nick Clifton - - * config/tc-arm.c (md_parse_option): Add support for -marm720 - command line switch. - -Tue Nov 30 22:59:00 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-mn10300.c (md_pseudo_table): Add ".am33" pseudo-op. - (r_registers, xr_registers): Define. - (r_register_name, xr_register_name): New functions. - (md_assemble): Handle new am33 operand types and instruction - formats. - (mn10300_insert_operand, check_operand): Likewise. - -1999-11-29 Nick Clifton - - * config/tc-arm.c (thumb_mode): Turn into a tristate variable. - (s_force_thumb): Set thumb_mode to 2. - (md_assemble): Do not complain about thumb instructions on a - non-thumb target if thumb_mode is set to 2. - -1999-11-28 Michael Meissner - - * config/tc-alpha.c (toplevel): Include struc-symbol.h. - (alpha_macro_arg): Add MACRO_{LITERAL,BASE,BYTOFF,JSR} cases. - (O_...): Add new machine dependent expressions if we are handling - explicit relocations. - (alpha_reloc_op): New static table holding the explicit relocation - information. - (alpha_literal_hash): New static to hold the hash table for - explicit relocations. - (alpha_macros): Add support for explicit relocations. - (md_begin): If explicit relocations, initialize hash table. - (md_assemble): Don't print a second error if tokenize_arguments - already printed an error message. - (md_apply_fix): Add support for explicit relocations. - (alpha_force_relocation): Ditto. - (alpha_fix_adjustable): Ditto. - (alpha_adjust_symtab): New function to support explicit - relocations. - (alpha_adjust_symtab_relocs): Ditto. - (debug_exp): Debug stub compiled if DEBUG_ALPHA is defined. - (tokenize_arguments): Add debug code if DEBUG_ALPHA is defined. - Add support for explicit relocations. Return -2 if an error - message was already printed. - (find_macro_match): Add support for explicit relocations. Comment - each of the cases. - (emit_insn): Add support for explicit relocations. - (assemble_tokens): Ditto. - (emit_ldgp): Ditto. - (load_expression): Ditto. - (emit_lda): Ditto. - (emit_ldah): Ditto. - (emit_ir_load): Ditto. - (emit_loadstore): Ditto. - (emit_ldXu): Ditto. - (emit_ldil): Ditto. - (emit_sextX): Ditto. - (emit_division): Ditto. - (emit_jsrjmp): Ditto. - (emit_retjcr): Ditto. - - * config/tc-alpha.h (RELOC_OP_P): Enable explicit relocations if - ELF object format. - (tc_adjust_symtab): If explicit relocations, call the function - alpha_adjust_symtab. - (TC_FIX_TYPE): Add fields to be able to move explicit lituse - relocations next to the literal relocation they reference. - (TC_INIT_FIX_DATA): Initialize the new fields. - (TC_FIX_DATA_PRINT): Print the new fields if DEBUG5 is defined. - -Wed Nov 24 20:27:58 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (pa_ip): Handle PA2.0 unit completers. Handle - 'B' operand for PA2.0 bb instruction. - -1999-11-18 Nick Clifton - - * config/tc-mcore.h (TC_FORCE_RELOCATION): Define for Mcore-pe - target. - - * config/tc-mcore.c (tc_gen_reloc): Support generation of RVA - relocs. - (mcore_force_relocation): Force relocations to be generated for - RVA relocs. - -1999-11-16 Alan Modra - - * config/tc-i386.c (i386_immediate): Disallow O_big immediates. - (i386_displacement): Disallow O_big displacements. - -Mon Nov 15 20:12:43 1999 Donald Lindsay - - * config/tc-arm.c (do_mia,do_mar,do_mra,do_pld,do_ldrl,do_co_reg): Small - improvements in error checking. - (md_assemble): Support for unconditional ARM instructions. - (md_parse_option): Support for -m[arm]v5e flag. - -1999-11-12 Nick Clifton - - * macro.c (buffer_and_nest): Do not check beyond the end of the - buffer. - -1999-11-11 Nick Clifton - - * macro.c (buffer_and_nest): Look for seperator after TO and - FROM tokens. - -1999-11-08 Andrew Haley - - * app.c (do_scrub_chars): When in State 10, treat backslash - characters in the same way as as symbol characters. - -1999-11-07 Richard Henderson - - * config/tc-alpha.c (alpha_align): Check, don't assert, that - the previous label was in the current section before playing - with auto-alignment. - -1999-11-06 Nick Clifton - - * config/tc-v850.c (v850_force_relocation): Force relocation - for weak symbols. - (v850_pcrel_from_selection): Do not compute a pcrel offset if - the symbol is weak. - -1999-11-05 Michael Meissner - - * expr.h (operatorT): Increase machine dependent operators to 16. - * expr.c (op_rank): Ditto. - -1999-11-03 Ian Lance Taylor - - * read.c (pseudo_set): Reject attempts to set the value of a - section symbol. - - * config/obj-elf.c (obj_elf_ident): Call md_flush_pending_output - if it is defined. - - * config/obj-elf.c (elf_set_index): Add ATTRIBUTE_UNUSED. - - * config/obj-elf.c (elf_frob_file_after_relocs): Don't pass NULL - to bfd_set_section_contents. - -1999-11-03 Nick Clifton - - * config/tc-mcore.h (TARGET_BYTES_BIG_ENDIAN): Change to false. - -1999-11-01 Gavin Romig-Koch - - * config/tc-mips.c (macro_build): Use OPCODE_IS_MEMBER. - (mips_ip): Use OPCODE_IS_MEMBER. - -Wed Oct 27 16:50:44 1999 Don Lindsay - - * config/tc-arm.c (reg_required_here): Improve comments. - - * config/tc-arm.c (thumb_opcode): Add "variants" field. - (tinsns): Initialize variants field. - - * config/tc-arm.c (bad_args, bad_pc): Renamed to BAD_ARGS and - BAD_PC respectively. - -1999-10-27 Scott Bambrough - - * config/tc-arm.c (reloc_map[]): Fix compiler warning. - * config/tc-arm.h: Fix compile time warnings. - -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). - -1999-10-21 Gavin Romig-Koch - - * config/tc-mips.c (ISA_HAS_COPROC_DELAYS) : New. - (ISA_HAS_64_BIT_REGS) New. - (gpr_interlocks,md_begin,reg_needs_delay,append_insn, - mips_emit_delays,macro_build,load_register,load_addresss, - macro,macro2,mips_ip,s_cprestore,s_cpadd): Simplify - and/or use new ISA_xxx macros in expressions involving - ISA, particularly mips_opts.isa. - -1999-10-18 Michael Meissner - - * expr.h (operatorT): Add machine dependent operators md1..md8. - (expressionS): Make X_op 8 bits instead of 7. Add a X_md field - for the machine dependent operators to use. - - * expr.c (op_rank): Add machine dependent operators. - - * config/tc-alpha.c (O_pregister): Define as a machine dependent - operator. - (O_cpregister): Ditto. - (md_begin): Change X_op test that field is wide enough to use - O_max instead of O_alpha_max. - (cpu_types): Fill in missing initializer. - (alpha_num_macros): Make unsigned. - (md_assemble): Make opnamelen be size_t. - (md_apply_fix): Cast alpha_num_operands to int before testing. - (alpha_force_relocation): Ditto. - (alpha_fix_adjustable): Ditto. - (alpha_fix_adjustable): Mark unused arguments ATTRIBUTE_UNUSED. - (tc_gen_reloc): Ditto. - (tc_get_register): Ditto. - (emit_ldgp): Ditto. - (emit_lda): Ditto. - (emit_ldah): Ditto. - (emit_ldil): Ditto. - (s_alpha_ent): Ditto. - (s_alpha_end): Ditto. - (s_alpha_frame): Ditto. - (s_alpha_prologue): Ditto. - (s_alpha_file): Ditto. - (s_alpha_gprel32): Ditto. - (s_alpha_proc): Ditto. - (s_alpha_set): Ditto. - (s_alpha_base): Ditto. - (s_alpha_align): Ditto. - (s_alpha_arch): Ditto. - (alpha_align): Ditto. - (assemble_insn): Suppress unused variable warning. - (emit_insn): Ditto. - (assemble_insn): Don't assume X_op and X_unsigned are in a given - order in the structure. - (s_alpha_coff_wrapper): Avoid int/unsigned comparison. - -Sun Oct 17 17:15:58 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (md_apply_fix): Make "fmt" an int. - -1999-10-12 Alan Modra - - * config/tc-i386.c (i386_index_check): Correct #endif location. - -Mon Oct 11 14:02:40 1999 Geoffrey Keating - - * as.c (show_usage): Document new options. - (parse_args): Add --no-warn, --warn, --fatal-warnings, - which become 'W', OPTION_WARN, and OPTION_WARN_FATAL. - (parse_args): Parse the new options. - (main): If there were warnings, and --fatal-warnings - was specified, print an error. - * as.h: New variable, flag_fatal_warnings, for new option. - -Sun Oct 10 01:47:23 1999 Jerry Quinn - - * config/tc-hppa.c (pa_ip): Add new codes 'cc', 'cd', 'cC', 'co', - '@'. Change autoincrement completers to fall through to cache control - completers. - - * config/tc-hppa.c (pa_ip): Remove unused args. Add code to '?W' - arg. - (pa_parse_addb_64_cmpltr): New function. - - * config/tc-hppa.c (pa_ip): Change error message. - (pa_ip,pa_parse_cmpb_64_cmpltr,pa_parse_cmpib_64_cmpltr) Fix '?N' and - '?Q' args to allow falling through. - - * configtc-hppa.c (pa_ip): Implement conditional codes "?N", "?Q". - Remove unused conditional codes. - (pa_parse_cmpb_64_cmpltr,pa_parse_cmpib_64_cmpltr): New. - -Thu Oct 7 00:23:53 MDT 1999 Diego Novillo - - * config/tc-d30v.c (CHAR_BIT): Define. - (check_range): Fix bit operations to support integers bigger than - 32 bits. - -Thu Oct 7 00:11:50 MDT 1999 Diego Novillo - - * config/tc-d10v.c (check_range): Check range for RESTRICTED_NUM3 - operands. - -Mon Oct 4 17:24:23 1999 Nick Clifton - Doug Evans - - Add support for m32rx. - * config/tc-m32r.c (enable_m32rx): New static global. - (enable_special,warn_explicit_parallel_conflicts,optimize): Ditto. - (allow_m32rx): New function. - (M32R_SHORTOPTS): Add `O'. - (md_longopts): Add --m32rx plus several warning options. - (md_parse_option): Handle new options. - (md_show_usage): Print them. - (md_begin): Enable m32rx. - (OPERAND_IS_COND_BIT): New macro. - (first_writes_to_seconds_operands): New function. - (writes_to_pc,can_make_parallel,make_parallel): New functions. - (target_make_parallel,assemble_two_insns): New functions. - (md_assemble): Recognize "insn1 -> insn2" and "insn1 || insn2". - If optimizing and m32rx, try to make consecutive insns parallel. - -Tue Sep 28 14:06:44 1999 Geoffrey Keating - - * config/tc-mips.c (nopic_need_relax): Allow for the - .sdata.foo sections generated by -fdata-sections, - and for the .gnu.linkonce.s sections generated by C++. - -Thu Sep 23 07:13:45 1999 Jerry Quinn - - * config/tc-hppa.c (pa_ip): Replace 'B', 'M', 'l' and 'g' handling - with cleaner code using completer prefixes. Add 'Y'. - - * config/tc-hppa.c (pa_ip): Add parens to silence compiler. - -Wed Sep 22 09:37:19 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (pa_ip): Avoid ANSI specific initialization. - (pa_ip, case 'm'): Failure to get a CBIT specifier just means the - insn does not match and we should try the next insn in the table. - -1999-09-22 Nick Clifton - - * config/tc-arm.c (MULTI_SET_PSR): Rename to LDM_TYPE_2_OR_3. - -Mon Sep 20 04:01:41 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (pa_ip): Fix thinkos in recent cleanup - of PA2.0 support. - -1999-09-19 Alexandre Oliva - - * config/tc-i386.c (md_shortopts): Check OBJ_MAYBE_ELF as well as - OBJ_ELF. If ELF, add "sq". - (md_parse_option): If ELF, ignore -s and -q. - (md_show_usage): Mention ELF options. - -Sun Sep 19 10:43:31 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (pa_ip): Handle 'J', 'K' and 'cc' - operands. - - * config/tc-hppa.c (pa_ip); Handle "fe", and 'cJ'. - - * config/tc-hppa.c (pa_ip): Handle 'd', '#' and 'cq'. - - * config/tc-hppa.c (struct pa_it): New field "trunc". - (pa_ip): Hadnle 'h', 'm', '=', '{', and '_' operands. - (pa_parse_ftest_gfx_completer): New function - (pa_parse_fp_cnv_format): New function. - - * config/tc-hppa.c (pa_ip): Handle 'X' operand. - (md_apply_fix): Handle 22bit pc-rel branches. - - * config/tc-hppa.c (pa_ip): Handle 'B' operand. - - * config/tc-hppa.c (pa_ip): Handle 'L' and 'M' operands. - - * config/tc-hppa.c (pa_ip): Handle 'l' operand. - - * config/tc-hppa.c (pa_ip): Handle 'g' operand. - -at Sep 18 12:13:28 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (md_assemble): Fix dwarf2 line handling. - (pa_ip): Handle 'fX'. - -Sat Sep 18 12:13:28 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (md_assemble): Fix dwarf2 line handling. - (pa_ip): Handle 'fX'. - -Fri Sep 17 11:57:34 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (pa_build_unwind_subspace): Do not build - unwinds unless the function is in the text space. - (pa_type_args): Set BSF_FUNCTION for an exproted data symbol. - -Wed Sep 15 05:14:32 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (pa_ip): Move dwarf2 stuff from here. - (md_assemble): To here. Tweak address generation. - - * config/tc-hppa.c: Include dwarf2dbg.h if OBJ_ELF. Declare - debug_line. - (md_pseudo_table): Add .file and .line pseudo-ops for OBJ_ELF. - (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. - -1999-09-14 Michael Meissner - - * configure.in (Canonicalization of target names): Remove adding - ${CONFIG_SHELL} in front of $ac_config_sub, since autoconfig 2.14 - generates $ac_config_sub with a ${CONFIG_SHELL} already. - * configure: Regenerate. - -1999-09-14 Donn Terry - - * config/te-interix.h (GLOBAL_OFFSET_TABLE_NAME): Define. - -1999-09-13 Alan Modra - - * config/tc-i386.c (md_assemble): Handle "jmp/call constant" as a - pc-relative jmp/call to an absolute symbol. - (md_apply_fix3): When OBJ_ELF, don't add the values in twice for - absolute section symbols. - - * config/tc-i386.c (md_assemble): Correct frag_var size. Tidy - jump handling code and comments. - -1999-09-12 Ian Lance Taylor - - * config/tc-i386.c (md_apply_fix3): Add horrible adjustments to - the value if TE_PE and a global defined symbol. - -1999-09-11 Ian Lance Taylor - - * write.c (dump_section_relocs): Call print_symbol_value_1 to - print the symbol, rather than printing it here. - -1999-09-11 Donn Terry - - * config/tc-i386.c (tc_i386_fix_adjustable): Don't adjust - BFD_RELOC_RVA relocations. - - * config/tc-i386.c (md_undefined_symbol): Compare the name against - the macro GLOBAL_OFFSET_TABLE_NAME, rather than assuming that it - starts with "_G". - - * write.c (write_relocs): Call SET_SECTION_RELOCS if it is - defined. - * config/obj-coff.h (SET_SECTION_RELOCS): Define. - * doc/internals.texi (Object format backend): Document - SET_SECTION_RELOCS. - - * config/tc-i386.c (tc_i386_fix_adjustable): Don't adjust - relocations against global symbols if TE_PE. - - * config/obj-coff.c (obj_coff_ident): Add BFD_ASSEMBLER version. - (obj_pseudo_table): Always handle ".ident" with obj-coff_ident. - - * config/obj-coff.c (coff_frob_symbol): Prohibit weak common - symbols. - - * config/obj-coff.c (obj_coff_endef): Don't merge labels, or - symbols which do not have a constant value, or tags with - non-tags. Remove the symbol from the list before adding it at the - end. - - * config/obj-coff.c (obj_coff_endef) [BFD_ASSEMBLER]: Handle .ef - C_FCN symbol differently if TE_PE. - (obj_coff_line) [BFD_ASSEMBLER]: Always use the line number which - appears in the pseudo-op, rather coff_line_base which is only set - for a .bf symbol. - - * config/obj-coff.c (obj_coff_loc): New static function. - (obj_pseudo_table): Add "loc". - - * config/obj-coff.c (add_lineno): Check that the line number is - positive. - - * config/atof-ieee.c (atof_ieee): Change what_kind to int. - * config/atof-vax.c (flonum_gen2vax): Change format_letter to - int. - (md_atof): Return NULL rather than 0. - * config/tc-i386.c (md_atof): Change type to int. - * expr.c (expr): Change first parameter to int. - * config/obj-coff.c: Add declarations for static functions. - (coff_frob_symbol): Use SYM_AUXENT. - * config/tc-i386.h (flag_16bit_code): Don't declare. - - * config/obj-coff.c (obj_coff_section): Default to setting - SEC_LOAD. Don't set SEC_DATA for 'w' modifier. - - * write.c (adjust_reloc_syms): Print adjusted fixup. - - * expr.c (integer_constant): Correct too_many_digits calculation - in base 10 case. - -1999-09-09 Andreas Schwab - - * doc/c-arm.texi: Fix arguments of @var to not contain - punctuation. - -1999-09-08 Philip Blundell - - * config/tc-arm.c (s_thumb_set): Only support interworking for ELF - and COFF targets. - (md_parse_option): Only support -k flag for ELF and COFF targets. - -Tue Sep 7 13:28:59 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (pa_ip): Put strict register checks before - call to pa_parse_number. - - * config/tc-hppa.c (pa_ip): Support 'Z' argument. - -1999-09-06 Ian Lance Taylor - - * config/obj-coff.c: Add ATTRIBUTE_UNUSED as needed for - BFD_ASSEMBLER code. - -1999-09-06 Donn Terry - - * as.c (perform_an_assembly_pass): Set SEC_DATA for data_section. - -Mon Sep 6 04:26:56 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (pa_ip): Get strict/non-strict mode from the - candidate instruction. Require registers for register arguments - when in strict mode. Require assemble-time constants for - constants when in strict mode. - (pa_get_absolute_expression): Require a constant when in strict - mode. - -1999-09-06 Nick Clifton - - * config/tc-m32r.c (md_longopts): Fix value for -Wnuh. - -1999-09-04 Steve Chamberlain - - * config/tc-pj.c: New file, supports picoJava in ELF. - * config/tc-pj.h: Ditto. - * configure.in (pjl*, pj*): New targets. - * Makefile.am: Rebuild dependencies. - (CPU_TYPES): Add pj. - (TARGET_CPU_CFILES): Add config/tc-pj.c. - (TARGET_CPU_HFILES): Add config/tc-pj.h. - * doc/c-pj.texi: New file. - * doc/as.texinfo: Add some PJ specifics. - * doc/all.texi: Add PJ to the list of all architectures, sort them - all alphabetically. - * doc/Makefile.in (CPU_DOCS): Add c-pj.texi. - * configure, Makefile.in, doc/Makefile.in: Rebuild. - -1999-09-02 Alan Modra - - * config/obj-multi.h: Include obj-elf.h if OBJ_MAYBE_ELF. Reformat. - (obj_frob_file): Test for null pointer. - (OBJ_COPY_SYMBOL_ATTRIBUTES): Here too. - (OBJ_PROCESS_STAB): And here. - (elf_obj_sy): Remove - - * config/obj-elf.h: #ifndef everything defined in obj-multi.h, - except OBJ_PROCESS_STAB, which we #undef for ecoff. - (elf_obj_sy): Remove #ifndef OBJ_SYMFIELD_TYPE. - - * config/obj-coff.c (no_func): Remove. - (coff_format_ops): Change occurrences of no_func to 0, as we test - for 0 in obj-multi.h. - - * configure.in: Enable bfd for i386-coff when primary target is - bfd. Enable i386 elf,coff emulation support. Don't set - USE_EMULATIONS=1 or te_file=multi unless there is more than one - emulation to support. - *configure: Regenerate. - -1999-09-02 Nick Clifton - - * config/tc-mcore.c (mcore_s_section): Do not dump literals if a - .section .line directive is encountered. - -1999-09-01 Nick Clifton - - * config/tc-arm.c (md_section_align): Do not align sections in ELF - format. - - * as.c (show_usage): Add --gdwarf2 to list of options displayed. - * as.texinfo: Document --gdwarf2 command line option. - Add additional documentation of ARM command line switches. - -1999-08-30 Alan Modra - - * config/tc-i386.c (i386_intel_memory_operand): Combine - i386_is_reg and parse_register calls. Remove END_STRING_AND_SAVE - and RESTORE_END_STRING around parse_register calls. - (i386_operand): Here too. - (i386_is_reg): Remove. - (parse_register): Move as_bad calls from within this function to - callers. - -1999-08-29 Alan Modra - - Based on a patch from H.J. Lu - * config/tc-i386.c (parse_register): Handle FP regs specially. - (md_begin): Remove '(' and ')' from register_chars. - -1999-08-29 Doug Evans - - * config/tc-m32r.c (md_parse_option): Delete unrecognized option - error message (done elsewhere). - -Sat Aug 28 01:23:11 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (pa_ip): Do not allow '*' in 32bit completers. - -Sat Aug 28 00:26:26 1999 Jerry Quinn - - * config/tc-hppa.c (pa_ip): Replace 'f' by 'v'. Prefix float register - args by 'f'. - - * config/tc-hppa.c (pa_ip): Add args q, %, and |. - - * config/tc-hppa.c (pa_ip): Absorb white space in instructions - between args. - Add new completers. Fix bug in 64 bit condition handling. - - * config/tc-hppa.c (pa_ip): Add completer codes 'a', 'ch', 'cH', - 'cS', and 'c*'. - - * config/tc-hppa.c (pa_ip): Place completers behind prefix 'c'. - - * config/tc-hppa.c (pa_ip): Add cases for '.', '~'. '$'. and '!' - - * config/tc-hppa.c (pa_ip): Add case for 'I'. - -1999-08-27 Jim Wilson - - * dwarf2dbg.c (MAX_SPECIAL_ADDR_DELTA): Correct typo in comment. - (struct ls): Add frag field. Initialize it to zero. - (out_end_sequence): New local text_frag. Set it while in text section. - Replace address check with frag check. Set ls.frag to text_frag if - out_set_addr called. - (dwarf2_gen_line_info): Add explanatory comment. New local saved_frag. - Set it before switching sections. Replace address check with frag - check. Set ls.frag to saved_frag if out_set_addr called. - -1999-08-26 David Mosberger - - * dwarf2dbg.c (out_end_sequence): If address changed, directly - output "advance_pc" opcode instead of calling gen_addr_line(). - The latter has the undesired side-effect of creating a new row - in the debug line info matrix. - -1999-08-26 Jim Wilson - - * dwarf2dbg.c (out_end_sequence): Correct comments. Set last to - ls.last_filename if last is less than zero. Set ls.last_filename - when allocating new entry. - (dwarf2_gen_line_info): Save seg and subseg info before subseg_new - call. - -1999-08-20 Alan Modra - - * config/tc-i386.c (i386_index_check): Fix the displacement size - when INFER_ADDR_PREFIX. - -1999-08-18 Nick Clifton - - * config/tc-arm.c (md_apply_fix3): If an offset is invalid, - display its value. - -1999-08-17 Ian Lance Taylor - - * config/tc-ppc.c (md_assemble): Trim @ha constant to 16 bits, to - handle 0xffffNNNN constants correctly. - -1999-08-16 Nick Clifton - - * config/tc-arm.c (do_ldst): Look for register conflicts on stores - as well as loads. - -1999-08-13 Nick Clifton - - * config/tc-arm.c (validate_offset_imm): Work on unsigned values. - (md_apply_fix3): Always pass positive values to - validate_offset_imm. - -1999-08-12 Nick Clifton - - * config/tc-arm.c (skip_whitespace): New macro. - Formatting tidy ups. - - (md_apply_fix3): Store relocation offset in addend for ELF based - relocs. - (arm_force_relocation): Always generate relocs for Thumb function - calls. - -1999-08-11 Alan Modra - - * config/tc-i386.c (md_assemble): Remove dead code. intel_syntax - LONG_DOUBLE_MNEM_SUFFIX floating point is done in opcode/i386.h - -Tue Aug 10 12:58:31 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (pa_build_unwind_subspace): Use sane section - flags for the unwind subspace. - - * config/tc-hppa.c (UNWIND_SECTION_NAME): Define for ELF. - (pa_build_unwind_subspace): Remove #if 0 wrapper. Select a - suitable relocation based on the size of the target's pointer. - Always Use subsegment zero for the unwinders. - (pa_level): Handle "2.0w". - -Mon Aug 9 20:02:22 1998 J"orn Rennecke - - * config/tc-d30v.c (write_2_short): Don't group repeat instructions - with the following instruction unless this was specified. - -1999-08-09 Ian Lance Taylor - - * config/tc-i386.h (SUB_SEGMENT_ALIGN): If TE_GO32, return 4 for - certain sections, to match BFD changes. - -1999-08-08 Mumit Khan - - * Makefile.am (noinst_SCRIPTS): Change .gdbinit to $(GDBINIT). - (EXTRA_SCRIPTS): Define to keep automake happy. - * Makefile.in: Rebuild. - -1999-08-08 Ian Lance Taylor - - * Makefile.am: Rename .dep* files to DEP*. - (MKDEP): Rename from DEP. Change all uses. Use $${srcdir} rather - than $(srcdir). Rename TCDEP targets to DEPTC. Rename OBJDEP - targets to DEPOBJ. - * Makefile.in: Rebuild. - -1999-08-08 Jakub Jelinek - - * config/tc-sparc.c (sparc_ip): Allow assembly of %lo()+%reg. - -1999-08-08 Ian Lance Taylor - - * Makefile.am: Change all uses of itbl-test-ops to itbl-tops to - avoid problems on DOS filesystems. - * Makefile.in: Rebuild. - - * doc/as.texinfo (Section): Document 's' flag for COFF version. - -1999-08-08 Mumit Khan - - * config/obj-coff.c (obj_coff_section): Handle 's' (shared) - section flag. - -1999-08-08 Ian Lance Taylor - - * configure.in: Define and substitute GDBINIT. Change AC_OUTPUT - line to create ${GDBINIT} rather than .gdbinit. - * configure, Makefile.in, doc/Makefile.in: Rebuild. - -Fri Aug 6 12:12:44 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (pa_ip, case '?'): Add missing break. - -Fri Aug 6 09:46:35 1999 Jerry Quinn - - * config/tc-hppa.c (pa_ip): Add 64 bit condition completers. - -1999-08-06 Jakub Jelinek - - * config/tc-sparc.h (tc_fix_adjustable): Fix check for PIC local - non-adjustable symbols. - -Thu Aug 5 16:52:51 1999 Jerry Quinn - - * config/tc-hppa.c (pa_ip): Change condition args to have '?' prefix. - -Thu Aug 5 23:05:56 1999 J"orn Rennecke - - * config/tc-sh.c (md_assemble): Call as_bad when there are excess - operands. - -1999-08-05 Donn Terry - - * config/te-interix.h: New file. - * configure.in (i386-*-interix*): New target. - * configure: Rebuild. - -Wed Aug 4 13:12:17 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (pa_chk_field_selector): Allow 3 byte - selectors for ELF too. - (selector_table): Add "ltp" and "rtp" selectors. - -1999-08-04 Alan Modra - - * config/tc-i386.c (i386_operand): No need to change - operand_string pointer in segment reg case before goto - do_memory_reference. Initialise displacement_string_start and - displacement_string_end after do_memory_reference label. - (i386_index_check): Add operand_string param, and print error - message on failure here. - (i386_intel_memory_operand): Instead of here. - (i386_operand): And here. - (INFER_ADDR_PREFIX): Enable. - - * doc/c-i386.texi (i386-16bit): Document .code16gcc. - - * config/tc-i386.h (DefaultSize): Define. Renumber following - opcode_modifier defines. - - From Etienne Lorrain - * config/tc-i386.c (stackop_size): New variable. - (set_16bit_code_flag): Clear it here. - (set_16bit_gcc_code_flag): New function. - (md_pseudo_table): Add "code16gcc" entry. - (md_assemble): Set i.suffix for insns with DefaultSize modifier. - -1999-08-03 Ian Lance Taylor - - * config/obj-coff.c (coff_frob_symbol): Always update set_end with - next_set_end even if the end symbol is being discarded. - - * gasp.c: Add ATTRIBUTE_UNUSED as needed for non-BFD_ASSEMBLER. - * output-file.c, symbols.c, config/tc-i386.c: Likewise. - * config/obj-coff.c: Likewise. - (seg_info_type): Remove. - (seg_info_off_by_4): Change to array of segT. - (s_get_segment): Adjust accordingly. - (obj_pseudo_table): Fully initialize sentinel entry. - - * config/tc-mips.c (append_insn): Correct INSN_SYNC test. From - Ralf Baechle . - -1999-08-03 Etienne Lorrain - - * config/tc-i386.c (f16_3): New. Fixes 16 bit 3 byte nop. - -1999-08-03 Alan Modra - - * config/tc-i386.c: Indentation and white space changes. - (i386_index_check): New function. Add INFER_ADDR_PREFIX code, but - don't enable it by default. - (i386_intel_operand): Remove redundant prototype. - Move check on number of memory operands, and i.mem_operands++ - (i386_intel_memory_operand): To here. - Remove i386_immediate code from here. Remove special case code - for input and output using (%dx). Remove base/index checks and - call i386_index_check instead. Save initial operand_string - argument for error message. - (i386_operand): Remove redundant prototype. Move base/index - checks to i386_index_check. - (i386_displacement): Move intel mode check for non-zero - i.disp_operand - (i386_intel_memory_operand): To here. - -1999-07-30 Jakub Jelinek - - * config/tc-sparc.c (md_longopts): Add --no-undeclared-regs option. - (sparc_ip): Warn if %g2 or %g3 register is used and not covered - by .register pseudo-op if -64 and --no-undeclared-regs. - (s_register, sparc_adjust_symtab): New functions. - * config/tc-sparc.h (tc_adjust_symtab, sparc_adjust_symtab): - Declare sparc_adjust_symtab as tc_adjust_symtab. - * doc/c-sparc.texi: Add description of #ignore special literal - for .register pseudo-op. - -1999-07-30 Catherine Moore - - * config/tc-arm.c (tc_gen_reloc): Record the vtable entry in - the relocation's section offset. - -1999-07-29 Alan Modra - - * write.c (fixup_segment): Fix generic error check overflow test. - - * config/tc-i386.c (pe): Change %d to %ld, %x to %lx, and cast - X_add_number to long. - -Wed Jul 28 02:04:24 1999 "Jerry Quinn" - - * config/tc-hppa.c (pa_ip): Add 'J' and 'K' code - processing. - -1999-07-27 Ian Lance Taylor - - * config/tc-sparc.h (tc_fix_adjustable): Don't adjust GOT, PLT, or - VTABLE relocations. - -1999-07-21 Mark Elbrecht - - * config/te-go32.h (COFF_LONG_SECTION_NAMES): Define. - - * configure.bat: Remove; obsolete. - * config/go32.cfg: Likewise. - -1999-07-21 Brad M. Garcia - - * configure.in (i386-*-vxworks*): New target. - * configure: Rebuild. - -1999-07-16 Jakub Jelinek - - * doc/c-sparc.texi: Document .register and .nword pseudo-ops. - -1999-07-16 Jakub Jelinek - - * config/tc-sparc.c (sparc_ip): Allow OLO10 relocations - on -64 and not pic. - (output_insn): Put OLO10's secondary addend into tc_fix_data. - (md_apply_fix3): Handle BFD_RELOC_SPARC_OLO10. - (tc_gen_reloc): Return two relocs for OLO10, LO10 and SPARC13. - * config/tc-sparc.h (RELOC_EXPANSION_POSSIBLE, - MAX_RELOC_EXPANSION): Define. - (TC_FIX_TYPE, TC_INIT_FIX_DATA, TC_FIX_DATA_PRINT): Likewise. - -1999-07-16 Alan Modra - - * config/tc-i386.c (intel_float_operand): Add prototype, make static. - (md_assemble): Localize *exp variable to if (fake_zero_displacement) - block. Print a warning if an 8-bit or 16-bit constant - displacement or immediate is truncated on output. - (i386_immediate): Ensure Imm16 is always legal for a 16-bit mode - immediate. - (i386_operand): Disallow immediate jump absolute operand. - -1999-07-15 Ian Lance Taylor - - * configure.in: Bump version number to 2.9.5. - * configure: Rebuild. - - * dwarf2dbg.c (dwarf2_gen_line_info): Don't assume that long long - or %llx work. - -Thu Jul 15 02:45:30 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (md_pseudo_table): Add ".dword" pseudo-op. - (cons_fix_new_hppa): Derive size of fixup from size of the object. - -1999-07-14 Philip Blundell - - * symbols.c (dollar_label_name): Prepend LOCAL_LABEL_PREFIX if it - is defined. - * config/tc-arm.h (LOCAL_LABEL_PREFIX): Define to '.' for ELF. - - * config/tc-arm.c (md_begin): Set F_SOFTFLOAT in the output file - if -mno-fpu was given. - (tc_gen_reloc): Fix typo. Delete bogus code related to GOTPC - relocs. - (cons_fix_new_arm): Remove misleading comments. - -1999-07-14 Ian Lance Taylor - - * write.c (cvt_frag_to_fill): Use frag file and line in rs_org - error message. - (relax_segment): Likewise. After giving a rs_org error, convert - the frag to rs_align to avoid cascading errors. - -1999-07-12 Andreas Schwab - - * config/tc-m68k.c: Add some ATTRIBUTE_UNUSED. - -1999-07-11 Ian Lance Taylor - - * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED - as appropriate. Fill in structure initializations. Add variable - initializations. Add casts. - * dwarf2dbg.c (print_stats): Change i to size_t. - * listing.c (listing_listing): Change list_line to unsigned int. - -1999-07-10 Ian Lance Taylor - - * config/tc-ppc.h (tc_fix_adjustable) [OBJ_ELF]: Call S_IS_LOCAL - rather than checking for \001 and \002 in symbol name. - * config/tc-sparc.h (tc_fix_adjustable) [OBJ_ELF]: Likewise. - -Thu Jul 8 12:32:23 1999 John David Anglin - - * configure.in (hppa*-linux-gnu*): New target. - * configure: Rebuilt. - -1999-07-08 Nick Clifton - - * doc/c-arm.texi (ARM Directives): Document .thumb_set directive. - -1999-07-07 Nick Clifton - - * config/tc-v850.c (v850_comm): Use symbol_get_obj() rather than - accessing symbolP directly. - -Tue Jul 6 10:41:42 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.h (tc_frob_symbol): Always punt "$global$" symbol - for ELF. - -1999-07-05 Nick Clifton - - * config/tc-arm.c (ARM_EXT_V5): Define. - (ARM_ARCH_V5, ARM_ARCH_V5T): Define. - (md_begin): Detect ARM v5 architectures. - (md_parse_option): Accept arm v5 specification. - (md_show_usage): Documment -marmv5 switch. - - * doc/c-arm.texi: Document -marmv5 command line option. - - * config/tc-arm.c (do_adrl): New function. Implement ADRL pseudo - op. - (validate_immediate_twopart): New function. Determine if a - constant can be computed by two ADD instructions. - (output_inst): Remove its command line parameter - it was never - used. - (md_apply_fix3): Support BFD_RELOC_ARM_ADRL_IMMEDIATE, used to - implememt the ADRL pseudo op. - (tc_gen_reloc): Generate a suitable error message if an ADRL - instruction tries to generate a real reloc. - - * doc/c-arm.texi: Document NOP, ADR and ADRL pseudo ops. - -Thu Jul 1 15:33:10 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (pa_ip): Convert the opcode and all completers - into lower case. - -1999-06-27 H.J. Lu - - * subsegs.c (subseg_text_p): Use 1/0 instead of true/false for - non BFD_ASSEMBLER case. - -1999-06-26 Mumit Khan - - * config/obj-coff.c (obj_coff_section): Mark writable sections as - data. - -1999-06-26 David Mosberger - - * dwarf2dbg.c (dwarf2_gen_line_info): Don't call - out_end_sequence() when the address decreases due to a new frag. - (gen_dir_list): Set ls.file[i].dir to j + 1 (not j) because file - numbering starts with 1. - -1999-06-23 Nick Clifton - - * config/tc-mcore.c (md_pseudo_table): Add .comm for ELF and allow - .section for COFF. - (mcore_s_text): Call obj_elf_text for ELF target. - (mcore_s_data): Call obj_elf_data for ELF target. - (mcore_s_section): No longer ELF specific. Call obj_coff_section - for COFF target. - (mcore_s_bss): New function: Dump literal table before changing - sections. - (mcore_s_comm): New function: Dump literal table before changing - sections. - - * config/obj-elf.c (obj_elf_common, obj_elf_data, obj_elf_text): - No longer static functions. - * config/obj-elf.h (obj_elf_common, obj_elf_data, obj_elf_text): - Provide prototypes for these functions. - -1999-06-22 Ian Lance Taylor - - * subsegs.c (subseg_text_p): Rewrite non BFD_ASSEMBLER case to use - a list of names, to try obj_segment_name, and to try abbreviated - names when using COFF without long section names. - - * config/tc-alpha.c: More use of symbol accessor functions. - * config/tc-arc.c: Likewise. - * config/tc-d30v.c: Likewise. - * config/tc-fr30.c: Likewise. - * config/tc-i860.c: Likewise. - * config/tc-m88k.c: Likewise. - * config/tc-mcore.c: Likewise. - * config/tc-ns32k.c: Likewise. - * config/tc-sparc.c: Likewise. - * config/tc-v850.c: Likewise. - - * config/tc-arc.c (get_arc_exp_reloc_type): Change uses of - sy_value with appropriate accessor functions. - * config/tc-arm.c (md_apply_fix3): Likewise. - * config/tc-d10v.c (AT_WORD_P): Likewise. - * config/tc-v850.c (reg_name_search): Likewise. - - * config/obj-ecoff.c (obj_ecoff_set_ext): Change uses of bsym to - use symbol_get_bfdsym instead. - * config/tc-ppc.c (md_assemble): Likewise. - * config/tc-v850.c (v850_comm): Likewise. - -1999-06-22 Jonathan Larmour - - * config/tc-arc.c (tc_gen_reloc): Use symbol_get_bfdsym to get at - the symbol, rather than accessing the bsym member. - * config/tc-d10v.c (tc_gen_reloc): Likewise. - * config/tc-d30v.c (tc_gen_reloc): Likewise. - * config/tc-mcore.c (tc_gen_reloc): Likewise. - * config/tc-mn10200.c (tc_gen_reloc): Likewise. - * config/tc-mn10300.c (tc_gen_reloc): Likewise. - * config/tc-ns32k.c (tc_gen_reloc): Likewise. - * config/tc-tic30.c (tc_gen_reloc): Likewise. - * config/tc-v850.c (tc_gen_reloc): Likewise. - -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. - (hppa_gen_reloc_type): Conditionalize on BFD64. - (tc_gen_reloc): Re-enable ELF relocations. - * tc-hppa.h (TARGET_FORMAT): Handle elf64-hppa format. - -1999-06-21 Ian Lance Taylor - - * config/tc-arm.c (ldst_extend): Add parentheses to avoid - warning. - (do_ldst): Move assignment out of if condition. - (md_apply_fix3): Add casts to avoid printf format warnings. Add - parentheses to avoid warning. - -1999-06-21 Nick Clifton - - * config/tc-arm.c (arm_adjust_symtab): Use symbol_get_bfdsym() - macro to get at the BFD symbol associated with a GAS symbol. - -1999-06-19 Ian Lance Taylor - - * config/tc-ppc.c: Update for symbol handling changes. - * config/obj-coff.c: Likewise. - -Fri Jun 18 14:34:18 1999 Jeffrey A Law (law@cygnus.com) - - * 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. - (GDB_SYMBOLS_SUBSPACE_NAME): Likewise - (UNWIND_SECTION_NAME): Likewise. - (space/subspace related structures): Conditionalize definitions - on OBJ_SOM. - (space/subspace directives and support routines): Conditionalize - definitions and references/uses on OBJ_SOM. - (label_symbol_struct): For ELF, track the symbol's segment. For - SOM track its space. - (pa_define_label, pa_undefine_label, pa_get_label): Corresponding - changes. - (USE_ALIASES): Kill for both SOM & ELF. - (pa_def_subspaces, pa_def_spaces): Corresponding changes. - (pa_space, pa_subspace): Corresponding changes. - (pa_spaces_begin): Corresponding chagnes. - (md_begin): Do not muck around with space/subspace stuff for - OBJ_ELF. - (md_apply_fix): Temporarily disable argument relocation stuff - for OBJ_ELF. - (tc_gen_reloc): Temporarily disable relocation generation for - OBJ_ELF - (pa_build_unwind_subspace): Similarly. - -1999-06-16 Nick Clifton - - * config/tc-arm.c (thumb_set): New pseudo op. - (text, data, section): Override these pseudo ops with ARM - specific versions. - (s_thumb_set): New function: Perform the same as a .set pseudo - op, but also mark the alias'ed symbol as being a Thumb - function. - (arm_s_text): New function: Perform the same as the .text - pseudo op, but dump the literal pool before changing - sections. - (arm_s_data): New function: Perform the same as the .data - pseudo op, but dump the literal pool before changing - sections. - (arm_s_section): New function: Perform the same as the - .section pseudo op, but dump the literal pool before changing - sections. - (arm_cleanup): Do not reset the current section before dumping - the literal pool. - -1999-06-17 Nick Clifton - - * config/tc-m32r.c (md_longopts): Fix OPTION_WARN_UNMATCHED and - OPTION_NO_WARN_UNMATCHED entries. - (md_parse_option): Generate a warning message if an unrecognised - option is encountered. - - * config/tc-d10v.c (do_not_ignore_hash): New variable. - (get_operands): When parsing an expression after an '@' symbol - has been detected, do not ignore '#' symbols. - (md_operand): Only ignore '#' symbols if do_not_ignore_hash is - false. - -1999-06-13 Ian Lance Taylor - - From K. Richard Pixley : - * configure.in (ppc-*-vxworks*): New target. - * configure: Rebuild. - -1999-06-12 Philip Blundell - - * config/tc-arm.c (tc_gen_reloc): Fix handling of GOTPC relocs. - -1999-06-13 Ian Lance Taylor - - * write.c (adjust_reloc_syms): Rather than never reducing reloc - which refer to symbols in linkonce sections, permit reducing the - relocs if the symbol is local. - -1999-06-12 Ian Lance Taylor - - * subsegs.c (subseg_text_p): New function. - * as.h (subseg_text_p): Declare. - * read.c (do_align): Use subseg_text_p to set the default fill. - * write.c (subsegs_finish): Likewise. - * config/obj-coff.c (write_object_file): Likewise. - * config/tc-i386.h (md_maybe_text): Don't define. - (md_do_align): Use subseg_text_p to set the default fill. - * config/tc-m32r.c (m32r_do_align): Likewise. - * config/tc-sh.c (sh_do_align): Likewise. - * config/tc-sparc.h (md_do_align): Likewise. - -1999-06-12 David O'Brien - - * configure.in: (i[3456]86-*-freebsd*): Now defaults to ELF. - * configure: Rebuild. - -1999-06-12 Ian Lance Taylor - - * dwarf2dbg.c: Include elf/dwarf2.h with "", not <>. - * Makefile.am: Rebuild dependencies. - * Makefile.in: Rebuild. - - * config/tc-i386.c (i386_immediate): Remove unused label - seg_unimplemented. - - * struc-symbol.h: Put local_symbol code in ifdef BFD_ASSEMBLER. - * symbols.c: Likewise. - * config/obj-aout.c (obj_crawl_symbol_chain): Refer directly to - sy_next field when taking address, rather than symbol_next. - - * dwarf2dbg.c: Change bfd_vma to addressT and bfd_signed_vma to - offsetT. - (out_set_addr): Don't use BYTES_PER_ADDRESS. Instead, get the - value from the output file architecture. - (dwarf2_gen_line_info): Ifdef BFD_ASSEMBLER specific code. - * dwarf2dbg.h: Change bfd_vma to addressT. - -1999-06-11 Ian Lance Taylor - - * dwarf2dbg.h: Use PARAMS in function declarations. - -1999-06-11 Martin Dorey - - * write.c (fixup_segment): Don't add symbol value for i960 ELF. - * config/tc-i960.c (s_leafproc): Don't call tc_set_bal_of_cal if - OBJ_ELF. - (md_apply_fix): Simplify BFD_ASSEMBLER handling. - -1999-06-11 Ian Lance Taylor - - * config/tc-i386.c (md_apply_fix3): Add default case to switch. - - * config/tc-sparc.c (md_pseudo_table): Remove pushsection and - popsection. - - * config/tc-sparc.c (sparc_ip): Add default case to reloc switch. - - * read.c (read_a_source_file): Only declare inescape if - QUOTES_IN_INSN. - - * itbl-ops.c (itbl_disassemble): Change sprintf format strings to - match parameters. - (find_entry_byval): Add parens to avoid warning. - - * as.c: If HAVE_ITBL_CPU, include "itbl-ops.h". - - * symbols.c (resolve_symbol_value): Don't permit subtraction of - undefined symbols. - -1999-06-10 Jakub Jelinek - - * config/tc-sparc.c (sparc_ip): Don't use side-effect expression - with isoctal. - - * config/tc-sparc.c (synthetize_setuw, synthetize_setsw, - synthetize_setx): New functions. - (md_assemble): Broken the special cases into the above - functions. Make compiler happy if sizeof(bfd_vma)==4. - Fix sethi generated from set/setuw. If instructions have a relloc, - always clear the fields to be relocated in the opcode. - (sparc_ip): Remove special_case global variable. - -1999-06-10 Ian Lance Taylor - - Based on patches from John W. Woznack : - * itbl-ops.c (itbl_get_reg_val): Add pval parameter. Return - indication of success rather than a value. - (itbl_get_val): Likewise. - (itbl_get_field): Use strcspn. Change delimiters to include - parens. - * itbl-ops.h (itbl_get_reg_val): Update declaration. - (itbl_get_val): Likewise. - * config/tc-mips.c (mips_ip): Update call to itbl_get_reg_val. - - * symbols.c (copy_symbol_attributes): Convert local symbols to - regular symbols. - -1999-06-10 Nick Clifton - - * config/tc-arm.c (md_parse_option): Add support for ARM920 and - ARM920t. - -1999-06-07 Jakub Jelinek - - * config/tc-sparc.c (md_assemble): Fix up setx, support setsw. - Optimize set if sizeof(bfd_vma) == 64. - (sparc_ip): Fix sethi - without %hi() it should generate - R_SPARC_22 reloc, not R_SPARC_HI22. - (tc_gen_reloc): Handle BFD_RELOC_SPARC22. - -1999-06-07 Jakub Jelinek - - * config/tc-sparc.c (md_begin): Handle native wordsize aliases. - (s_ncons): New function. - (native_op_table): New table. - (sparc_ip): Be more strict on %hi() etc.; prepare assembler for - R_SPARC_OLO10 handling. - -Mon Jun 7 10:22:16 1999 Richard Henderson - - * expr.h (struct expressionS): Revert last change; widen X_op. - * config/tc-alpha.c (md_begin): Check the field is wide enough. - -Mon Jun 7 11:25:16 1999 Andreas Schwab - - * Makefile.am (TARGET_CPU_CFILES): Add config/tc-fr30.c. - (TARGET_CPU_HFILES): Add config/tc-fr30.h. - (TARG_ENV_HFILES): Add config/te-epoc-pe.h. - * Makefile.in: Regenerated. - - * config/obj-elf.c (obj_elf_common): In MRI mode if called as - `common' pass on to s_mri_common. - (elf_pseudo_table): Pass 1 to obj_elf_common for `common'. - -1999-06-06 Richard Henderson - - * config/obj-elf.c (obj_elf_section): Don't free the return - value of demand_copy_C_string. - -1999-06-05 Richard Henderson - - * dwarf2dbg.c (dwarf2_gen_line_info): Mirror the section symbol - creation logic from obj_elf_create_section. - - * config/obj-elf.c (elf_pseudo_tab): Add pushsection/popsection. - (section_stack): New. - (special_sections): Make const. - (obj_elf_section): Gut and rewrite parsing. - (obj_elf_change_section): New function broken out of obj_elf_section. - (obj_elf_parse_section_letters): Likewise. - (obj_elf_section_word): Likewise. - (obj_elf_section_type): Likewise. - (obj_elf_previous): Treat as a toggle. - (obj_elf_popsection): New. - * config/tc-ppc.c (ppc_section_word): Take str+len not ptr_str. - (ppc_section_type): Likewise. - * config/tc-ppc.h: Likewise. - - * expr.h (struct expressionS): Don't make X_op a bitfield. - * config/tc-alpha.c: Update for symbol handling changes. - (md_apply_fix) [case GPREL]: Use now_seg instead of absolute_section. - (load_expression, emit_ir_load, emit_loadstore, emit_jsrjmp): Likewise. - -1999-06-05 Richard Henderson - - * dwarf2dbg.c (*): Convert to K&R + prototypes. - (dwarf2_gen_line_info): Kill unused variables. - (dwarf2_finish): Likewise. - (dwarf2_where): Likewise. - (dwarf2_directive_file): If we've only got a string, - hand off to s_app_file. - * ecoff.c: Move the include of ecoff.h. - * symbols.h (S_IS_FUNCTION): Prototype. - - * read.c (LEX_HASH): Supply a default. - (lex_type): Use it. - (s_globl): Update `c' after skipping whitespace. - * read.h (LEX_END_NAME, is_name_ender): New. - * expr.c (get_symbol_end): Respect it. - -1999-06-04 Mark Klein - - * config/tc-hppa.c (md_begin): Convert local symbol dummy_symbol - to real if OBJ_SOM - (tc_gen_reloc): Still need bfd_abs_symbol in some relocs. - - * config/tc-hppa.c: Update for symbol handling changes. - -1999-06-03 Ian Lance Taylor - - * cgen.c: Update for symbol handling changes. - * config/tc-m32r.c: Likewise. - - * config/tc-hppa.h: Update for symbol handling changes. - * config/tc-hppa.c: Likewise. - - * config/tc-arm.h: Update for symbol handling changes. - * config/tc-arm.c: Likewise. - (symbol_make_empty): Remove. Just use symbol_create. - - * symbols.c (symbol_set_tc): Correct name. - - * Makefile.am: Rebuild dependencies. - ($(OBJS)): Don't depend upon struc-symbol.h. - (.dep1, .tcdep, .objdep): Create itbl-parse.h. - * dep-in.sed: Don't remove struc-symbol.h. - * Makefile.in: Rebuild. - - * doc/internals.texi (Symbols): Describe changes in symbol - handling. - -1999-06-03 Richard Henderson - - * dwarf2dbg.c (dwarf2_gen_line_info): Use section_symbol - instead of doing the work by hand. - -1999-06-03 David Mosberger - - * dwarf2dbg.c (INITIAL_STATE): New macro encapsulating initial - state of line state-machine. - (struct ls): Collect DWARF2 line state-machine state in new member - SM. Add member EMPTY_SEQUENCE to keep track if a code sequence - resulted in any DWARF2 directives. - (reset_state_machine): New function. - (out_end_sequence): Ditto. - (dwarf2_gen_line_info): When switching sections or switching to a - lower text address, call out_end_sequence() first to terminate the - previous code sequence as code sequences MUST have monotonically - increasing addresses. - (dwarf2_finish): Call out_end_sequence() instead of open coding it. - -1999-06-03 David Mosberger - - * as.c (parse_args): Add option -gdwarf2 to allow requesting - DWARF2 debug info (line information only, at this point). - * as.h: Update comment about supported debug formats. - * dwarf2dbg.c, dwarf2dbg.h: New files. - * Makefile.am (GAS_CFILES, HFILES, GENERIC_OBJS): Add them. - - * expr.c (operand): Don't use [ for parens if we want an index op. - (op_encoding): Switch [ into O_index, if desired. - (op_rank): Renumber with O_index on bottom. - (expr): If O_index, match closing bracket. - * expr.h (O_index): New. - - * read.c (read_a_source_file): Conditionally allow matched " - in lines passed to md_assemble. - - * config/obj-elf.c (elf_pseudo_table): Add `common'. - -1999-06-03 Ian Lance Taylor - - Add support for storing local symbols in a small structure to save - memory when assembling large files. - * as.h: Don't include struc-symbol.h. - (symbolS): Add typedef. - * symbols.c: Include struc-symbol.h. - (local_hash): New static variable. - (save_symbol_name): New static function, from symbol_create. - (symbol_create): Call save_symbol_name. - (local_symbol_count): New static variable. - (local_symbol_conversion_count): Likewise. - (LOCAL_SYMBOL_CHECK): Define. - (local_symbol_make): New static function. - (local_symbol_convert): New static function. - (colon): Handle local symbols. Create local symbol for local - label name. - (symbol_table_insert): Handle local symbols. - (symbol_find_or_make): Create local symbol for local label name. - (symbol_find_base): Check for local symbol. - (symbol_append, symbol_insert): Check for local symbols. - (symbol_clear_list_pointers, symbol_remove): Likewise. - (verify_symbol_chain): Likewise. - (copy_symbol_attributes): Likewise. - (resolve_symbol_value): Handle local symbols. - (resolve_local_symbol): New static function. - (resolve_local_symbol_values): New function. - (S_GET_VALUE, S_SET_VALUE): Handle local symbols. - (S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise. - (S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise. - (S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise. - (S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise. - (symbol_previous, symbol_next): New functions. - (symbol_get_value_expression): Likewise. - (symbol_set_value_expression): Likewise. - (symbol_set_frag, symbol_get_frag): Likewise. - (symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise. - (symbol_mark_used_in_reloc): Likewise. - (symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise. - (symbol_mark_mri_common, symbol_clear_mri_common): Likewise. - (symbol_mri_common_p): Likewise. - (symbol_mark_written, symbol_clear_written): Likewise. - (symbol_written_p): Likewise. - (symbol_mark_resolved, symbol_resolved_p): Likewise. - (symbol_section_p, symbol_equated_p): Likewise. - (symbol_constant_p): Likewise. - (symbol_get_bfdsym, symbol_set_bfdsym): Likewise. - (symbol_get_obj, symbol_set_obj): Likewise. - (symbol_get_tc, symbol_set_tc): Likewise. - (symbol_begin): Initialize local_hash. - (print_symbol_value_1): Handle local symbols. - (symbol_print_statistics): Print local symbol statistics. - * symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER. - Declare new symbols.c functions. Move many declarations here from - struc-symbol.h. - (SYMBOLS_NEED_BACKPOINTERS): Define if needed. - * struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set. - (struct symbol): Move bsym to make it clearly the first field. - Remove TARGET_SYMBOL_FIELDS. - (symbolS): Don't typedef. - (struct broken_word): Remove. - (N_TYPE_seg, seg_N_TYPE): Move to symbol.h. - (SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise. - (symbol_clear_list_pointers): Likewise. - (symbol_insert, symbol_remove): Likewise. - (symbol_previous, symbol_append): Likewise. - (verify_symbol_chain, verify_symbol_chain_2): Likewise. - (struct local_symbol): Define. - (local_symbol_converted_p, local_symbol_mark_converted): Define. - (local_symbol_resolved_p, local_symbol_mark_resolved): Define. - (local_symbol_get_frag, local_symbol_set_frag): Define. - (local_symbol_get_real_symbol): Define. - (local_symbol_set_real_symbol): Define. - Define. - * write.c (write_object_file): Call resolve_local_symbol_values. - * config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define. - (TARGET_SYMBOL_FIELDS): Don't define. - * config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If - ECOFF_DEBUGGING, add ECOFF fields. - (ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define. - * config/obj-multi.h (struct elf_obj_sy): Add local field. If - ECOFF_DEBUGGING, add ECOFF fields. - (ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define. - (ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define. - * config/tc-mcore.h: Don't include struc-symbol.h. - (TARGET_SYMBOL_FIELDS): Don't define. - (struct mcore_tc_sy): Define. - (TC_SYMFIELD_TYPE): Define. - * Many files: Use symbolS instead of struct symbol. Use new - accessor functions rather than referring to symbolS fields - directly. - - * read.c (s_mri_common): Don't add in value of line_label. - - * config/tc-mips.c (md_apply_fix): Correct parenthesization when - checking for SEC_LINK_ONCE. - - * config/tc-sh.h (sh_fix_adjustable): Declare. - - * app.c (input_buffer): New static variable. - (app_push): Save saved_input in allocated buffer. - (app_pop): Restored saved_input. - (do_scrub_chars): Change get parameter to take char * and int as - arguments. Change GET macro to pass input_buffer to get - function. Don't save input into allocated buffer. - * as.h (do_scrub_chars): Update declaration. - * input-file.c (input_file_get): Change to take char * and int. - Read data into passed in buffer. Remove static buffer. - * read.c (scrub_from_string): Change to take char * and int. Copy - data into passed in buffer. - - * hash.h: Neaten. Declare hash_traverse. - * hash.c: Complete rewrite based on BFD hashing code. - * gasp.c (chunksize): New variable. - * macro.c (macro_expand_body): Call hash_jam with NULL rather than - hash_delete. - -1999-05-28 Nick Clifton - - * config/tc-arm.c (md_apply_fix3): Add pipeline offset into reloc - addend unless the target uses an old ABI. - -Mon May 24 13:36:55 1999 Doug Evans - - -Wchar-subscripts cleanup - * listing.c (listing_newline): Use unsigned char variable, so - calls to isascii,iscntrl are correct. - * atof-generic.c (atof_generic): Cast arg to isdigit, et. al. with - (unsigned char). - * ecoff.c (ecoff_directive_ent,ecoff_stab): Ditto. - * config/obj-elf.c (obj_elf_vtable_inherit): Ditto. - * config/tc-mips.c (mips_ip,mips16_ip): Ditto. - (my_getSmallExpression,get_number,s_mips_ent): Ditto. - -1999-05-28 Torbjorn Granlund - - * config/tc-m68k.c (m68k_ip): Check for disallowed index register - width for Coldfire. - (arch_coldfire_p): New #define. - (m68k_ip, m68k_init_after_args): Use arch_coldfire_p. - -1999-05-28 Linus Nordberg - - * config/tc-m68k.c (install_operand): Add places `n', `o'. - - * config/tc-m68k.c (m68k_ip): Add formats `E', `G', `H'. - (install_operand): Add place `N'. - (init_table): Add registers ACC, MACSR, MASK. - - * config/m68k-parse.h (m68k_register): Add ACC, MACSR, MASK. - - * config/tc-m68k.c: Change mcf5200 --> mcf. - (archs): Add mcf5206e, mcf5307. - (m68k_ip): Add format `u'. - (install_operand): Add place `m', `M', `h'. - (init_table): Add upper/lower registers. - - * config/m68k-parse.h (m68k_register): Add upper/lower registers. - -1999-05-28 Martin Dorey - - * config/tc-i960.c: Several minor changes to add ELF and - BFD_ASSEMBLER support. - * config/tc-i960.h: Likewise. - * configure.in (i960-*-elf*): New target. - * aclocal.m4, configure: Rebuild. - -1999-05-25 Alan Modra - - * config/tc-i386.c (md_apply_fix3): Only do 1999-05-17 fx_pcrel - reloc changes when defined(BFD_ASSEMBLER). - -1999-05-17 Alan Modra - - * config/tc-i386.c (tc_gen_reloc): Remove F and MAP macros. - - * write.c (write_print_statistics): Output to file, not stderr. - - * expr.c (generic_bignum_to_int32,64): Prototype. - - * read.c (s_lcomm_internal, sizeof_sleb128, sizeof_uleb128, - output_sleb128, output_uleb128, output_big_sleb128, - output_big_uleb128, output_big_leb128): Prototype. - (output_big_sleb128, output_big_uleb128): Make inline. - (output_big_leb128): Remove inline - - From Maciej W. Rozycki - * config/tc-i386.c (md_apply_fix3): Convert BFD_RELOC_16 with - fx_pcrel set to BFD_RELOC_16_PCREL. Similarly for BFD_RELOC_8. - Handle BFD_RELOC_16_PCREL and BFD_RELOC_8_PCREL. Return changed - value for correct overflow check in write.c:fixup_segment. - * write.c (fixup_segment): Move bitfield overflow checks to after - the md_apply_fix call. - * config/obj-coff.c (fixup_segment): Likewise. - * doc/internals.texi (CPU backend): Mention md_apply_fix modifying - valueT *val argument. - -Fri May 14 10:52:13 1999 Andreas Schwab - - * config/atof-ieee.c (gen_to_words): Correctly round a - denormalized number. Fix off-by-one in range checking for - exponent in a denormal. - -1999-05-10 Nick Clifton - - * config/tc-mcore.c (parse_reg): Accept 'sp' as a valid register - name. - -Thu May 13 09:46:59 1999 Joel Sherrill (joel@OARcorp.com) - - * configure.in (i386-*-rtemself*, sh-*-rtemself*): New targets. - -1999-05-12 Alan Modra - - * config/tc-i386.h (InvMem): New flag. Add to AnyMem. - (ReverseRegRegmem): Remove. - (ImmExt): New flag. Renumber some of the opcode_modifier bits. - * config/tc-i386.c (md_assemble): Test for PIII SIMD and AMD - 3DNow! via ImmExt opcode_modifier. Remove ReverseRegRegmem - kludge. - - From Doug Ledford - * config/tc-i386.h (RegXMM): New for P/III. - * config/tc-i386.c: Add support for P/III. - -Sat May 8 23:28:50 1999 Richard Henderson - - * config/tc-ppc.c (md_parse_option): Recognize -mppc64bridge. - (md_begin): Allow ppc32 insns in ppc64bridge mode. - (ppc_insert_operand): Accept SIGNOPT in ppc64 mode. - -Thu May 6 23:13:39 1999 Richard Henderson - - * config/tc-i386.c (i386_immediate): Skip whitespace before - complaining about junk after expression. - (i386_displacement): Likewise. - -Thu May 6 19:50:14 1999 Richard Henderson - - * symbols.c (symbol_find_base): Use memcpy instead of strcpy. - Don't copy before downcaseing. - -1999-05-05 Catherine Moore - - * tc-m68k.c: Include elf/m68k.h. - (m68k_elf_final_processing): New routine. - * tc-m68k.h (elf_tc_final_processing m68k_elf_final_processing): - Define. - -Mon May 3 10:26:03 1999 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (md_apply_fix): Handle 22 bit fmt insn like a - 17 bit fmt insn. - -1999-04-30 Nick Clifton - - * config/tc-mcore.c (mcore_s_section): Dump literals before - changing section. - -1999-04-29 Nick Clifton - - * config/tc-mcore.c (md_apply_fix3): Insert reloc addend into insn - for COFF/PE port. - -Mon Apr 26 12:34:37 1999 Doug Evans - - * config/tc-fr30.h (TC_FIX_TYPE): Delete, cgen fields moved to write.h. - (TC_INIT_FIX_DATA): Delete. - * config/tc-m32r.h (TC_FIX_TYPE): Delete, cgen fields moved to write.h. - (TC_INIT_FIX_DATA): Delete. - * write.h (struct fix): New member fx_cgen, ifdef USING_CGEN. - * write.c (fix_new_internal): Initialize fx_cgen member. - * cgen.c (gas_cgen_record_fixup,gas_cgen_record_fixup_exp): Update. - (gas_cgen_md_apply_fix3): Update. - * config/tc-m32r.c (md_cgen_lookup_reloc): Update. - (md_cgen_record_fixup_exp): Update. - (FX_OPINFO_R_TYPE): Update. - - * frags.c (frag_var,frag_variant): Initialize fr_cgen here. - * config/tc-fr30.h (TC_FRAG_INIT): Delete. - * config/tc-m32r.h (TC_FRAG_INIT): Delete. - * frags.h (struct frag): Make opindex, opinfo ints. - - * config/tc-fr30.c (FX_OPINFO_R_TYPE): Delete, unused. - -1999-04-26 Tom Tromey - - * aclocal.m4, configure: Updated for new version of libtool. - -1999-04-22 Nick Clifton - - * config/tc-mcore.c (md_apply_fix3): Renamed function from - md_apply_fix. - (md_apply_fix3): Do not fix up absolute relocations against - symbolic values. - - * config/tc-mcore.h (MD_APPLY_FIX3): Define. - -1999-04-20 Nick Clifton - - * config/tc-mcore.c (md_pseudo_table): Add intercepts for section - changes and data-in-text directives. - (mcore_cons): New function: intercept cons() operations. - (mcore_float_cons): New function: intercept float_cons() - operations. - (mcore_stringer): New function: intercept stringer() operations. - -1999-04-18 Ian Lance Taylor - - * obj.h (struct format_ops): Change generate_asm_lineno field to - take no parameters. - * config/obj-ecoff.h (OBJ_GENERATE_ASM_LINENO): Don't define. - - * config/tc-alpha.c (find_opcode_match): Add default case to - switch. - (find_macro_match): Likewise. - (load_expression): Parenthesize && within ||. - - * config/tc-alpha.h (TC_RELOC_RTSYM_LOC_FIXUP): Define. - -1999-04-17 Nick Clifton - - * config/tc-mcore.c (md_pseudo_table): Add overrides for .bss - .text .data .section pseudo ops. - (mcore_s_section): New function. Dump lits before changing secs. - (mcore_s_text): New function. Dump lits before changing secs. - (mcore_s_data): New function. Dump lits before changing secs. - -1999-04-16 Gavin Romig-Koch - - * config/tc-mips.c (mips_32bitmode): New. - (md_begin): Set mips_32bitmode if needed. - (mips_elf_final_processing): Don't set EF_MIPS_ARCH. - Set EF_MIPS_32BITMODE. - -Fri Apr 16 12:26:39 1999 Bob Manson - - * config/obj-coff.c (c_section_symbol): Fix typo in previous - change. - -1999-04-16 Nick Clifton - - * config/tc-mcore.h (LOCAL_LABELS_FB): Define to 1. - -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" - expressions correctly. - - -1999-04-15 Gavin Romig-Koch - - * config/tc-mips.c (mips_elf_final_processing): Set EF_MIPS_ARCH. - -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 - and fmpynfadd instructions. - -1999-04-11 Richard Henderson - - * as.h (environ): Declare it, if needed. - * as.c (dump_statistics): Don't declare environ. - * configure.in (environ): Detect declaration. - * configure, config.in: Rebuild - - * config/tc-i386.c (i386_immediate): Accept @GOT relocations. - (i386_displacement): Allocate enough space for replacement buffer. - Clean up replacement buffer initialization. - -1999-04-11 Bob Manson : - - * subsegs.c (section_symbol): Don't create a new symbol if one - already exists; instead, use the existing one, but set its segment - and frag data if it hasn't already been defined. - * config/obj-coff.c (c_section_symbol): Likewise. - -Sat Apr 10 20:10:02 1999 Richard Henderson - - * tc-alpha.c (load_expression): Call as_bad instead of abort. - -1999-04-08 Nick Clifton - - * config/tc-mcore.c: New File: Support routines for MCore - assembler. - * config/tc-mcore.h: New File: Definitions for MCore assembler. - * config/obj-coff.c: Add support for mcore-pe target. - - * Makefile.am: Add support for MCore targets. - * Makefile.in: Regenerate. - * configure.in: Add support for MCore targets. - * configure: Regenerate. - - * doc/all.texi: Set MCORE. - * doc/as.texinfo: Document MCore specific command line options. - - * write.h: Prevent multiple inclusion. - -1999-04-06 Ian Lance Taylor - - * asintl.h (LC_MESSAGES): Never define. - * as.c (main): Don't pass LC_MESSAGES to setlocale if the system - does not define it. - * gasp.c (main): Don't pass LC_MESSAGES to setlocale if the system - does not define it. - - * Makefile.am (m68k-parse.c): If configuring in the source - directory, copy m68k-parse.y into the local directory before - running ylwrap, to remove spurious differences when generating - snapshots. - * Makefile.in: Rebuild. - - * config/tc-sparc.h (md_do_align): Just allocate the number of - bytes necessary, rather than always allocating 1024. - -1999-04-04 Ian Lance Taylor - - * listing.c (listing_newline): Add cast to avoid warning. - * read.c (generate_lineno_debug): Add cases to switch. Reindent. - * config/tc-i386.c (i386_scale): Add return value. - (build_displacement_string): Remove unused local temp_disp2. - (i386_intel_memory_operand): Add parentheses to avoid warning. - (i386_intel_operand): Remove unused local end_of_operand_string. - (i386_operand): Remove unused local operand_modifier. - (i386_operand): Add parens to avoid warning. - -1999-04-04 Don Bowman - - * configure.in: Add mips*-*-vxworks* target; have it define - MIPS_STABS_ELF. - * configure, config.in: Rebuild. - -1999-03-31 Nick Clifton - - * configure.in (emulations): Add support for arm-epoc-pe. - * configure: Regenerate. - * config/te-epoc-pe.h: New file. Define macros specific to - arm-epoc-pe target. - * config/tc-arm.h: Select epoc-pe-arm target format if configured - for arm-epoc-pe target. - -Mon Mar 29 10:15:40 CST 1999 Catherine Moore - - * 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 - 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 - instruction is encoded with one bit. - - -1999-03-23 Ian Lance Taylor - - * doc/internals.texi (CPU backend): Mention that - line_separator_chars should not include newline. From thi - . - -1999-03-22 Doug Evans - - * config/tc-fr30.c (md_begin): Update call to fr30_cgen_cpu_open. - * config/tc-m32r.c (md_begin): Update call to m32r_cgen_cpu_open. - -Sun Mar 21 18:08:18 1999 Richard Henderson - - * 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. - - -Thu Mar 18 02:30:07 1999 Jeffrey A Law (law@cygnus.com) - - * tc-hppa.c (pa_ip, case 'd'): Do not allow ",n". - -1999-03-15 Martin Hunt - - * app.c (do_scrub_begin): Change '-' back to a symbol char - so we can use multiple opcodes on a line again. - - * config/tc-d30v.c: By default, warn if a symbol has - the same name as a register. Plus some minor - updates from the branch. - -1999-03-13 Nick Clifton - - * config/tc-d30v.c (md_apply_fix3): Handle BFD_RELOC_8, - BFD_RELOC_16 and BFD_RELOC_64. - -1999-03-12 Andreas Schwab - - * expr.c (expr): Add missing else. - -1999-03-12 Nick Clifton - - * config/tc-arm.c (md_apply_fix3): Improve error message. - -1999-03-11 Doug Evans - - * Makefile.am (CPU_TYPES): Add fr30. - (cgen.o): Add $(CGEN_CPU_PREFIX)-desc.h dependency. - (fr30,m32r dependencies): Update. - * Makefile.in: Rebuild. - - * cgen.c (gas_cgen_record_fixup): Update use of operand->type. - (gas_cgen_record_fixup_exp): Ditto. - (gas_cgen_finish_insn): Call cgen_operand_lookup_by_num. - (gas_cgen_md_apply_fix3): Ditto. Update call to set_vma_operand. - * config/tc-fr30.c (md_begin): Update call to fr30_cgen_cpu_open. - (md_cgen_lookup_reloc): Update use of operand->type. - * config/tc-m32r.c (md_begin): Update call to fr30_cgen_cpu_open. - (md_convert_frag): Call cgen_operand_lookup_by_num. - (md_cgen_lookup_reloc): Update use of operand->type. - (m32r_cgen_record_fixup_exp): Ditto. - -1999-03-09 Jim Blandy - - * config/tc-mips.c (md_show_usage): Fix message. - -1999-03-03 Nick Clifton - - * doc/c-arm.texi (ARM Syntax): Document new command line switches - and LDR reg,= instruction. - - * config/tc-arm.c: Add support for -mcpu=arm810, -mcpu=arm9 and - -mcpu=arm9tdmi. - -Fri Feb 19 09:36:30 1999 Ian Lance Taylor - - * doc/c-arm.texi (ARM-Chars): Fix typo in use of '@'. - -1999-02-17 Nick Clifton - - This patch was created by: Scott Bambrough - - - * app.c: - Special cased '@' character. The '@' character is used as the - ARM assembler comment character, as a special character - and in ELF .symver pseudo-op's, and as a special character in - .type and .section pseudo-ops. - (symver_pseudo): New static variable. - (symver_state): New static variable. - (struct app_save): Add field 'symver_state'. - (app_push): Save global symver_state int struct app_save. - (app_pop): Restore global symver_state from struct app_save. - (do_scrub_chars): Special case handling of '@' character in - .symver pseudo-ops. - - * configure.in: Modified to recognize armv* uname syntax from ARM - Linux kernel. - * configure: Regenerated. - - * config/obj-elf.c (obj_elf_section): Allow '%' as well as '@' as - a prefix to the section's type. - (obj_elf_type): Allow '%' as well as '@' and '#' as prefixes to - the type's typename. - - * config/tc-arm.h: Add support for PIC generation: - (pic_code): New boolean. - (obj_relocate_extern): Define. - (TC_RELOC_RTSYM_LOC_FIXUP): Define - (TC_CONS_FIX_NEW): Define. - (tc_fix_adjustable): Define. - (GLOBAL_OFFSET_TABLE_NAME): Define. - - * config/tc-arm.c: Add support for PIC generation: - (line_seperator_chars): Allow ';' as a seperator for Linux. - (is_immediate_prefix): New macro. - (arm_parse_reloc): New function. - (s_arm_elf_cons): New function. - (do_branch): Special case for BFD_RELOC_ARM_PLT32. - (md_undefined_symbol): Special case handling for the Global Offset - Table's symbol. - (md_apply_fix3): Handle PIC relocs. - (tc_gen_reloc): Handle PIC relocs. - (md_parse_option): Add support for '-k' command line switch to - enable PIC generation. - (cons_fix_new_arm): New function. - (s_arm_elf_cons): New function. - -Tue Feb 16 16:31:53 1999 Ian Lance Taylor - - * configure.in: Add comments for uses of AC_DEFINE. - * acinclude.m4: Likewise. - * acconfig.h: Remove. - * aclocal.m4: Rebuild. - * configure: Rebuild. - * Makefile.in: Rebuild. - * config.in: Rebuild. - -1999-02-15 Jim Lemke - - * config/tc-mips.c (mips_ip: case 'o'): Fix assertion failure for - non-constant offset from a base register. - -1999-02-14 Ken Raeburn - - * config/tc-alpha.c (md_show_usage): Put \ before newline in - strings always. - -Sat Feb 13 14:10:10 1999 Richard Henderson - - * config/tc-alpha.c (cpu_types): Enable EV6 PALcode with -m21264. - (emit_insn): Look for pc-relative and no-overflow specifiers on - internal relocation types. - -1999-02-13 Jim Blandy - - * doc/c-mips.texi (MIPS Opts): Updated list of -mNNNN and - -mcpu=NNNN flags. - - * config/tc-mips.c: Remove all the mips_NNNN variables; just use - mips_cpu instead. - (mips_4650, mips_4010, mips_4100): Variables removed. - (hilo_interlocks, gpr_interlocks, append_insn, macro_build, macro, - macro2, mips16_macro, mips_ip): Test mips_cpu, not the mips_NNNN - variables. - (md_begin): Don't bother initializing the mips_NNNN variables; - mips_cpu is set, and that's good enough now. - (md_parse_option): Have the -mNNNN options set mips_cpu instead of - the mips_NNNN variable. The -no-mNNNN flags are now no-ops. - (show): New function, to handle wrapping in the CPU lists. - (md_show_usage): Update lists of -mcpu and -mNNNN switches. - -Sat Feb 13 00:17:26 1999 Richard Henderson - - * config/tc-i386.c (i386_intel_operand): Ignore `SHORT' rather - than treat as an immediate specifier. - -Thu Feb 11 16:18:31 1999 Richard Henderson - - * config/tc-i386.c: Prototype many functions. - (set_intel_syntax): Accept `prefix'/`noprefix' specifiers. - (i386_immediate): Remove unused second argument. - (i386_intel_operand): Fix i386_is_reg typo. - (i386_operand): Use allow_naked_reg. - (output_invalid): Make operand int for K&R. - -Thu Feb 11 11:21:02 1999 Ian Lance Taylor - - * Makefile.am (EXTRA_as_new_SOURCES): Uncomment--fixed by automake - patch. - * Makefile.in: Rebuild. - -1999-02-09 Doug Evans - - * Makefile.am (DISTCLEANFILES): Change cgen-opc.h to cgen-desc.h. - (cgen.o): Ditto. - (EXTRA_as_new_SOURCES): Comment out. - (.tcdep): -opc.h renamed to -desc.h. - * Makefile.in: Rebuild. - * doc/Makefile.in: Rebuild. - * configure.in: Require autoconf 2.13. Redo using_cgen handling. - Delete call to AM_CYGWIN32. Replace AM_EXEEXT with AC_EXEEXT. - (AC_OUTPUT): -opc.h renamed to -desc.h. - * configure: Rebuild. - * aclocal.m4: Rebuild. - * config.in: Rebuild. - * cgen.c: Include cgen-desc.h, not cgen-opc.h. - (*): CGEN_OPCODE_DESC renamed to CGEN_CPU_DESC. - (gas_cgen_cpu_desc): Renamed from gas_cgen_opcode_desc. - CGEN_INSN_ATTR renamed to CGEN_INSN_ATTR_VALUE. - CGEN_OPERAND_ATTR renamed to CGEN_OPERAND_ATTR_VALUE. - (gas_cgen_record_fixup): Remove unnecessary != 0 test. - (gas_cgen_record_fixup_exp): Ditto. - (gas_cgen_finish_insn): Ditto. Refer to operand table via cpu - descriptor, not global variable. - (gas_cgen_md_apply_fix3): Refer to operand_table via cpu - descriptor, not global variable. Refer to insert_operand handler - via cpu descriptor, not global function. - * cgen.h (*): CGEN_OPCODE_DESC renamed to CGEN_CPU_DESC. - * config/tc-fr30.c: Include opcodes/fr30-desc.h. - (*): gas_cgen_opcode_desc renamed to gas_cgen_cpu_desc. - CGEN_INSN_ATTR renamed to CGEN_INSN_ATTR_VALUE. - Update call to CGEN_OPERAND_TYPE,CGEN_INSN_OPERANDS. - * config/tc-m32r.c: Ditto. - (assemble_two_insns): Update calls to cgen_lookup_get_insn_operands. - (md_assemble): Ditto. - (md_convert_frag): Update call to CGEN_OPERAND_ENTRY. - -1999-02-09 Nick Clifton - - * config/tc-arm.c (md_apply_fix3): Fix handling of label1 - label2 - relocations for ELF targets. - -1999-02-08 Nick Clifton - - * configure.in: Add support for StrongARM target. - * configure: Regenerate. - -1999-02-05 Nick Clifton - - * config/tc-arm.h: Tidy OBJ_ELF and OBJ_COFF definitions. - - * config/tc-arm.c (md_apply_fix3): Fix BFD_RELOC_ARM_PCREL_BRANCH - for COFF ports. - -Wed Feb 3 11:35:47 1999 Richard Henderson - - * config/tc-alpha.c (md_show_usage): Document pca56 and ev6 options. - -Mon Feb 1 20:37:30 1999 Catherine Moore - - * config/tc-i386.h (LONG_DOUBLE_MNEM_SUFFIX): Define. - (INTEL_DWORD_MNEM_SUFFIX): Define. - (BYTE_PTR): Define. - (WORD_PTR): Define. - (DWORD_PTR): Define. - (XWORD_PTR): Define. - (SHORT): Define. - (OFFSET_FLAT): Define. - (FLAT): Define. - (NONE_FOUND): Define. - (No_dSuf): Define. - (No_xSuf): Define. - * config/tc-i386.c (set_intel_syntax): New routine. - (intel_syntax): Declare. - (allow_naked_reg): Declare. - (md_pseudo_table): Support .intel_syntax and .att_syntax. - (intel_float_operand): New routine. - (md_assemble): Handle INTEL_DWORD_MNEM_SUFFIX. - Handle brackets as well as parens. Call i386_intel_operand for - intel syntax. Reverse operands if appropriate. Handle new - suffixes. Handle movzx and movsx. - (i386_is_reg): New routine. - (i386_immediate): New routine. - (i386_scale): New routine. - (i386_displacement): New routine. - (i386_operand_modifier): New routine. - (build_displacement_string): New routine. - (i386_parse_seg): New routine. - (i386_intel_memory_operand): New routine. - (i386_intel_operand): New routine. - (i386_operand): Call i386_displacement, i386_immediate, - i386_scale, etc. instead of handling inline. - (parse_register): Handle registers without prefix. - -Mon Feb 1 12:24:58 1999 Catherine Moore - - * configure: Regenerate. - * configure.in (arm-*-oabi): New. - (thumb-*-oabi): New. - * config/tc-arm.c (target_oabi): Declare. - (md_apply_fix3): Support REL relocs. - (md_parse_option): Handle -oabi. - (elf32_arm_target_format): New routine. - (md_longopts): Add OPTION_OABI. - * config/tc-arm.h: Redefine TARGET_FORMAT. - - -1999-01-28 Nick Clifton - - * write.c (write_relocs): Handle out of range error. - - * config/tc-fr30.c (fr30_fix_adjustable): New function. - (fr30_force_relocation): Default to 0. - - * config/tc-fr30.h (obj_fix_adjustable): Define. - (TC_FORCE_RELOCATION): Define. - - * cgen.c (gas_cgen_md_apply_fix3): Do not apply fixes to VTABLE - relocs. - -1999-01-16 Nick Clifton - - * config/tc-d30v.c (write_2_short): Do not generate a sequential - merge of two instructions if the left instruciton kills the right. - -1999-01-11 Doug Evans - - * Makefile.in: Regenerate. - * configure.in: Redo test for using cgen. - * configure: Regenerate. - -1999-01-09 Nick Clifton - - * config/obj-coff.h (obj_adjust_symtab): Prevent accidental - redefinition of this macro. - -Tue Jan 5 21:58:03 1999 Doug Evans - - * config/tc-mips.c (mips_frob_file): Disable "Unmatched %hi reloc" - warning. - -1998-12-29 Gavin Romig-Koch - - * config/tc-mips.c (append_insn): For mips16, insert a nop between - a read of HI or LO and an immediatly following branch. - -1998-12-29 Gavin Romig-Koch - - * config/tc-mips.c (md_begin): Another correction to the setting of - mips_eabi64. - -1998-12-23 Gavin Romig-Koch - - * config/tc-mips.c (md_begin): Correct type-o in setting of mips_eabi64. - -1998-12-21 Nick Clifton - - * config/tc-m32r.c (md_assemble): Emit a NOP after a relaxable 16 - bit insn when optimizing, so that parallelised instructions will - start on a 32 bit boundary. - -1998-12-19 Gavin Romig-Koch - - * config/tc-mips.c (mips_eabi64): New. - (md_begin): Set mips_eabi64. - (mips_elf_final_processing): Use it. - -1998-12-18 Gavin Romig-Koch - - * config/tc-mips.c (mips_elf_final_processing): - Correct setting of ABI in e_flags. - -Wed Dec 16 16:17:22 1998 Dave Brolley - - * config/tc-fr30.c (md_assemble): Warn about invalid instructions in delay slots. - -1998-12-16 Gavin Romig-Koch - - * config/tc-mips.c (md_begin,md_parse_option): Handle vr4111. - -1998-12-15 Doug Evans - - * cgen.c (gas_cgen_md_apply_fix3): Mark as an error, rather than a - warning, values that don't fit in the field. - -1998-12-15 Gavin Romig-Koch - - * config/tc-mips.c (mips_abi_string): New. - (md_parse_option,md_longopts): Add mabi. - (mips_elf_final_processing): Set e_flags based on mabi flag. - -1998-12-15 Gavin Romig-Koch - - * config/tc-mips.c (md_parse_option): Handle vr4111. - -98-12-11 Ken Raeburn - - * config/tc-h8300.c (build_bytes): Change message given if the - instruction requires H8/300H mode and we're not in Hmode, to - suggest that it may be the operand modes that are the problem, not - necessarily the opcode. - -1998-12-10 Nick Clifton - - * config/tc-fr30.c: Add line separator character. - -Tue Dec 8 19:51:50 1998 Mark Klein - - * configure.in (hppa-*-mpeix*): New target. - * config/obj-som.h (obj_som_compiler): Declare. - * config/obj-som.c (compiler_seen): New static variable. - (obj_som_compiler): New function. - * config/tc-hppa.c: Update tc_data uses for change to bfd/som.h. - (md_pseudo_table): Add "compiler" if OBJ_SOM. - (pa_type_args): Set hppa_priv_level. - (pa_compiler): New static function if OBJ_SOM. - * configure: Rebuild. - -Tue Dec 8 15:00:50 1998 Ian Lance Taylor - - * read.c (output_leb128): Don't mark as inline. - -1998-12-08 Andrew MacLeod - - * config/tc-ppc.c (ppc_vbyte): Prototype and new function for - AIX .vbyte unaligned data support. - (md_pseudo_table): Add 'vbyte' to list of valid pseudos. - (ppc_elf_validate_fix): Add eh_frame to list of ELF relocatable - sections. - -1998-12-07 Nick Clifton - - * config/tc-d30v.c (md_assemble, do_assemble): Improve erroneous - input handling. - -Mon Dec 7 09:48:34 1998 Catherine Moore - - * config/tc-arm.c (elf32_arm_force_relocation): Check for - BFD_RELOC_ARM_PCREL_BRANCH. - -Sun Dec 6 12:46:36 1998 Ian Lance Taylor - - * configure.in: Define TARGET_BYTES_{BIG,LITTLE}_ENDIAN after - checking the target type. - (mips-dec-bsd*): Set endian to little. - * configure: Rebuild. - - COFF weak symbol support, based on patches from Mark Elbrecht - : - * config/obj-coff.h (S_IS_WEAK): Define if not BFD_ASSEMBLER. - * config/obj-coff.c (obj_coff_weak): New static function. - (obj_coff_endef) [both versions]: Handle weak symbols. - (coff_frob_symbol): Likewise. - (yank_symbols): Likewise. - (obj_pseudo_table): Add "weak". - - * configure.in (m68k-*-gnu*): New target. From Aymeric Vincent - . - * aclocal.m4: Rebuild with current tools. - * configure: Rebuild. - - * config/tc-alpha.c (emit_ldgp): Give an error message rather than - an assertion failure for a case we can't handle when OBJ_ECOFF. - - * expr.c (operator): And with 0xff to avoid problems with signed - char. - -1998-12-03 Nick Clifton - - * config/tc-fr30.c (md_cgen_lookup_reloc): Generate - BFD_RELOC_FR30_48 instead of BFD_RELOC_FR30_32. - -1998-12-02 Nick Clifton - - * config/tc-fr30.c (md_cgen_lookup_reloc): Enable relocs for - LDI:20 insn. - -Thu Nov 26 11:23:48 1998 Dave Brolley - - * config/tc-fr30.c (md_pcrel_from_section): Restore previous calculation - of pcrel point. - -Tue Nov 24 17:21:52 1998 Nick Clifton - - * config/tc-fr30.c (md_pcrel_from_section): Fix calculation of - pcrel point. - -Tue Nov 24 14:54:38 1998 Nick Clifton - - * config/tc-d10v.c (md_assemble): Make static 'etype' have file - scope. - (d10v_cleanup): Only generate previous insn if a multiline insn is - not pending. - -Fri Nov 20 11:41:13 1998 Nick Clifton - - * config/tc-fr30.c (md_cgen_lookup_reloc): Add support for - FR30_OPERAND_I32. - -Thu Nov 19 15:01:29 1998 Nick Clifton - - * config/tc-arm.c (md_parse_option): Add support for -marm7xxx and - -marm6xxx command line switches. - -1998-11-18 Doug Evans - - * Makefile.am (DEP): Use $(srcdir)/../mkdep. - (itbl-ops.o): Delete duplicate dependencies. - Rebuild dependencies. - Add fr30 dependencies. - * Makefile.in: Rebuild. - -Tue Nov 17 13:42:42 1998 Nick Clifton - - * config/tc-fr30.c (md_cgen_lookup_reloc): Updated to match latest - opcode list. - * listing.c: Ignore line terminator characters found inside - strings. - -Thu Nov 12 19:21:24 1998 Dave Brolley - - * po/gas.pot: Regenerated. - -Thu Nov 12 10:54:16 1998 Nick Clifton - - * config/tc-fr30.c (fr30_is_colon_insn): New name for - fr30_is_label_start(). Also checks for delay slot insns. - - * config/tc-fr30.c (fr30_is_label_start): New function: Handle - FR30 instructions which contain a colon in the mnemonic. - - * config/tc-fr30.h (TC_START_LABEL): Define this macro. - -Wed Nov 11 09:58:21 1998 Nick Clifton - - * config/tc-fr30.c: Removed currently superflous code. - -Tue Nov 10 13:13:05 1998 Nick Clifton - - * config/tc-fr30.h: New file. - * config/tc-fr30.c: Tweaking so that it will compile. - -Tue Nov 10 14:41:33 1998 Catherine Moore - - * config/tc-d10v.h (obj_fix_adjustable): Define. - (TC_FORCE_RELOCATION): Define. - (d10v_force_relocation): Declare. - * config/tc-d10v.c (tc_gen_reloc): Handle Vtable relocs. - (md_apply_fix3): Handle Vtable relocs. - (d10v_fix_adjustable): New. - (d10v_force_relocation): New. - -Mon Nov 9 14:25:06 1998 Nick Clifton - - * config/tc-d30v.c: Change default behaviour to ignore potential - conflicts between register name and symbol names. - -Wed Nov 4 18:42:00 1998 Dave Brolley - - * configure.in: Add fr30-*-*. - * config/tc-fr30.c: New file. - * Makefile.in: Regenerated. - * config.in: Regenerated. - * configure: Regenerated. - * doc/Makefile.in: Regenerated. - * po/gas.pot: Regenerated. - -Mon Nov 2 20:54:16 1998 Doug Evans - - * config/tc-m32r.c (assemble_two_insns): Ensure both insns - are 16 bit insns. - -Mon Nov 2 20:10:18 1998 Martin von Loewis - - * app.c (do_scrub_begin): Set characters above 127 to be symbol - characters. - (do_scrub_chars): Add some casts to unsigned char to avoid - unwanted sign extension. - * read.c (lex_type): Set characters about 127 to be symbol - characters. - * config/tc-i386.c (md_begin): Set identifier_chars and - operand_chars for values above 127. - -Mon Nov 2 15:05:33 1998 Geoffrey Noer - - * configure.in: detect cygwin* instead of cygwin32* - * configure: regenerate - -Tue Oct 27 13:18:40 1998 Nick Clifton - - * listing.c: Add support for producing a listing from piped - input. - -Tue Oct 27 08:56:44 1998 Gavin Romig-Koch - - * config/tc-mips.c (hilo_interlocks): Remove mips_3900. - (append_insn): Account for the tx39's multiply behavior. - -1998-10-26 Michael Meissner - - * config/tc-m32r.c (assemble_two_insns): Rename assemble_two_insns - from assemble_parallel_insns. Add support for '->' to indicate - explicitly serializing the instructions. - (md_assemble): Ditto. - -Sat Oct 24 15:12:19 1998 Catherine Moore - - * config/tc-sh.c (sh_fix_adjustable): Adjust EXTERN and - WEAK handling. - -Thu Oct 22 12:41:33 1998 Catherine Moore - - * cgen.c (gas_cgen_md_apply_fix3): Revert last change. - -Thu Oct 22 10:03:15 1998 Ron Unrau - - * config/tc-mips.c : support frame and regmask/fregmask when - MIPS_STABS_ELF is specified. - -Wed Oct 21 11;34:51 1998 Catherine Moore - - * config/tc-sh.c (sh_fix_adjustable): Only include if OBJ_ELF. - (md_apply_fix): Don't return 1 for VTABLE relocs. - * config/tc-sh.h (obj_fix_adjustable): Define only if OBJ_ELF. - -Tue Oct 20 11:18:28 1998 Alan Modra - - * doc/c-i386.texi: Replace occurences of "opcode" with - "instruction mnemonic", "instruction", or "mnemonic" when - referring to the name of an instruction. Use "opcode" when - referring to the sequence of machine bytes. - - * config/tc-i386.c (opcode_chars): Rename to mnemonic_chars. - (is_opcode_char): Rename to is_mnemonic_char. - (md_assemble and i386_operand): Correct error messages from - "opcode" to "instruction mnemonic" - Rename throughout opcode[] -> mnemonic[], opp -> mnem_p, - MAX_OPCODE_SIZE -> MAX_MNEM_SIZE, - DWORD_OPCODE_SUFFIX -> DWORD_MNEM_SUFFIX, - WORD_OPCODE_SUFFIX -> WORD_MNEM_SUFFIX, - BYTE_OPCODE_SUFFIX -> BYTE_MNEM_SUFFIX, - SHORT_OPCODE_SUFFIX -> SHORT_MNEM_SUFFIX - LONG_OPCODE_SUFFIX -> LONG_MNEM_SUFFIX - - * config/tc-i386.h (*_MNEM_SUFFIX): Rename from *_OPCODE_SUFFIX. - - * config/tc-i386.c (i386_operand): Check for garbage after - register name. - -Tue Oct 20 10:49:42 1998 Ian Lance Taylor - - * config/tc-i386.c (md_apply_fix3): Change handling of PCREL reloc - for BFD_ASSEMBLER to only change value when COFF if TE_PE. - -Mon Oct 19 20:20:42 1998 Catherine Moore - - * config/tc-sh.h (obj_fix_adjustable): Define. - * config/tc-sh.c (sh_force_relocation): Handle VT relocs. - (md_apply_fix): Likewise. - (tc_gen_reloc): Likewise. - (sh_fix_adjustable): New. - -Mon Oct 19 12:35:43 1998 Doug Evans - - * cgen.c (gas_cgen_finish_insn): Update handling of CGEN_INT_INSN_P. - * cgen.h (gas_cgen_finish_insn): Update prototype. - * config/tc-m32r.c (m32r_insn): CGEN_INT_INSN -> CGEN_INT_INSN_P. - cgen_insn_t -> CGEN_INSN_INT. - (make_parallel): Update handling of CGEN_INT_INSN_P. - (assemble_parallel_insn): Ditto. - (target_make_parallel): New function. - (md_assemble): Use it. - -Mon Oct 19 13:16:12 1998 Catherine Moore - - * config/tc-m32r.c (m32r_force_relocation): Fix typo. - -Sun Oct 18 18:48:57 1998 Jeffrey A Law (law@cygnus.com) - - * config/tc-sh.c (md_assemble): Make sure the entire opcode is - converted into lower case. - -Fri Oct 16 13:36:34 CDT Catherine Moore - - * cgen.c (gas_cgen_md_apply_fix3): Handle VTABLE relocs. - (gas_cgen_tc_gen_reloc): Likewise. - * config/tc-m32r.h (obj_fix_adjustable): Define. - * config/tc-m32r.c (m32r_fix_adjustable): New. - (m32r_force_relocation): Handle VTABLE relocs. - -Wed Oct 14 11:33:38 1998 Nick Clifton - - * doc/c-arm.texi (ARM Directives): Document .ltorn directive. - -Mon Oct 12 11:07:21 1998 Nick Clifton - - * config/tc-m32r.c (assemble_parallel_insn): Convert second opcode - to lower case before parsing. - - * config/tc-d30v.c (parallel_ok): Ignore conflicts when explicitly - parallel insns modift buts in the PSW as a side effect. - -Thu Oct 8 10:18:33 1998 Nick Clifton - - * config/tc-d30v.c (find_format): Test for missing flag and - control registers. - - (md_apply_fix3): Fix error messages to avoid - assumption about presence of a symbol. - - (parallel_ok): Disallow parallel instructions that both modify the - same flag register. - - (find_format): Generate a warning if an odd numbered register is - used as the first register in a mutli-register instruction. - -Wed Oct 7 14:09:14 1998 Nick Clifton - - * config/tc-d30v.c (md_apply_fix3): Do not assume that bad - relocations are always associated with a symbol. - -Tue Oct 6 09:31:15 1998 Catherine Moore - - * tc-sparc.h (TC_FORCE_RELOCATION): Define. - (elf32_sparc_force_relocation): Declare. - * tc-sparc.c (md_apply_fix3): Handle vtable relocs. - (tc_gen_reloc): Handle vtable relocs. - (elf32_sparc_force_relocation): New. - -Mon Oct 5 09:25:32 1998 Catherine Moore - - * symbols.c (S_IS_FUNCTION): New. - * config/tc-v850.h (obj_fix_adjustable): Define. - (TC_FORCE_RELOCATION): Define. - (v850_force_relocation): Declare. - * config/tc-v850.c (tc_gen_reloc): Use offset instead - of fx_addnumber for VTABLE reloc addends. - (md_apply_fix3): Handle VTABLE relocs. - (v850_fix_adjustable): New. - (v850_force_relocation): New. - -Mon Oct 5 00:48:52 1998 Jeffrey A Law (law@cygnus.com) - - * 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". - -Sun Oct 4 20:57:43 1998 Alan Modra - - * config/tc-i386.c (md_assemble): Handle AMD_3DNOW_OPCODE. - * config/tc-i386.h (template.extension_opcode): Change to - unsigned int to allow full range of 8-bit opcode suffixes. - (None): Redefine as 0xffff. - - From Jeff B Epler - * doc/c-i386.texi (i386-SIMD): New section. - -Thu Oct 1 15:37:54 1998 Richard Henderson - - * read.c (discard_rest_of_line): New function. - * read.h: Declare it. - * config/tc-alpha.c (s_alpha_mask, s_alpha_frame): Use it. - -Thu Oct 1 10:33:53 1998 Nick Clifton - - * config/tc-d10v.c (find_symbol_matching_register): New function. - (find_opcode): Cope with the case where a register name matches - a symbol name. - -Wed Sep 30 10:52:32 1998 Nick Clifton - - * config/tc-v850.c (md_pcrel_from): Rename to - v850_pcrel_from_section. - (v850_pcrel_from_section): Do not resolves symbols in other - sections. - - * config/tc-v850.h (MD_PCREL_FROM_SECTION): Define. - -Mon Sep 28 11:01:20 1998 Nick Clifton - - * config/tc-d10v.c (find_opcode): Generate an error if a register - is supplied for an operand that should not be a register. - -Fri Sep 25 10:04:21 1998 Nick Clifton - - * config/tc-d30v.c (write_2_short): But do allow delayed branch - instructions to have another instruction in the right bin. - -Thu Sep 24 09:28:34 1998 Nick Clifton - - * config/tc-d30v.c (write_2_short): Do not allow instructions in - the right container if the left container holds a branch - instruction. - -Wed Sep 23 10:54:29 1998 Nick Clifton - - * config/tc-d30v.c (reg_name_search): Only warn if a name matches - both a register name and symbol name. - (find_format): Allow correct parsing of MVTSYS and MVFSYS insns. - -Tue Sep 22 17:49:16 1998 Nick Clifton - - * config/tc-d30v.c (write_2_short): Implement EITHER_BUT_PREFER_MU - execution unit class. - - (reg_name_search): If a name matches a register and a symbol, - prefer the register. - (find_format): Disallow flag registers when a general purpose - register is required. - If a number is required, but a register has been given, check to - see if a symbol with the same name as the register exists, and if - so, use that symbol. - -Tue Sep 22 16:40:52 1998 Jim Wilson - - * config/obj-elf.h (ECOFF_DEBUGGING): Add missing parens. - -Tue Sep 22 15:44:21 1998 Nick Clifton - - * config/tc-d30v.c (find_format): Do not accept flag registers as - general purpose registers. - (find_format): If an immediate value is expected at a given place - in a format, but a register name has been provided instead, check - to see if that register name matches the name of a predefined - symbol and if it does, then use the symbol instead. - (reg_name_search): If a register name matches a symbol name, - prefer the register name to the symbol name. - -Mon Sep 21 10:42:57 1998 Nick Clifton - - * config/tc-m32r.c (m32r_do_align): After inserting NOPs, reset - the previous insn to empty. - -1998-09-20 Michael Meissner - - * config/tc-ppc.c (md_apply_fix3): Do not break string into two - pieces, forcing the use of an ANSI compiler. - -Sun Sep 20 00:58:12 1998 Andreas Schwab - - * config/tc-m68k.h (TC_FORCE_RELOCATION): New macro. Force vtable - relocs. - * config/tc-m68k.c (md_apply_fix_2): Do nothing for vtable relocs. - -Tue Sep 15 08:51:07 1998 Catherine Moore - - * config/obj-elf.c (obj_elf_vtable_inherit): Handle arm - assembler syntax. - (obj_elf_vtable_entry): Likewise. - * config/tc-arm.h: Define TC_FORCE_RELOCATION for OBJ_ELF. - * config/tc-arm.c (md_apply_fix3): Handle VTABLE relocations. - (tc_gen_reloc): Likewise. - (arm_fix_adjustable): Likewise. - (elf32_arm_force_relocation): New. - (armelf_frob_symbol): Remove coff-style symbol support. - -Wed Sep 9 11:27:16 1998 Richard Henderson - - * config/tc-i386.c (i386_operand): Fix typo in last patch. - -Tue Sep 8 18:10:01 1998 Catherine Moore - - * config/tc-arm.c (arm_adjust_symtab): Move #ifdef - OBJ_COFF so that routine is defined for a.out format. - -Tue Sep 8 15:56:19 1998 Richard Henderson - - * config/tc-i386.c (i386_operand): Detect non-segment registers - used as segment prefixes. - -Sat Sep 5 19:00:38 1998 Ian Lance Taylor - - * ehopt.c (check_eh_frame): Check the size of the FDE, and don't - optimize across FDE boundaries. - - * config/obj-coff.c (obj_coff_section): Preserve any link once - flags when setting the section flags. - -Fri Sep 4 17:07:14 1998 Nick Clifton - - * config/tc-arm.h (obj_adjust_symtab): Fixed typo. - * config/tc-arm.c (armelf_adjust_symtab): Reformatted. - -Fri Sep 4 13:57:43 1998 Jakub Jelinek - - * config/tc-sparc.c (in_signed_range): Sign extend 32-bit words - to the host width. - -Wed Sep 2 11:31:14 1998 Richard Henderson - - * frags.c (frag_grow): Include the size of the frag struct in the - obstack chunk size. - - * subsegs.c (subseg_set_rest): Adjust the seginfo frchain start - if the new subseg comes before the old. - -Tue Sep 1 15:01:33 1998 Jakub Jelinek - - * config/tc-sparc.c (sparc_ip): Allow all digits in an instruction - to handle edge8 and edge16. - -Mon Aug 31 09:51:14 1998 Richard Henderson - - * config/obj-elf.c (obj_elf_vtable_inherit): Print error message - before we clobber the symbol involved. - -Mon Aug 31 10:58:06 1998 Catherine Moore - - * config/tc-arm.c: Remove OBJ_ELF definitions for - S_GET_STORAGE_CLASS and S_SET_STORAGE_CLASS. Only - use arm_adjust_symtab for OBJ_COFF. - (armelf_adjust_symtab): New Routine. - * config/tc-arm.h: Define obj_adjust_symtab to - armelf_adjust_symtab for OBJ_ELF. - -Sat Aug 29 22:18:51 1998 Richard Henderson - - * configure.in: Make all i386-elf targets use bfd_gas. - * config/tc-i386.c (tc_i386_force_relocation): New. - (tc_i386_fix_adjustable): Don't fix vtable relocs. - (md_apply_fix3): Likewise. - (tc_gen_reloc): Handle them. - * config/tc-i386.h (TC_FORCE_RELOCATION): Always define, calling - tc_i386_force_relocation. - -Mon Aug 24 13:40:21 1998 Nick Clifton - - * config/tc-arm.c (md_show_usage): Improve formatting of --help output. - -Fri Aug 21 18:43:48 1998 Nick Clifton - - * config/tc-d30v.c (md_assemble): Copy previous opcode over - current opcode after writing the first insturction of a reverse - sequential pair. - -Fri Aug 21 07:30:35 1998 Doug Evans - - * read.h (generate_lineno_debug): Add prototype. - * read.c (generate_lineno_debug): Make non-static. - -Thu Aug 20 23:17:04 1998 Alan Modra - - * config/tc-i386.c (md_assemble): Only warn for address/data size - prefixes. - -Thu Aug 20 14:45:08 1998 Nick Clifton - - * config/tc-arm.c (arm_fix_adjustable): Do not adjust relocations - against Thumb function names, as the linker needs this information. - -1998-08-20 Vladimir N. Makarov - - * expr.c (operand): Check also that there is no advance in operand - after atof_generic in order to decide "is it label 0f or floating - point number?". - -Wed Aug 19 09:30:16 1998 Nick Clifton - - * config/tc-m32r.c: Replace double dash prefix to M32R specific - command line options with a single dash. - * doc/c-m32r.texi: Replace double dash prefix with a single dash. - -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. - -1998-08-13 Vladimir N. Makarov - - * read.c (s_align, s_comm, s_mri_common, s_fail, s_globl, s_space, - s_float_space, s_struct, cons_worker): Move ignore_rest_of_line or - demand_empty_rest_of_line before mri_comment_end. - (equals): Check garbage after expression before - mri_comment_end in MRI mode. - -Thu Aug 13 15:08:42 1998 Ian Lance Taylor - - * config/tc-mips.c (macro): Correct M_SGE_I/M_SGEUI_I case for a - small immediate constant to use the constant itself rather than - always using 1. - -Wed Aug 12 18:47:38 1998 Ian Lance Taylor - - * config/tc-hppa.c (pa_enter): Call as_bad rather than abort. - (pa_leave): Likewise. - -Wed Aug 12 13:25:03 1998 Alan Modra - - * config/tc-i386.c (md_assemble): Emit a warning for stand-alone - prefixes. - (i386_operand): Fix an error message. - -Tue Aug 11 14:44:32 1998 Nick Clifton - - * doc/c-arm.texi (ARM Directives): Document .req directive. - - * config/tc-arm.c (reg_required_here): Display erroneous string if - the register name could not be decoded. - Do not set inst.instruction if the sift is -1. - -Mon Aug 10 15:39:56 1998 Richard Henderson - - * config/tc-alpha.c (tc_gen_reloc): Bias WEAK symbols just as - we do for EXTERN. - -Mon Aug 10 15:06:18 1998 Nick Clifton - - * config/tc-d30v.c (d30v_align): Always perform alignment request, - even if it is belived to be unnecessary. - -Mon Aug 10 17:48:09 1998 Alan Modra - - config/tc-i386.c (i386_operand): Size immediate constants by - suffix (erroneously removed as part of July 7 change). - -Sun Aug 9 20:45:32 1998 Catherine Moore - - * config/obj-elf.h: Check for redefinition of obj_frob_symbol. - * config/tc-arm.c: Define S_GET_STORAGE_CLASS and S_SET_STORAGE_CLASS. - (armelf_frob_symbol): New Routine. - * config/tc-arm.h: Define obj_frob_symbol if OBJ_ELF. - -Sat Aug 8 15:21:28 1998 Richard Henderson - - * config/tc-alpha.c (alpha_fix_adjustable): Don't adjust weak syms. - -Wed Aug 5 15:54:14 1998 Nick Clifton - - * config/tc-arm.c (md_begin): Set BFD private flags depending upon - command line switches passed to assembler. - -Mon Aug 3 14:02:52 1998 Doug Evans - - * cgen.h (GAS_CGEN_MAX_FIXUPS): GAS_ prepended, all uses updated. - (gas_cgen_opcode_desc): Declare. - (gas_cgen_parse_operand): Declare. - (*): Prepend gas_ to gas specific fns to denote them as such. - All uses updated. - * cgen.c (gas_cgen_opcode_desc): New global - (gas_cgen_init_parse): Renamed from cgen_asm_init_parse. - (queue_fixup): Renamed from cgen_queue_fixup. - (*): Prepend gas_ to gas specific fns to denote them as such. - All uses updated. - (gas_cgen_md_apply_fix3): Update call to insert_operand. - (gas_cgen_finish_insn): Renamed from cgen_asm_finish_insn. - * config/tc-m32r.c (md_begin): Remove use of CGEN_SYM. - Open opcode table and initialize it. - (make_parallel): Use gas_cgen_opcode_desc. - (assemble_parallel_insn): Ditto. Remove use of CGEN_SYM. - (md_assemble): Ditto. - -Sat Aug 1 19:27:30 1998 Richard Henderson - - * as.h (debug_info_type): Add entries for unspecified and dwarf*. - * ecoff.c (ecoff_generate_asm_lineno): Take no arguments; call - as_where ourselves. Provide a stub for !ECOFF_DEBUGGING. - * ecoff.h: Move ECOFF_DEBUGGING protection inside GAS_ECOFF_H. - Move ecoff_generate_asm_lineno outside ECOFF_DEBUGGING protection. - * read.c (generate_lineno_debug): Tidy ECOFF bits. Use - DEBUG_UNSPECIFIED rather than DEBUG_NONE for initial test. - * config/obj-elf.h (ECOFF_DEBUGGING) [TC_ALPHA]: Define to a variable. - (SEPARATE_STAB_SECTIONS): Conditionalize on value of ECOFF_DEBUGGING. - (INIT_STAB_SECTION): Likewise. - (OBJ_PROCESS_STAB): Likewise. - - * config/tc-alpha.c (md_longopts): New options -mdebug/-no-mdebug. - (md_parse_option): Watch for them. - (alpha_cur_ent_sym, alpha_flag_mdebug): New variables. - (md_begin): Kill neverdef code. - (s_alpha_ent, s_alpha_end, s_alpha_mask, s_alpha_frame): New. - (s_alpha_prologue): Watch alpha_cur_ent_sym. - (s_alpha_coff_wrapper): New. - (md_pseudo_table): Trap all ECOFF pseudos. - -Fri Jul 31 16:45:54 1998 Ron Unrau - - Start of changes to remove mdebug section from mips*-elf - Based on MIPS_STAB_ELF definition - * acconfig.h: undef if not configured - * config.in: undef if not configured - * config/mips-elf.h: only set ECOFF debugging if not stabs-in-elf - * config/tc-mips.c (s_ent): set BSF_FUNCTION - * stabs.c (s_stab_generic): flush frag - -Fri Jul 31 16:14:45 1998 Catherine Moore - - * configure.in: (arm-*-elf): Handle. - (thumb-*-elf): Handle. - * configure: Regenerate. - * read.c (stringer): Fix typo in comment. - * write.c (fixup_segment): Don't add symbol value to addend if - TC_ARM and OBJ_ELF. - * config/tc-arm.c (md_section_align): Don't align dwarf debug - sections. - (tc_gen_reloc): Always set the reloc addend to fixp->fx_offset - for OBJ_ELF. - -Thu Jul 30 21:38:43 1998 Frank Ch. Eigler - - * config/tc-d30v.c ({cur,prev}_left_kills_right_p): New variables. - (write_2_short): Emit warning if new flag is set. - (do_assemble): Set flags if left instruction is one of special - "right-instruction-killer" type. - -Tue Jun 28 18:12:28 1998 Stan Cox - - * config/tc-sparc.c (md_number_to_chars, cons_fix_new_sparc): - Always output words in debug_info section as big endian. - (sparc_target_format): Choose correct bfd target. - (md_apply_fix3): Rename BFD_RELOC_SPARC_32LE to BFD_RELOC_SPARC_REV32. - -Tue Jul 28 11:01:21 1998 Jeffrey A Law (law@cygnus.com) - - * config/tc-mn10300.c (md_assemble): Fix "errmsg" initialization - to work with internationalization code. Issue an error when two - operands match that are not allowed to match. - -Mon Jul 27 16:25:58 1998 Doug Evans - - * configure.in (install_tooldir): Allow target to specify whether - it wants to be installed in $(tooldir)/bin. - * configure: Regenerate. - * Makefile.am (install-exec-local): Set install-exec-tooldir - dependency via configure. - * Makefile.in: Regenerate. - -Fri Jul 24 19:58:59 1998 Doug Evans - - * Makefile.am (install-exec-local): Split into two ... - (install-exec-bindir,install-exec-tooldir): New rules. - * Makefile.in: Regenerate. - -Fri Jul 24 16:31:49 1998 Ian Lance Taylor - - * Makefile.am (install-exec-local): Don't remove the file before - checking whether $(bindir) == $(tooldir)/bin. From Maciej - W. Rozycki . - * Makefile.in: Rebuild. - -Fri Jul 24 09:13:46 1998 Doug Evans - - * cgen.c: Include libiberty.h. - (cgen_md_apply_fix3): Update call to md_cgen_lookup_reloc. - (cgen_tc_gen_reloc): Use xmalloc, not bfd_alloc. - * cgen.h (cgen_md_apply_fix3,cgen_tc_gen_reloc): Declare. - (md_cgen_lookup_reloc)): Declare. - (md_cgen_record_fixup_exp): Declare. - * config/tc-m32r.h (md_pcrel_from_section): Declare. - (m32r_relax_frag): Declare. - (cgen_md_apply_fix3): Decls moved to cgen.h. - (cgen_record_fixup_exp,cgen_tc_gen_reloc): Ditto. - (m32r_cgen_record_fixup_exp): Delete decl. - * config/tc-m32r.c (m32r_cpu_desc): #if 0 out. - (assemble_nop): Delete. - (expand_debug_syms): Delete unused `exp'. - (md_cgen_lookup_reloc): Renamed from CGEN_SYM (lookup_reloc). - Add default case for -Wall. - (m32r_cgen_record_fixup_exp): Add default case for -Wall. - (md_atof): Delete unused wordP. - -Thu Jul 23 13:19:50 1998 Jeffrey A Law (law@cygnus.com) - - * config/tc-mn10300.c (md_assemble): Make sure "errmsg" has a non-NULL - value. - -Wed Jul 22 14:36:56 1998 Ian Lance Taylor - - * doc/as.texinfo: Add documentation for .end, .exitm, .fail, - .ifc, .ifeqs, .ifge, .ifgt, .ifle, .iflt, .ifnc, .ifne, .ifnes, - .print, .purgem, and .struct. Remove documentation for - .app-file. - -Tue Jul 21 16:50:52 1998 Doug Evans - - * cgen.c (cgen_md_apply_fix3): set_operand renamed to set_vma_operand. - Update call to insert_operand. - -Fri Jul 17 11:42:20 1998 Nick Clifton - - * config/tc-m32r.c (ms_show_usage): Formatting changes. - -Wed Jul 15 15:38:28 1998 Ian Lance Taylor - - * config/tc-i386.c (md_assemble): Don't get confused by trailing - whitespace after a prefix operator. - -Tue Jul 14 15:32:56 1998 Richard Henderson - - * configure.in (i386-*-beos{pe,elf,}*): Recognize. - -Tue Jul 14 12:33:44 1998 Chris Torek - - * config/tc-sparc.c (log2): New static function. - (s_reserve): Use log2 to convert alignment before calling - record_alignment. - (s_common): Use log2 to convert alignment before calling - record_alignment and frag_align. - (sparc_cons_align): Use log2. - -Tue Jul 14 11:58:40 1998 Ian Lance Taylor - - * config/tc-sparc.c (s_reserve): Set symbol size if OBJ_ELF. - (s_common): Likewise. - - * config/tc-sparc.c (sparc_handle_align): Reindent a bit. Correct - initialization of waddr. - (sparc_elf_final_processing): Add default case to switch. - -Tue Jul 14 11:00:16 1998 Alan Modra - - * doc/c-i386.texi: Fix a typo. Use the term 80-bit real rather - than temporary real. - -Mon Jul 13 13:55:42 1998 Ian Lance Taylor - - * write.c (subsegs_finish): Don't align the segments if there were - any errors. - - * config/obj-coff.c (c_symbol_merge): Correct number of bytes when - copying aux information. - - * expr.c (make_expr_symbol): Catch attempts to turn an O_big - expression into a symbol. - -Mon Jul 13 13:29:04 1998 Alan Modra - - * config/tc-i386.c (mode_from_disp_size): Change arg and return - type to unsigned int. - (md_assemble): Change type used to store offsets from unsigned - long to long. - (i386_operand): Switch error check to only call RESTORE_END_STRING - once after parse_register. - -Fri Jul 10 16:00:04 1998 Nick Clifton - - * config/tc-v850.c (md_show_usage): Changed format to match that - of gcc, ld, etc. - - * as.c (show_usage): Changed format to match that of gcc, ld, etc. - -Thu Jul 9 12:09:57 1998 Andreas Schwab - - * config/tc-m68k.c (tc_m68k_fix_adjustable): Don't adjust vtable - relocs. - (md_apply_fix_2): Force the symbol of the vtable reloc to be - weak. - -Thu Jul 9 11:31:54 1998 Ian Lance Taylor - - * doc/Makefile.am (MAINTAINERCLEANFILES): Define. - * doc/Makefile.in: Rebuild. - -Wed Jul 8 12:18:56 1998 Jeffrey A Law (law@cygnus.com) - - * config/tc-mips.c (mips_ip, case 'i' and 'j'): Mask off high bits - for %lo expressions. - (mips_ip, case 'u'): Move range check after code to mask - off bits in %hi/%lo expressions. Mask off high bits for - %lo expressions. - -Tue Jul 7 17:57:38 1998 Ian Lance Taylor - - * doc/Makefile.am (gasver.texi): New target. - (as.info, as.dvi): Depends upon gasver.texi. - * doc/as.texinfo: Include gasver.texi. Mention version number on - title page and in top node. - * doc/Makefile.in: Rebuild. - -Tue Jul 7 11:42:16 1998 Richard Henderson - - * listing.c (listing_listing): For EDICT_LIST, skip all lines up to - but not including the line containing the edict. - * listing.h (LISTING_EOF): New. - * input-scrub.c (input_scrub_next_buffer): Call it. - -Tue Jul 7 13:00:37 1998 Alan Modra - - * config/tc-i386.c (i386_operand): Don't set the size of an - immediate address based solely on the suffix and the mode. - - * config/tc-i386.c (md_assemble): Add assertion to make sure - overlap2 does not set Imm. - - * config/tc-i386.c (space_chars): Remove. The scrubber converts - sequences of whitespace to a single space. - (is_space_chars): Just compare with space. - (md_begin): Don't initialize space_chars. - (md_assemble): Just skip a single whitespace character. - (i386_operand): Rewrite base-index parsing to use new - parse_register, and to skip white space. Skip white space in a - number of other places too. Don't give error message if - parse_register fails. - (parse_register): Change reg_string parameter to be non-const. - Add end_op parameter. Skip white space after the `%', and return - end of register string. Give error message here rather than - caller. - -Fri Jul 3 15:34:34 1998 Ian Lance Taylor - - Based on patch from Matt Semersky : - * expr.c (op_encoding): Make const. - (expr_set_precedence): New function. - (expr_begin): Don't set operator rankings, just call - expr_set_precedence. - * expr.h (expr_set_precedence): Declare. - * read.c (s_mri): Call expr_set_precedence. - -Thu Jul 2 16:24:58 1998 Ian Lance Taylor - - * doc/as.texinfo (Statements): Remove paragraph discussing - continuing lines with a backslash. This hasn't worked for years, - if it ever did. - -Thu Jul 2 14:06:22 1998 Klaus Kaempf - - * 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. - (vms_fixup_xtors_section): New function - (Ctors_Psect, Dtors_Psect): Define. - (IS_GXX_XTOR): Define - (global_symbol_directory): Change check of gxx_bug_fixed to 0. - Filter static constructors/destructors and add to - Ctors_Symbols/Dtors_Symbols chain. - (vms_write_object_file): Write Ctors_Symbols/Dtors_Symbols to - appropriate section. - - * 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 - - * config/obj-elf.c (obj_elf_vtable_inherit, obj_elf_vtable_entry): New. - (elf_pseudo_table): Add them. - * config/tc-mips.c (mips_force_relocation): Force vtable relocs. - (md_apply_fix): Accept them. - (mips_fix_adjustable): Don't adjust them. - (tc_gen_reloc): Mung BFD_RELOC_VTABLE_ENTRY for Rel. - * config/tc-ppc.c (md_apply_fix3): Accept vtable relocs. - * config/tc-ppc.h (TC_FORCE_RELOCATION_SECTION): Force vtable relocs. - (tc_fix_adjustable): Don't adjust them. - -Wed Jul 1 16:35:32 1998 Doug Evans - - * Makefile.am (CGEN_CPU_PREFIX): New variable. - (cgen.o): Use it. - * Makefile.in: Regenerate. - * configure.in: AC_SUBST cgen_cpu_prefix. - * configure: Regenerate. - -Wed Jul 1 21:38:56 1998 J"orn Rennecke - - * config/tc-sh (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) - - * config/tc-mn10300.c (set_arch_mach): New function. - (md_pseudo_table): Add pseudo-ops to set the current machine type. - (md_begin): Default to mn10300 mode. - (md_assemble): Only accept instructions for the core mn10300 - chip and the active machine type. - -Wed Jun 24 19:06:04 1998 Ian Lance Taylor - - * subsegs.h (segment_info_type): Give the struct a name. - * config/tc-h8300.h (tc_reloc_mangle): Add prototype. - * config/tc-h8500.h (tc_reloc_mangle): Declare. - * config/tc-sh.h (sh_coff_reloc_mangle): Add prototype. - * config/tc-w65.h (tc_reloc_mangle): Declare. - * config/tc-z8k.h (tc_reloc_mangle): Declare. - -Wed Jun 24 13:45:00 1998 Catherine Moore - - * config/tc-v850.c (v850_comm): Restore old section - after common processing. - -Wed Jun 24 11:50:54 1998 Klaus Kaempf - - * config/obj-vms.c (Create_VMS_Object_File): Force binary file. - -Tue Jun 23 17:47:31 1998 Jim Wilson - - * config/tc-h8300.c (do_a_fix_imm, build_bytes): Replace cast to - char with code that explicitly sign-extends. - -Tue Jun 23 13:54:57 1998 Nick Clifton - - * config/tc-v850.c (md_begin): Restore text section as the current - section after creating call table sections. - * config/obj-coff.h (SYM_AUXINFO): New macro to conceal ugly - code. - - * config/obj-coff.c (c_symbol_merge): Replace complex expresion - with call to macro SYM_AUXINFO. - -Tue Jun 23 15:09:27 1998 Mike Stump - - * Makefile.am (install-exec-local): Don't let EXEEXT interfere - with the program transform name. - * Makefile.in: Rebuild. - -Mon Jun 22 19:52:42 1998 Ian Lance Taylor - - * config/obj-coff.c (c_symbol_merge): Fix copying of auxiliary - information. - -Mon Jun 22 15:18:58 1998 Ian Lance Taylor - - * config/tc-i386.c (i386_operand): Be prepared for a space between - the open parenthesis and the start of the register operand, - because of the June 16 change. - -Sun Jun 21 21:27:03 1998 Ian Lance Taylor - - * config/tc-sh.c (md_apply_fix): Handle weak symbols correctly if - BFD_ASSEMBLER. - -Sun Jun 21 12:26:36 1998 Nick Clifton - - * config/tc-d30v.c (d30v_align): Always perform alignment request, - even if it is belived to be unnecessary. - -Fri Jun 19 13:57:06 1998 Ian Lance Taylor - - * write.c (adjust_reloc_syms): Never adjust relocs against weak - symbols. - * config/tc-mips.c (md_apply_fix): Adjust accordingly. - -Fri Jun 19 09:50:17 1998 Jeffrey A Law (law@cygnus.com) - - * config/tc-mn10300.c (mn10300_insert_operand): Do not hardcode the - shift amount for a repeated operand. The shift amount for the - repeated copy comes from the size of the operand. - -Fri Jun 19 00:44:19 1998 Jeffrey A Law (law@cygnus.com) - - * config/tc-h8300.c (get_operand): Fix typos in ldm/stm support. - -Wed Jun 17 13:07:05 1998 Ian Lance Taylor - - * config/tc-mips.c (md_show_usage): Fix -mipsN usage. - -Tue Jun 16 13:06:21 1998 Alan Modra - - * app.c (do_scrub_begin): If tc_symbol_chars is defined, treat all - characters in it as LEX_IS_SYMBOL_COMPONENT. - * config/tc-i386.h (tc_symbol_chars): Define. - (extra_symbol_chars): Declare. - * config/tc-i386.c (extra_symbol_chars): Define. - (comment_chars): Don't use '/' as comment start if TE_LINUX. - (line_comment_chars): Set to '/' if TE_LINUX. - * doc/c-i386.texi (i386-prefixes): Update. - * doc/internals.texi (CPU backend): Document tc_symbol_chars. - -Fri Jun 12 13:36:54 1998 Tom Tromey - - * po/Make-in (all-yes): If maintainer mode, depend on .pot file. - ($(PACKAGE).pot): Unconditionally depend on POTFILES. - -1998-06-12 Vladimir N. Makarov - - * config/tc-d10v.c (md_apply_fix3): Checking displacement - constraint in instructions REP & REPI. - -Thu Jun 11 08:56:46 1998 Nick Clifton - - * config/tc-d30v.c (md_apply_fix3): Catch BFD_RELOC_8, - BFD_RELOC_16, BFD_RELOC_64 and issue appropriate error messages. - - (check_range): If the operand is shifted, then shift the number - before checking its range. - - * write.c (adjust_reloc_syms): Add more checks for NULL pointers. - - * config/tc-v850.c (v850_comm): Set SEC_COMMON bit on special - common sections. - -Wed Jun 10 17:26:35 1998 Nick Clifton - - * config/tc-v850.c (v850_comm): Create special sections as needed. - -1998-06-10 Vladimir N. Makarov - - * config/tc-d10v.c (write_2_short): Addition of swapping - instructions for sequential and reverse sequential order when - given order is not possible. - -Tue Jun 9 13:52:53 1998 Ian Lance Taylor - - * Makefile.am: Rebuild dependencies. - (DEP_INCLUDES): Fix reference to intl build directory. - * Makefile.in: Rebuild. - -Tue Jun 9 12:20:05 1998 Alan Modra - - * doc/c-i386.texi: Update 16 bit documentation. - - * config/tc-i386.h: Change Data16 to Size16, Data32 to Size32, - IgnoreDataSize to IgnoreSize as they are used for address size as - well as data size. - * config/tc-i386.c: Likewise. Add code to reject addr32/data32 in - 32-bit mode, similarly addr16/data16 and variants. - -Mon Jun 8 18:32:01 1998 Nick Clifton - - * config/tc-d30v.c (md_assemble): Fix handling of reverse - sequential word multiply instructions. - - (do_assemble): Add extra command line argument, to allow mul32 - attribute to be preserved across parallel insns. - (md_assemble): Insert NOPs between explicitly parallel insns which - contain an 32 bit multiply and a 16 multiply. - -Mon Jun 8 12:20:30 1998 Alan Modra - - * config/tc-i386.c: REPNE renamed to REPNE_PREFIX_OPCODE, and - likewise for REPE. - - * config/tc-i386.c (reloc): Add braces. - - * config/tc-i386.c (struct _i386_insn): Rename bi to sib to be - consistent with Intel naming. - * config/tc-i386.h (base_index_byte): Rename to sib_byte. Don't - use bitfields in sib_byte. - (modrm_byte): Don't use bitfields here either. - - * config/tc-i386.c (current_templates): Add const. - (parse_register): Add const to return, param, and char *s. - (i386_operand): Add const to reg_entry *r. - * config/tc-i386.h (templates): Add const to start, end. - - Inspired by code for 16 bit gas support from Martynas Kunigelis - : - * config/tc-i386.c (md_assemble): Add full support for 16 bit - modrm, and Jump, JumpByte, JumpDword, JumpInterSegment insns. - (uses_mem_addrmode): Remove. - (md_estimate_size_before_relax): Add support here too. - (md_relax_table): Rewrite interface to md_relax for 16 bit - support. - (BYTE, WORD, DWORD, UNKNOWN_SIZE): Remove. - (opcode_suffix_to_type): Remove. - (CODE16, SMALL, SMALL16, BIG, BIG16): Define. - (SIZE_FROM_RELAX_STATE): Modify to suit above. - (md_convert_frag): Likewise. - (i386_operand): Add support for 16 bit base/index regs, - immediates, and displacements. Remove some unnecessary casts, and - localise end_of_operand_string, displacement_string_start, - displacement_string_end variables. Add GCC_ASM_O_HACK. - * config/tc-i386.h (NO_BASE_REGISTER_16): Define. - - * config/tc-i386.c (prefix_hash): Remove. - (md_begin): Rewrite without obstacks. Remove prefix hash table - handling. Rewrite lexical table handling. - (i386_print_statistics): Don't print prefix statistics. - (md_assemble): Rewrite instruction parser so that line is not - converted to lower case. Don't do a hash_find for prefixes, - instead recognise them via opcode modifier. - (expecting_operand, paren_not_balanced): Localise variables. - * config/tc-i386.h (IsPrefix): Define. - (prefix_entry): Remove. - - * config/tc-i386.h (PREFIX_SEPERATOR): Don't define. - * config/tc-i386.c (PREFIX_SEPARATOR): Define here instead, using - '\\' in case where comment_chars contains '/'. - - * config/tc-i386.c (MATCH): Ensure given operand and template - match for JumpAbsolute. Makes e.g. `ljmp table(%ebx)' invalid; - you must write `ljmp *table(%ebx)'. - - From H.J. Lu : - * config/tc-i386.c (BFD_RELOC_16, BFD_RELOC_16_PCREL): Define - as 0 ifndef BFD_ASSEMBLER. - (md_assemble): Allow immediate operands without suffix or - other reg operand to default in size to the current code size. - -Mon Jun 8 09:45:00 1998 Catherine Moore - - * config/tc-v850.c (md_begin): Restore creation of - .call_table_text and .call_table_data sections. - -Sat Jun 6 00:02:41 1998 Nick Clifton - - * config/tc-d30v.c (md_assemble): Set execution type to unknown - after emitting a word of noops. - -Fri Jun 5 23:27:04 1998 Alan Modra - - * config/tc-i386.c (mode_from_disp_size): Disp16 is mode 2. - (i386_operand): Simplify checks for valid base/index combinations. - Disallow `in 4(%dx),%al'. - - * config/tc-i386.c (struct _i386_insn): Make regs, base_reg, and - index_reg const. - (add_prefix): Change parameter from char to int. - - * config/tc-i386.h (Ugh): Define opcode modifier. - * config/tc-i386.c (md_assemble): Print warnings for Ugh insns. - - * config/tc-i386.c (md_assemble): Rewrite MATCH and - CONSISTENT_REGISTER_MATCH macros to check register types more - thoroughly. Check for illegal suffix/operand combinations - when matching insns with operands. Handle new `s' suffix, and - associated FloatMF opcode modifier for float insns with memory - operands. - * config/tc-i386.h (FloatMF): Define new opcode modifier. - (No_sSuf, No_bSuf, No_wSuf, No_lSuf): Likewise. - (SHORT_OPCODE_SUFFIX, LONG_OPCODE_SUFFIX): Define. - * config/tc-i386.c: Rename WORD_PREFIX_OPCODE to - DATA_PREFIX_OPCODE throughout. - - * config/tc-i386.c (REGISTER_WARNINGS): Define. - (md_assemble): Rewrite suffix/register operand checking code to be - more thorough. Remove Abs8,16,32. Change occurrences of Mem to - AnyMem, the better to grep. - (pi): Remove Abs. - (i386_operand): Don't set Mem bits in i.types[this_operand] when - given a memory operand. Don't set Abs bits either. - (type_names): Remove Mem*, Abs*. - * config/tc-i386.h (Mem8, Mem16, Mem32, Abs8, Abs16, Abs32): Don't - define opcode_modifiers as these cases are handled by Disp8, - Disp16, Disp32 and suffix checks. - (COMES_IN_BOTH_DIRECTIONS): Remove. - (FloatR): Define. It's OK to share the bit with ReverseRegRegmem. - - * config/tc-i386.c (md_assemble): Don't emit operand size prefix - if IgnoreDataSize modifier given. Remove ShortformW modifier - test. Add test for ShortForm in W base_opcode modification. - Merge Seg2ShortForm and Seg3ShortForm code. - * config/tc-i386.h (ShortFormW): Remove. - (IgnoreDataSize): Define. - -Fri Jun 5 10:50:53 1998 Nick Clifton - - * config/tc-d30v.c (md_assemble): Store previous segment state - with previous instruction. - -Wed Jun 3 18:21:56 1998 Alan Modra - - * config/tc-i386.c (SCALE1_WHEN_NO_INDEX): Define. - (ebp, esp): Remove static variables. - (MATCH): Remove test for InOutPortReg. - (i386_operand): Properly handle InOutPortReg here instead. - Disallows `inb (%dx,2)', `inb %es:(%dx)' and `mov (%dx),%ax' - (md_assemble): Simplify and correct modrm and sib generation. - (i386_operand): Add warning for scale without index. - Rewrite checks for valid base/index combinations. - - * config/tc-i386.c (END_STRING_AND_SAVE): Protect arguments of - macros and enclose in do while(0). - (RESTORE_END_STRING): Likewise. - (md_assemble): Add one to printed operand number so we start - from 1 not 0. Add some more gettext invocations. - (i386_operand): Fix `%%s' -> `%%%s'. Inc printed operand - number here too. - - * config/tc-i386.h (WAIT_PREFIX, LOCKREP_PREFIX, ADDR_PREFIX, - DATA_PREFIX, SEG_PREFIX): Define. - * config/tc-i386.c (struct _i386_insn): Remove wait_prefix field. - (check_prefix): Remove function. - (add_prefix): New function. Add prefix to i.prefix as well as - doing checks. - (md_assemble): Changes for add_prefix. Remove hack for wait - prefix, instead always output prefixes in fixed order. Test - for jcxz/loop when selecting between word & dword operations, - and add address size prefix rather than operand size prefix. - Remove operand -> address size hack when emitting jcxz/loop. - (i386_operand): Remove O_Absent check as it's done in expr. - -Wed Jun 3 15:09:10 1998 Ian Lance Taylor - - * configure.in: Recognize m5200 as a cpu_type of m68k. - * aclocal.m4: Rebuild with current libtool. - * configure: Rebuild. - -Wed Jun 3 14:11:59 1998 Andreas Schwab - - * config/tc-m68k.c (md_estimate_size_before_relax): Add more calls - to relaxable_symbol to prevent references to external symbol from - being relaxed. - -Wed Jun 3 14:10:36 1998 Ian Lance Taylor - - * config/tc-m68k.c (relaxable_symbol): If TARGET_OS is "elf", all - symbols are relaxable. - -Wed Jun 3 09:16:00 1998 Catherine Moore - - * config/tc-v850.c (md_begin): Don't create special - sections by default. - -Tue Jun 2 14:52:56 1998 Jeffrey A Law (law@cygnus.com) - - * config/tc-mips.c (macro): For div and udiv, close the - reorder block as soon as possible. - -Tue Jun 2 15:36:13 1998 Ian Lance Taylor - - From Matt Semersky : - * macro.c (macro_mri_mode): New function. - * macro.h (macro_mri_mode): Declare. - * read.c (s_mri): Call macro_mri_mode when switching in and out of - MRI mode. - -Tue Jun 2 13:32:22 1998 Klaus Kaempf - - * config/tc-alpha.c (s_alpha_comm): Allow alignment parameter in - OBJ_EVAX case. - - * config/tc-alpha.c (s_alpha_comm): Defer restoring character - until after xstrdup in OBJ_EVAX case. - -Tue Jun 2 13:11:13 1998 Pat Rankin - - * config/tc-vax.c (md_create_short_jump): Fix off by two bug in - offset calculation. Also, use VAX_BRW from vax-inst.h instead - of hardcoded magic number. - (md_create_long_jump): Use VAX_JMP and VAX_ABSOLUTE_MODE macros. - -Tue Jun 2 09:25:34 1998 Doug Evans - - * read.c (do_s_func): New function. - (s_func): Call it. - * read.h (do_s_func): Add prototype. - -Mon Jun 1 12:47:30 1998 Doug Evans - - * config/tc-m32r.c (m32r_do_align): Only fill code sections with - nops if fill pattern not specified. - -Mon Jun 1 14:08:35 1998 Ian Lance Taylor - - From Andrew Crabtree : - * config/te-go32.h (TE_GO32): Define. - * config/tc-i386.h (LOCAL_LABEL): Don't define if TE_GO32. - -Sun May 31 15:43:06 1998 Doug Evans - - Implement .func/.endfunc pseudo-ops. - * read.h (stabs_generate_asm_func,stabs_generate_asm_endfunc): Declare. - (s_func): Declare. - * read.c (potable): Add .func,.endfunc. - (s_func): New function. - * stabs.c (stabs_generate_asm_func,stabs_generate_asm_endfunc): New - functions. - (in_doc_func_p,current_function_label): New static globals. - (stabs_generate_asm_lineno): Emit function relative stabs if in .func. - -Fri May 29 18:13:12 1998 Ian Lance Taylor - - * config/tc-a29k.h (WORKING_DOT_WORD): Define. - * config/tc-alpha.h (WORKING_DOT_WORD): Define. - * config/tc-arm.h (WORKING_DOT_WORD): Define. - * config/tc-h8300.h (WORKING_DOT_WORD): Define. - * config/tc-h8500.h (WORKING_DOT_WORD): Define. - * config/tc-hppa.h (WORKING_DOT_WORD): Define. - * config/tc-i860.h (WORKING_DOT_WORD): Define. - * config/tc-i960.h (WORKING_DOT_WORD): Define. - * config/tc-tic30.h (WORKING_DOT_WORD): Define. - * config/tc-w65.h (WORKING_DOT_WORD): Define. - * config/tc-z8k.h (WORKING_DOT_WORD): Define. - * config/tc-a29k.c: Don't define md_short_jump_size, - md_long_jump_size, md_create_short_jump or md_create_long_jump. - * config/tc-alpha.c: Likewise. - * config/tc-alpha.h: Likewise. - * config/tc-arm.c: Likewise. - * config/tc-h8300.c: Likewise. - * config/tc-h8500.c: Likewise. - * config/tc-hppa.c: Likewise. - * config/tc-i860.c: Likewise. - * config/tc-i960.c: Likewise. - * config/tc-ppc.c: Likewise. - * config/tc-sh.c: Likewise. - * config/tc-sparc.h: Likewise. - * config/tc-tic30.c: Likewise. - * config/tc-w65.c: Likewise. - * config/tc-z8k.c: Likewise. - -Fri May 29 16:03:26 1998 Pat Rankin - - * config/tc-vax.c (_): Delete this macro used for placeholder - values in vax_operand_width_size; it conflicts with the _() macro - used for internationalization. - -Fri May 29 13:46:07 1998 Ian Lance Taylor - - * symbols.c (symbol_find_base): Fix case insensitive symbol name - code. From Chris Moller . - - Based on patch from Klaus Kaempf : - * struc-symbol.h (struct broken_word): Add seg and subseg fields. - * read.c (emit_expr): Initialize seg and subseg fields of a new - broken word. - * write.c (write_object_file): Switch to the appropriate segment - and subsegment when processing a broken word. - - * config/tc-m68k.c (mri_assemble): New static function. - (build_mri_control_operand): Call mri_assemble rather than - md_assemble. - (s_mri_else, s_mri_break, s_mri_next, s_mri_for): Likewise. - (s_mri_endf, s_mri_endw): Likewise. - -Wed May 27 11:16:25 1998 Ian Lance Taylor - - * read.c (s_org): Call md_flush_pending_output if it is defined. - - * config/tc-sparc.c (md_show_usage): Add \n\ to new string. - -Tue May 26 19:27:52 1998 Stan Cox - - * config/tc-sparc.c (OPTION_LITTLE_ENDIAN_DATA): New. - (md_parse_option): Add for same. - (sparc_md_end): Set bfd_mach_sparc_sparclite_le. - (md_apply_fix3, tc_gen_reloc): Allow BFD_RELOC_SPARC_32LE. - (cons_fix_new_sparc): Added to create BFD_RELOC_SPARC_32LE. - - * config/tc-sparc.h (cons_fix_new_sparc): Added. - -Thu May 21 15:02:41 1998 Nick Clifton - - * config/tc-arm.c (find_real_start): Relax definition of local - labels. - -Tue May 19 16:59:44 1998 Nick Clifton - - * config/tc-d30v.c (d30v_align): Apply address adjustment to all - symbols at the given address, not just the last one specified. - -Tue May 19 08:25:19 1998 Catherine Moore - - * config/tc-sparc.c (sparc_handle_align): Use number_to_chars_bigendian - or number_to_chars_littleendian to write data. - -Mon May 18 17:09:30 1998 Nick Clifton - - * config/tc-v850.c (md_assemble): Remove artificially created - register name symbols. - -Mon May 18 13:47:06 1998 Doug Evans - - * write.c (fixup_segment): Change "segment" to "section" in - error message. - -Mon May 18 16:55:40 1998 Michael Meissner - - * write.c (fixup_segment): Change sym1-sym2 message again. - -Mon May 18 09:31:43 1998 Michael Meissner - - * write.c (fixup_segment): Improve error message for sym1-sym2 - errors when sym1 is in a different segment from sym2. - -Wed May 13 10:16:37 1998 Doug Evans - - * config/tc-m32r.c (warn_unmatched_high): New static local. - (OPTION_WARN_PARALLEL): Rename from OPTION_WARN. - (OPTION_NO_WARN_PARALLEL): Rename from OPTION_NO_WARN. - (md_longopts): Recognize --{no-,}warn-unmatched-high. - (md_parse_option): Likewise. - (md_show_usage): Likewise. - (m32r_frob_file): Likewise. - - * read.c (generate_file_debug,generate_lineno_debug): New functions. - (read_a_source_file): Call them. - * read.h (stabs_generate_asm_file): Declare. - * stabs.c (stabs_generate_asm_file): New function. - (generate_asm_file): New function. - (stabs_generate_asm_lineno): Move file name handling into - generate_asm_file. - -Tue May 12 12:03:44 1998 Richard Henderson - - * config/tc-d30v.c (cur_mul32_p, prev_mul32_p): Make static. - (d30v_current_align, d30v_current_align_seg): New variables. - (d30v_last_label): New variable. - (d30v_align, s_d30v_align, s_d30v_text): New functions. - (s_d30v_data, s_d30v_section): Likewise. - (md_pseudo_table): Call them. - (md_begin): Initialize d30v_current_align_seg. - (md_assemble): Call d30v_align when needed by known current alignment. - (d30v_frob_label, d30v_cons_align): New functions. - * config/tc-d30v.h (md_do_align): Remove. - (tc_frob_label): Call d30v_frob_label. - (md_cons_align): New. - - * config/tc-d30v.c (find_format): Convert complex expressions to - expression symbols before processing. Clean up code formatting. - -Sun May 10 22:35:02 1998 Jeffrey A Law (law@cygnus.com) - - * po/Make-in (install-info): New target. - -Thu May 7 15:49:07 1998 Jeffrey A Law (law@cygnus.com) - - * config/tc-mn10200.c (md_assemble): Handle "bra" just like "jmp" - instructions. - * config/tc-mn10300.c (md_assemble): Likewise. - -Thu May 7 11:47:22 1998 Doug Evans - - * Makefile.am: Update with `make dep-am'. - (HFILES): Add cgen.h. - (cgen.o): Depend on cgen.h. - * Makefile.in: Regenerate. - - * cgen.c (cgen_md_apply_fix3): Don't pass newline to as_warn_where. - -Thu May 7 13:20:56 1998 Anders Blomdell - - * gasp.c (grab_label): Permit a label to be a preprocessor - variable by permitting a label to start with a backslash. - -Thu May 7 12:50:33 1998 Frank Ch. Eigler - - * config/tc-mips.c (validate_mips_insn): Removed hack - for previously inaccessible bitfields in some INSN_TRAP - instructions. - -Thu May 7 11:13:00 1998 Frank Ch. Eigler - - * config/tc-d30v.c (do_assemble): Abort with error message - if opcode operands do not match. - -Thu May 7 09:36:06 1998 Frank Ch. Eigler - - * config/tc-mips.c (macro_build, validate_mips_insn): Implement - 'q' operand format for 20-bit "break"/"sdbbp" instructions. - (mips_ip): Truncate overflowed "break" 'c' operand. Implement - similar new 'q' operand. - -Thu May 7 07:47:14 1998 Michael Meissner - - * cgen.c (cgen_asm_finish_insn): Fix typo. - -Thu May 7 02:19:14 1998 Doug Evans - - * cgen.h: New file. - * cgen.c: Include it. - (MAX_FIXUPS): Renamed to CGEN_MAX_FIXUPS. - (cgen_asm_finish_insn): Result is now void. New arg `result'. - All callers updated. - * config/tc-m32r.c: Include cgen.h. - (m23r_insn): New members num_fixups,fixups. - -Wed May 6 16:29:19 1998 Jeffrey A Law (law@cygnus.com) - - * config/tc-hppa.c (md_apply_fix): Slightly rework some code - to avoid compiler warning. - -Wed May 6 15:26:34 1998 Klaus Kaempf - - * makefile.vms: Run dec c with /nodebug. Pass CC value when - calling make. - - * makefile.vms (OBJS): Add ehopt.obj - -Wed May 6 15:11:12 1998 Klaus Kaempf - - * doc/c-vax.texi: Correct and extend vax/vms documentation. - -Wed May 6 11:51:51 1998 Richard Henderson - - * config/tc-d30v.c (do_assemble): Accept a new parameter requesting - a short format insn. - (md_assemble): Set it for explicitly packed insns. - -Tue May 5 13:23:13 1998 Nick Clifton - - * config/obj-coff.c (c_symbol_merge): Do not take address of - native fields when performing the memcpy. - -Tue May 5 13:10:41 1998 Gavin Koch - - * config/tc-mips.c (macro,macro2): Implement - M_DMULO_I, M_MULO_I, M_DMULOU_I, and M_MULOU_I. - -Mon May 4 17:49:14 1998 Andreas Schwab - - * config/tc-m68k.h (TC_RELOC_RTSYM_LOC_FIXUP): Changed to keep - relocations against globally visible symbols. - * config/tc-m68k.c (relaxable_symbol): New macro. - (m68k_ip, md_estimate_size_before_relax): Use it. - (tc_m68k_fix_adjustable): Also handle weak symbols. - -Mon May 4 16:12:23 1998 Ian Lance Taylor - - * config/tc-i386.h (TC_RELOC_RTSYM_LOC_FIXUP): Keep relocs for all - references to externally visible symbols. - * config/tc-i386.c (md_apply_fix3): When OBJ_ELF, don't add the - values in twice for a PC relative reloc if the symbol is - externally defined. - - * config/tc-sparc.h (tc_fix_adjustable) [OBJ_AOUT]: When PIC, - don't adjust a PC relative reloc against an externally visible - symbol. - * config/tc-sparc.c (md_apply_fix3): When generating a.out PIC, - for a PC relative fixup against an externally visible defined - symbol, arrange to store object file and addend values as though - the symbol were not defined. - (tc_gen_reloc): Likewise. - -Thu Apr 30 13:09:39 1998 Fred Fish - - * read.c (sizeof_leb128): Referenced externally by write.c so - don't inline. - -Wed Apr 29 15:45:57 1998 Michael Meissner - - * config/tc-m32r.c ({,expand_}debug_sym): New functions to record - and expand a 'debug' symbol associated with the next instruction - that does not cause a short instruction to be filled with a NOP. - (md_pseudo_table): Add support for .debugsym. - (assemble_parallel_insn): Add calls to expand_debug_sym as - appropriate. - (md_assemble): Ditto. - -Tue Apr 28 19:16:26 1998 Tom Tromey - - * as.c (main): Conditionally call setlocale. - * gasp.c (main): Likewise. - * asintl.h: Include if HAVE_LOCALE_H. - (LC_MESSAGES): Now can be defined even when ENABLE_NLS. - -Tue Apr 28 18:33:23 1998 Frank Ch. Eigler - - * config/tc-d30v.c (md_show_usage): Correct gettext typo. - -Tue Apr 28 12:16:30 1998 Ian Lance Taylor - - * config/tc-hppa.c: Change all calls to bzero to use memset. - (pa_ip): Add cast to avoid warning. - (tc_gen_reloc, md_apply_fix): Likewise. - (pa_find_space_by_number): Likewise. - (hppa_force_relocation): Likewise. - (pa_block): Change i to unsigned int. - * config/obj-som.h (obj_som_copyright): Declare. - -Tue Apr 28 11:35:56 1998 Frank Ch. Eigler - - * ecoff.c (ecoff_build_lineno): Do not use dummy first_lineno - for line numbers for assembly source. - -Mon Apr 27 15:58:46 1998 Ian Lance Taylor - - * configure.in: Change version number to 2.9.4 - * configure: Rebuild. - -Mon Apr 27 12:07:33 1998 Doug Evans - - * cgen.c (cgen_asm_finish_insn): New arg relax_p. All callers updated. - -Mon Apr 27 15:16:12 1998 Ian Lance Taylor - - * ecoff.h: Change symbolS in function declaration to struct - symbol. - -Sun Apr 26 13:44:22 1998 Ian Lance Taylor - - * config/tc-sh.c (parse_reg): Add casts to avoid warnings. - (md_convert_frag): Fix i18n typo. - -Sat Apr 25 20:12:02 1998 Richard Henderson - - * ecoff.c (ecoff_get_cur_proc_sym): New function. - * ecoff.h: Protoype it. - * config/tc-alpha.c [ELF] (s_alpha_prologue): New function. - [EVAX] (s_alpha_prologue): Delete. - (md_pseudo_table): Update. - -Sat Apr 25 14:00:52 1998 Ian Lance Taylor - - * config/tc-i960.c (md_assemble): Change bp_error_msg from static - array to local pointer. - (get_args, parse_expr): Add casts to avoid warnings. - -Fri Apr 24 12:47:42 1998 Philippe De Muyter - - * read.c (s_set): Cast xmalloc return value to fragS *. - * config/tc-m68k.c (m68k_ip): Function made static to match - previous forward declaration. - (insert_reg, init_regtable, md_convert_frag_1): Likewise. - -Fri Apr 24 09:26:46 1998 Nick Clifton - - * config/tc-v850.c: Add internationalisation macros to error - strings. - - * config/tc-m32r.c (can_make_parallel): Add internationalisation - macros to error strings. - -Thu Apr 23 19:23:23 1998 Ian Lance Taylor - - * config/tc-ppc.c (ppc_fix_adjustable): Correct test of whether a - reloc is in the TOC csect. - (md_apply_fix3): Correct gettext typo. - -Thu Apr 23 14:58:31 1998 Nick Clifton - - * config/tc-arm.c (find_real_start): Ignore symbols starting with - .L - they are local labels and the branches are not really - function calls but rather far jumps. - -Wed Apr 22 15:57:21 1998 Tom Tromey - - * po/Make-in (MKINSTALLDIRS): Don't look in $(top_srcdir). - -Wed Apr 22 14:52:36 1998 Ian Lance Taylor - - * config/tc-i386.c (md_assemble): Print operand number rather than - using ordinal_names. - (i386_operand): Likewise. - -Tue Apr 21 22:34:25 1998 Tom Tromey - - * Makefile.am (INTLLIBS): Define to work around apparent automake - bug. - All Makefiles: Regenerated. - - * Many files: Added gettext invocations around user-visible - strings. - * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY, - HAVE_LC_MESSAGES): Define. - * dep-in.sed: Added asintl.h. - * po/Make-in: New file. - * gasp.c (main): Call setlocale, bindtextdomain, and textdomain. - Include "asintl.h". - * read.c (Z_): Renamed from `_'. - * Makefile.am (SUBDIRS): Added po. - (POTFILES): new macro. - (po/POTFILES.in): New target. - ($(OBJS)): Added asintl.h. - (HFILES): Likewise. - (INCLUDES): Added -DLOCALEDIR, -I$(top_srcdir)/../intl. - (as_new_LDADD): Added $(INTLLIBS). - (as_new_DEPENDENCIES): Added $(INTLDEPS). - (gasp_new_LDADD): Added $(INTLLIBS). - (gasp_new_DEPENDENCIES): New macro. - * configure, aclocal.m4: Rebuilt. - * configure.in: Call CY_GNU_GETTEXT. Generate po/Makefile.in and - po/Makefile. - (ALL_LINGUAS): Define. - * macro.c: Include "asintl.h". - * as.c (main): Call setlocale, bindtextdomain, and textdomain. - * as.h: Include "asintl.h". - * config/tc-i386.c (ordinal_names): Removed. - (md_assemble): Changed error text to avoid ordinal_names. - (i386_operand): Likewise. - (reloc): Added as_bad to avoid i18n problems. - (tc_gen_reloc): Likewise. - * config/tc-arm.c (bad_args): Now a #define. - (bad_pc): Likewise. - * config/obj-vms.c (VMS_stab_parse): Changed type of - `long_const_msg'. - (global_symbol_directory): Unified strings to avoid i18n - problems. - * config/tc-m68k.c (get_reloc_code): Added some as_bad calls to - avoid i18n problems. - * config/tc-ns32k.c (reloc): Added as_bad to avoid i18n problems. - * config/tc-ppc.c (md_apply_fix3): Added as_bad_where to avoid - i18n problems. - * config/tc-sh.c (md_convert_frag): Added as_bad to avoid i18n - problems. - * config/tc-v850.c (md_assemble): Changed C++ comment into C - comment. - * config/tc-vax.c (md_assemble): Added as_warn to avoid i18n - problems. - * as.c (print_version_id): Added an fprintf to avoid i18n - problems. - * cond.c (cond_finish_check): Added as_bad call to avoid i18n - problems. - * expr.c (expr): Added as_warn call to avoid i18n problems. - * messages.c (as_assert): Changed code to avoid i18n problems. - (as_abort): Likewise. - * read.c (pseudo_set): Added as_bad call to avoid i18n problems. - (s_space): Likewise. - * po/Make-in, po/POTFILES.in, po/gas.pot: New files. - -Tue Apr 21 17:01:22 1998 Alan Modra - - * config/tc-i386.c (check_prefix): New static function, split out - from md_assemble. - (struct _i386_insn): Add wait_prefix field. - (md_assemble): Remove wait_prefix local variable. Use - check_prefix when adding a prefix. - - * config/tc-i386.c (current_templates): New static variable. - (md_assemble): Remove current_templates local variable. - (md_assemble, i386_operand): Improve error and warning messages in - many places. Add RESTORE_END_STRING in many places before error - return. Clarify some comments. - - * config/tc-i386.c (struct _i386_insn): Change seg field to a two - element array. - (md_assemble): Parse string instruction operands, looking for - segment override prefixes. Check for invalid segment prefixes on - string instruction. - (i386_operand): i.seg[] and max mem_operand changes for string - insns. - * config/tc-i386.h (EsSeg): Define. - - * config/tc-i386.h (regKludge): Define. - (iclrKludge, imulKludge): Don't define. - * config/tc-i386.c (md_assemble): Merge imulKludge and iclrKludge - code. Move ReverseRegRegmem fudges into Modrm case. Reorder - opcode_modifier checks to look for more common cases first. Add - default_seg for IsString case. - -Tue Apr 21 16:18:12 1998 Ian Lance Taylor - - * configure.in: Call AM_PROG_LEX rather than AC_PROG_LEX and - AC_DECL_YYTEXT. - * configure: Rebuild with new automake and libtool. - * aclocal.m4, Makefile.in: Likewise. - - * doc/Makefile.am (as.dvi): New target. - * doc/Makefile.in: Rebuild. - -Sat Apr 18 01:21:04 1998 Stan Cox - - * configure.in: Added sparc86x support. - - * configure: Rebuild. - - * config/tc-sparc.c (lookup_arch): Added arch_type to struct - sparc_arch. - (md_parse_option): Warn if -EL is not supported for this architecture. - - * config/tc-sparc.h (SPARC_BIENDIAN) Always define. - -Sat Apr 18 01:19:01 1998 Jeffrey A Law (law@cygnus.com) - - * config/tc-mips.c (mips_ip): Note when we use get match on - the full instruction name. - -Wed Apr 15 15:17:27 1998 Richard Henderson - - * symbols.c (resolve_symbol_value) [O_symbol]: Also store the symbol - back into the expression to handle add/sub simplification correctly. - -Wed Apr 15 07:06:04 1998 Catherine Moore - - * config/tc-mips.c (hilo_interlocks): Remove 4300. - -Mon Apr 13 16:51:04 1998 Nick Clifton - - * config/tc-arm.c (do_msr): Support undocumented 'msr cpsr_flg, - #' instruction. - -Thu Apr 9 10:29:42 1998 Doug Evans - - * symbols.c (max_indent_level): New global. - (print_symbol_value_1): Use it. - * expr.h (expr_build_dot): Declare. - * expr.c (expr_build_dot): New function. - -Wed Apr 8 16:16:11 1998 Doug Evans - - * symbols.c (print_binary): New function. - (print_expr_1): Call it. - -Mon Apr 6 12:06:39 1998 Andreas Schwab - - * config/tc-m68k.c (m68k_ip, case "#B"): Install the offset of the - operand in the opcode. - -Fri Apr 3 11:58:19 1998 Alan Modra - - * config/tc-i386.h: Reorder operand flags and opcode modifier - flags for clarity. Remove unused definitions: Unknown, - ImmUnknown, DispUnknown, NoModrm. - * config/tc-i386.c (type_names): Add missing Debug type. - (md_assemble): Better duplicate prefix checking. Quicker string - instruction check via new opcode_modifier flag. - -Fri Apr 3 11:44:34 1998 Ian Lance Taylor - - * doc/as.texinfo (Invoking): Clarify -Wa example. - -Fri Apr 3 09:12:23 1998 Gavin Koch - - * config/tc-mips.c (mips_pseudo_table): Add weakext entry. - (s_mips_weakext): Define. - * ecoff.c (ecoff_directive_weakext): Don't define if defined(TC_MIPS). - * config/obj-ecoff.c (obj_pseudo_table): Don't add weakext if - defined(TC_MIPS). - -Thu Apr 2 22:42:02 1998 Jeffrey A Law (law@cygnus.com) - - * config/tc-mn10200.c (tc_gen_reloc): The difference of two symbols - is an error if the value can not be computed at assembly time. - * config/tc-mn10300.c (tc_gen-reloc): Likewise. - -Thu Apr 2 16:36:47 1998 Ian Lance Taylor - - * gasp.c (main): Set next field of new include_path structure to - NULL. From Avery Pennarun . - - * read.c (s_mri_sect): Call as_bad rather than abort for an - unsupported MRI target. - -Wed Apr 1 11:08:27 1998 Nick Clifton - - * config/tc-arm.c (arm_validate_fix): New function. Determine if - the destination of a branch instruction should be altered. - (find_real_start): New function: Locate the real, Thumb coded - start of a Thumb function. - (do_t_branch23): Alter the destination of branches to Thumb - functions. - - * config/tc-arm.h: Define TC_VALIDATE_FIX. - -Tue Mar 31 13:27:33 1998 Dean M. Deaver - - * config/tc-arm.c (decode_shift): Handle addressing mode 2 w/rrx - also. - -Wed Apr 1 13:13:20 1998 Andreas Schwab - - * doc/as.texinfo: Use @itemx for a secondary item in a table. - * doc/c-hppa.texi: Likewise. - -Tue Mar 31 17:52:40 1998 Ian Lance Taylor - - * Makefile.am: Rebuild dependencies. - * Makefile.in: Rebuild. - - * Makefile.am (DEP_INCLUDES): New variable. - (.dep1): Change to work when srcdir is not an absolute path. - (.tcdep, .objdep, .dep2, dep.sed): Likewise. - * Makefile.in: Rebuild. - -Mon Mar 30 12:46:48 1998 Ian Lance Taylor - - * config/tc-i386.h, config/tc-i386.c: Revert March 24 - LinearAddress patch. - - * configure.in: Set version to 2.9.1. - * configure: Rebuild. - - * Branched binutils 2.9. - -Mon Mar 30 11:22:08 1998 Alan Modra - - * config/tc-i386.h (FWait): Define. - * config/tc-i386.c (md_assemble): Emit fwait prefix before any - other prefixes. Check FWait flag in opcode table to see which - instructions require an fwait prefix. - -Mon Mar 30 10:12:00 1998 Andreas Schwab - - * stabs.c (get_stab_string_offset): Always create a stab string - section. - -Sat Mar 28 22:28:02 1998 Ian Lance Taylor - - Fix some gcc -Wall warnings: - * atof-generic.c (atof_generic): Add casts to avoid warnings. - * ehopt.c (eh_frame_code_alignment): Likewise. - * expr.c (integer_constant, operand): Likewise. - * frags.c (frag_align): Likewise. - * gasp.c (level_0, change_base, doinstr): Likewise. - * hash.c (hash_ask): Likewise. - * listing.c (listing_page, calc_hex, print_lines): Likewise. - (debugging_pseudo): Likewise. - * macro.c (define_macro, check_macro): Likewise. - * read.c (read_a_source_file, s_align, s_float_space): Likewise. - (ignore_rest_of_line, float_cons): Likewise. - * symbols.c (decode_local_label_name): Likewise. - * write.c (record_alignment, cvs_frag_to_fill): Likewise. - (fixup_segment, number_to_chars_bigendian): Likewise. - (number_to_chars_littleendian): Likewise. - * config/atof-ieee.c (gen_to_words): Likewise. - * config/tc-sparc.c (md_begin, md_assemble): Likewise. - (sparc_ip, parse_keyword_arg, s_common): Likewise. - * read.c (output_big_sleb128): Initialize locals to avoid - warnings. - (output_big_uleb128, equals): Likewise. - * atof-generic.c (atof_generic): Change number_of_digits_* locals - to unsigned int. Change zeros to unsigned int. - * cond.c (s_if): Add return to default case. - * frags.c (frag_now_fix): Change return type to addressT. - * frags.h (frag_now_fix): Update declaration. - * listing.c (file_info_struct): Change linenum to unsigned int. - (struct list_info_struct): Change hll_line to unsigned int. - (print_source): Update format string. - * read.c (emit_expr): Change scan to unsigned int, and don't - bother to initialize it. - * symbols.c (dollar_label_count): Change to unsigned long. - * write.c (adjust_reloc_syms): Remove unused label reduce_fixup. - * config/tc-sparc.c (sparc_memory_model): Only define if OBJ_ELF. - * config/tc-sparc.c (tc_gen_reloc): Add return to default case. - -Fri Mar 27 12:46:47 1998 Ian Lance Taylor - - * config/tc-m68k.c (m68k_ip): Check legal addressing modes for - mcf5200 just as we do for m68000. - (m68k_init_after_args): Likewise. - (md_estimate_size_before_relax): Likewise. - -Fri Mar 27 10:30:01 1998 Catherine Moore - - * config/tc-v850.c (md_assemble): Store relocation addend in - fixup instead of instruction. - -Thu Mar 26 23:07:18 1998 Alan Modra - - * config/tc-i386.c (md_assemble): Swap template arguments to - CONSISTENT_REGISTER_MATCH macro in reverse direction test. - This macro is currently symmetric, so passing them the wrong - way didn't cause any problem, but may if the macro is changed - in the future. - After copying template to i.tm, use i.tm. rather than t-> to - access fields, and make t a const* - Move i.tm.operand_types[] swap to immediately after the copy. - -Wed Mar 25 13:44:18 1998 Doug Evans - - * expr.h (expr_build_uconstant): Add prototype. - (expr_build_unary,expr_build_binary): Add prototypes. - * expr.c (expr_build_uconstant): New function. - (expr_build_unary,expr_build_binary): New functions. - -Wed Mar 25 13:10:42 1998 Bruno Haible - - * gasp.c (IS*): Cast argument to unsigned char, not unsigned int. - * macro.c (macro_expand_body): Increase buffer size. - * messages.c (as_warn): Likewise. - (as_warn_where, as_bad, as_bad_where): Likewise. - -Wed Mar 25 12:59:07 1998 Ian Lance Taylor - - Based on patch from H.J. Lu : - * Makefile.am (DISTSTUFF): New variable. - (diststuff): New target. - * Makefile.in: Rebuild. - -Tue Mar 24 16:51:29 1998 Nick Clifton - - * config/tc-m32r.h (md_cleanup, md_elf_section_change_hook): Call - m32r_elf_section_change_hook. - - * config/tc-m32r.c (m32r_elf_section_change_hook): New function to - emit a nop if a section ends with a 16 bit instruction. - -Tue Mar 24 19:48:09 1998 Ian Lance Taylor - - * config/obj-coff.c (obj_coff_bss): Compile unconditionally. Call - s_lcomm rather than obj_coff_lcomm. - (obj_pseudo_table): Compile .bss pseudo-op unconditionally. - -Tue Mar 24 18:30:58 1998 H.J. Lu - - * config/tc-i386.h (LinearAddress): Define. - * config/tc-i386.c (md_assemble): If LinearAddress is set for the - instruction, don't use a default segment. - -Mon Mar 23 18:53:40 1998 Joel Sherrill - - * configure.in: (sh*-*-rtems*): Switched from ELF to COFF. - * configure: Rebuild. - -Fri Mar 20 19:15:44 1998 Ian Lance Taylor - - * aclocal.m4, configure: Rebuild with libtool 1.2. - -Thu Mar 19 16:03:12 1998 Nick Clifton - - * config/tc-arm.c (md_apply_fix3): fix code to test the range of - PC relative branches. Patch courtesy of Jonathan Walton. - - -Wed Mar 18 09:29:51 1998 Nick Clifton - - * configure.in (emulations): Add thumb-pe target. - - * configure (emulations): Add thumb-pe target. - -1998-03-17 Ken Raeburn - - * itbl-lex.l (yywrap): Don't define if already defined as a - macro. - -Fri Mar 13 16:31:38 1998 Tom Tromey - - * depend.c (quote_string_for_make): New function. - (wrap_output): Use it. - -Thu Mar 12 18:28:22 1998 Nick Clifton - - * config/obj-elf.c (obj_elf_section): Set bss flag in seg_info - structure if type is SHT_NOBITS. [Bug fix courtesy of rth] - -Sat Feb 28 17:28:55 1998 Richard Henderson - - * config/tc-alpha.c (md_shortopts, md_longopts, md_parse_option): - Recognize -GN and -relax. - (md_begin): Initialize gp size from -G switch. - (alpha_force_relocation): Always force if -relax. - (alpha_align): Take a new argument that will specify when to - emit an R_ALPHA_ALIGN relocation (though we don't do that now). - Change all callers. Emit nop alignment padding as nop+unop pair. - -Sat Feb 28 17:06:22 1998 Richard Henderson - - * config/obj-elf.c [TC_ALPHA]: Include . - * config/tc-alpha.h (ELF_TC_SPECIAL_SECTIONS): New. - -Thu Feb 26 15:49:04 1998 Michael Meissner - - * config/tc-d30v.c (write_2_short): Delayed jsr instructions don't - require padding to the next long word boundary. - -Mon Feb 23 11:29:06 1998 Doug Evans - - * cgen.c: #include symcat.h. - * config/tc-m32r.c: Likewise. - -Mon Feb 23 10:27:40 1998 Jeffrey A Law (law@cygnus.com) - - * config/tc-mips.c (mips_ip, case 'P'): Make 'P' arguments be - absolute expressions instead of '$' prefixed register names. - -Sat Feb 21 22:36:52 1998 Richard Henderson - - * read.c (s_set): Record file and line info for symbols when -as. - (pseudo_set): Don't overwrite that dummy fragment. - -Fri Feb 20 15:03:13 1998 Ian Lance Taylor - - * config/tc-ppc.c (md_pseudo_table): Add "section". - (ppc_named_section): New static function. - -Thu Feb 19 22:25:42 1998 Richard Henderson - - * 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 - - * config/tc-d30v.c (parallel_ok): For the explicitly parallel - case, allow the parallel instructions to modify the same flag - bits. - -Thu Feb 19 16:08:15 1998 Richard Henderson - - * listing.c (list_symbol_table): Categorize symbols by - undefined_section rather than sy_frag->line == NULL. - -Wed Feb 18 23:39:46 1998 Richard Henderson - - * Makefile.am (install-exec-local): Install properly when ln - fails or tooldir == prefix. - -Tue Feb 17 18:58:51 1998 Doug Evans - - * cgen.c (cgen_md_apply_fix3): Delete call to validate_operand. - Test result of insert_operand for error. - -Fri Feb 13 16:41:42 1998 Ian Lance Taylor - - * Makefile.am (AUTOMAKE_OPTIONS): Add cygnus. - * configure, Makefile.in, aclocal.m4: Rebuild with automake 1.2e. - * doc/Makefile.am (AUTOMAKE_OPTIONS): Define. - * doc/Makefile.in: Rebuild. - -Fri Feb 13 00:47:44 1998 Ian Lance Taylor - - * config/tc-mips.c (macro_build): Handle operand type 'C'. - (macro): Fix handling of M_COP[0-3]. - -Thu Feb 12 14:06:59 1998 Ian Lance Taylor - - Based on patches from Ross Harvey : - * macro.c (ISSEP): Only treat '<' and '>' as separator characters - if macro_alternate or macro_mri. - (getstring): Remove support for byte constants between < and >. - (get_any_string): '<' only starts a string if macro_alternate or - macro_mri. - (macro_expand_body): Permit keyword parameters following - positional parameters. - - NetBSD patches from Gordon W. Ross : - * configure.in (alpha*-*-netbsd*): New target. - * config/te-nbsd.h (LOCAL_LABELS_FB): Define. - * configure: Rebuild. - - * as.h (flag_warn_suppress_instructionswap): Move from here... - * config/tc-d10v.c (flag_warn_suppress_instructionswap): ...to - here, and make static. - - * ehopt.c (eh_frame_code_alignment): Only use seg_info if - BFD_ASSEMBLER or MANY_SEGMENTS. - - * as.c (show_usage): Update bug-gnu-utils address. - * gasp.c (show_usage): Likewise. - * doc/as.texinfo (Bug Reporting): Likewise. - -Wed Feb 11 23:26:28 1998 Jeffrey A Law (law@cygnus.com) - - * config/tc-mips.c (load_address): Don't use mips III or mips IV - insns regardless of the size of a pointer if we're in mips I or - MIPS II mode. - (macro, macro2, s_cprestore, s_cpadd): Likewise. - -Thu Feb 12 03:41:00 1998 J"orn Rennecke - -Fix rac to accept only a0: - * tc-d10v.c (parallel_ok, find_opcode): - Split OPERAND_ACC into OPERAND_ACC0 and OPERAND_ACC1. - Introduce OPERAND_GPR. - -Wed Feb 11 16:28:13 1998 Richard Henderson - - * read.c (s_fill): Handle non-constant repeat counts by creating - an rs_space fragment. - -Tue Feb 10 18:31:31 1998 Ian Lance Taylor - - * config/tc-i386.c (i386_operand): Change error added Jan 2 1998 - from as_bad to as_warn. - -Tue Feb 10 18:04:00 1998 Jim Lemke - - * as.c: (perform_an_assembly_pass): Use [TEXT|DATA|BSS]_SECTION_NAME - * as.h: Define default values of [TEXT|DATA|BSS]_SECTION_NAME - * config/obj-elf.c (elf_begin): Use [TEXT|DATA|BSS]_SECTION_NAME - -Tue Feb 10 17:58:18 1998 Ian Lance Taylor - - * ehopt.c (eh_frame_code_alignment): If not BFD_ASSEMBLER, use - seg_fix_rotP rather than fix_root from seg_info. - -Tue Feb 10 15:32:22 1998 Ian Carmichael - - * expr.c: Add support for 0x1_2_3_4 bignums. - -Tue Feb 10 14:43:40 1998 Ian Lance Taylor - - * configure.in: Change -linux* to -linux-gnu*. - * configure: Rebuild. - - * app.c (do_scrub_begin): Treat \r as whitespace. - -Mon Feb 9 14:16:11 1998 Ian Lance Taylor - - * Makefile.am: Update dependencies. - * Makefile.in: Rebuild. - -Sat Feb 7 15:33:51 1998 Ian Lance Taylor - - * configure, aclocal.m4: Rebuild with new libtool. - -Fri Feb 6 16:08:30 1998 Jeffrey A Law (law@cygnus.com) - - * config/tc-mips.c (md_begin): If mips_cpu is set, then use it as - the argument to bfd_set_arch_mach. - (load_address): Use bfd_arch_bits_per_address to determine the - bit size of an address instead of looking at the isa level. - (macro, macro2, s_cprestore, s_cpadd): Likewise. - -Fri Feb 6 14:44:34 1998 Nick Clifton - - * config/tc-v850.c (md_parse_option): Add -mv850any command line option. - -Thu Feb 5 12:39:08 1998 Ian Lance Taylor - - * ehopt.c: New file. - * as.h (enum _relax_state): Add rs_cfa. - (check_eh_frame, eh_frame_estimate_size_before_relax): Declare. - (eh_frame_relax_frag, eh_frame_convert_frag): Declare. - * read.c (emit_expr): Call check_eh_frame. - * write.c (cvt_frag_to_fill): Handle rs_cfa. - (relax_segment): Likewise. - * Makefile.am: Rebuild dependencies. - (GAS_CFILES): Add ehopt.c. - (GENERIC_OBJS): Add ehopt.o. - * doc/internals.texi (Frags): Document rs_cfa. - - * as.c (show_usage): Mention --traditional-format. - (parse_args): Accept --traditional-format. - * as.h (flag_traditional_format): Declare. - * output-file.c (output_file_create): If flag_traditional_format, - set BFD_TRADITIONAL_FORMAT on stdoutput. - * doc/as.texinfo, doc/as.1: Document --traditional-format. - - * config/tc-mips.c (append_insn): Make sure that if we have a - fixup for an unmatched %hi reloc, it does not associated with a - variant frag. - - * configure, Makefile.in, aclocal.m4: Rebuild with new libtool. - * doc/Makefile.in: Likewise. - -Wed Feb 4 15:41:54 1998 Nick Clifton - - * config/tc-m32r.c (check_for_side_effects): New function. - (can_make_parallel): Add checks for instruction side effects - clashing with the other instruction. - (assemble_parallel_insn): Improve warning messages. Return error - message from non-swapped instruction order. - -Wed Feb 4 20:00:26 1998 James G. Smith - - * config/tc-arm.c: Rename arm_after_pass_hook() to arm_cleanup(). - - * config/tc-arm.h: Replace md_after_pass_hook definition with a - md_cleanup definition. This moves the forced literal output to - the end of the source pass, and avoids macro's inserting literals - into the code immediately after the macro expansion. - -Wed Feb 4 13:17:19 1998 Ian Lance Taylor - - * config/tc-sparc.h (tc_fix_adjustable) [OBJ_ELF]: A reloc against - a gas internal symbol is adjustable. - * config/tc-ppc.h (tc_fix_adjustable): Likewise. - - * as.h: If gcc version greater than 2.6, use `__format__' and - `__printf__' in function attributes, rather than `format' and - `printf'. - -Mon Feb 2 18:38:18 1998 Ian Lance Taylor - - * config/tc-sparc.c: Only include elf/sparc.h if OBJ_ELF. - -Mon Feb 2 18:30:34 1998 Steve Haworth - - Add tms320c30 support: - * config/tc-tic30.h: New file. - * config/tc-tic30.c: New file. - * config/obj-coff.h: If TC_TIC30, include coff/tic30.h and define - TARGET_FORMAT as "coff-tic30". - * configure.in (tic30-*-*aout*, tic30-*-*coff*): New targets. - * Makefile.am: Rebuild dependencies. - (CPU_TYPES): Add tic30. - (CPU_OBJ_VALID): tic30-aout is valid. - (TARGET_CPU_CFILES): Add config/tc-tic30.c. - (TARGET_CPU_HFILES): Add config/tc-tic30.h. - * configure, Makefile.in: Rebuild. - -Mon Feb 2 10:20:37 1998 Nick Clifton - - * config/tc-v850.c (md_assemble): Improvements to error messages. - -Mon Feb 2 12:39:05 1998 Geoff Keating - - * config/tc-ppc.c (md_apply_fix3): Change BFD_RELOC_HI16 and - BFD_RELOC_HI16_S to store the high bits of any value. - - * config/tc-ppc.h (tc_fix_adjustable): Undo change of Fri Jun 27. - (TC_RELOC_RTSYM_LOC_FIXUP): Don't let the - assembler calculate relocations to any external symbol at all. - * config/tc-ppc.c (md_apply_fix3) [OBJ_ELF]: Correct bugs - involving generation of pc-relative relocs. - (md_pcrel_from_section) [OBJ_ELF]: The job this code used to do - has been moved to md_apply_fix3. - - * config/tc-ppc.c (md_apply_fix3): Fix test for too-far branch. - (ppc_elf_suffix): Warn about 'identifier+constant@got' syntax, - which actually means (the address of identifier's GOT entry) + - constant, which is not particularly useful. - -Fri Jan 30 11:02:35 1998 Doug Evans - - * read.h (include_dirs): Declare. - (include_dir_count,include_dir_maxlen): Declare. - -Fri Jan 30 11:47:02 1998 Ian Lance Taylor - - * configure.in: Correct check for shared opcodes library. - * configure: Rebuild. - - * listing.c (buffer_line): If we can't open the file, set at_end. - (listing_print): Remove unused local variable fi. - - * config/m68k-parse.y (reglistpair): Handle register list in - either order. - - * config/vms-conf.h: Don't undef VERSION. - -Thu Jan 29 14:42:44 1998 Pat Rankin - - * Makefile.am (CONFIG_OBJS): New variable, containing part of old - OBJS variable. - (GENERIC_OBJS): New variable, with the rest of the old OBJS - variable. - (OBJS): Now just $(CONFIG_OBJS) and $(GENERIC_OBJS). - ($(srcdir)/make-gas.com): Rename from make-gas.com. - (stamp-mk.com): Replace $(OBJS) with $(GENERIC_OBJS). - (EXTRA_DIST): Define. - * vmsconf.sh: Handle {targ-cpu, obj-format, atof-targ} modules - explicitly rather than via the list of object files. - (gcc-as.opt): New file created when make-gas.com is run. - * config-gas.com: Create {targ-cpu.h, obj-format.h, targ-env.h, - itbl-cpu.h} to #include appropriate file rather than copying that - file. - * config/vms-conf.h: Synchronize with current config.in. - * Makefile.in: Rebuild. - -Thu Jan 29 18:48:19 1998 Bill Moyer - - * config/tc-d30v.c (do_assemble): Added flag_explicitly_parallel. - (parallel_ok): Relaxed parallel subinstruction dependency check. - -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" - command line argument. - * tc-d10v.c (write_2_short): emit "Swapping instructions" - warning only if flag_warn_suppress_instructionswap is false. - -Wed Jan 28 16:41:19 1998 J.J. van der Heijden - - * configure.in (i386-*-mingw32*): New target. - * configure: Rebuild. - -Wed Jan 28 14:51:18 1998 Ian Lance Taylor - - * symbols.c (resolve_symbol_value): Don't set the segment if it - hasn't changed, and this is OBJ_AOUT without BFD_ASSEMBLER. - - * config/obj-aout.h (S_IS_LOCAL): Correct typo--pass argument to - S_GET_SEGMENT. - -Wed Jan 28 13:54:50 1998 Pat Rankin - - as.h (unlink): Reverse 13-Feb-97 change; use of unlink vs remove - depends upon HAVE_{UNLINK,REMOVE} values rather than host - compiler. - -Wed Jan 28 13:48:08 1998 Ian Lance Taylor - - * config/obj-coff.h (RESOLVE_SYMBOL_REDEFINITION): Define. - -Wed Jan 28 09:52:00 1998 Nick Clifton - - * config/tc-v850.c (v850_insert_operand): Display instruction when - an error is encountered. - -Tue Jan 27 13:32:01 1998 Robert Lipe - - * configure.in (i386-*-sco3.2v5*): Defaults to ELF now. - (i386-*-sco3.2v5*coff): New target. - (i386-*-sco3.2*): New target. - * configure: Rebuild. - -Tue Jan 27 11:06:52 1998 Nick Clifton - - * config/tc-v850.c: Tidy error message production. - -Tue Jan 27 12:24:32 1998 Ian Lance Taylor - - * config/tc-arm.c (md_apply_fix3): Add new variable newimm to hold - validate_immediate return value in the right type for comparisons - to FAIL. - -Tue Jan 27 06:51:59 1998 Richard Henderson - - * listing.c (MAX_BYTES): Use listing variables not constants. - (data_buffer): No longer an array, but a pointer. - (calc_hex): sizeof(data_buffer) -> MAX_BYTES. - (listing_listing): Allocate data_buffer. - -Tue Jan 27 06:38:35 1998 Richard Henderson - - * as.c (parse_args): Add --listing-lhs-width, --listing-lhs-width2, - --listing-rhs-width, --listing-cont-lines. - (show_usage): Update. - * listing.c (listing_lhs_width, listing_lhs_width_second): New vars. - (listing_lhs_cont_lines, listing_rhs_width): New vars. - (print_lines): Use the variables instead of the constants. - (listing_listing): Likewise. - * listing.h: Declare the new vars. - -Tue Jan 27 05:32:05 1998 Richard Henderson - - * as.c (parse_args): Add --keep-locals alias for -L. - Add --strip-local-absolute. - (show_usage): Update. - * as.h (flag_strip_local_absolute): New flag. - * symbols.c (S_IS_LOCAL): Use it. - * config/obj-aout.h (S_IS_LOCAL): Likewise. - * config/obj-bout.h (S_IS_LOCAL): Likewise. - * config/obj-coff.h (S_IS_LOCAL): Likewise. - -Mon Jan 26 13:07:41 1998 Nick Clifton - - * config/tc-m32r.c: Detect if explicitly parallel instructions - might have an io conflict and issue a warning message. - -Thu Jan 22 17:51:44 1998 Nick Clifton - - * cgen.c (cgen_save_fixups, cgen_restore_fixups, - cgen_swap_fixups): Functions to save, restore and swap the fixup - chain with a backup copy. - (cgen_asm_finish_insn): Returns address of constructed insn. - -Wed Jan 21 16:49:10 1998 Richard Henderson - - * listing.c (file_info_struct): Remove FILE, add POS. - (last_open_file_info, last_open_file): New; a one entry FILE* cache. - (file_info): Don't open the file. - (buffer_line): Check for the file in the last_open cache, updating - as necessary. - (print_source): Don't reference file_info->file. - (listing_listing): Likewise. - (listing_print): Close the file in the cache, if any. - -Fri Jan 16 14:51:48 1998 Ian Lance Taylor - - * read.c (dwarf_file_string): New file static variable. - (emit_expr): Look for constant sequence that leads up to a file - name in DWARF debugging output. - (stringer): Use dwarf_file_string to decide whether to accept a - string as a file name. - -Fri Jan 16 11:30:37 1998 Richard Henderson - - * 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. - -Thu Jan 15 13:46:48 1998 Richard Henderson - - * tc-h8300.c (parse_reg): Take the length of the symbol into - account when attempting to match a register name. - * tc-h8500.c (parse_reg): Likewise. - -Wed Jan 14 17:52:33 1998 Nick Clifton - - * cgen.c: Formatting changes to improve readability. - -Wed Jan 14 15:41:41 1998 Jeffrey A Law (law@cygnus.com) - - * config/tc-mips.c (macro): Rework division code to avoid unfilled - delay slot. - -Wed Jan 14 18:04:20 1998 Michael Meissner - - Based on a patch from Jim Wilson - * config/tc-d30v.c (do_assemble): Remove non-ansi default case. - (tc_gen_reloc): Handle cross section PC relative relocs - correctly. - -Wed Jan 14 15:02:19 1998 Doug Evans - - * config/tc-mips.c (mips_ip): Don't test pinfo flags if INSN_MACRO. - -Mon Jan 12 13:04:57 1998 Doug Evans - - * cgen.c: #include setjmp.h. Clean up pass over `struct foo' usage. - (expr_jmp_buf): New static local. - (cgen_parse_operand): Allow use of longjmp in parsing to handle errors. - (cgen_md_operand): New function. - * tc-m32r.c: Clean up pass over `struct foo' usage. - (md_estimate_size_before_relax): Use CGEN_INSN_MNEMONIC. - -Tue Jan 6 15:36:02 1998 Richard Henderson - - * symbols.c (S_SET_SEGMENT): Don't set the segment for section syms. - (S_IS_EXTERNAL, S_IS_LOCAL): Correct parenthetication. - -Fri Jan 2 16:08:54 1998 Ian Lance Taylor - - * config/tc-i386.c (i386_operand): Give an error if there are - unrecognized characters after an expression. - -For older changes see ChangeLog-9697 +For older changes see ChangeLog-9899 diff --git a/gnu/dist/toolchain/gas/ChangeLog-9697 b/gnu/dist/toolchain/gas/ChangeLog-9697 index dd2af8245565..7b9373339558 100644 --- a/gnu/dist/toolchain/gas/ChangeLog-9697 +++ b/gnu/dist/toolchain/gas/ChangeLog-9697 @@ -98,7 +98,6 @@ Mon Dec 15 15:20:32 1997 Nick Clifton * doc/c-m32r.texi: New file, documenting m32r specific features. - Mon Dec 15 10:32:28 1997 Jeffrey A Law (law@cygnus.com) * config/tc-mips.c (mips_ip): Correctly insert 'P' operands into diff --git a/gnu/dist/toolchain/gas/ChangeLog-9899 b/gnu/dist/toolchain/gas/ChangeLog-9899 new file mode 100644 index 000000000000..a853b883941b --- /dev/null +++ b/gnu/dist/toolchain/gas/ChangeLog-9899 @@ -0,0 +1,4854 @@ +1999-12-22 Philip Blundell + + * config/tc-arm.c (arm_s_text): If OBJ_ELF, call the appropriate + hook function when changing sections. + (arm_s_data): Likewise. + +1999-12-14 Nick Clifton + + * config/tc-arm.c (md_parse_option): Add support for -marm720 + command line switch. + +Tue Nov 30 22:59:00 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-mn10300.c (md_pseudo_table): Add ".am33" pseudo-op. + (r_registers, xr_registers): Define. + (r_register_name, xr_register_name): New functions. + (md_assemble): Handle new am33 operand types and instruction + formats. + (mn10300_insert_operand, check_operand): Likewise. + +1999-11-29 Nick Clifton + + * config/tc-arm.c (thumb_mode): Turn into a tristate variable. + (s_force_thumb): Set thumb_mode to 2. + (md_assemble): Do not complain about thumb instructions on a + non-thumb target if thumb_mode is set to 2. + +1999-11-28 Michael Meissner + + * config/tc-alpha.c (toplevel): Include struc-symbol.h. + (alpha_macro_arg): Add MACRO_{LITERAL,BASE,BYTOFF,JSR} cases. + (O_...): Add new machine dependent expressions if we are handling + explicit relocations. + (alpha_reloc_op): New static table holding the explicit relocation + information. + (alpha_literal_hash): New static to hold the hash table for + explicit relocations. + (alpha_macros): Add support for explicit relocations. + (md_begin): If explicit relocations, initialize hash table. + (md_assemble): Don't print a second error if tokenize_arguments + already printed an error message. + (md_apply_fix): Add support for explicit relocations. + (alpha_force_relocation): Ditto. + (alpha_fix_adjustable): Ditto. + (alpha_adjust_symtab): New function to support explicit + relocations. + (alpha_adjust_symtab_relocs): Ditto. + (debug_exp): Debug stub compiled if DEBUG_ALPHA is defined. + (tokenize_arguments): Add debug code if DEBUG_ALPHA is defined. + Add support for explicit relocations. Return -2 if an error + message was already printed. + (find_macro_match): Add support for explicit relocations. Comment + each of the cases. + (emit_insn): Add support for explicit relocations. + (assemble_tokens): Ditto. + (emit_ldgp): Ditto. + (load_expression): Ditto. + (emit_lda): Ditto. + (emit_ldah): Ditto. + (emit_ir_load): Ditto. + (emit_loadstore): Ditto. + (emit_ldXu): Ditto. + (emit_ldil): Ditto. + (emit_sextX): Ditto. + (emit_division): Ditto. + (emit_jsrjmp): Ditto. + (emit_retjcr): Ditto. + + * config/tc-alpha.h (RELOC_OP_P): Enable explicit relocations if + ELF object format. + (tc_adjust_symtab): If explicit relocations, call the function + alpha_adjust_symtab. + (TC_FIX_TYPE): Add fields to be able to move explicit lituse + relocations next to the literal relocation they reference. + (TC_INIT_FIX_DATA): Initialize the new fields. + (TC_FIX_DATA_PRINT): Print the new fields if DEBUG5 is defined. + +Wed Nov 24 20:27:58 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (pa_ip): Handle PA2.0 unit completers. Handle + 'B' operand for PA2.0 bb instruction. + +1999-11-18 Nick Clifton + + * config/tc-mcore.h (TC_FORCE_RELOCATION): Define for Mcore-pe + target. + + * config/tc-mcore.c (tc_gen_reloc): Support generation of RVA + relocs. + (mcore_force_relocation): Force relocations to be generated for + RVA relocs. + +1999-11-16 Alan Modra + + * config/tc-i386.c (i386_immediate): Disallow O_big immediates. + (i386_displacement): Disallow O_big displacements. + +Mon Nov 15 20:12:43 1999 Donald Lindsay + + * config/tc-arm.c (do_mia,do_mar,do_mra,do_pld,do_ldrl,do_co_reg): + Small improvements in error checking. + (md_assemble): Support for unconditional ARM instructions. + (md_parse_option): Support for -m[arm]v5e flag. + +1999-11-12 Nick Clifton + + * macro.c (buffer_and_nest): Do not check beyond the end of the + buffer. + +1999-11-11 Nick Clifton + + * macro.c (buffer_and_nest): Look for seperator after TO and + FROM tokens. + +1999-11-08 Andrew Haley + + * app.c (do_scrub_chars): When in State 10, treat backslash + characters in the same way as as symbol characters. + +1999-11-07 Richard Henderson + + * config/tc-alpha.c (alpha_align): Check, don't assert, that + the previous label was in the current section before playing + with auto-alignment. + +1999-11-06 Nick Clifton + + * config/tc-v850.c (v850_force_relocation): Force relocation + for weak symbols. + (v850_pcrel_from_selection): Do not compute a pcrel offset if + the symbol is weak. + +1999-11-05 Michael Meissner + + * expr.h (operatorT): Increase machine dependent operators to 16. + * expr.c (op_rank): Ditto. + +1999-11-03 Ian Lance Taylor + + * read.c (pseudo_set): Reject attempts to set the value of a + section symbol. + + * config/obj-elf.c (obj_elf_ident): Call md_flush_pending_output + if it is defined. + + * config/obj-elf.c (elf_set_index): Add ATTRIBUTE_UNUSED. + + * config/obj-elf.c (elf_frob_file_after_relocs): Don't pass NULL + to bfd_set_section_contents. + +1999-11-03 Nick Clifton + + * config/tc-mcore.h (TARGET_BYTES_BIG_ENDIAN): Change to false. + +1999-11-01 Gavin Romig-Koch + + * config/tc-mips.c (macro_build): Use OPCODE_IS_MEMBER. + (mips_ip): Use OPCODE_IS_MEMBER. + +Wed Oct 27 16:50:44 1999 Don Lindsay + + * config/tc-arm.c (reg_required_here): Improve comments. + + * config/tc-arm.c (thumb_opcode): Add "variants" field. + (tinsns): Initialize variants field. + + * config/tc-arm.c (bad_args, bad_pc): Renamed to BAD_ARGS and + BAD_PC respectively. + +1999-10-27 Scott Bambrough + + * config/tc-arm.c (reloc_map[]): Fix compiler warning. + * config/tc-arm.h: Fix compile time warnings. + +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). + +1999-10-21 Gavin Romig-Koch + + * config/tc-mips.c (ISA_HAS_COPROC_DELAYS) : New. + (ISA_HAS_64_BIT_REGS) New. + (gpr_interlocks,md_begin,reg_needs_delay,append_insn, + mips_emit_delays,macro_build,load_register,load_addresss, + macro,macro2,mips_ip,s_cprestore,s_cpadd): Simplify + and/or use new ISA_xxx macros in expressions involving + ISA, particularly mips_opts.isa. + +1999-10-18 Michael Meissner + + * expr.h (operatorT): Add machine dependent operators md1..md8. + (expressionS): Make X_op 8 bits instead of 7. Add a X_md field + for the machine dependent operators to use. + + * expr.c (op_rank): Add machine dependent operators. + + * config/tc-alpha.c (O_pregister): Define as a machine dependent + operator. + (O_cpregister): Ditto. + (md_begin): Change X_op test that field is wide enough to use + O_max instead of O_alpha_max. + (cpu_types): Fill in missing initializer. + (alpha_num_macros): Make unsigned. + (md_assemble): Make opnamelen be size_t. + (md_apply_fix): Cast alpha_num_operands to int before testing. + (alpha_force_relocation): Ditto. + (alpha_fix_adjustable): Ditto. + (alpha_fix_adjustable): Mark unused arguments ATTRIBUTE_UNUSED. + (tc_gen_reloc): Ditto. + (tc_get_register): Ditto. + (emit_ldgp): Ditto. + (emit_lda): Ditto. + (emit_ldah): Ditto. + (emit_ldil): Ditto. + (s_alpha_ent): Ditto. + (s_alpha_end): Ditto. + (s_alpha_frame): Ditto. + (s_alpha_prologue): Ditto. + (s_alpha_file): Ditto. + (s_alpha_gprel32): Ditto. + (s_alpha_proc): Ditto. + (s_alpha_set): Ditto. + (s_alpha_base): Ditto. + (s_alpha_align): Ditto. + (s_alpha_arch): Ditto. + (alpha_align): Ditto. + (assemble_insn): Suppress unused variable warning. + (emit_insn): Ditto. + (assemble_insn): Don't assume X_op and X_unsigned are in a given + order in the structure. + (s_alpha_coff_wrapper): Avoid int/unsigned comparison. + +Sun Oct 17 17:15:58 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (md_apply_fix): Make "fmt" an int. + +1999-10-12 Alan Modra + + * config/tc-i386.c (i386_index_check): Correct #endif location. + +Mon Oct 11 14:02:40 1999 Geoffrey Keating + + * as.c (show_usage): Document new options. + (parse_args): Add --no-warn, --warn, --fatal-warnings, + which become 'W', OPTION_WARN, and OPTION_WARN_FATAL. + (parse_args): Parse the new options. + (main): If there were warnings, and --fatal-warnings + was specified, print an error. + * as.h: New variable, flag_fatal_warnings, for new option. + +Sun Oct 10 01:47:23 1999 Jerry Quinn + + * config/tc-hppa.c (pa_ip): Add new codes 'cc', 'cd', 'cC', 'co', + '@'. Change autoincrement completers to fall through to cache control + completers. + + * config/tc-hppa.c (pa_ip): Remove unused args. Add code to '?W' + arg. + (pa_parse_addb_64_cmpltr): New function. + + * config/tc-hppa.c (pa_ip): Change error message. + (pa_ip,pa_parse_cmpb_64_cmpltr,pa_parse_cmpib_64_cmpltr) Fix '?N' and + '?Q' args to allow falling through. + + * config/tc-hppa.c (pa_ip): Implement conditional codes "?N", "?Q". + Remove unused conditional codes. + (pa_parse_cmpb_64_cmpltr,pa_parse_cmpib_64_cmpltr): New. + +Thu Oct 7 00:23:53 MDT 1999 Diego Novillo + + * config/tc-d30v.c (CHAR_BIT): Define. + (check_range): Fix bit operations to support integers bigger than + 32 bits. + +Thu Oct 7 00:11:50 MDT 1999 Diego Novillo + + * config/tc-d10v.c (check_range): Check range for RESTRICTED_NUM3 + operands. + +Mon Oct 4 17:24:23 1999 Nick Clifton + Doug Evans + + Add support for m32rx. + * config/tc-m32r.c (enable_m32rx): New static global. + (enable_special,warn_explicit_parallel_conflicts,optimize): Ditto. + (allow_m32rx): New function. + (M32R_SHORTOPTS): Add `O'. + (md_longopts): Add --m32rx plus several warning options. + (md_parse_option): Handle new options. + (md_show_usage): Print them. + (md_begin): Enable m32rx. + (OPERAND_IS_COND_BIT): New macro. + (first_writes_to_seconds_operands): New function. + (writes_to_pc,can_make_parallel,make_parallel): New functions. + (target_make_parallel,assemble_two_insns): New functions. + (md_assemble): Recognize "insn1 -> insn2" and "insn1 || insn2". + If optimizing and m32rx, try to make consecutive insns parallel. + +Tue Sep 28 14:06:44 1999 Geoffrey Keating + + * config/tc-mips.c (nopic_need_relax): Allow for the + .sdata.foo sections generated by -fdata-sections, + and for the .gnu.linkonce.s sections generated by C++. + +Thu Sep 23 07:13:45 1999 Jerry Quinn + + * config/tc-hppa.c (pa_ip): Replace 'B', 'M', 'l' and 'g' handling + with cleaner code using completer prefixes. Add 'Y'. + + * config/tc-hppa.c (pa_ip): Add parens to silence compiler. + +Wed Sep 22 09:37:19 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (pa_ip): Avoid ANSI specific initialization. + (pa_ip, case 'm'): Failure to get a CBIT specifier just means the + insn does not match and we should try the next insn in the table. + +1999-09-22 Nick Clifton + + * config/tc-arm.c (MULTI_SET_PSR): Rename to LDM_TYPE_2_OR_3. + +Mon Sep 20 04:01:41 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (pa_ip): Fix thinkos in recent cleanup + of PA2.0 support. + +1999-09-19 Alexandre Oliva + + * config/tc-i386.c (md_shortopts): Check OBJ_MAYBE_ELF as well as + OBJ_ELF. If ELF, add "sq". + (md_parse_option): If ELF, ignore -s and -q. + (md_show_usage): Mention ELF options. + +Sun Sep 19 10:43:31 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (pa_ip): Handle 'J', 'K' and 'cc' + operands. + + * config/tc-hppa.c (pa_ip): Handle "fe", and 'cJ'. + + * config/tc-hppa.c (pa_ip): Handle 'd', '#' and 'cq'. + + * config/tc-hppa.c (struct pa_it): New field "trunc". + (pa_ip): Handle 'h', 'm', '=', '{', and '_' operands. + (pa_parse_ftest_gfx_completer): New function + (pa_parse_fp_cnv_format): New function. + + * config/tc-hppa.c (pa_ip): Handle 'X' operand. + (md_apply_fix): Handle 22bit pc-rel branches. + + * config/tc-hppa.c (pa_ip): Handle 'B' operand. + + * config/tc-hppa.c (pa_ip): Handle 'L' and 'M' operands. + + * config/tc-hppa.c (pa_ip): Handle 'l' operand. + + * config/tc-hppa.c (pa_ip): Handle 'g' operand. + +Sat Sep 18 12:13:28 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (md_assemble): Fix dwarf2 line handling. + (pa_ip): Handle 'fX'. + +Fri Sep 17 11:57:34 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (pa_build_unwind_subspace): Do not build + unwinds unless the function is in the text space. + (pa_type_args): Set BSF_FUNCTION for an exproted data symbol. + +Wed Sep 15 05:14:32 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (pa_ip): Move dwarf2 stuff from here. + (md_assemble): To here. Tweak address generation. + + * config/tc-hppa.c: Include dwarf2dbg.h if OBJ_ELF. Declare + debug_line. + (md_pseudo_table): Add .file and .line pseudo-ops for OBJ_ELF. + (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. + +1999-09-14 Michael Meissner + + * configure.in (Canonicalization of target names): Remove adding + ${CONFIG_SHELL} in front of $ac_config_sub, since autoconfig 2.14 + generates $ac_config_sub with a ${CONFIG_SHELL} already. + * configure: Regenerate. + +1999-09-14 Donn Terry + + * config/te-interix.h (GLOBAL_OFFSET_TABLE_NAME): Define. + +1999-09-13 Alan Modra + + * config/tc-i386.c (md_assemble): Handle "jmp/call constant" as a + pc-relative jmp/call to an absolute symbol. + (md_apply_fix3): When OBJ_ELF, don't add the values in twice for + absolute section symbols. + + * config/tc-i386.c (md_assemble): Correct frag_var size. Tidy + jump handling code and comments. + +1999-09-12 Ian Lance Taylor + + * config/tc-i386.c (md_apply_fix3): Add horrible adjustments to + the value if TE_PE and a global defined symbol. + +1999-09-11 Ian Lance Taylor + + * write.c (dump_section_relocs): Call print_symbol_value_1 to + print the symbol, rather than printing it here. + +1999-09-11 Donn Terry + + * config/tc-i386.c (tc_i386_fix_adjustable): Don't adjust + BFD_RELOC_RVA relocations. + + * config/tc-i386.c (md_undefined_symbol): Compare the name against + the macro GLOBAL_OFFSET_TABLE_NAME, rather than assuming that it + starts with "_G". + + * write.c (write_relocs): Call SET_SECTION_RELOCS if it is + defined. + * config/obj-coff.h (SET_SECTION_RELOCS): Define. + * doc/internals.texi (Object format backend): Document + SET_SECTION_RELOCS. + + * config/tc-i386.c (tc_i386_fix_adjustable): Don't adjust + relocations against global symbols if TE_PE. + + * config/obj-coff.c (obj_coff_ident): Add BFD_ASSEMBLER version. + (obj_pseudo_table): Always handle ".ident" with obj-coff_ident. + + * config/obj-coff.c (coff_frob_symbol): Prohibit weak common + symbols. + + * config/obj-coff.c (obj_coff_endef): Don't merge labels, or + symbols which do not have a constant value, or tags with + non-tags. Remove the symbol from the list before adding it at the + end. + + * config/obj-coff.c (obj_coff_endef) [BFD_ASSEMBLER]: Handle .ef + C_FCN symbol differently if TE_PE. + (obj_coff_line) [BFD_ASSEMBLER]: Always use the line number which + appears in the pseudo-op, rather coff_line_base which is only set + for a .bf symbol. + + * config/obj-coff.c (obj_coff_loc): New static function. + (obj_pseudo_table): Add "loc". + + * config/obj-coff.c (add_lineno): Check that the line number is + positive. + + * config/atof-ieee.c (atof_ieee): Change what_kind to int. + * config/atof-vax.c (flonum_gen2vax): Change format_letter to + int. + (md_atof): Return NULL rather than 0. + * config/tc-i386.c (md_atof): Change type to int. + * expr.c (expr): Change first parameter to int. + * config/obj-coff.c: Add declarations for static functions. + (coff_frob_symbol): Use SYM_AUXENT. + * config/tc-i386.h (flag_16bit_code): Don't declare. + + * config/obj-coff.c (obj_coff_section): Default to setting + SEC_LOAD. Don't set SEC_DATA for 'w' modifier. + + * write.c (adjust_reloc_syms): Print adjusted fixup. + + * expr.c (integer_constant): Correct too_many_digits calculation + in base 10 case. + +1999-09-09 Andreas Schwab + + * doc/c-arm.texi: Fix arguments of @var to not contain + punctuation. + +1999-09-08 Philip Blundell + + * config/tc-arm.c (s_thumb_set): Only support interworking for ELF + and COFF targets. + (md_parse_option): Only support -k flag for ELF and COFF targets. + +Tue Sep 7 13:28:59 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (pa_ip): Put strict register checks before + call to pa_parse_number. + + * config/tc-hppa.c (pa_ip): Support 'Z' argument. + +1999-09-06 Ian Lance Taylor + + * config/obj-coff.c: Add ATTRIBUTE_UNUSED as needed for + BFD_ASSEMBLER code. + +1999-09-06 Donn Terry + + * as.c (perform_an_assembly_pass): Set SEC_DATA for data_section. + +Mon Sep 6 04:26:56 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (pa_ip): Get strict/non-strict mode from the + candidate instruction. Require registers for register arguments + when in strict mode. Require assemble-time constants for + constants when in strict mode. + (pa_get_absolute_expression): Require a constant when in strict + mode. + +1999-09-06 Nick Clifton + + * config/tc-m32r.c (md_longopts): Fix value for -Wnuh. + +1999-09-04 Steve Chamberlain + + * config/tc-pj.c: New file, supports picoJava in ELF. + * config/tc-pj.h: Ditto. + * configure.in (pjl*, pj*): New targets. + * Makefile.am: Rebuild dependencies. + (CPU_TYPES): Add pj. + (TARGET_CPU_CFILES): Add config/tc-pj.c. + (TARGET_CPU_HFILES): Add config/tc-pj.h. + * doc/c-pj.texi: New file. + * doc/as.texinfo: Add some PJ specifics. + * doc/all.texi: Add PJ to the list of all architectures, sort them + all alphabetically. + * doc/Makefile.in (CPU_DOCS): Add c-pj.texi. + * configure, Makefile.in, doc/Makefile.in: Rebuild. + +1999-09-02 Alan Modra + + * config/obj-multi.h: Include obj-elf.h if OBJ_MAYBE_ELF. Reformat. + (obj_frob_file): Test for null pointer. + (OBJ_COPY_SYMBOL_ATTRIBUTES): Here too. + (OBJ_PROCESS_STAB): And here. + (elf_obj_sy): Remove + + * config/obj-elf.h: #ifndef everything defined in obj-multi.h, + except OBJ_PROCESS_STAB, which we #undef for ecoff. + (elf_obj_sy): Remove #ifndef OBJ_SYMFIELD_TYPE. + + * config/obj-coff.c (no_func): Remove. + (coff_format_ops): Change occurrences of no_func to 0, as we test + for 0 in obj-multi.h. + + * configure.in: Enable bfd for i386-coff when primary target is + bfd. Enable i386 elf,coff emulation support. Don't set + USE_EMULATIONS=1 or te_file=multi unless there is more than one + emulation to support. + *configure: Regenerate. + +1999-09-02 Nick Clifton + + * config/tc-mcore.c (mcore_s_section): Do not dump literals if a + .section .line directive is encountered. + +1999-09-01 Nick Clifton + + * config/tc-arm.c (md_section_align): Do not align sections in ELF + format. + + * as.c (show_usage): Add --gdwarf2 to list of options displayed. + * as.texinfo: Document --gdwarf2 command line option. + Add additional documentation of ARM command line switches. + +1999-08-30 Alan Modra + + * config/tc-i386.c (i386_intel_memory_operand): Combine + i386_is_reg and parse_register calls. Remove END_STRING_AND_SAVE + and RESTORE_END_STRING around parse_register calls. + (i386_operand): Here too. + (i386_is_reg): Remove. + (parse_register): Move as_bad calls from within this function to + callers. + +1999-08-29 Alan Modra + + Based on a patch from H.J. Lu + * config/tc-i386.c (parse_register): Handle FP regs specially. + (md_begin): Remove '(' and ')' from register_chars. + +1999-08-29 Doug Evans + + * config/tc-m32r.c (md_parse_option): Delete unrecognized option + error message (done elsewhere). + +Sat Aug 28 01:23:11 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (pa_ip): Do not allow '*' in 32bit completers. + +Sat Aug 28 00:26:26 1999 Jerry Quinn + + * config/tc-hppa.c (pa_ip): Replace 'f' by 'v'. Prefix float register + args by 'f'. + + * config/tc-hppa.c (pa_ip): Add args q, %, and |. + + * config/tc-hppa.c (pa_ip): Absorb white space in instructions + between args. + Add new completers. Fix bug in 64 bit condition handling. + + * config/tc-hppa.c (pa_ip): Add completer codes 'a', 'ch', 'cH', + 'cS', and 'c*'. + + * config/tc-hppa.c (pa_ip): Place completers behind prefix 'c'. + + * config/tc-hppa.c (pa_ip): Add cases for '.', '~'. '$'. and '!' + + * config/tc-hppa.c (pa_ip): Add case for 'I'. + +1999-08-27 Jim Wilson + + * dwarf2dbg.c (MAX_SPECIAL_ADDR_DELTA): Correct typo in comment. + (struct ls): Add frag field. Initialize it to zero. + (out_end_sequence): New local text_frag. Set it while in text section. + Replace address check with frag check. Set ls.frag to text_frag if + out_set_addr called. + (dwarf2_gen_line_info): Add explanatory comment. New local saved_frag. + Set it before switching sections. Replace address check with frag + check. Set ls.frag to saved_frag if out_set_addr called. + +1999-08-26 David Mosberger + + * dwarf2dbg.c (out_end_sequence): If address changed, directly + output "advance_pc" opcode instead of calling gen_addr_line(). + The latter has the undesired side-effect of creating a new row + in the debug line info matrix. + +1999-08-26 Jim Wilson + + * dwarf2dbg.c (out_end_sequence): Correct comments. Set last to + ls.last_filename if last is less than zero. Set ls.last_filename + when allocating new entry. + (dwarf2_gen_line_info): Save seg and subseg info before subseg_new + call. + +1999-08-20 Alan Modra + + * config/tc-i386.c (i386_index_check): Fix the displacement size + when INFER_ADDR_PREFIX. + +1999-08-18 Nick Clifton + + * config/tc-arm.c (md_apply_fix3): If an offset is invalid, + display its value. + +1999-08-17 Ian Lance Taylor + + * config/tc-ppc.c (md_assemble): Trim @ha constant to 16 bits, to + handle 0xffffNNNN constants correctly. + +1999-08-16 Nick Clifton + + * config/tc-arm.c (do_ldst): Look for register conflicts on stores + as well as loads. + +1999-08-13 Nick Clifton + + * config/tc-arm.c (validate_offset_imm): Work on unsigned values. + (md_apply_fix3): Always pass positive values to + validate_offset_imm. + +1999-08-12 Nick Clifton + + * config/tc-arm.c (skip_whitespace): New macro. + Formatting tidy ups. + + (md_apply_fix3): Store relocation offset in addend for ELF based + relocs. + (arm_force_relocation): Always generate relocs for Thumb function + calls. + +1999-08-11 Alan Modra + + * config/tc-i386.c (md_assemble): Remove dead code. intel_syntax + LONG_DOUBLE_MNEM_SUFFIX floating point is done in opcode/i386.h + +Tue Aug 10 12:58:31 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (pa_build_unwind_subspace): Use sane section + flags for the unwind subspace. + + * config/tc-hppa.c (UNWIND_SECTION_NAME): Define for ELF. + (pa_build_unwind_subspace): Remove #if 0 wrapper. Select a + suitable relocation based on the size of the target's pointer. + Always Use subsegment zero for the unwinders. + (pa_level): Handle "2.0w". + +Mon Aug 9 20:02:22 1999 J"orn Rennecke + + * config/tc-d30v.c (write_2_short): Don't group repeat instructions + with the following instruction unless this was specified. + +1999-08-09 Ian Lance Taylor + + * config/tc-i386.h (SUB_SEGMENT_ALIGN): If TE_GO32, return 4 for + certain sections, to match BFD changes. + +1999-08-08 Mumit Khan + + * Makefile.am (noinst_SCRIPTS): Change .gdbinit to $(GDBINIT). + (EXTRA_SCRIPTS): Define to keep automake happy. + * Makefile.in: Rebuild. + +1999-08-08 Ian Lance Taylor + + * Makefile.am: Rename .dep* files to DEP*. + (MKDEP): Rename from DEP. Change all uses. Use $${srcdir} rather + than $(srcdir). Rename TCDEP targets to DEPTC. Rename OBJDEP + targets to DEPOBJ. + * Makefile.in: Rebuild. + +1999-08-08 Jakub Jelinek + + * config/tc-sparc.c (sparc_ip): Allow assembly of %lo()+%reg. + +1999-08-08 Ian Lance Taylor + + * Makefile.am: Change all uses of itbl-test-ops to itbl-tops to + avoid problems on DOS filesystems. + * Makefile.in: Rebuild. + + * doc/as.texinfo (Section): Document 's' flag for COFF version. + +1999-08-08 Mumit Khan + + * config/obj-coff.c (obj_coff_section): Handle 's' (shared) + section flag. + +1999-08-08 Ian Lance Taylor + + * configure.in: Define and substitute GDBINIT. Change AC_OUTPUT + line to create ${GDBINIT} rather than .gdbinit. + * configure, Makefile.in, doc/Makefile.in: Rebuild. + +Fri Aug 6 12:12:44 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (pa_ip, case '?'): Add missing break. + +Fri Aug 6 09:46:35 1999 Jerry Quinn + + * config/tc-hppa.c (pa_ip): Add 64 bit condition completers. + +1999-08-06 Jakub Jelinek + + * config/tc-sparc.h (tc_fix_adjustable): Fix check for PIC local + non-adjustable symbols. + +Thu Aug 5 16:52:51 1999 Jerry Quinn + + * config/tc-hppa.c (pa_ip): Change condition args to have '?' prefix. + +Thu Aug 5 23:05:56 1999 J"orn Rennecke + + * config/tc-sh.c (md_assemble): Call as_bad when there are excess + operands. + +1999-08-05 Donn Terry + + * config/te-interix.h: New file. + * configure.in (i386-*-interix*): New target. + * configure: Rebuild. + +Wed Aug 4 13:12:17 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (pa_chk_field_selector): Allow 3 byte + selectors for ELF too. + (selector_table): Add "ltp" and "rtp" selectors. + +1999-08-04 Alan Modra + + * config/tc-i386.c (i386_operand): No need to change + operand_string pointer in segment reg case before goto + do_memory_reference. Initialise displacement_string_start and + displacement_string_end after do_memory_reference label. + (i386_index_check): Add operand_string param, and print error + message on failure here. + (i386_intel_memory_operand): Instead of here. + (i386_operand): And here. + (INFER_ADDR_PREFIX): Enable. + + * doc/c-i386.texi (i386-16bit): Document .code16gcc. + + * config/tc-i386.h (DefaultSize): Define. Renumber following + opcode_modifier defines. + + From Etienne Lorrain + * config/tc-i386.c (stackop_size): New variable. + (set_16bit_code_flag): Clear it here. + (set_16bit_gcc_code_flag): New function. + (md_pseudo_table): Add "code16gcc" entry. + (md_assemble): Set i.suffix for insns with DefaultSize modifier. + +1999-08-03 Ian Lance Taylor + + * config/obj-coff.c (coff_frob_symbol): Always update set_end with + next_set_end even if the end symbol is being discarded. + + * gasp.c: Add ATTRIBUTE_UNUSED as needed for non-BFD_ASSEMBLER. + * output-file.c, symbols.c, config/tc-i386.c: Likewise. + * config/obj-coff.c: Likewise. + (seg_info_type): Remove. + (seg_info_off_by_4): Change to array of segT. + (s_get_segment): Adjust accordingly. + (obj_pseudo_table): Fully initialize sentinel entry. + + * config/tc-mips.c (append_insn): Correct INSN_SYNC test. From + Ralf Baechle . + +1999-08-03 Etienne Lorrain + + * config/tc-i386.c (f16_3): New. Fixes 16 bit 3 byte nop. + +1999-08-03 Alan Modra + + * config/tc-i386.c: Indentation and white space changes. + (i386_index_check): New function. Add INFER_ADDR_PREFIX code, but + don't enable it by default. + (i386_intel_operand): Remove redundant prototype. + Move check on number of memory operands, and i.mem_operands++ + (i386_intel_memory_operand): To here. + Remove i386_immediate code from here. Remove special case code + for input and output using (%dx). Remove base/index checks and + call i386_index_check instead. Save initial operand_string + argument for error message. + (i386_operand): Remove redundant prototype. Move base/index + checks to i386_index_check. + (i386_displacement): Move intel mode check for non-zero + i.disp_operand + (i386_intel_memory_operand): To here. + +1999-07-30 Jakub Jelinek + + * config/tc-sparc.c (md_longopts): Add --no-undeclared-regs option. + (sparc_ip): Warn if %g2 or %g3 register is used and not covered + by .register pseudo-op if -64 and --no-undeclared-regs. + (s_register, sparc_adjust_symtab): New functions. + * config/tc-sparc.h (tc_adjust_symtab, sparc_adjust_symtab): + Declare sparc_adjust_symtab as tc_adjust_symtab. + * doc/c-sparc.texi: Add description of #ignore special literal + for .register pseudo-op. + +1999-07-30 Catherine Moore + + * config/tc-arm.c (tc_gen_reloc): Record the vtable entry in + the relocation's section offset. + +1999-07-29 Alan Modra + + * write.c (fixup_segment): Fix generic error check overflow test. + + * config/tc-i386.c (pe): Change %d to %ld, %x to %lx, and cast + X_add_number to long. + +Wed Jul 28 02:04:24 1999 "Jerry Quinn" + + * config/tc-hppa.c (pa_ip): Add 'J' and 'K' code + processing. + +1999-07-27 Ian Lance Taylor + + * config/tc-sparc.h (tc_fix_adjustable): Don't adjust GOT, PLT, or + VTABLE relocations. + +1999-07-21 Mark Elbrecht + + * config/te-go32.h (COFF_LONG_SECTION_NAMES): Define. + + * configure.bat: Remove; obsolete. + * config/go32.cfg: Likewise. + +1999-07-21 Brad M. Garcia + + * configure.in (i386-*-vxworks*): New target. + * configure: Rebuild. + +1999-07-16 Jakub Jelinek + + * doc/c-sparc.texi: Document .register and .nword pseudo-ops. + +1999-07-16 Jakub Jelinek + + * config/tc-sparc.c (sparc_ip): Allow OLO10 relocations + on -64 and not pic. + (output_insn): Put OLO10's secondary addend into tc_fix_data. + (md_apply_fix3): Handle BFD_RELOC_SPARC_OLO10. + (tc_gen_reloc): Return two relocs for OLO10, LO10 and SPARC13. + * config/tc-sparc.h (RELOC_EXPANSION_POSSIBLE, + MAX_RELOC_EXPANSION): Define. + (TC_FIX_TYPE, TC_INIT_FIX_DATA, TC_FIX_DATA_PRINT): Likewise. + +1999-07-16 Alan Modra + + * config/tc-i386.c (intel_float_operand): Add prototype, make static. + (md_assemble): Localize *exp variable to if (fake_zero_displacement) + block. Print a warning if an 8-bit or 16-bit constant + displacement or immediate is truncated on output. + (i386_immediate): Ensure Imm16 is always legal for a 16-bit mode + immediate. + (i386_operand): Disallow immediate jump absolute operand. + +1999-07-15 Ian Lance Taylor + + * configure.in: Bump version number to 2.9.5. + * configure: Rebuild. + + * dwarf2dbg.c (dwarf2_gen_line_info): Don't assume that long long + or %llx work. + +Thu Jul 15 02:45:30 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (md_pseudo_table): Add ".dword" pseudo-op. + (cons_fix_new_hppa): Derive size of fixup from size of the object. + +1999-07-14 Philip Blundell + + * symbols.c (dollar_label_name): Prepend LOCAL_LABEL_PREFIX if it + is defined. + * config/tc-arm.h (LOCAL_LABEL_PREFIX): Define to '.' for ELF. + + * config/tc-arm.c (md_begin): Set F_SOFTFLOAT in the output file + if -mno-fpu was given. + (tc_gen_reloc): Fix typo. Delete bogus code related to GOTPC + relocs. + (cons_fix_new_arm): Remove misleading comments. + +1999-07-14 Ian Lance Taylor + + * write.c (cvt_frag_to_fill): Use frag file and line in rs_org + error message. + (relax_segment): Likewise. After giving a rs_org error, convert + the frag to rs_align to avoid cascading errors. + +1999-07-12 Andreas Schwab + + * config/tc-m68k.c: Add some ATTRIBUTE_UNUSED. + +1999-07-11 Ian Lance Taylor + + * Many files: Changes to avoid gcc warnings: Add ATTRIBUTE_UNUSED + as appropriate. Fill in structure initializations. Add variable + initializations. Add casts. + * dwarf2dbg.c (print_stats): Change i to size_t. + * listing.c (listing_listing): Change list_line to unsigned int. + +1999-07-10 Ian Lance Taylor + + * config/tc-ppc.h (tc_fix_adjustable) [OBJ_ELF]: Call S_IS_LOCAL + rather than checking for \001 and \002 in symbol name. + * config/tc-sparc.h (tc_fix_adjustable) [OBJ_ELF]: Likewise. + +Thu Jul 8 12:32:23 1999 John David Anglin + + * configure.in (hppa*-linux-gnu*): New target. + * configure: Rebuilt. + +1999-07-08 Nick Clifton + + * doc/c-arm.texi (ARM Directives): Document .thumb_set directive. + +1999-07-07 Nick Clifton + + * config/tc-v850.c (v850_comm): Use symbol_get_obj() rather than + accessing symbolP directly. + +Tue Jul 6 10:41:42 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.h (tc_frob_symbol): Always punt "$global$" symbol + for ELF. + +1999-07-05 Nick Clifton + + * config/tc-arm.c (ARM_EXT_V5): Define. + (ARM_ARCH_V5, ARM_ARCH_V5T): Define. + (md_begin): Detect ARM v5 architectures. + (md_parse_option): Accept arm v5 specification. + (md_show_usage): Documment -marmv5 switch. + + * doc/c-arm.texi: Document -marmv5 command line option. + + * config/tc-arm.c (do_adrl): New function. Implement ADRL pseudo + op. + (validate_immediate_twopart): New function. Determine if a + constant can be computed by two ADD instructions. + (output_inst): Remove its command line parameter - it was never + used. + (md_apply_fix3): Support BFD_RELOC_ARM_ADRL_IMMEDIATE, used to + implememt the ADRL pseudo op. + (tc_gen_reloc): Generate a suitable error message if an ADRL + instruction tries to generate a real reloc. + + * doc/c-arm.texi: Document NOP, ADR and ADRL pseudo ops. + +Thu Jul 1 15:33:10 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (pa_ip): Convert the opcode and all completers + into lower case. + +1999-06-27 H.J. Lu + + * subsegs.c (subseg_text_p): Use 1/0 instead of true/false for + non BFD_ASSEMBLER case. + +1999-06-26 Mumit Khan + + * config/obj-coff.c (obj_coff_section): Mark writable sections as + data. + +1999-06-26 David Mosberger + + * dwarf2dbg.c (dwarf2_gen_line_info): Don't call + out_end_sequence() when the address decreases due to a new frag. + (gen_dir_list): Set ls.file[i].dir to j + 1 (not j) because file + numbering starts with 1. + +1999-06-23 Nick Clifton + + * config/tc-mcore.c (md_pseudo_table): Add .comm for ELF and allow + .section for COFF. + (mcore_s_text): Call obj_elf_text for ELF target. + (mcore_s_data): Call obj_elf_data for ELF target. + (mcore_s_section): No longer ELF specific. Call obj_coff_section + for COFF target. + (mcore_s_bss): New function: Dump literal table before changing + sections. + (mcore_s_comm): New function: Dump literal table before changing + sections. + + * config/obj-elf.c (obj_elf_common, obj_elf_data, obj_elf_text): + No longer static functions. + * config/obj-elf.h (obj_elf_common, obj_elf_data, obj_elf_text): + Provide prototypes for these functions. + +1999-06-22 Ian Lance Taylor + + * subsegs.c (subseg_text_p): Rewrite non BFD_ASSEMBLER case to use + a list of names, to try obj_segment_name, and to try abbreviated + names when using COFF without long section names. + + * config/tc-alpha.c: More use of symbol accessor functions. + * config/tc-arc.c: Likewise. + * config/tc-d30v.c: Likewise. + * config/tc-fr30.c: Likewise. + * config/tc-i860.c: Likewise. + * config/tc-m88k.c: Likewise. + * config/tc-mcore.c: Likewise. + * config/tc-ns32k.c: Likewise. + * config/tc-sparc.c: Likewise. + * config/tc-v850.c: Likewise. + + * config/tc-arc.c (get_arc_exp_reloc_type): Change uses of + sy_value with appropriate accessor functions. + * config/tc-arm.c (md_apply_fix3): Likewise. + * config/tc-d10v.c (AT_WORD_P): Likewise. + * config/tc-v850.c (reg_name_search): Likewise. + + * config/obj-ecoff.c (obj_ecoff_set_ext): Change uses of bsym to + use symbol_get_bfdsym instead. + * config/tc-ppc.c (md_assemble): Likewise. + * config/tc-v850.c (v850_comm): Likewise. + +1999-06-22 Jonathan Larmour + + * config/tc-arc.c (tc_gen_reloc): Use symbol_get_bfdsym to get at + the symbol, rather than accessing the bsym member. + * config/tc-d10v.c (tc_gen_reloc): Likewise. + * config/tc-d30v.c (tc_gen_reloc): Likewise. + * config/tc-mcore.c (tc_gen_reloc): Likewise. + * config/tc-mn10200.c (tc_gen_reloc): Likewise. + * config/tc-mn10300.c (tc_gen_reloc): Likewise. + * config/tc-ns32k.c (tc_gen_reloc): Likewise. + * config/tc-tic30.c (tc_gen_reloc): Likewise. + * config/tc-v850.c (tc_gen_reloc): Likewise. + +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. + (hppa_gen_reloc_type): Conditionalize on BFD64. + (tc_gen_reloc): Re-enable ELF relocations. + * tc-hppa.h (TARGET_FORMAT): Handle elf64-hppa format. + +1999-06-21 Ian Lance Taylor + + * config/tc-arm.c (ldst_extend): Add parentheses to avoid + warning. + (do_ldst): Move assignment out of if condition. + (md_apply_fix3): Add casts to avoid printf format warnings. Add + parentheses to avoid warning. + +1999-06-21 Nick Clifton + + * config/tc-arm.c (arm_adjust_symtab): Use symbol_get_bfdsym() + macro to get at the BFD symbol associated with a GAS symbol. + +1999-06-19 Ian Lance Taylor + + * config/tc-ppc.c: Update for symbol handling changes. + * config/obj-coff.c: Likewise. + +Fri Jun 18 14:34:18 1999 Jeffrey A Law (law@cygnus.com) + + * 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. + (GDB_SYMBOLS_SUBSPACE_NAME): Likewise + (UNWIND_SECTION_NAME): Likewise. + (space/subspace related structures): Conditionalize definitions + on OBJ_SOM. + (space/subspace directives and support routines): Conditionalize + definitions and references/uses on OBJ_SOM. + (label_symbol_struct): For ELF, track the symbol's segment. For + SOM track its space. + (pa_define_label, pa_undefine_label, pa_get_label): Corresponding + changes. + (USE_ALIASES): Kill for both SOM & ELF. + (pa_def_subspaces, pa_def_spaces): Corresponding changes. + (pa_space, pa_subspace): Corresponding changes. + (pa_spaces_begin): Corresponding chagnes. + (md_begin): Do not muck around with space/subspace stuff for + OBJ_ELF. + (md_apply_fix): Temporarily disable argument relocation stuff + for OBJ_ELF. + (tc_gen_reloc): Temporarily disable relocation generation for + OBJ_ELF + (pa_build_unwind_subspace): Similarly. + +1999-06-16 Nick Clifton + + * config/tc-arm.c (thumb_set): New pseudo op. + (text, data, section): Override these pseudo ops with ARM + specific versions. + (s_thumb_set): New function: Perform the same as a .set pseudo + op, but also mark the alias'ed symbol as being a Thumb + function. + (arm_s_text): New function: Perform the same as the .text + pseudo op, but dump the literal pool before changing + sections. + (arm_s_data): New function: Perform the same as the .data + pseudo op, but dump the literal pool before changing + sections. + (arm_s_section): New function: Perform the same as the + .section pseudo op, but dump the literal pool before changing + sections. + (arm_cleanup): Do not reset the current section before dumping + the literal pool. + +1999-06-17 Nick Clifton + + * config/tc-m32r.c (md_longopts): Fix OPTION_WARN_UNMATCHED and + OPTION_NO_WARN_UNMATCHED entries. + (md_parse_option): Generate a warning message if an unrecognised + option is encountered. + + * config/tc-d10v.c (do_not_ignore_hash): New variable. + (get_operands): When parsing an expression after an '@' symbol + has been detected, do not ignore '#' symbols. + (md_operand): Only ignore '#' symbols if do_not_ignore_hash is + false. + +1999-06-13 Ian Lance Taylor + + From K. Richard Pixley : + * configure.in (ppc-*-vxworks*): New target. + * configure: Rebuild. + +1999-06-12 Philip Blundell + + * config/tc-arm.c (tc_gen_reloc): Fix handling of GOTPC relocs. + +1999-06-13 Ian Lance Taylor + + * write.c (adjust_reloc_syms): Rather than never reducing reloc + which refer to symbols in linkonce sections, permit reducing the + relocs if the symbol is local. + +1999-06-12 Ian Lance Taylor + + * subsegs.c (subseg_text_p): New function. + * as.h (subseg_text_p): Declare. + * read.c (do_align): Use subseg_text_p to set the default fill. + * write.c (subsegs_finish): Likewise. + * config/obj-coff.c (write_object_file): Likewise. + * config/tc-i386.h (md_maybe_text): Don't define. + (md_do_align): Use subseg_text_p to set the default fill. + * config/tc-m32r.c (m32r_do_align): Likewise. + * config/tc-sh.c (sh_do_align): Likewise. + * config/tc-sparc.h (md_do_align): Likewise. + +1999-06-12 David O'Brien + + * configure.in: (i[3456]86-*-freebsd*): Now defaults to ELF. + * configure: Rebuild. + +1999-06-12 Ian Lance Taylor + + * dwarf2dbg.c: Include elf/dwarf2.h with "", not <>. + * Makefile.am: Rebuild dependencies. + * Makefile.in: Rebuild. + + * config/tc-i386.c (i386_immediate): Remove unused label + seg_unimplemented. + + * struc-symbol.h: Put local_symbol code in ifdef BFD_ASSEMBLER. + * symbols.c: Likewise. + * config/obj-aout.c (obj_crawl_symbol_chain): Refer directly to + sy_next field when taking address, rather than symbol_next. + + * dwarf2dbg.c: Change bfd_vma to addressT and bfd_signed_vma to + offsetT. + (out_set_addr): Don't use BYTES_PER_ADDRESS. Instead, get the + value from the output file architecture. + (dwarf2_gen_line_info): Ifdef BFD_ASSEMBLER specific code. + * dwarf2dbg.h: Change bfd_vma to addressT. + +1999-06-11 Ian Lance Taylor + + * dwarf2dbg.h: Use PARAMS in function declarations. + +1999-06-11 Martin Dorey + + * write.c (fixup_segment): Don't add symbol value for i960 ELF. + * config/tc-i960.c (s_leafproc): Don't call tc_set_bal_of_cal if + OBJ_ELF. + (md_apply_fix): Simplify BFD_ASSEMBLER handling. + +1999-06-11 Ian Lance Taylor + + * config/tc-i386.c (md_apply_fix3): Add default case to switch. + + * config/tc-sparc.c (md_pseudo_table): Remove pushsection and + popsection. + + * config/tc-sparc.c (sparc_ip): Add default case to reloc switch. + + * read.c (read_a_source_file): Only declare inescape if + QUOTES_IN_INSN. + + * itbl-ops.c (itbl_disassemble): Change sprintf format strings to + match parameters. + (find_entry_byval): Add parens to avoid warning. + + * as.c: If HAVE_ITBL_CPU, include "itbl-ops.h". + + * symbols.c (resolve_symbol_value): Don't permit subtraction of + undefined symbols. + +1999-06-10 Jakub Jelinek + + * config/tc-sparc.c (sparc_ip): Don't use side-effect expression + with isoctal. + + * config/tc-sparc.c (synthetize_setuw, synthetize_setsw, + synthetize_setx): New functions. + (md_assemble): Broken the special cases into the above + functions. Make compiler happy if sizeof(bfd_vma)==4. + Fix sethi generated from set/setuw. If instructions have a relloc, + always clear the fields to be relocated in the opcode. + (sparc_ip): Remove special_case global variable. + +1999-06-10 Ian Lance Taylor + + Based on patches from John W. Woznack : + * itbl-ops.c (itbl_get_reg_val): Add pval parameter. Return + indication of success rather than a value. + (itbl_get_val): Likewise. + (itbl_get_field): Use strcspn. Change delimiters to include + parens. + * itbl-ops.h (itbl_get_reg_val): Update declaration. + (itbl_get_val): Likewise. + * config/tc-mips.c (mips_ip): Update call to itbl_get_reg_val. + + * symbols.c (copy_symbol_attributes): Convert local symbols to + regular symbols. + +1999-06-10 Nick Clifton + + * config/tc-arm.c (md_parse_option): Add support for ARM920 and + ARM920t. + +1999-06-07 Jakub Jelinek + + * config/tc-sparc.c (md_assemble): Fix up setx, support setsw. + Optimize set if sizeof(bfd_vma) == 64. + (sparc_ip): Fix sethi - without %hi() it should generate + R_SPARC_22 reloc, not R_SPARC_HI22. + (tc_gen_reloc): Handle BFD_RELOC_SPARC22. + +1999-06-07 Jakub Jelinek + + * config/tc-sparc.c (md_begin): Handle native wordsize aliases. + (s_ncons): New function. + (native_op_table): New table. + (sparc_ip): Be more strict on %hi() etc.; prepare assembler for + R_SPARC_OLO10 handling. + +Mon Jun 7 10:22:16 1999 Richard Henderson + + * expr.h (struct expressionS): Revert last change; widen X_op. + * config/tc-alpha.c (md_begin): Check the field is wide enough. + +Mon Jun 7 11:25:16 1999 Andreas Schwab + + * Makefile.am (TARGET_CPU_CFILES): Add config/tc-fr30.c. + (TARGET_CPU_HFILES): Add config/tc-fr30.h. + (TARG_ENV_HFILES): Add config/te-epoc-pe.h. + * Makefile.in: Regenerated. + + * config/obj-elf.c (obj_elf_common): In MRI mode if called as + `common' pass on to s_mri_common. + (elf_pseudo_table): Pass 1 to obj_elf_common for `common'. + +1999-06-06 Richard Henderson + + * config/obj-elf.c (obj_elf_section): Don't free the return + value of demand_copy_C_string. + +1999-06-05 Richard Henderson + + * dwarf2dbg.c (dwarf2_gen_line_info): Mirror the section symbol + creation logic from obj_elf_create_section. + + * config/obj-elf.c (elf_pseudo_tab): Add pushsection/popsection. + (section_stack): New. + (special_sections): Make const. + (obj_elf_section): Gut and rewrite parsing. + (obj_elf_change_section): New function broken out of obj_elf_section. + (obj_elf_parse_section_letters): Likewise. + (obj_elf_section_word): Likewise. + (obj_elf_section_type): Likewise. + (obj_elf_previous): Treat as a toggle. + (obj_elf_popsection): New. + * config/tc-ppc.c (ppc_section_word): Take str+len not ptr_str. + (ppc_section_type): Likewise. + * config/tc-ppc.h: Likewise. + + * expr.h (struct expressionS): Don't make X_op a bitfield. + * config/tc-alpha.c: Update for symbol handling changes. + (md_apply_fix) [case GPREL]: Use now_seg instead of absolute_section. + (load_expression, emit_ir_load, emit_loadstore, emit_jsrjmp): Likewise. + +1999-06-05 Richard Henderson + + * dwarf2dbg.c (*): Convert to K&R + prototypes. + (dwarf2_gen_line_info): Kill unused variables. + (dwarf2_finish): Likewise. + (dwarf2_where): Likewise. + (dwarf2_directive_file): If we've only got a string, + hand off to s_app_file. + * ecoff.c: Move the include of ecoff.h. + * symbols.h (S_IS_FUNCTION): Prototype. + + * read.c (LEX_HASH): Supply a default. + (lex_type): Use it. + (s_globl): Update `c' after skipping whitespace. + * read.h (LEX_END_NAME, is_name_ender): New. + * expr.c (get_symbol_end): Respect it. + +1999-06-04 Mark Klein + + * config/tc-hppa.c (md_begin): Convert local symbol dummy_symbol + to real if OBJ_SOM + (tc_gen_reloc): Still need bfd_abs_symbol in some relocs. + + * config/tc-hppa.c: Update for symbol handling changes. + +1999-06-03 Ian Lance Taylor + + * cgen.c: Update for symbol handling changes. + * config/tc-m32r.c: Likewise. + + * config/tc-hppa.h: Update for symbol handling changes. + * config/tc-hppa.c: Likewise. + + * config/tc-arm.h: Update for symbol handling changes. + * config/tc-arm.c: Likewise. + (symbol_make_empty): Remove. Just use symbol_create. + + * symbols.c (symbol_set_tc): Correct name. + + * Makefile.am: Rebuild dependencies. + ($(OBJS)): Don't depend upon struc-symbol.h. + (.dep1, .tcdep, .objdep): Create itbl-parse.h. + * dep-in.sed: Don't remove struc-symbol.h. + * Makefile.in: Rebuild. + + * doc/internals.texi (Symbols): Describe changes in symbol + handling. + +1999-06-03 Richard Henderson + + * dwarf2dbg.c (dwarf2_gen_line_info): Use section_symbol + instead of doing the work by hand. + +1999-06-03 David Mosberger + + * dwarf2dbg.c (INITIAL_STATE): New macro encapsulating initial + state of line state-machine. + (struct ls): Collect DWARF2 line state-machine state in new member + SM. Add member EMPTY_SEQUENCE to keep track if a code sequence + resulted in any DWARF2 directives. + (reset_state_machine): New function. + (out_end_sequence): Ditto. + (dwarf2_gen_line_info): When switching sections or switching to a + lower text address, call out_end_sequence() first to terminate the + previous code sequence as code sequences MUST have monotonically + increasing addresses. + (dwarf2_finish): Call out_end_sequence() instead of open coding it. + +1999-06-03 David Mosberger + + * as.c (parse_args): Add option -gdwarf2 to allow requesting + DWARF2 debug info (line information only, at this point). + * as.h: Update comment about supported debug formats. + * dwarf2dbg.c, dwarf2dbg.h: New files. + * Makefile.am (GAS_CFILES, HFILES, GENERIC_OBJS): Add them. + + * expr.c (operand): Don't use [ for parens if we want an index op. + (op_encoding): Switch [ into O_index, if desired. + (op_rank): Renumber with O_index on bottom. + (expr): If O_index, match closing bracket. + * expr.h (O_index): New. + + * read.c (read_a_source_file): Conditionally allow matched " + in lines passed to md_assemble. + + * config/obj-elf.c (elf_pseudo_table): Add `common'. + +1999-06-03 Ian Lance Taylor + + Add support for storing local symbols in a small structure to save + memory when assembling large files. + * as.h: Don't include struc-symbol.h. + (symbolS): Add typedef. + * symbols.c: Include struc-symbol.h. + (local_hash): New static variable. + (save_symbol_name): New static function, from symbol_create. + (symbol_create): Call save_symbol_name. + (local_symbol_count): New static variable. + (local_symbol_conversion_count): Likewise. + (LOCAL_SYMBOL_CHECK): Define. + (local_symbol_make): New static function. + (local_symbol_convert): New static function. + (colon): Handle local symbols. Create local symbol for local + label name. + (symbol_table_insert): Handle local symbols. + (symbol_find_or_make): Create local symbol for local label name. + (symbol_find_base): Check for local symbol. + (symbol_append, symbol_insert): Check for local symbols. + (symbol_clear_list_pointers, symbol_remove): Likewise. + (verify_symbol_chain): Likewise. + (copy_symbol_attributes): Likewise. + (resolve_symbol_value): Handle local symbols. + (resolve_local_symbol): New static function. + (resolve_local_symbol_values): New function. + (S_GET_VALUE, S_SET_VALUE): Handle local symbols. + (S_IS_FUNCTION, S_IS_EXTERNAL, S_IS_WEAK, S_IS_COMMON): Likewise. + (S_IS_DEFINED, S_IS_DEBUG, S_IS_LOCAL, S_GET_NAME): Likewise. + (S_GET_SEGMENT, S_SET_SEGMENT, S_SET_EXTERNAL): Likewise. + (S_CLEAR_EXTERNAL, S_SET_WEAK, S_SET_NAME): Likewise. + (symbol_previous, symbol_next): New functions. + (symbol_get_value_expression): Likewise. + (symbol_set_value_expression): Likewise. + (symbol_set_frag, symbol_get_frag): Likewise. + (symbol_mark_used, symbol_clear_used, symbol_used_p): Likewise. + (symbol_mark_used_in_reloc): Likewise. + (symbol_clear_used_in_reloc, symbol_used_in_reloc_p): Likewise. + (symbol_mark_mri_common, symbol_clear_mri_common): Likewise. + (symbol_mri_common_p): Likewise. + (symbol_mark_written, symbol_clear_written): Likewise. + (symbol_written_p): Likewise. + (symbol_mark_resolved, symbol_resolved_p): Likewise. + (symbol_section_p, symbol_equated_p): Likewise. + (symbol_constant_p): Likewise. + (symbol_get_bfdsym, symbol_set_bfdsym): Likewise. + (symbol_get_obj, symbol_set_obj): Likewise. + (symbol_get_tc, symbol_set_tc): Likewise. + (symbol_begin): Initialize local_hash. + (print_symbol_value_1): Handle local symbols. + (symbol_print_statistics): Print local symbol statistics. + * symbols.h: Include "struc-symbol.h" if not BFD_ASSEMBLER. + Declare new symbols.c functions. Move many declarations here from + struc-symbol.h. + (SYMBOLS_NEED_BACKPOINTERS): Define if needed. + * struc-symbol.h (SYMBOLS_NEED_BACKPOINTERS): Don't set. + (struct symbol): Move bsym to make it clearly the first field. + Remove TARGET_SYMBOL_FIELDS. + (symbolS): Don't typedef. + (struct broken_word): Remove. + (N_TYPE_seg, seg_N_TYPE): Move to symbol.h. + (SEGMENT_TO_SYMBOL_TYPE, N_REGISTER): Likewise. + (symbol_clear_list_pointers): Likewise. + (symbol_insert, symbol_remove): Likewise. + (symbol_previous, symbol_append): Likewise. + (verify_symbol_chain, verify_symbol_chain_2): Likewise. + (struct local_symbol): Define. + (local_symbol_converted_p, local_symbol_mark_converted): Define. + (local_symbol_resolved_p, local_symbol_mark_resolved): Define. + (local_symbol_get_frag, local_symbol_set_frag): Define. + (local_symbol_get_real_symbol): Define. + (local_symbol_set_real_symbol): Define. + Define. + * write.c (write_object_file): Call resolve_local_symbol_values. + * config/obj-ecoff.h (OBJ_SYMFIELD_TYPE): Define. + (TARGET_SYMBOL_FIELDS): Don't define. + * config/obj-elf.h (OBJ_SYMFIELD_TYPE): Add local field. If + ECOFF_DEBUGGING, add ECOFF fields. + (ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define. + * config/obj-multi.h (struct elf_obj_sy): Add local field. If + ECOFF_DEBUGGING, add ECOFF fields. + (ELF_TARGET_SYMBOL_FIELDS, TARGET_SYMBOL_FIELDS): Don't define. + (ECOFF_DEBUG_TARGET_SYMBOL_FIELDS): Don't define. + * config/tc-mcore.h: Don't include struc-symbol.h. + (TARGET_SYMBOL_FIELDS): Don't define. + (struct mcore_tc_sy): Define. + (TC_SYMFIELD_TYPE): Define. + * Many files: Use symbolS instead of struct symbol. Use new + accessor functions rather than referring to symbolS fields + directly. + + * read.c (s_mri_common): Don't add in value of line_label. + + * config/tc-mips.c (md_apply_fix): Correct parenthesization when + checking for SEC_LINK_ONCE. + + * config/tc-sh.h (sh_fix_adjustable): Declare. + + * app.c (input_buffer): New static variable. + (app_push): Save saved_input in allocated buffer. + (app_pop): Restored saved_input. + (do_scrub_chars): Change get parameter to take char * and int as + arguments. Change GET macro to pass input_buffer to get + function. Don't save input into allocated buffer. + * as.h (do_scrub_chars): Update declaration. + * input-file.c (input_file_get): Change to take char * and int. + Read data into passed in buffer. Remove static buffer. + * read.c (scrub_from_string): Change to take char * and int. Copy + data into passed in buffer. + + * hash.h: Neaten. Declare hash_traverse. + * hash.c: Complete rewrite based on BFD hashing code. + * gasp.c (chunksize): New variable. + * macro.c (macro_expand_body): Call hash_jam with NULL rather than + hash_delete. + +1999-05-28 Nick Clifton + + * config/tc-arm.c (md_apply_fix3): Add pipeline offset into reloc + addend unless the target uses an old ABI. + +Mon May 24 13:36:55 1999 Doug Evans + + -Wchar-subscripts cleanup + * listing.c (listing_newline): Use unsigned char variable, so + calls to isascii,iscntrl are correct. + * atof-generic.c (atof_generic): Cast arg to isdigit, et. al. with + (unsigned char). + * ecoff.c (ecoff_directive_ent,ecoff_stab): Ditto. + * config/obj-elf.c (obj_elf_vtable_inherit): Ditto. + * config/tc-mips.c (mips_ip,mips16_ip): Ditto. + (my_getSmallExpression,get_number,s_mips_ent): Ditto. + +1999-05-28 Torbjorn Granlund + + * config/tc-m68k.c (m68k_ip): Check for disallowed index register + width for Coldfire. + (arch_coldfire_p): New #define. + (m68k_ip, m68k_init_after_args): Use arch_coldfire_p. + +1999-05-28 Linus Nordberg + + * config/tc-m68k.c (install_operand): Add places `n', `o'. + + * config/tc-m68k.c (m68k_ip): Add formats `E', `G', `H'. + (install_operand): Add place `N'. + (init_table): Add registers ACC, MACSR, MASK. + + * config/m68k-parse.h (m68k_register): Add ACC, MACSR, MASK. + + * config/tc-m68k.c: Change mcf5200 --> mcf. + (archs): Add mcf5206e, mcf5307. + (m68k_ip): Add format `u'. + (install_operand): Add place `m', `M', `h'. + (init_table): Add upper/lower registers. + + * config/m68k-parse.h (m68k_register): Add upper/lower registers. + +1999-05-28 Martin Dorey + + * config/tc-i960.c: Several minor changes to add ELF and + BFD_ASSEMBLER support. + * config/tc-i960.h: Likewise. + * configure.in (i960-*-elf*): New target. + * aclocal.m4, configure: Rebuild. + +1999-05-25 Alan Modra + + * config/tc-i386.c (md_apply_fix3): Only do 1999-05-17 fx_pcrel + reloc changes when defined(BFD_ASSEMBLER). + +1999-05-17 Alan Modra + + * config/tc-i386.c (tc_gen_reloc): Remove F and MAP macros. + + * write.c (write_print_statistics): Output to file, not stderr. + + * expr.c (generic_bignum_to_int32,64): Prototype. + + * read.c (s_lcomm_internal, sizeof_sleb128, sizeof_uleb128, + output_sleb128, output_uleb128, output_big_sleb128, + output_big_uleb128, output_big_leb128): Prototype. + (output_big_sleb128, output_big_uleb128): Make inline. + (output_big_leb128): Remove inline + + From Maciej W. Rozycki + * config/tc-i386.c (md_apply_fix3): Convert BFD_RELOC_16 with + fx_pcrel set to BFD_RELOC_16_PCREL. Similarly for BFD_RELOC_8. + Handle BFD_RELOC_16_PCREL and BFD_RELOC_8_PCREL. Return changed + value for correct overflow check in write.c:fixup_segment. + * write.c (fixup_segment): Move bitfield overflow checks to after + the md_apply_fix call. + * config/obj-coff.c (fixup_segment): Likewise. + * doc/internals.texi (CPU backend): Mention md_apply_fix modifying + valueT *val argument. + +Fri May 14 10:52:13 1999 Andreas Schwab + + * config/atof-ieee.c (gen_to_words): Correctly round a + denormalized number. Fix off-by-one in range checking for + exponent in a denormal. + +1999-05-10 Nick Clifton + + * config/tc-mcore.c (parse_reg): Accept 'sp' as a valid register + name. + +Thu May 13 09:46:59 1999 Joel Sherrill (joel@OARcorp.com) + + * configure.in (i386-*-rtemself*, sh-*-rtemself*): New targets. + +1999-05-12 Alan Modra + + * config/tc-i386.h (InvMem): New flag. Add to AnyMem. + (ReverseRegRegmem): Remove. + (ImmExt): New flag. Renumber some of the opcode_modifier bits. + * config/tc-i386.c (md_assemble): Test for PIII SIMD and AMD + 3DNow! via ImmExt opcode_modifier. Remove ReverseRegRegmem + kludge. + + From Doug Ledford + * config/tc-i386.h (RegXMM): New for P/III. + * config/tc-i386.c: Add support for P/III. + +Sat May 8 23:28:50 1999 Richard Henderson + + * config/tc-ppc.c (md_parse_option): Recognize -mppc64bridge. + (md_begin): Allow ppc32 insns in ppc64bridge mode. + (ppc_insert_operand): Accept SIGNOPT in ppc64 mode. + +Thu May 6 23:13:39 1999 Richard Henderson + + * config/tc-i386.c (i386_immediate): Skip whitespace before + complaining about junk after expression. + (i386_displacement): Likewise. + +Thu May 6 19:50:14 1999 Richard Henderson + + * symbols.c (symbol_find_base): Use memcpy instead of strcpy. + Don't copy before downcaseing. + +1999-05-05 Catherine Moore + + * tc-m68k.c: Include elf/m68k.h. + (m68k_elf_final_processing): New routine. + * tc-m68k.h (elf_tc_final_processing m68k_elf_final_processing): + Define. + +Mon May 3 10:26:03 1999 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (md_apply_fix): Handle 22 bit fmt insn like a + 17 bit fmt insn. + +1999-04-30 Nick Clifton + + * config/tc-mcore.c (mcore_s_section): Dump literals before + changing section. + +1999-04-29 Nick Clifton + + * config/tc-mcore.c (md_apply_fix3): Insert reloc addend into insn + for COFF/PE port. + +Mon Apr 26 12:34:37 1999 Doug Evans + + * config/tc-fr30.h (TC_FIX_TYPE): Delete, cgen fields moved to write.h. + (TC_INIT_FIX_DATA): Delete. + * config/tc-m32r.h (TC_FIX_TYPE): Delete, cgen fields moved to write.h. + (TC_INIT_FIX_DATA): Delete. + * write.h (struct fix): New member fx_cgen, ifdef USING_CGEN. + * write.c (fix_new_internal): Initialize fx_cgen member. + * cgen.c (gas_cgen_record_fixup,gas_cgen_record_fixup_exp): Update. + (gas_cgen_md_apply_fix3): Update. + * config/tc-m32r.c (md_cgen_lookup_reloc): Update. + (md_cgen_record_fixup_exp): Update. + (FX_OPINFO_R_TYPE): Update. + + * frags.c (frag_var,frag_variant): Initialize fr_cgen here. + * config/tc-fr30.h (TC_FRAG_INIT): Delete. + * config/tc-m32r.h (TC_FRAG_INIT): Delete. + * frags.h (struct frag): Make opindex, opinfo ints. + + * config/tc-fr30.c (FX_OPINFO_R_TYPE): Delete, unused. + +1999-04-26 Tom Tromey + + * aclocal.m4, configure: Updated for new version of libtool. + +1999-04-22 Nick Clifton + + * config/tc-mcore.c (md_apply_fix3): Renamed function from + md_apply_fix. + (md_apply_fix3): Do not fix up absolute relocations against + symbolic values. + + * config/tc-mcore.h (MD_APPLY_FIX3): Define. + +1999-04-20 Nick Clifton + + * config/tc-mcore.c (md_pseudo_table): Add intercepts for section + changes and data-in-text directives. + (mcore_cons): New function: intercept cons() operations. + (mcore_float_cons): New function: intercept float_cons() + operations. + (mcore_stringer): New function: intercept stringer() operations. + +1999-04-18 Ian Lance Taylor + + * obj.h (struct format_ops): Change generate_asm_lineno field to + take no parameters. + * config/obj-ecoff.h (OBJ_GENERATE_ASM_LINENO): Don't define. + + * config/tc-alpha.c (find_opcode_match): Add default case to + switch. + (find_macro_match): Likewise. + (load_expression): Parenthesize && within ||. + + * config/tc-alpha.h (TC_RELOC_RTSYM_LOC_FIXUP): Define. + +1999-04-17 Nick Clifton + + * config/tc-mcore.c (md_pseudo_table): Add overrides for .bss + .text .data .section pseudo ops. + (mcore_s_section): New function. Dump lits before changing secs. + (mcore_s_text): New function. Dump lits before changing secs. + (mcore_s_data): New function. Dump lits before changing secs. + +1999-04-16 Gavin Romig-Koch + + * config/tc-mips.c (mips_32bitmode): New. + (md_begin): Set mips_32bitmode if needed. + (mips_elf_final_processing): Don't set EF_MIPS_ARCH. + Set EF_MIPS_32BITMODE. + +Fri Apr 16 12:26:39 1999 Bob Manson + + * config/obj-coff.c (c_section_symbol): Fix typo in previous + change. + +1999-04-16 Nick Clifton + + * config/tc-mcore.h (LOCAL_LABELS_FB): Define to 1. + +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" + expressions correctly. + + +1999-04-15 Gavin Romig-Koch + + * config/tc-mips.c (mips_elf_final_processing): Set EF_MIPS_ARCH. + +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 + and fmpynfadd instructions. + +1999-04-11 Richard Henderson + + * as.h (environ): Declare it, if needed. + * as.c (dump_statistics): Don't declare environ. + * configure.in (environ): Detect declaration. + * configure, config.in: Rebuild + + * config/tc-i386.c (i386_immediate): Accept @GOT relocations. + (i386_displacement): Allocate enough space for replacement buffer. + Clean up replacement buffer initialization. + +1999-04-11 Bob Manson : + + * subsegs.c (section_symbol): Don't create a new symbol if one + already exists; instead, use the existing one, but set its segment + and frag data if it hasn't already been defined. + * config/obj-coff.c (c_section_symbol): Likewise. + +Sat Apr 10 20:10:02 1999 Richard Henderson + + * tc-alpha.c (load_expression): Call as_bad instead of abort. + +1999-04-08 Nick Clifton + + * config/tc-mcore.c: New File: Support routines for MCore + assembler. + * config/tc-mcore.h: New File: Definitions for MCore assembler. + * config/obj-coff.c: Add support for mcore-pe target. + + * Makefile.am: Add support for MCore targets. + * Makefile.in: Regenerate. + * configure.in: Add support for MCore targets. + * configure: Regenerate. + + * doc/all.texi: Set MCORE. + * doc/as.texinfo: Document MCore specific command line options. + + * write.h: Prevent multiple inclusion. + +1999-04-06 Ian Lance Taylor + + * asintl.h (LC_MESSAGES): Never define. + * as.c (main): Don't pass LC_MESSAGES to setlocale if the system + does not define it. + * gasp.c (main): Don't pass LC_MESSAGES to setlocale if the system + does not define it. + + * Makefile.am (m68k-parse.c): If configuring in the source + directory, copy m68k-parse.y into the local directory before + running ylwrap, to remove spurious differences when generating + snapshots. + * Makefile.in: Rebuild. + + * config/tc-sparc.h (md_do_align): Just allocate the number of + bytes necessary, rather than always allocating 1024. + +1999-04-04 Ian Lance Taylor + + * listing.c (listing_newline): Add cast to avoid warning. + * read.c (generate_lineno_debug): Add cases to switch. Reindent. + * config/tc-i386.c (i386_scale): Add return value. + (build_displacement_string): Remove unused local temp_disp2. + (i386_intel_memory_operand): Add parentheses to avoid warning. + (i386_intel_operand): Remove unused local end_of_operand_string. + (i386_operand): Remove unused local operand_modifier. + (i386_operand): Add parens to avoid warning. + +1999-04-04 Don Bowman + + * configure.in: Add mips*-*-vxworks* target; have it define + MIPS_STABS_ELF. + * configure, config.in: Rebuild. + +1999-03-31 Nick Clifton + + * configure.in (emulations): Add support for arm-epoc-pe. + * configure: Regenerate. + * config/te-epoc-pe.h: New file. Define macros specific to + arm-epoc-pe target. + * config/tc-arm.h: Select epoc-pe-arm target format if configured + for arm-epoc-pe target. + +Mon Mar 29 10:15:40 CST 1999 Catherine Moore + + * 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 + 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 + instruction is encoded with one bit. + + +1999-03-23 Ian Lance Taylor + + * doc/internals.texi (CPU backend): Mention that + line_separator_chars should not include newline. From thi + . + +1999-03-22 Doug Evans + + * config/tc-fr30.c (md_begin): Update call to fr30_cgen_cpu_open. + * config/tc-m32r.c (md_begin): Update call to m32r_cgen_cpu_open. + +Sun Mar 21 18:08:18 1999 Richard Henderson + + * 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. + + +Thu Mar 18 02:30:07 1999 Jeffrey A Law (law@cygnus.com) + + * tc-hppa.c (pa_ip, case 'd'): Do not allow ",n". + +1999-03-15 Martin Hunt + + * app.c (do_scrub_begin): Change '-' back to a symbol char + so we can use multiple opcodes on a line again. + + * config/tc-d30v.c: By default, warn if a symbol has + the same name as a register. Plus some minor + updates from the branch. + +1999-03-13 Nick Clifton + + * config/tc-d30v.c (md_apply_fix3): Handle BFD_RELOC_8, + BFD_RELOC_16 and BFD_RELOC_64. + +1999-03-12 Andreas Schwab + + * expr.c (expr): Add missing else. + +1999-03-12 Nick Clifton + + * config/tc-arm.c (md_apply_fix3): Improve error message. + +1999-03-11 Doug Evans + + * Makefile.am (CPU_TYPES): Add fr30. + (cgen.o): Add $(CGEN_CPU_PREFIX)-desc.h dependency. + (fr30,m32r dependencies): Update. + * Makefile.in: Rebuild. + + * cgen.c (gas_cgen_record_fixup): Update use of operand->type. + (gas_cgen_record_fixup_exp): Ditto. + (gas_cgen_finish_insn): Call cgen_operand_lookup_by_num. + (gas_cgen_md_apply_fix3): Ditto. Update call to set_vma_operand. + * config/tc-fr30.c (md_begin): Update call to fr30_cgen_cpu_open. + (md_cgen_lookup_reloc): Update use of operand->type. + * config/tc-m32r.c (md_begin): Update call to fr30_cgen_cpu_open. + (md_convert_frag): Call cgen_operand_lookup_by_num. + (md_cgen_lookup_reloc): Update use of operand->type. + (m32r_cgen_record_fixup_exp): Ditto. + +1999-03-09 Jim Blandy + + * config/tc-mips.c (md_show_usage): Fix message. + +1999-03-03 Nick Clifton + + * doc/c-arm.texi (ARM Syntax): Document new command line switches + and LDR reg,= instruction. + + * config/tc-arm.c: Add support for -mcpu=arm810, -mcpu=arm9 and + -mcpu=arm9tdmi. + +Fri Feb 19 09:36:30 1999 Ian Lance Taylor + + * doc/c-arm.texi (ARM-Chars): Fix typo in use of '@'. + +1999-02-17 Nick Clifton + + This patch was created by: Scott Bambrough + + + * app.c: + Special cased '@' character. The '@' character is used as the + ARM assembler comment character, as a special character + and in ELF .symver pseudo-op's, and as a special character in + .type and .section pseudo-ops. + (symver_pseudo): New static variable. + (symver_state): New static variable. + (struct app_save): Add field 'symver_state'. + (app_push): Save global symver_state int struct app_save. + (app_pop): Restore global symver_state from struct app_save. + (do_scrub_chars): Special case handling of '@' character in + .symver pseudo-ops. + + * configure.in: Modified to recognize armv* uname syntax from ARM + Linux kernel. + * configure: Regenerated. + + * config/obj-elf.c (obj_elf_section): Allow '%' as well as '@' as + a prefix to the section's type. + (obj_elf_type): Allow '%' as well as '@' and '#' as prefixes to + the type's typename. + + * config/tc-arm.h: Add support for PIC generation: + (pic_code): New boolean. + (obj_relocate_extern): Define. + (TC_RELOC_RTSYM_LOC_FIXUP): Define + (TC_CONS_FIX_NEW): Define. + (tc_fix_adjustable): Define. + (GLOBAL_OFFSET_TABLE_NAME): Define. + + * config/tc-arm.c: Add support for PIC generation: + (line_seperator_chars): Allow ';' as a seperator for Linux. + (is_immediate_prefix): New macro. + (arm_parse_reloc): New function. + (s_arm_elf_cons): New function. + (do_branch): Special case for BFD_RELOC_ARM_PLT32. + (md_undefined_symbol): Special case handling for the Global Offset + Table's symbol. + (md_apply_fix3): Handle PIC relocs. + (tc_gen_reloc): Handle PIC relocs. + (md_parse_option): Add support for '-k' command line switch to + enable PIC generation. + (cons_fix_new_arm): New function. + (s_arm_elf_cons): New function. + +Tue Feb 16 16:31:53 1999 Ian Lance Taylor + + * configure.in: Add comments for uses of AC_DEFINE. + * acinclude.m4: Likewise. + * acconfig.h: Remove. + * aclocal.m4: Rebuild. + * configure: Rebuild. + * Makefile.in: Rebuild. + * config.in: Rebuild. + +1999-02-15 Jim Lemke + + * config/tc-mips.c (mips_ip: case 'o'): Fix assertion failure for + non-constant offset from a base register. + +1999-02-14 Ken Raeburn + + * config/tc-alpha.c (md_show_usage): Put \ before newline in + strings always. + +Sat Feb 13 14:10:10 1999 Richard Henderson + + * config/tc-alpha.c (cpu_types): Enable EV6 PALcode with -m21264. + (emit_insn): Look for pc-relative and no-overflow specifiers on + internal relocation types. + +1999-02-13 Jim Blandy + + * doc/c-mips.texi (MIPS Opts): Updated list of -mNNNN and + -mcpu=NNNN flags. + + * config/tc-mips.c: Remove all the mips_NNNN variables; just use + mips_cpu instead. + (mips_4650, mips_4010, mips_4100): Variables removed. + (hilo_interlocks, gpr_interlocks, append_insn, macro_build, macro, + macro2, mips16_macro, mips_ip): Test mips_cpu, not the mips_NNNN + variables. + (md_begin): Don't bother initializing the mips_NNNN variables; + mips_cpu is set, and that's good enough now. + (md_parse_option): Have the -mNNNN options set mips_cpu instead of + the mips_NNNN variable. The -no-mNNNN flags are now no-ops. + (show): New function, to handle wrapping in the CPU lists. + (md_show_usage): Update lists of -mcpu and -mNNNN switches. + +Sat Feb 13 00:17:26 1999 Richard Henderson + + * config/tc-i386.c (i386_intel_operand): Ignore `SHORT' rather + than treat as an immediate specifier. + +Thu Feb 11 16:18:31 1999 Richard Henderson + + * config/tc-i386.c: Prototype many functions. + (set_intel_syntax): Accept `prefix'/`noprefix' specifiers. + (i386_immediate): Remove unused second argument. + (i386_intel_operand): Fix i386_is_reg typo. + (i386_operand): Use allow_naked_reg. + (output_invalid): Make operand int for K&R. + +Thu Feb 11 11:21:02 1999 Ian Lance Taylor + + * Makefile.am (EXTRA_as_new_SOURCES): Uncomment--fixed by automake + patch. + * Makefile.in: Rebuild. + +1999-02-09 Doug Evans + + * Makefile.am (DISTCLEANFILES): Change cgen-opc.h to cgen-desc.h. + (cgen.o): Ditto. + (EXTRA_as_new_SOURCES): Comment out. + (.tcdep): -opc.h renamed to -desc.h. + * Makefile.in: Rebuild. + * doc/Makefile.in: Rebuild. + * configure.in: Require autoconf 2.13. Redo using_cgen handling. + Delete call to AM_CYGWIN32. Replace AM_EXEEXT with AC_EXEEXT. + (AC_OUTPUT): -opc.h renamed to -desc.h. + * configure: Rebuild. + * aclocal.m4: Rebuild. + * config.in: Rebuild. + * cgen.c: Include cgen-desc.h, not cgen-opc.h. + (*): CGEN_OPCODE_DESC renamed to CGEN_CPU_DESC. + (gas_cgen_cpu_desc): Renamed from gas_cgen_opcode_desc. + CGEN_INSN_ATTR renamed to CGEN_INSN_ATTR_VALUE. + CGEN_OPERAND_ATTR renamed to CGEN_OPERAND_ATTR_VALUE. + (gas_cgen_record_fixup): Remove unnecessary != 0 test. + (gas_cgen_record_fixup_exp): Ditto. + (gas_cgen_finish_insn): Ditto. Refer to operand table via cpu + descriptor, not global variable. + (gas_cgen_md_apply_fix3): Refer to operand_table via cpu + descriptor, not global variable. Refer to insert_operand handler + via cpu descriptor, not global function. + * cgen.h (*): CGEN_OPCODE_DESC renamed to CGEN_CPU_DESC. + * config/tc-fr30.c: Include opcodes/fr30-desc.h. + (*): gas_cgen_opcode_desc renamed to gas_cgen_cpu_desc. + CGEN_INSN_ATTR renamed to CGEN_INSN_ATTR_VALUE. + Update call to CGEN_OPERAND_TYPE,CGEN_INSN_OPERANDS. + * config/tc-m32r.c: Ditto. + (assemble_two_insns): Update calls to cgen_lookup_get_insn_operands. + (md_assemble): Ditto. + (md_convert_frag): Update call to CGEN_OPERAND_ENTRY. + +1999-02-09 Nick Clifton + + * config/tc-arm.c (md_apply_fix3): Fix handling of label1 - label2 + relocations for ELF targets. + +1999-02-08 Nick Clifton + + * configure.in: Add support for StrongARM target. + * configure: Regenerate. + +1999-02-05 Nick Clifton + + * config/tc-arm.h: Tidy OBJ_ELF and OBJ_COFF definitions. + + * config/tc-arm.c (md_apply_fix3): Fix BFD_RELOC_ARM_PCREL_BRANCH + for COFF ports. + +Wed Feb 3 11:35:47 1999 Richard Henderson + + * config/tc-alpha.c (md_show_usage): Document pca56 and ev6 options. + +Mon Feb 1 20:37:30 1999 Catherine Moore + + * config/tc-i386.h (LONG_DOUBLE_MNEM_SUFFIX): Define. + (INTEL_DWORD_MNEM_SUFFIX): Define. + (BYTE_PTR): Define. + (WORD_PTR): Define. + (DWORD_PTR): Define. + (XWORD_PTR): Define. + (SHORT): Define. + (OFFSET_FLAT): Define. + (FLAT): Define. + (NONE_FOUND): Define. + (No_dSuf): Define. + (No_xSuf): Define. + * config/tc-i386.c (set_intel_syntax): New routine. + (intel_syntax): Declare. + (allow_naked_reg): Declare. + (md_pseudo_table): Support .intel_syntax and .att_syntax. + (intel_float_operand): New routine. + (md_assemble): Handle INTEL_DWORD_MNEM_SUFFIX. + Handle brackets as well as parens. Call i386_intel_operand for + intel syntax. Reverse operands if appropriate. Handle new + suffixes. Handle movzx and movsx. + (i386_is_reg): New routine. + (i386_immediate): New routine. + (i386_scale): New routine. + (i386_displacement): New routine. + (i386_operand_modifier): New routine. + (build_displacement_string): New routine. + (i386_parse_seg): New routine. + (i386_intel_memory_operand): New routine. + (i386_intel_operand): New routine. + (i386_operand): Call i386_displacement, i386_immediate, + i386_scale, etc. instead of handling inline. + (parse_register): Handle registers without prefix. + +Mon Feb 1 12:24:58 1999 Catherine Moore + + * configure: Regenerate. + * configure.in (arm-*-oabi): New. + (thumb-*-oabi): New. + * config/tc-arm.c (target_oabi): Declare. + (md_apply_fix3): Support REL relocs. + (md_parse_option): Handle -oabi. + (elf32_arm_target_format): New routine. + (md_longopts): Add OPTION_OABI. + * config/tc-arm.h: Redefine TARGET_FORMAT. + + +1999-01-28 Nick Clifton + + * write.c (write_relocs): Handle out of range error. + + * config/tc-fr30.c (fr30_fix_adjustable): New function. + (fr30_force_relocation): Default to 0. + + * config/tc-fr30.h (obj_fix_adjustable): Define. + (TC_FORCE_RELOCATION): Define. + + * cgen.c (gas_cgen_md_apply_fix3): Do not apply fixes to VTABLE + relocs. + +1999-01-16 Nick Clifton + + * config/tc-d30v.c (write_2_short): Do not generate a sequential + merge of two instructions if the left instruciton kills the right. + +1999-01-11 Doug Evans + + * Makefile.in: Regenerate. + * configure.in: Redo test for using cgen. + * configure: Regenerate. + +1999-01-09 Nick Clifton + + * config/obj-coff.h (obj_adjust_symtab): Prevent accidental + redefinition of this macro. + +Tue Jan 5 21:58:03 1999 Doug Evans + + * config/tc-mips.c (mips_frob_file): Disable "Unmatched %hi reloc" + warning. + +1998-12-29 Gavin Romig-Koch + + * config/tc-mips.c (append_insn): For mips16, insert a nop between + a read of HI or LO and an immediatly following branch. + +1998-12-29 Gavin Romig-Koch + + * config/tc-mips.c (md_begin): Another correction to the setting of + mips_eabi64. + +1998-12-23 Gavin Romig-Koch + + * config/tc-mips.c (md_begin): Correct type-o in setting of + mips_eabi64. + +1998-12-21 Nick Clifton + + * config/tc-m32r.c (md_assemble): Emit a NOP after a relaxable 16 + bit insn when optimizing, so that parallelised instructions will + start on a 32 bit boundary. + +1998-12-19 Gavin Romig-Koch + + * config/tc-mips.c (mips_eabi64): New. + (md_begin): Set mips_eabi64. + (mips_elf_final_processing): Use it. + +1998-12-18 Gavin Romig-Koch + + * config/tc-mips.c (mips_elf_final_processing): + Correct setting of ABI in e_flags. + +Wed Dec 16 16:17:22 1998 Dave Brolley + + * config/tc-fr30.c (md_assemble): Warn about invalid instructions + in delay slots. + +1998-12-16 Gavin Romig-Koch + + * config/tc-mips.c (md_begin,md_parse_option): Handle vr4111. + +1998-12-15 Doug Evans + + * cgen.c (gas_cgen_md_apply_fix3): Mark as an error, rather than a + warning, values that don't fit in the field. + +1998-12-15 Gavin Romig-Koch + + * config/tc-mips.c (mips_abi_string): New. + (md_parse_option,md_longopts): Add mabi. + (mips_elf_final_processing): Set e_flags based on mabi flag. + +1998-12-15 Gavin Romig-Koch + + * config/tc-mips.c (md_parse_option): Handle vr4111. + +98-12-11 Ken Raeburn + + * config/tc-h8300.c (build_bytes): Change message given if the + instruction requires H8/300H mode and we're not in Hmode, to + suggest that it may be the operand modes that are the problem, not + necessarily the opcode. + +1998-12-10 Nick Clifton + + * config/tc-fr30.c: Add line separator character. + +Tue Dec 8 19:51:50 1998 Mark Klein + + * configure.in (hppa-*-mpeix*): New target. + * config/obj-som.h (obj_som_compiler): Declare. + * config/obj-som.c (compiler_seen): New static variable. + (obj_som_compiler): New function. + * config/tc-hppa.c: Update tc_data uses for change to bfd/som.h. + (md_pseudo_table): Add "compiler" if OBJ_SOM. + (pa_type_args): Set hppa_priv_level. + (pa_compiler): New static function if OBJ_SOM. + * configure: Rebuild. + +Tue Dec 8 15:00:50 1998 Ian Lance Taylor + + * read.c (output_leb128): Don't mark as inline. + +1998-12-08 Andrew MacLeod + + * config/tc-ppc.c (ppc_vbyte): Prototype and new function for + AIX .vbyte unaligned data support. + (md_pseudo_table): Add 'vbyte' to list of valid pseudos. + (ppc_elf_validate_fix): Add eh_frame to list of ELF relocatable + sections. + +1998-12-07 Nick Clifton + + * config/tc-d30v.c (md_assemble, do_assemble): Improve erroneous + input handling. + +Mon Dec 7 09:48:34 1998 Catherine Moore + + * config/tc-arm.c (elf32_arm_force_relocation): Check for + BFD_RELOC_ARM_PCREL_BRANCH. + +Sun Dec 6 12:46:36 1998 Ian Lance Taylor + + * configure.in: Define TARGET_BYTES_{BIG,LITTLE}_ENDIAN after + checking the target type. + (mips-dec-bsd*): Set endian to little. + * configure: Rebuild. + + COFF weak symbol support, based on patches from Mark Elbrecht + : + * config/obj-coff.h (S_IS_WEAK): Define if not BFD_ASSEMBLER. + * config/obj-coff.c (obj_coff_weak): New static function. + (obj_coff_endef) [both versions]: Handle weak symbols. + (coff_frob_symbol): Likewise. + (yank_symbols): Likewise. + (obj_pseudo_table): Add "weak". + + * configure.in (m68k-*-gnu*): New target. From Aymeric Vincent + . + * aclocal.m4: Rebuild with current tools. + * configure: Rebuild. + + * config/tc-alpha.c (emit_ldgp): Give an error message rather than + an assertion failure for a case we can't handle when OBJ_ECOFF. + + * expr.c (operator): And with 0xff to avoid problems with signed + char. + +1998-12-03 Nick Clifton + + * config/tc-fr30.c (md_cgen_lookup_reloc): Generate + BFD_RELOC_FR30_48 instead of BFD_RELOC_FR30_32. + +1998-12-02 Nick Clifton + + * config/tc-fr30.c (md_cgen_lookup_reloc): Enable relocs for + LDI:20 insn. + +Thu Nov 26 11:23:48 1998 Dave Brolley + + * config/tc-fr30.c (md_pcrel_from_section): Restore previous + calculation of pcrel point. + +Tue Nov 24 17:21:52 1998 Nick Clifton + + * config/tc-fr30.c (md_pcrel_from_section): Fix calculation of + pcrel point. + +Tue Nov 24 14:54:38 1998 Nick Clifton + + * config/tc-d10v.c (md_assemble): Make static 'etype' have file + scope. + (d10v_cleanup): Only generate previous insn if a multiline insn is + not pending. + +Fri Nov 20 11:41:13 1998 Nick Clifton + + * config/tc-fr30.c (md_cgen_lookup_reloc): Add support for + FR30_OPERAND_I32. + +Thu Nov 19 15:01:29 1998 Nick Clifton + + * config/tc-arm.c (md_parse_option): Add support for -marm7xxx and + -marm6xxx command line switches. + +1998-11-18 Doug Evans + + * Makefile.am (DEP): Use $(srcdir)/../mkdep. + (itbl-ops.o): Delete duplicate dependencies. + Rebuild dependencies. + Add fr30 dependencies. + * Makefile.in: Rebuild. + +Tue Nov 17 13:42:42 1998 Nick Clifton + + * config/tc-fr30.c (md_cgen_lookup_reloc): Updated to match latest + opcode list. + * listing.c: Ignore line terminator characters found inside + strings. + +Thu Nov 12 19:21:24 1998 Dave Brolley + + * po/gas.pot: Regenerated. + +Thu Nov 12 10:54:16 1998 Nick Clifton + + * config/tc-fr30.c (fr30_is_colon_insn): New name for + fr30_is_label_start(). Also checks for delay slot insns. + + * config/tc-fr30.c (fr30_is_label_start): New function: Handle + FR30 instructions which contain a colon in the mnemonic. + + * config/tc-fr30.h (TC_START_LABEL): Define this macro. + +Wed Nov 11 09:58:21 1998 Nick Clifton + + * config/tc-fr30.c: Removed currently superflous code. + +Tue Nov 10 13:13:05 1998 Nick Clifton + + * config/tc-fr30.h: New file. + * config/tc-fr30.c: Tweaking so that it will compile. + +Tue Nov 10 14:41:33 1998 Catherine Moore + + * config/tc-d10v.h (obj_fix_adjustable): Define. + (TC_FORCE_RELOCATION): Define. + (d10v_force_relocation): Declare. + * config/tc-d10v.c (tc_gen_reloc): Handle Vtable relocs. + (md_apply_fix3): Handle Vtable relocs. + (d10v_fix_adjustable): New. + (d10v_force_relocation): New. + +Mon Nov 9 14:25:06 1998 Nick Clifton + + * config/tc-d30v.c: Change default behaviour to ignore potential + conflicts between register name and symbol names. + +Wed Nov 4 18:42:00 1998 Dave Brolley + + * configure.in: Add fr30-*-*. + * config/tc-fr30.c: New file. + * Makefile.in: Regenerated. + * config.in: Regenerated. + * configure: Regenerated. + * doc/Makefile.in: Regenerated. + * po/gas.pot: Regenerated. + +Mon Nov 2 20:54:16 1998 Doug Evans + + * config/tc-m32r.c (assemble_two_insns): Ensure both insns + are 16 bit insns. + +Mon Nov 2 20:10:18 1998 Martin von Loewis + + * app.c (do_scrub_begin): Set characters above 127 to be symbol + characters. + (do_scrub_chars): Add some casts to unsigned char to avoid + unwanted sign extension. + * read.c (lex_type): Set characters about 127 to be symbol + characters. + * config/tc-i386.c (md_begin): Set identifier_chars and + operand_chars for values above 127. + +Mon Nov 2 15:05:33 1998 Geoffrey Noer + + * configure.in: detect cygwin* instead of cygwin32* + * configure: regenerate + +Tue Oct 27 13:18:40 1998 Nick Clifton + + * listing.c: Add support for producing a listing from piped + input. + +Tue Oct 27 08:56:44 1998 Gavin Romig-Koch + + * config/tc-mips.c (hilo_interlocks): Remove mips_3900. + (append_insn): Account for the tx39's multiply behavior. + +1998-10-26 Michael Meissner + + * config/tc-m32r.c (assemble_two_insns): Rename assemble_two_insns + from assemble_parallel_insns. Add support for '->' to indicate + explicitly serializing the instructions. + (md_assemble): Ditto. + +Sat Oct 24 15:12:19 1998 Catherine Moore + + * config/tc-sh.c (sh_fix_adjustable): Adjust EXTERN and + WEAK handling. + +Thu Oct 22 12:41:33 1998 Catherine Moore + + * cgen.c (gas_cgen_md_apply_fix3): Revert last change. + +Thu Oct 22 10:03:15 1998 Ron Unrau + + * config/tc-mips.c: support frame and regmask/fregmask when + MIPS_STABS_ELF is specified. + +Wed Oct 21 11:34:51 1998 Catherine Moore + + * config/tc-sh.c (sh_fix_adjustable): Only include if OBJ_ELF. + (md_apply_fix): Don't return 1 for VTABLE relocs. + * config/tc-sh.h (obj_fix_adjustable): Define only if OBJ_ELF. + +Tue Oct 20 11:18:28 1998 Alan Modra + + * doc/c-i386.texi: Replace occurences of "opcode" with + "instruction mnemonic", "instruction", or "mnemonic" when + referring to the name of an instruction. Use "opcode" when + referring to the sequence of machine bytes. + + * config/tc-i386.c (opcode_chars): Rename to mnemonic_chars. + (is_opcode_char): Rename to is_mnemonic_char. + (md_assemble and i386_operand): Correct error messages from + "opcode" to "instruction mnemonic" + Rename throughout opcode[] -> mnemonic[], opp -> mnem_p, + MAX_OPCODE_SIZE -> MAX_MNEM_SIZE, + DWORD_OPCODE_SUFFIX -> DWORD_MNEM_SUFFIX, + WORD_OPCODE_SUFFIX -> WORD_MNEM_SUFFIX, + BYTE_OPCODE_SUFFIX -> BYTE_MNEM_SUFFIX, + SHORT_OPCODE_SUFFIX -> SHORT_MNEM_SUFFIX + LONG_OPCODE_SUFFIX -> LONG_MNEM_SUFFIX + + * config/tc-i386.h (*_MNEM_SUFFIX): Rename from *_OPCODE_SUFFIX. + + * config/tc-i386.c (i386_operand): Check for garbage after + register name. + +Tue Oct 20 10:49:42 1998 Ian Lance Taylor + + * config/tc-i386.c (md_apply_fix3): Change handling of PCREL reloc + for BFD_ASSEMBLER to only change value when COFF if TE_PE. + +Mon Oct 19 20:20:42 1998 Catherine Moore + + * config/tc-sh.h (obj_fix_adjustable): Define. + * config/tc-sh.c (sh_force_relocation): Handle VT relocs. + (md_apply_fix): Likewise. + (tc_gen_reloc): Likewise. + (sh_fix_adjustable): New. + +Mon Oct 19 12:35:43 1998 Doug Evans + + * cgen.c (gas_cgen_finish_insn): Update handling of CGEN_INT_INSN_P. + * cgen.h (gas_cgen_finish_insn): Update prototype. + * config/tc-m32r.c (m32r_insn): CGEN_INT_INSN -> CGEN_INT_INSN_P. + cgen_insn_t -> CGEN_INSN_INT. + (make_parallel): Update handling of CGEN_INT_INSN_P. + (assemble_parallel_insn): Ditto. + (target_make_parallel): New function. + (md_assemble): Use it. + +Mon Oct 19 13:16:12 1998 Catherine Moore + + * config/tc-m32r.c (m32r_force_relocation): Fix typo. + +Sun Oct 18 18:48:57 1998 Jeffrey A Law (law@cygnus.com) + + * config/tc-sh.c (md_assemble): Make sure the entire opcode is + converted into lower case. + +Fri Oct 16 13:36:34 CDT Catherine Moore + + * cgen.c (gas_cgen_md_apply_fix3): Handle VTABLE relocs. + (gas_cgen_tc_gen_reloc): Likewise. + * config/tc-m32r.h (obj_fix_adjustable): Define. + * config/tc-m32r.c (m32r_fix_adjustable): New. + (m32r_force_relocation): Handle VTABLE relocs. + +Wed Oct 14 11:33:38 1998 Nick Clifton + + * doc/c-arm.texi (ARM Directives): Document .ltorn directive. + +Mon Oct 12 11:07:21 1998 Nick Clifton + + * config/tc-m32r.c (assemble_parallel_insn): Convert second opcode + to lower case before parsing. + + * config/tc-d30v.c (parallel_ok): Ignore conflicts when explicitly + parallel insns modift buts in the PSW as a side effect. + +Thu Oct 8 10:18:33 1998 Nick Clifton + + * config/tc-d30v.c (find_format): Test for missing flag and + control registers. + + (md_apply_fix3): Fix error messages to avoid + assumption about presence of a symbol. + + (parallel_ok): Disallow parallel instructions that both modify the + same flag register. + + (find_format): Generate a warning if an odd numbered register is + used as the first register in a mutli-register instruction. + +Wed Oct 7 14:09:14 1998 Nick Clifton + + * config/tc-d30v.c (md_apply_fix3): Do not assume that bad + relocations are always associated with a symbol. + +Tue Oct 6 09:31:15 1998 Catherine Moore + + * tc-sparc.h (TC_FORCE_RELOCATION): Define. + (elf32_sparc_force_relocation): Declare. + * tc-sparc.c (md_apply_fix3): Handle vtable relocs. + (tc_gen_reloc): Handle vtable relocs. + (elf32_sparc_force_relocation): New. + +Mon Oct 5 09:25:32 1998 Catherine Moore + + * symbols.c (S_IS_FUNCTION): New. + * config/tc-v850.h (obj_fix_adjustable): Define. + (TC_FORCE_RELOCATION): Define. + (v850_force_relocation): Declare. + * config/tc-v850.c (tc_gen_reloc): Use offset instead + of fx_addnumber for VTABLE reloc addends. + (md_apply_fix3): Handle VTABLE relocs. + (v850_fix_adjustable): New. + (v850_force_relocation): New. + +Mon Oct 5 00:48:52 1998 Jeffrey A Law (law@cygnus.com) + + * 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". + +Sun Oct 4 20:57:43 1998 Alan Modra + + * config/tc-i386.c (md_assemble): Handle AMD_3DNOW_OPCODE. + * config/tc-i386.h (template.extension_opcode): Change to + unsigned int to allow full range of 8-bit opcode suffixes. + (None): Redefine as 0xffff. + + From Jeff B Epler + * doc/c-i386.texi (i386-SIMD): New section. + +Thu Oct 1 15:37:54 1998 Richard Henderson + + * read.c (discard_rest_of_line): New function. + * read.h: Declare it. + * config/tc-alpha.c (s_alpha_mask, s_alpha_frame): Use it. + +Thu Oct 1 10:33:53 1998 Nick Clifton + + * config/tc-d10v.c (find_symbol_matching_register): New function. + (find_opcode): Cope with the case where a register name matches + a symbol name. + +Wed Sep 30 10:52:32 1998 Nick Clifton + + * config/tc-v850.c (md_pcrel_from): Rename to + v850_pcrel_from_section. + (v850_pcrel_from_section): Do not resolves symbols in other + sections. + + * config/tc-v850.h (MD_PCREL_FROM_SECTION): Define. + +Mon Sep 28 11:01:20 1998 Nick Clifton + + * config/tc-d10v.c (find_opcode): Generate an error if a register + is supplied for an operand that should not be a register. + +Fri Sep 25 10:04:21 1998 Nick Clifton + + * config/tc-d30v.c (write_2_short): But do allow delayed branch + instructions to have another instruction in the right bin. + +Thu Sep 24 09:28:34 1998 Nick Clifton + + * config/tc-d30v.c (write_2_short): Do not allow instructions in + the right container if the left container holds a branch + instruction. + +Wed Sep 23 10:54:29 1998 Nick Clifton + + * config/tc-d30v.c (reg_name_search): Only warn if a name matches + both a register name and symbol name. + (find_format): Allow correct parsing of MVTSYS and MVFSYS insns. + +Tue Sep 22 17:49:16 1998 Nick Clifton + + * config/tc-d30v.c (write_2_short): Implement EITHER_BUT_PREFER_MU + execution unit class. + + (reg_name_search): If a name matches a register and a symbol, + prefer the register. + (find_format): Disallow flag registers when a general purpose + register is required. + If a number is required, but a register has been given, check to + see if a symbol with the same name as the register exists, and if + so, use that symbol. + +Tue Sep 22 16:40:52 1998 Jim Wilson + + * config/obj-elf.h (ECOFF_DEBUGGING): Add missing parens. + +Tue Sep 22 15:44:21 1998 Nick Clifton + + * config/tc-d30v.c (find_format): Do not accept flag registers as + general purpose registers. + (find_format): If an immediate value is expected at a given place + in a format, but a register name has been provided instead, check + to see if that register name matches the name of a predefined + symbol and if it does, then use the symbol instead. + (reg_name_search): If a register name matches a symbol name, + prefer the register name to the symbol name. + +Mon Sep 21 10:42:57 1998 Nick Clifton + + * config/tc-m32r.c (m32r_do_align): After inserting NOPs, reset + the previous insn to empty. + +1998-09-20 Michael Meissner + + * config/tc-ppc.c (md_apply_fix3): Do not break string into two + pieces, forcing the use of an ANSI compiler. + +Sun Sep 20 00:58:12 1998 Andreas Schwab + + * config/tc-m68k.h (TC_FORCE_RELOCATION): New macro. Force vtable + relocs. + * config/tc-m68k.c (md_apply_fix_2): Do nothing for vtable relocs. + +Tue Sep 15 08:51:07 1998 Catherine Moore + + * config/obj-elf.c (obj_elf_vtable_inherit): Handle arm + assembler syntax. + (obj_elf_vtable_entry): Likewise. + * config/tc-arm.h: Define TC_FORCE_RELOCATION for OBJ_ELF. + * config/tc-arm.c (md_apply_fix3): Handle VTABLE relocations. + (tc_gen_reloc): Likewise. + (arm_fix_adjustable): Likewise. + (elf32_arm_force_relocation): New. + (armelf_frob_symbol): Remove coff-style symbol support. + +Wed Sep 9 11:27:16 1998 Richard Henderson + + * config/tc-i386.c (i386_operand): Fix typo in last patch. + +Tue Sep 8 18:10:01 1998 Catherine Moore + + * config/tc-arm.c (arm_adjust_symtab): Move #ifdef + OBJ_COFF so that routine is defined for a.out format. + +Tue Sep 8 15:56:19 1998 Richard Henderson + + * config/tc-i386.c (i386_operand): Detect non-segment registers + used as segment prefixes. + +Sat Sep 5 19:00:38 1998 Ian Lance Taylor + + * ehopt.c (check_eh_frame): Check the size of the FDE, and don't + optimize across FDE boundaries. + + * config/obj-coff.c (obj_coff_section): Preserve any link once + flags when setting the section flags. + +Fri Sep 4 17:07:14 1998 Nick Clifton + + * config/tc-arm.h (obj_adjust_symtab): Fixed typo. + * config/tc-arm.c (armelf_adjust_symtab): Reformatted. + +Fri Sep 4 13:57:43 1998 Jakub Jelinek + + * config/tc-sparc.c (in_signed_range): Sign extend 32-bit words + to the host width. + +Wed Sep 2 11:31:14 1998 Richard Henderson + + * frags.c (frag_grow): Include the size of the frag struct in the + obstack chunk size. + + * subsegs.c (subseg_set_rest): Adjust the seginfo frchain start + if the new subseg comes before the old. + +Tue Sep 1 15:01:33 1998 Jakub Jelinek + + * config/tc-sparc.c (sparc_ip): Allow all digits in an instruction + to handle edge8 and edge16. + +Mon Aug 31 09:51:14 1998 Richard Henderson + + * config/obj-elf.c (obj_elf_vtable_inherit): Print error message + before we clobber the symbol involved. + +Mon Aug 31 10:58:06 1998 Catherine Moore + + * config/tc-arm.c: Remove OBJ_ELF definitions for + S_GET_STORAGE_CLASS and S_SET_STORAGE_CLASS. Only + use arm_adjust_symtab for OBJ_COFF. + (armelf_adjust_symtab): New Routine. + * config/tc-arm.h: Define obj_adjust_symtab to + armelf_adjust_symtab for OBJ_ELF. + +Sat Aug 29 22:18:51 1998 Richard Henderson + + * configure.in: Make all i386-elf targets use bfd_gas. + * config/tc-i386.c (tc_i386_force_relocation): New. + (tc_i386_fix_adjustable): Don't fix vtable relocs. + (md_apply_fix3): Likewise. + (tc_gen_reloc): Handle them. + * config/tc-i386.h (TC_FORCE_RELOCATION): Always define, calling + tc_i386_force_relocation. + +Mon Aug 24 13:40:21 1998 Nick Clifton + + * config/tc-arm.c (md_show_usage): Improve formatting of --help output. + +Fri Aug 21 18:43:48 1998 Nick Clifton + + * config/tc-d30v.c (md_assemble): Copy previous opcode over + current opcode after writing the first insturction of a reverse + sequential pair. + +Fri Aug 21 07:30:35 1998 Doug Evans + + * read.h (generate_lineno_debug): Add prototype. + * read.c (generate_lineno_debug): Make non-static. + +Thu Aug 20 23:17:04 1998 Alan Modra + + * config/tc-i386.c (md_assemble): Only warn for address/data size + prefixes. + +Thu Aug 20 14:45:08 1998 Nick Clifton + + * config/tc-arm.c (arm_fix_adjustable): Do not adjust relocations + against Thumb function names, as the linker needs this information. + +1998-08-20 Vladimir N. Makarov + + * expr.c (operand): Check also that there is no advance in operand + after atof_generic in order to decide "is it label 0f or floating + point number?". + +Wed Aug 19 09:30:16 1998 Nick Clifton + + * config/tc-m32r.c: Replace double dash prefix to M32R specific + command line options with a single dash. + * doc/c-m32r.texi: Replace double dash prefix with a single dash. + +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. + +1998-08-13 Vladimir N. Makarov + + * read.c (s_align, s_comm, s_mri_common, s_fail, s_globl, s_space, + s_float_space, s_struct, cons_worker): Move ignore_rest_of_line or + demand_empty_rest_of_line before mri_comment_end. + (equals): Check garbage after expression before + mri_comment_end in MRI mode. + +Thu Aug 13 15:08:42 1998 Ian Lance Taylor + + * config/tc-mips.c (macro): Correct M_SGE_I/M_SGEUI_I case for a + small immediate constant to use the constant itself rather than + always using 1. + +Wed Aug 12 18:47:38 1998 Ian Lance Taylor + + * config/tc-hppa.c (pa_enter): Call as_bad rather than abort. + (pa_leave): Likewise. + +Wed Aug 12 13:25:03 1998 Alan Modra + + * config/tc-i386.c (md_assemble): Emit a warning for stand-alone + prefixes. + (i386_operand): Fix an error message. + +Tue Aug 11 14:44:32 1998 Nick Clifton + + * doc/c-arm.texi (ARM Directives): Document .req directive. + + * config/tc-arm.c (reg_required_here): Display erroneous string if + the register name could not be decoded. + Do not set inst.instruction if the sift is -1. + +Mon Aug 10 15:39:56 1998 Richard Henderson + + * config/tc-alpha.c (tc_gen_reloc): Bias WEAK symbols just as + we do for EXTERN. + +Mon Aug 10 15:06:18 1998 Nick Clifton + + * config/tc-d30v.c (d30v_align): Always perform alignment request, + even if it is belived to be unnecessary. + +Mon Aug 10 17:48:09 1998 Alan Modra + + config/tc-i386.c (i386_operand): Size immediate constants by + suffix (erroneously removed as part of July 7 change). + +Sun Aug 9 20:45:32 1998 Catherine Moore + + * config/obj-elf.h: Check for redefinition of obj_frob_symbol. + * config/tc-arm.c: Define S_GET_STORAGE_CLASS and S_SET_STORAGE_CLASS. + (armelf_frob_symbol): New Routine. + * config/tc-arm.h: Define obj_frob_symbol if OBJ_ELF. + +Sat Aug 8 15:21:28 1998 Richard Henderson + + * config/tc-alpha.c (alpha_fix_adjustable): Don't adjust weak syms. + +Wed Aug 5 15:54:14 1998 Nick Clifton + + * config/tc-arm.c (md_begin): Set BFD private flags depending upon + command line switches passed to assembler. + +Mon Aug 3 14:02:52 1998 Doug Evans + + * cgen.h (GAS_CGEN_MAX_FIXUPS): GAS_ prepended, all uses updated. + (gas_cgen_opcode_desc): Declare. + (gas_cgen_parse_operand): Declare. + (*): Prepend gas_ to gas specific fns to denote them as such. + All uses updated. + * cgen.c (gas_cgen_opcode_desc): New global + (gas_cgen_init_parse): Renamed from cgen_asm_init_parse. + (queue_fixup): Renamed from cgen_queue_fixup. + (*): Prepend gas_ to gas specific fns to denote them as such. + All uses updated. + (gas_cgen_md_apply_fix3): Update call to insert_operand. + (gas_cgen_finish_insn): Renamed from cgen_asm_finish_insn. + * config/tc-m32r.c (md_begin): Remove use of CGEN_SYM. + Open opcode table and initialize it. + (make_parallel): Use gas_cgen_opcode_desc. + (assemble_parallel_insn): Ditto. Remove use of CGEN_SYM. + (md_assemble): Ditto. + +Sat Aug 1 19:27:30 1998 Richard Henderson + + * as.h (debug_info_type): Add entries for unspecified and dwarf*. + * ecoff.c (ecoff_generate_asm_lineno): Take no arguments; call + as_where ourselves. Provide a stub for !ECOFF_DEBUGGING. + * ecoff.h: Move ECOFF_DEBUGGING protection inside GAS_ECOFF_H. + Move ecoff_generate_asm_lineno outside ECOFF_DEBUGGING protection. + * read.c (generate_lineno_debug): Tidy ECOFF bits. Use + DEBUG_UNSPECIFIED rather than DEBUG_NONE for initial test. + * config/obj-elf.h (ECOFF_DEBUGGING) [TC_ALPHA]: Define to a variable. + (SEPARATE_STAB_SECTIONS): Conditionalize on value of ECOFF_DEBUGGING. + (INIT_STAB_SECTION): Likewise. + (OBJ_PROCESS_STAB): Likewise. + + * config/tc-alpha.c (md_longopts): New options -mdebug/-no-mdebug. + (md_parse_option): Watch for them. + (alpha_cur_ent_sym, alpha_flag_mdebug): New variables. + (md_begin): Kill neverdef code. + (s_alpha_ent, s_alpha_end, s_alpha_mask, s_alpha_frame): New. + (s_alpha_prologue): Watch alpha_cur_ent_sym. + (s_alpha_coff_wrapper): New. + (md_pseudo_table): Trap all ECOFF pseudos. + +Fri Jul 31 16:45:54 1998 Ron Unrau + + Start of changes to remove mdebug section from mips*-elf + Based on MIPS_STAB_ELF definition + * acconfig.h: undef if not configured + * config.in: undef if not configured + * config/mips-elf.h: only set ECOFF debugging if not stabs-in-elf + * config/tc-mips.c (s_ent): set BSF_FUNCTION + * stabs.c (s_stab_generic): flush frag + +Fri Jul 31 16:14:45 1998 Catherine Moore + + * configure.in: (arm-*-elf): Handle. + (thumb-*-elf): Handle. + * configure: Regenerate. + * read.c (stringer): Fix typo in comment. + * write.c (fixup_segment): Don't add symbol value to addend if + TC_ARM and OBJ_ELF. + * config/tc-arm.c (md_section_align): Don't align dwarf debug + sections. + (tc_gen_reloc): Always set the reloc addend to fixp->fx_offset + for OBJ_ELF. + +Thu Jul 30 21:38:43 1998 Frank Ch. Eigler + + * config/tc-d30v.c ({cur,prev}_left_kills_right_p): New variables. + (write_2_short): Emit warning if new flag is set. + (do_assemble): Set flags if left instruction is one of special + "right-instruction-killer" type. + +Tue Jun 28 18:12:28 1998 Stan Cox + + * config/tc-sparc.c (md_number_to_chars, cons_fix_new_sparc): + Always output words in debug_info section as big endian. + (sparc_target_format): Choose correct bfd target. + (md_apply_fix3): Rename BFD_RELOC_SPARC_32LE to BFD_RELOC_SPARC_REV32. + +Tue Jul 28 11:01:21 1998 Jeffrey A Law (law@cygnus.com) + + * config/tc-mn10300.c (md_assemble): Fix "errmsg" initialization + to work with internationalization code. Issue an error when two + operands match that are not allowed to match. + +Mon Jul 27 16:25:58 1998 Doug Evans + + * configure.in (install_tooldir): Allow target to specify whether + it wants to be installed in $(tooldir)/bin. + * configure: Regenerate. + * Makefile.am (install-exec-local): Set install-exec-tooldir + dependency via configure. + * Makefile.in: Regenerate. + +Fri Jul 24 19:58:59 1998 Doug Evans + + * Makefile.am (install-exec-local): Split into two ... + (install-exec-bindir,install-exec-tooldir): New rules. + * Makefile.in: Regenerate. + +Fri Jul 24 16:31:49 1998 Ian Lance Taylor + + * Makefile.am (install-exec-local): Don't remove the file before + checking whether $(bindir) == $(tooldir)/bin. From Maciej + W. Rozycki . + * Makefile.in: Rebuild. + +Fri Jul 24 09:13:46 1998 Doug Evans + + * cgen.c: Include libiberty.h. + (cgen_md_apply_fix3): Update call to md_cgen_lookup_reloc. + (cgen_tc_gen_reloc): Use xmalloc, not bfd_alloc. + * cgen.h (cgen_md_apply_fix3,cgen_tc_gen_reloc): Declare. + (md_cgen_lookup_reloc)): Declare. + (md_cgen_record_fixup_exp): Declare. + * config/tc-m32r.h (md_pcrel_from_section): Declare. + (m32r_relax_frag): Declare. + (cgen_md_apply_fix3): Decls moved to cgen.h. + (cgen_record_fixup_exp,cgen_tc_gen_reloc): Ditto. + (m32r_cgen_record_fixup_exp): Delete decl. + * config/tc-m32r.c (m32r_cpu_desc): #if 0 out. + (assemble_nop): Delete. + (expand_debug_syms): Delete unused `exp'. + (md_cgen_lookup_reloc): Renamed from CGEN_SYM (lookup_reloc). + Add default case for -Wall. + (m32r_cgen_record_fixup_exp): Add default case for -Wall. + (md_atof): Delete unused wordP. + +Thu Jul 23 13:19:50 1998 Jeffrey A Law (law@cygnus.com) + + * config/tc-mn10300.c (md_assemble): Make sure "errmsg" has a non-NULL + value. + +Wed Jul 22 14:36:56 1998 Ian Lance Taylor + + * doc/as.texinfo: Add documentation for .end, .exitm, .fail, + .ifc, .ifeqs, .ifge, .ifgt, .ifle, .iflt, .ifnc, .ifne, .ifnes, + .print, .purgem, and .struct. Remove documentation for + .app-file. + +Tue Jul 21 16:50:52 1998 Doug Evans + + * cgen.c (cgen_md_apply_fix3): set_operand renamed to set_vma_operand. + Update call to insert_operand. + +Fri Jul 17 11:42:20 1998 Nick Clifton + + * config/tc-m32r.c (ms_show_usage): Formatting changes. + +Wed Jul 15 15:38:28 1998 Ian Lance Taylor + + * config/tc-i386.c (md_assemble): Don't get confused by trailing + whitespace after a prefix operator. + +Tue Jul 14 15:32:56 1998 Richard Henderson + + * configure.in (i386-*-beos{pe,elf,}*): Recognize. + +Tue Jul 14 12:33:44 1998 Chris Torek + + * config/tc-sparc.c (log2): New static function. + (s_reserve): Use log2 to convert alignment before calling + record_alignment. + (s_common): Use log2 to convert alignment before calling + record_alignment and frag_align. + (sparc_cons_align): Use log2. + +Tue Jul 14 11:58:40 1998 Ian Lance Taylor + + * config/tc-sparc.c (s_reserve): Set symbol size if OBJ_ELF. + (s_common): Likewise. + + * config/tc-sparc.c (sparc_handle_align): Reindent a bit. Correct + initialization of waddr. + (sparc_elf_final_processing): Add default case to switch. + +Tue Jul 14 11:00:16 1998 Alan Modra + + * doc/c-i386.texi: Fix a typo. Use the term 80-bit real rather + than temporary real. + +Mon Jul 13 13:55:42 1998 Ian Lance Taylor + + * write.c (subsegs_finish): Don't align the segments if there were + any errors. + + * config/obj-coff.c (c_symbol_merge): Correct number of bytes when + copying aux information. + + * expr.c (make_expr_symbol): Catch attempts to turn an O_big + expression into a symbol. + +Mon Jul 13 13:29:04 1998 Alan Modra + + * config/tc-i386.c (mode_from_disp_size): Change arg and return + type to unsigned int. + (md_assemble): Change type used to store offsets from unsigned + long to long. + (i386_operand): Switch error check to only call RESTORE_END_STRING + once after parse_register. + +Fri Jul 10 16:00:04 1998 Nick Clifton + + * config/tc-v850.c (md_show_usage): Changed format to match that + of gcc, ld, etc. + + * as.c (show_usage): Changed format to match that of gcc, ld, etc. + +Thu Jul 9 12:09:57 1998 Andreas Schwab + + * config/tc-m68k.c (tc_m68k_fix_adjustable): Don't adjust vtable + relocs. + (md_apply_fix_2): Force the symbol of the vtable reloc to be + weak. + +Thu Jul 9 11:31:54 1998 Ian Lance Taylor + + * doc/Makefile.am (MAINTAINERCLEANFILES): Define. + * doc/Makefile.in: Rebuild. + +Wed Jul 8 12:18:56 1998 Jeffrey A Law (law@cygnus.com) + + * config/tc-mips.c (mips_ip, case 'i' and 'j'): Mask off high bits + for %lo expressions. + (mips_ip, case 'u'): Move range check after code to mask + off bits in %hi/%lo expressions. Mask off high bits for + %lo expressions. + +Tue Jul 7 17:57:38 1998 Ian Lance Taylor + + * doc/Makefile.am (gasver.texi): New target. + (as.info, as.dvi): Depends upon gasver.texi. + * doc/as.texinfo: Include gasver.texi. Mention version number on + title page and in top node. + * doc/Makefile.in: Rebuild. + +Tue Jul 7 11:42:16 1998 Richard Henderson + + * listing.c (listing_listing): For EDICT_LIST, skip all lines up to + but not including the line containing the edict. + * listing.h (LISTING_EOF): New. + * input-scrub.c (input_scrub_next_buffer): Call it. + +Tue Jul 7 13:00:37 1998 Alan Modra + + * config/tc-i386.c (i386_operand): Don't set the size of an + immediate address based solely on the suffix and the mode. + + * config/tc-i386.c (md_assemble): Add assertion to make sure + overlap2 does not set Imm. + + * config/tc-i386.c (space_chars): Remove. The scrubber converts + sequences of whitespace to a single space. + (is_space_chars): Just compare with space. + (md_begin): Don't initialize space_chars. + (md_assemble): Just skip a single whitespace character. + (i386_operand): Rewrite base-index parsing to use new + parse_register, and to skip white space. Skip white space in a + number of other places too. Don't give error message if + parse_register fails. + (parse_register): Change reg_string parameter to be non-const. + Add end_op parameter. Skip white space after the `%', and return + end of register string. Give error message here rather than + caller. + +Fri Jul 3 15:34:34 1998 Ian Lance Taylor + + Based on patch from Matt Semersky : + * expr.c (op_encoding): Make const. + (expr_set_precedence): New function. + (expr_begin): Don't set operator rankings, just call + expr_set_precedence. + * expr.h (expr_set_precedence): Declare. + * read.c (s_mri): Call expr_set_precedence. + +Thu Jul 2 16:24:58 1998 Ian Lance Taylor + + * doc/as.texinfo (Statements): Remove paragraph discussing + continuing lines with a backslash. This hasn't worked for years, + if it ever did. + +Thu Jul 2 14:06:22 1998 Klaus Kaempf + + * 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. + (vms_fixup_xtors_section): New function + (Ctors_Psect, Dtors_Psect): Define. + (IS_GXX_XTOR): Define + (global_symbol_directory): Change check of gxx_bug_fixed to 0. + Filter static constructors/destructors and add to + Ctors_Symbols/Dtors_Symbols chain. + (vms_write_object_file): Write Ctors_Symbols/Dtors_Symbols to + appropriate section. + + * 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 + + * config/obj-elf.c (obj_elf_vtable_inherit, obj_elf_vtable_entry): New. + (elf_pseudo_table): Add them. + * config/tc-mips.c (mips_force_relocation): Force vtable relocs. + (md_apply_fix): Accept them. + (mips_fix_adjustable): Don't adjust them. + (tc_gen_reloc): Mung BFD_RELOC_VTABLE_ENTRY for Rel. + * config/tc-ppc.c (md_apply_fix3): Accept vtable relocs. + * config/tc-ppc.h (TC_FORCE_RELOCATION_SECTION): Force vtable relocs. + (tc_fix_adjustable): Don't adjust them. + +Wed Jul 1 16:35:32 1998 Doug Evans + + * Makefile.am (CGEN_CPU_PREFIX): New variable. + (cgen.o): Use it. + * Makefile.in: Regenerate. + * configure.in: AC_SUBST cgen_cpu_prefix. + * configure: Regenerate. + +Wed Jul 1 21:38:56 1998 J"orn Rennecke + + * config/tc-sh (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) + + * config/tc-mn10300.c (set_arch_mach): New function. + (md_pseudo_table): Add pseudo-ops to set the current machine type. + (md_begin): Default to mn10300 mode. + (md_assemble): Only accept instructions for the core mn10300 + chip and the active machine type. + +Wed Jun 24 19:06:04 1998 Ian Lance Taylor + + * subsegs.h (segment_info_type): Give the struct a name. + * config/tc-h8300.h (tc_reloc_mangle): Add prototype. + * config/tc-h8500.h (tc_reloc_mangle): Declare. + * config/tc-sh.h (sh_coff_reloc_mangle): Add prototype. + * config/tc-w65.h (tc_reloc_mangle): Declare. + * config/tc-z8k.h (tc_reloc_mangle): Declare. + +Wed Jun 24 13:45:00 1998 Catherine Moore + + * config/tc-v850.c (v850_comm): Restore old section + after common processing. + +Wed Jun 24 11:50:54 1998 Klaus Kaempf + + * config/obj-vms.c (Create_VMS_Object_File): Force binary file. + +Tue Jun 23 17:47:31 1998 Jim Wilson + + * config/tc-h8300.c (do_a_fix_imm, build_bytes): Replace cast to + char with code that explicitly sign-extends. + +Tue Jun 23 13:54:57 1998 Nick Clifton + + * config/tc-v850.c (md_begin): Restore text section as the current + section after creating call table sections. + * config/obj-coff.h (SYM_AUXINFO): New macro to conceal ugly + code. + + * config/obj-coff.c (c_symbol_merge): Replace complex expresion + with call to macro SYM_AUXINFO. + +Tue Jun 23 15:09:27 1998 Mike Stump + + * Makefile.am (install-exec-local): Don't let EXEEXT interfere + with the program transform name. + * Makefile.in: Rebuild. + +Mon Jun 22 19:52:42 1998 Ian Lance Taylor + + * config/obj-coff.c (c_symbol_merge): Fix copying of auxiliary + information. + +Mon Jun 22 15:18:58 1998 Ian Lance Taylor + + * config/tc-i386.c (i386_operand): Be prepared for a space between + the open parenthesis and the start of the register operand, + because of the June 16 change. + +Sun Jun 21 21:27:03 1998 Ian Lance Taylor + + * config/tc-sh.c (md_apply_fix): Handle weak symbols correctly if + BFD_ASSEMBLER. + +Sun Jun 21 12:26:36 1998 Nick Clifton + + * config/tc-d30v.c (d30v_align): Always perform alignment request, + even if it is belived to be unnecessary. + +Fri Jun 19 13:57:06 1998 Ian Lance Taylor + + * write.c (adjust_reloc_syms): Never adjust relocs against weak + symbols. + * config/tc-mips.c (md_apply_fix): Adjust accordingly. + +Fri Jun 19 09:50:17 1998 Jeffrey A Law (law@cygnus.com) + + * config/tc-mn10300.c (mn10300_insert_operand): Do not hardcode the + shift amount for a repeated operand. The shift amount for the + repeated copy comes from the size of the operand. + +Fri Jun 19 00:44:19 1998 Jeffrey A Law (law@cygnus.com) + + * config/tc-h8300.c (get_operand): Fix typos in ldm/stm support. + +Wed Jun 17 13:07:05 1998 Ian Lance Taylor + + * config/tc-mips.c (md_show_usage): Fix -mipsN usage. + +Tue Jun 16 13:06:21 1998 Alan Modra + + * app.c (do_scrub_begin): If tc_symbol_chars is defined, treat all + characters in it as LEX_IS_SYMBOL_COMPONENT. + * config/tc-i386.h (tc_symbol_chars): Define. + (extra_symbol_chars): Declare. + * config/tc-i386.c (extra_symbol_chars): Define. + (comment_chars): Don't use '/' as comment start if TE_LINUX. + (line_comment_chars): Set to '/' if TE_LINUX. + * doc/c-i386.texi (i386-prefixes): Update. + * doc/internals.texi (CPU backend): Document tc_symbol_chars. + +Fri Jun 12 13:36:54 1998 Tom Tromey + + * po/Make-in (all-yes): If maintainer mode, depend on .pot file. + ($(PACKAGE).pot): Unconditionally depend on POTFILES. + +1998-06-12 Vladimir N. Makarov + + * config/tc-d10v.c (md_apply_fix3): Checking displacement + constraint in instructions REP & REPI. + +Thu Jun 11 08:56:46 1998 Nick Clifton + + * config/tc-d30v.c (md_apply_fix3): Catch BFD_RELOC_8, + BFD_RELOC_16, BFD_RELOC_64 and issue appropriate error messages. + + (check_range): If the operand is shifted, then shift the number + before checking its range. + + * write.c (adjust_reloc_syms): Add more checks for NULL pointers. + + * config/tc-v850.c (v850_comm): Set SEC_COMMON bit on special + common sections. + +Wed Jun 10 17:26:35 1998 Nick Clifton + + * config/tc-v850.c (v850_comm): Create special sections as needed. + +1998-06-10 Vladimir N. Makarov + + * config/tc-d10v.c (write_2_short): Addition of swapping + instructions for sequential and reverse sequential order when + given order is not possible. + +Tue Jun 9 13:52:53 1998 Ian Lance Taylor + + * Makefile.am: Rebuild dependencies. + (DEP_INCLUDES): Fix reference to intl build directory. + * Makefile.in: Rebuild. + +Tue Jun 9 12:20:05 1998 Alan Modra + + * doc/c-i386.texi: Update 16 bit documentation. + + * config/tc-i386.h: Change Data16 to Size16, Data32 to Size32, + IgnoreDataSize to IgnoreSize as they are used for address size as + well as data size. + * config/tc-i386.c: Likewise. Add code to reject addr32/data32 in + 32-bit mode, similarly addr16/data16 and variants. + +Mon Jun 8 18:32:01 1998 Nick Clifton + + * config/tc-d30v.c (md_assemble): Fix handling of reverse + sequential word multiply instructions. + + (do_assemble): Add extra command line argument, to allow mul32 + attribute to be preserved across parallel insns. + (md_assemble): Insert NOPs between explicitly parallel insns which + contain an 32 bit multiply and a 16 multiply. + +Mon Jun 8 12:20:30 1998 Alan Modra + + * config/tc-i386.c: REPNE renamed to REPNE_PREFIX_OPCODE, and + likewise for REPE. + + * config/tc-i386.c (reloc): Add braces. + + * config/tc-i386.c (struct _i386_insn): Rename bi to sib to be + consistent with Intel naming. + * config/tc-i386.h (base_index_byte): Rename to sib_byte. Don't + use bitfields in sib_byte. + (modrm_byte): Don't use bitfields here either. + + * config/tc-i386.c (current_templates): Add const. + (parse_register): Add const to return, param, and char *s. + (i386_operand): Add const to reg_entry *r. + * config/tc-i386.h (templates): Add const to start, end. + + Inspired by code for 16 bit gas support from Martynas Kunigelis + : + * config/tc-i386.c (md_assemble): Add full support for 16 bit + modrm, and Jump, JumpByte, JumpDword, JumpInterSegment insns. + (uses_mem_addrmode): Remove. + (md_estimate_size_before_relax): Add support here too. + (md_relax_table): Rewrite interface to md_relax for 16 bit + support. + (BYTE, WORD, DWORD, UNKNOWN_SIZE): Remove. + (opcode_suffix_to_type): Remove. + (CODE16, SMALL, SMALL16, BIG, BIG16): Define. + (SIZE_FROM_RELAX_STATE): Modify to suit above. + (md_convert_frag): Likewise. + (i386_operand): Add support for 16 bit base/index regs, + immediates, and displacements. Remove some unnecessary casts, and + localise end_of_operand_string, displacement_string_start, + displacement_string_end variables. Add GCC_ASM_O_HACK. + * config/tc-i386.h (NO_BASE_REGISTER_16): Define. + + * config/tc-i386.c (prefix_hash): Remove. + (md_begin): Rewrite without obstacks. Remove prefix hash table + handling. Rewrite lexical table handling. + (i386_print_statistics): Don't print prefix statistics. + (md_assemble): Rewrite instruction parser so that line is not + converted to lower case. Don't do a hash_find for prefixes, + instead recognise them via opcode modifier. + (expecting_operand, paren_not_balanced): Localise variables. + * config/tc-i386.h (IsPrefix): Define. + (prefix_entry): Remove. + + * config/tc-i386.h (PREFIX_SEPERATOR): Don't define. + * config/tc-i386.c (PREFIX_SEPARATOR): Define here instead, using + '\\' in case where comment_chars contains '/'. + + * config/tc-i386.c (MATCH): Ensure given operand and template + match for JumpAbsolute. Makes e.g. `ljmp table(%ebx)' invalid; + you must write `ljmp *table(%ebx)'. + + From H.J. Lu : + * config/tc-i386.c (BFD_RELOC_16, BFD_RELOC_16_PCREL): Define + as 0 ifndef BFD_ASSEMBLER. + (md_assemble): Allow immediate operands without suffix or + other reg operand to default in size to the current code size. + +Mon Jun 8 09:45:00 1998 Catherine Moore + + * config/tc-v850.c (md_begin): Restore creation of + .call_table_text and .call_table_data sections. + +Sat Jun 6 00:02:41 1998 Nick Clifton + + * config/tc-d30v.c (md_assemble): Set execution type to unknown + after emitting a word of noops. + +Fri Jun 5 23:27:04 1998 Alan Modra + + * config/tc-i386.c (mode_from_disp_size): Disp16 is mode 2. + (i386_operand): Simplify checks for valid base/index combinations. + Disallow `in 4(%dx),%al'. + + * config/tc-i386.c (struct _i386_insn): Make regs, base_reg, and + index_reg const. + (add_prefix): Change parameter from char to int. + + * config/tc-i386.h (Ugh): Define opcode modifier. + * config/tc-i386.c (md_assemble): Print warnings for Ugh insns. + + * config/tc-i386.c (md_assemble): Rewrite MATCH and + CONSISTENT_REGISTER_MATCH macros to check register types more + thoroughly. Check for illegal suffix/operand combinations + when matching insns with operands. Handle new `s' suffix, and + associated FloatMF opcode modifier for float insns with memory + operands. + * config/tc-i386.h (FloatMF): Define new opcode modifier. + (No_sSuf, No_bSuf, No_wSuf, No_lSuf): Likewise. + (SHORT_OPCODE_SUFFIX, LONG_OPCODE_SUFFIX): Define. + * config/tc-i386.c: Rename WORD_PREFIX_OPCODE to + DATA_PREFIX_OPCODE throughout. + + * config/tc-i386.c (REGISTER_WARNINGS): Define. + (md_assemble): Rewrite suffix/register operand checking code to be + more thorough. Remove Abs8,16,32. Change occurrences of Mem to + AnyMem, the better to grep. + (pi): Remove Abs. + (i386_operand): Don't set Mem bits in i.types[this_operand] when + given a memory operand. Don't set Abs bits either. + (type_names): Remove Mem*, Abs*. + * config/tc-i386.h (Mem8, Mem16, Mem32, Abs8, Abs16, Abs32): Don't + define opcode_modifiers as these cases are handled by Disp8, + Disp16, Disp32 and suffix checks. + (COMES_IN_BOTH_DIRECTIONS): Remove. + (FloatR): Define. It's OK to share the bit with ReverseRegRegmem. + + * config/tc-i386.c (md_assemble): Don't emit operand size prefix + if IgnoreDataSize modifier given. Remove ShortformW modifier + test. Add test for ShortForm in W base_opcode modification. + Merge Seg2ShortForm and Seg3ShortForm code. + * config/tc-i386.h (ShortFormW): Remove. + (IgnoreDataSize): Define. + +Fri Jun 5 10:50:53 1998 Nick Clifton + + * config/tc-d30v.c (md_assemble): Store previous segment state + with previous instruction. + +Wed Jun 3 18:21:56 1998 Alan Modra + + * config/tc-i386.c (SCALE1_WHEN_NO_INDEX): Define. + (ebp, esp): Remove static variables. + (MATCH): Remove test for InOutPortReg. + (i386_operand): Properly handle InOutPortReg here instead. + Disallows `inb (%dx,2)', `inb %es:(%dx)' and `mov (%dx),%ax' + (md_assemble): Simplify and correct modrm and sib generation. + (i386_operand): Add warning for scale without index. + Rewrite checks for valid base/index combinations. + + * config/tc-i386.c (END_STRING_AND_SAVE): Protect arguments of + macros and enclose in do while(0). + (RESTORE_END_STRING): Likewise. + (md_assemble): Add one to printed operand number so we start + from 1 not 0. Add some more gettext invocations. + (i386_operand): Fix `%%s' -> `%%%s'. Inc printed operand + number here too. + + * config/tc-i386.h (WAIT_PREFIX, LOCKREP_PREFIX, ADDR_PREFIX, + DATA_PREFIX, SEG_PREFIX): Define. + * config/tc-i386.c (struct _i386_insn): Remove wait_prefix field. + (check_prefix): Remove function. + (add_prefix): New function. Add prefix to i.prefix as well as + doing checks. + (md_assemble): Changes for add_prefix. Remove hack for wait + prefix, instead always output prefixes in fixed order. Test + for jcxz/loop when selecting between word & dword operations, + and add address size prefix rather than operand size prefix. + Remove operand -> address size hack when emitting jcxz/loop. + (i386_operand): Remove O_Absent check as it's done in expr. + +Wed Jun 3 15:09:10 1998 Ian Lance Taylor + + * configure.in: Recognize m5200 as a cpu_type of m68k. + * aclocal.m4: Rebuild with current libtool. + * configure: Rebuild. + +Wed Jun 3 14:11:59 1998 Andreas Schwab + + * config/tc-m68k.c (md_estimate_size_before_relax): Add more calls + to relaxable_symbol to prevent references to external symbol from + being relaxed. + +Wed Jun 3 14:10:36 1998 Ian Lance Taylor + + * config/tc-m68k.c (relaxable_symbol): If TARGET_OS is "elf", all + symbols are relaxable. + +Wed Jun 3 09:16:00 1998 Catherine Moore + + * config/tc-v850.c (md_begin): Don't create special + sections by default. + +Tue Jun 2 14:52:56 1998 Jeffrey A Law (law@cygnus.com) + + * config/tc-mips.c (macro): For div and udiv, close the + reorder block as soon as possible. + +Tue Jun 2 15:36:13 1998 Ian Lance Taylor + + From Matt Semersky : + * macro.c (macro_mri_mode): New function. + * macro.h (macro_mri_mode): Declare. + * read.c (s_mri): Call macro_mri_mode when switching in and out of + MRI mode. + +Tue Jun 2 13:32:22 1998 Klaus Kaempf + + * config/tc-alpha.c (s_alpha_comm): Allow alignment parameter in + OBJ_EVAX case. + + * config/tc-alpha.c (s_alpha_comm): Defer restoring character + until after xstrdup in OBJ_EVAX case. + +Tue Jun 2 13:11:13 1998 Pat Rankin + + * config/tc-vax.c (md_create_short_jump): Fix off by two bug in + offset calculation. Also, use VAX_BRW from vax-inst.h instead + of hardcoded magic number. + (md_create_long_jump): Use VAX_JMP and VAX_ABSOLUTE_MODE macros. + +Tue Jun 2 09:25:34 1998 Doug Evans + + * read.c (do_s_func): New function. + (s_func): Call it. + * read.h (do_s_func): Add prototype. + +Mon Jun 1 12:47:30 1998 Doug Evans + + * config/tc-m32r.c (m32r_do_align): Only fill code sections with + nops if fill pattern not specified. + +Mon Jun 1 14:08:35 1998 Ian Lance Taylor + + From Andrew Crabtree : + * config/te-go32.h (TE_GO32): Define. + * config/tc-i386.h (LOCAL_LABEL): Don't define if TE_GO32. + +Sun May 31 15:43:06 1998 Doug Evans + + Implement .func/.endfunc pseudo-ops. + * read.h (stabs_generate_asm_func,stabs_generate_asm_endfunc): Declare. + (s_func): Declare. + * read.c (potable): Add .func,.endfunc. + (s_func): New function. + * stabs.c (stabs_generate_asm_func,stabs_generate_asm_endfunc): New + functions. + (in_doc_func_p,current_function_label): New static globals. + (stabs_generate_asm_lineno): Emit function relative stabs if in .func. + +Fri May 29 18:13:12 1998 Ian Lance Taylor + + * config/tc-a29k.h (WORKING_DOT_WORD): Define. + * config/tc-alpha.h (WORKING_DOT_WORD): Define. + * config/tc-arm.h (WORKING_DOT_WORD): Define. + * config/tc-h8300.h (WORKING_DOT_WORD): Define. + * config/tc-h8500.h (WORKING_DOT_WORD): Define. + * config/tc-hppa.h (WORKING_DOT_WORD): Define. + * config/tc-i860.h (WORKING_DOT_WORD): Define. + * config/tc-i960.h (WORKING_DOT_WORD): Define. + * config/tc-tic30.h (WORKING_DOT_WORD): Define. + * config/tc-w65.h (WORKING_DOT_WORD): Define. + * config/tc-z8k.h (WORKING_DOT_WORD): Define. + * config/tc-a29k.c: Don't define md_short_jump_size, + md_long_jump_size, md_create_short_jump or md_create_long_jump. + * config/tc-alpha.c: Likewise. + * config/tc-alpha.h: Likewise. + * config/tc-arm.c: Likewise. + * config/tc-h8300.c: Likewise. + * config/tc-h8500.c: Likewise. + * config/tc-hppa.c: Likewise. + * config/tc-i860.c: Likewise. + * config/tc-i960.c: Likewise. + * config/tc-ppc.c: Likewise. + * config/tc-sh.c: Likewise. + * config/tc-sparc.h: Likewise. + * config/tc-tic30.c: Likewise. + * config/tc-w65.c: Likewise. + * config/tc-z8k.c: Likewise. + +Fri May 29 16:03:26 1998 Pat Rankin + + * config/tc-vax.c (_): Delete this macro used for placeholder + values in vax_operand_width_size; it conflicts with the _() macro + used for internationalization. + +Fri May 29 13:46:07 1998 Ian Lance Taylor + + * symbols.c (symbol_find_base): Fix case insensitive symbol name + code. From Chris Moller . + + Based on patch from Klaus Kaempf : + * struc-symbol.h (struct broken_word): Add seg and subseg fields. + * read.c (emit_expr): Initialize seg and subseg fields of a new + broken word. + * write.c (write_object_file): Switch to the appropriate segment + and subsegment when processing a broken word. + + * config/tc-m68k.c (mri_assemble): New static function. + (build_mri_control_operand): Call mri_assemble rather than + md_assemble. + (s_mri_else, s_mri_break, s_mri_next, s_mri_for): Likewise. + (s_mri_endf, s_mri_endw): Likewise. + +Wed May 27 11:16:25 1998 Ian Lance Taylor + + * read.c (s_org): Call md_flush_pending_output if it is defined. + + * config/tc-sparc.c (md_show_usage): Add \n\ to new string. + +Tue May 26 19:27:52 1998 Stan Cox + + * config/tc-sparc.c (OPTION_LITTLE_ENDIAN_DATA): New. + (md_parse_option): Add for same. + (sparc_md_end): Set bfd_mach_sparc_sparclite_le. + (md_apply_fix3, tc_gen_reloc): Allow BFD_RELOC_SPARC_32LE. + (cons_fix_new_sparc): Added to create BFD_RELOC_SPARC_32LE. + + * config/tc-sparc.h (cons_fix_new_sparc): Added. + +Thu May 21 15:02:41 1998 Nick Clifton + + * config/tc-arm.c (find_real_start): Relax definition of local + labels. + +Tue May 19 16:59:44 1998 Nick Clifton + + * config/tc-d30v.c (d30v_align): Apply address adjustment to all + symbols at the given address, not just the last one specified. + +Tue May 19 08:25:19 1998 Catherine Moore + + * config/tc-sparc.c (sparc_handle_align): Use number_to_chars_bigendian + or number_to_chars_littleendian to write data. + +Mon May 18 17:09:30 1998 Nick Clifton + + * config/tc-v850.c (md_assemble): Remove artificially created + register name symbols. + +Mon May 18 13:47:06 1998 Doug Evans + + * write.c (fixup_segment): Change "segment" to "section" in + error message. + +Mon May 18 16:55:40 1998 Michael Meissner + + * write.c (fixup_segment): Change sym1-sym2 message again. + +Mon May 18 09:31:43 1998 Michael Meissner + + * write.c (fixup_segment): Improve error message for sym1-sym2 + errors when sym1 is in a different segment from sym2. + +Wed May 13 10:16:37 1998 Doug Evans + + * config/tc-m32r.c (warn_unmatched_high): New static local. + (OPTION_WARN_PARALLEL): Rename from OPTION_WARN. + (OPTION_NO_WARN_PARALLEL): Rename from OPTION_NO_WARN. + (md_longopts): Recognize --{no-,}warn-unmatched-high. + (md_parse_option): Likewise. + (md_show_usage): Likewise. + (m32r_frob_file): Likewise. + + * read.c (generate_file_debug,generate_lineno_debug): New functions. + (read_a_source_file): Call them. + * read.h (stabs_generate_asm_file): Declare. + * stabs.c (stabs_generate_asm_file): New function. + (generate_asm_file): New function. + (stabs_generate_asm_lineno): Move file name handling into + generate_asm_file. + +Tue May 12 12:03:44 1998 Richard Henderson + + * config/tc-d30v.c (cur_mul32_p, prev_mul32_p): Make static. + (d30v_current_align, d30v_current_align_seg): New variables. + (d30v_last_label): New variable. + (d30v_align, s_d30v_align, s_d30v_text): New functions. + (s_d30v_data, s_d30v_section): Likewise. + (md_pseudo_table): Call them. + (md_begin): Initialize d30v_current_align_seg. + (md_assemble): Call d30v_align when needed by known current alignment. + (d30v_frob_label, d30v_cons_align): New functions. + * config/tc-d30v.h (md_do_align): Remove. + (tc_frob_label): Call d30v_frob_label. + (md_cons_align): New. + + * config/tc-d30v.c (find_format): Convert complex expressions to + expression symbols before processing. Clean up code formatting. + +Sun May 10 22:35:02 1998 Jeffrey A Law (law@cygnus.com) + + * po/Make-in (install-info): New target. + +Thu May 7 15:49:07 1998 Jeffrey A Law (law@cygnus.com) + + * config/tc-mn10200.c (md_assemble): Handle "bra" just like "jmp" + instructions. + * config/tc-mn10300.c (md_assemble): Likewise. + +Thu May 7 11:47:22 1998 Doug Evans + + * Makefile.am: Update with `make dep-am'. + (HFILES): Add cgen.h. + (cgen.o): Depend on cgen.h. + * Makefile.in: Regenerate. + + * cgen.c (cgen_md_apply_fix3): Don't pass newline to as_warn_where. + +Thu May 7 13:20:56 1998 Anders Blomdell + + * gasp.c (grab_label): Permit a label to be a preprocessor + variable by permitting a label to start with a backslash. + +Thu May 7 12:50:33 1998 Frank Ch. Eigler + + * config/tc-mips.c (validate_mips_insn): Removed hack + for previously inaccessible bitfields in some INSN_TRAP + instructions. + +Thu May 7 11:13:00 1998 Frank Ch. Eigler + + * config/tc-d30v.c (do_assemble): Abort with error message + if opcode operands do not match. + +Thu May 7 09:36:06 1998 Frank Ch. Eigler + + * config/tc-mips.c (macro_build, validate_mips_insn): Implement + 'q' operand format for 20-bit "break"/"sdbbp" instructions. + (mips_ip): Truncate overflowed "break" 'c' operand. Implement + similar new 'q' operand. + +Thu May 7 07:47:14 1998 Michael Meissner + + * cgen.c (cgen_asm_finish_insn): Fix typo. + +Thu May 7 02:19:14 1998 Doug Evans + + * cgen.h: New file. + * cgen.c: Include it. + (MAX_FIXUPS): Renamed to CGEN_MAX_FIXUPS. + (cgen_asm_finish_insn): Result is now void. New arg `result'. + All callers updated. + * config/tc-m32r.c: Include cgen.h. + (m23r_insn): New members num_fixups,fixups. + +Wed May 6 16:29:19 1998 Jeffrey A Law (law@cygnus.com) + + * config/tc-hppa.c (md_apply_fix): Slightly rework some code + to avoid compiler warning. + +Wed May 6 15:26:34 1998 Klaus Kaempf + + * makefile.vms: Run dec c with /nodebug. Pass CC value when + calling make. + + * makefile.vms (OBJS): Add ehopt.obj + +Wed May 6 15:11:12 1998 Klaus Kaempf + + * doc/c-vax.texi: Correct and extend vax/vms documentation. + +Wed May 6 11:51:51 1998 Richard Henderson + + * config/tc-d30v.c (do_assemble): Accept a new parameter requesting + a short format insn. + (md_assemble): Set it for explicitly packed insns. + +Tue May 5 13:23:13 1998 Nick Clifton + + * config/obj-coff.c (c_symbol_merge): Do not take address of + native fields when performing the memcpy. + +Tue May 5 13:10:41 1998 Gavin Koch + + * config/tc-mips.c (macro,macro2): Implement + M_DMULO_I, M_MULO_I, M_DMULOU_I, and M_MULOU_I. + +Mon May 4 17:49:14 1998 Andreas Schwab + + * config/tc-m68k.h (TC_RELOC_RTSYM_LOC_FIXUP): Changed to keep + relocations against globally visible symbols. + * config/tc-m68k.c (relaxable_symbol): New macro. + (m68k_ip, md_estimate_size_before_relax): Use it. + (tc_m68k_fix_adjustable): Also handle weak symbols. + +Mon May 4 16:12:23 1998 Ian Lance Taylor + + * config/tc-i386.h (TC_RELOC_RTSYM_LOC_FIXUP): Keep relocs for all + references to externally visible symbols. + * config/tc-i386.c (md_apply_fix3): When OBJ_ELF, don't add the + values in twice for a PC relative reloc if the symbol is + externally defined. + + * config/tc-sparc.h (tc_fix_adjustable) [OBJ_AOUT]: When PIC, + don't adjust a PC relative reloc against an externally visible + symbol. + * config/tc-sparc.c (md_apply_fix3): When generating a.out PIC, + for a PC relative fixup against an externally visible defined + symbol, arrange to store object file and addend values as though + the symbol were not defined. + (tc_gen_reloc): Likewise. + +Thu Apr 30 13:09:39 1998 Fred Fish + + * read.c (sizeof_leb128): Referenced externally by write.c so + don't inline. + +Wed Apr 29 15:45:57 1998 Michael Meissner + + * config/tc-m32r.c ({,expand_}debug_sym): New functions to record + and expand a 'debug' symbol associated with the next instruction + that does not cause a short instruction to be filled with a NOP. + (md_pseudo_table): Add support for .debugsym. + (assemble_parallel_insn): Add calls to expand_debug_sym as + appropriate. + (md_assemble): Ditto. + +Tue Apr 28 19:16:26 1998 Tom Tromey + + * as.c (main): Conditionally call setlocale. + * gasp.c (main): Likewise. + * asintl.h: Include if HAVE_LOCALE_H. + (LC_MESSAGES): Now can be defined even when ENABLE_NLS. + +Tue Apr 28 18:33:23 1998 Frank Ch. Eigler + + * config/tc-d30v.c (md_show_usage): Correct gettext typo. + +Tue Apr 28 12:16:30 1998 Ian Lance Taylor + + * config/tc-hppa.c: Change all calls to bzero to use memset. + (pa_ip): Add cast to avoid warning. + (tc_gen_reloc, md_apply_fix): Likewise. + (pa_find_space_by_number): Likewise. + (hppa_force_relocation): Likewise. + (pa_block): Change i to unsigned int. + * config/obj-som.h (obj_som_copyright): Declare. + +Tue Apr 28 11:35:56 1998 Frank Ch. Eigler + + * ecoff.c (ecoff_build_lineno): Do not use dummy first_lineno + for line numbers for assembly source. + +Mon Apr 27 15:58:46 1998 Ian Lance Taylor + + * configure.in: Change version number to 2.9.4 + * configure: Rebuild. + +Mon Apr 27 12:07:33 1998 Doug Evans + + * cgen.c (cgen_asm_finish_insn): New arg relax_p. All callers updated. + +Mon Apr 27 15:16:12 1998 Ian Lance Taylor + + * ecoff.h: Change symbolS in function declaration to struct + symbol. + +Sun Apr 26 13:44:22 1998 Ian Lance Taylor + + * config/tc-sh.c (parse_reg): Add casts to avoid warnings. + (md_convert_frag): Fix i18n typo. + +Sat Apr 25 20:12:02 1998 Richard Henderson + + * ecoff.c (ecoff_get_cur_proc_sym): New function. + * ecoff.h: Protoype it. + * config/tc-alpha.c [ELF] (s_alpha_prologue): New function. + [EVAX] (s_alpha_prologue): Delete. + (md_pseudo_table): Update. + +Sat Apr 25 14:00:52 1998 Ian Lance Taylor + + * config/tc-i960.c (md_assemble): Change bp_error_msg from static + array to local pointer. + (get_args, parse_expr): Add casts to avoid warnings. + +Fri Apr 24 12:47:42 1998 Philippe De Muyter + + * read.c (s_set): Cast xmalloc return value to fragS *. + * config/tc-m68k.c (m68k_ip): Function made static to match + previous forward declaration. + (insert_reg, init_regtable, md_convert_frag_1): Likewise. + +Fri Apr 24 09:26:46 1998 Nick Clifton + + * config/tc-v850.c: Add internationalisation macros to error + strings. + + * config/tc-m32r.c (can_make_parallel): Add internationalisation + macros to error strings. + +Thu Apr 23 19:23:23 1998 Ian Lance Taylor + + * config/tc-ppc.c (ppc_fix_adjustable): Correct test of whether a + reloc is in the TOC csect. + (md_apply_fix3): Correct gettext typo. + +Thu Apr 23 14:58:31 1998 Nick Clifton + + * config/tc-arm.c (find_real_start): Ignore symbols starting with + .L - they are local labels and the branches are not really + function calls but rather far jumps. + +Wed Apr 22 15:57:21 1998 Tom Tromey + + * po/Make-in (MKINSTALLDIRS): Don't look in $(top_srcdir). + +Wed Apr 22 14:52:36 1998 Ian Lance Taylor + + * config/tc-i386.c (md_assemble): Print operand number rather than + using ordinal_names. + (i386_operand): Likewise. + +Tue Apr 21 22:34:25 1998 Tom Tromey + + * Makefile.am (INTLLIBS): Define to work around apparent automake + bug. + All Makefiles: Regenerated. + + * Many files: Added gettext invocations around user-visible + strings. + * acconfig.h (ENABLE_NLS, HAVE_CATGETS, HAVE_GETTEXT, HAVE_STPCPY, + HAVE_LC_MESSAGES): Define. + * dep-in.sed: Added asintl.h. + * po/Make-in: New file. + * gasp.c (main): Call setlocale, bindtextdomain, and textdomain. + Include "asintl.h". + * read.c (Z_): Renamed from `_'. + * Makefile.am (SUBDIRS): Added po. + (POTFILES): new macro. + (po/POTFILES.in): New target. + ($(OBJS)): Added asintl.h. + (HFILES): Likewise. + (INCLUDES): Added -DLOCALEDIR, -I$(top_srcdir)/../intl. + (as_new_LDADD): Added $(INTLLIBS). + (as_new_DEPENDENCIES): Added $(INTLDEPS). + (gasp_new_LDADD): Added $(INTLLIBS). + (gasp_new_DEPENDENCIES): New macro. + * configure, aclocal.m4: Rebuilt. + * configure.in: Call CY_GNU_GETTEXT. Generate po/Makefile.in and + po/Makefile. + (ALL_LINGUAS): Define. + * macro.c: Include "asintl.h". + * as.c (main): Call setlocale, bindtextdomain, and textdomain. + * as.h: Include "asintl.h". + * config/tc-i386.c (ordinal_names): Removed. + (md_assemble): Changed error text to avoid ordinal_names. + (i386_operand): Likewise. + (reloc): Added as_bad to avoid i18n problems. + (tc_gen_reloc): Likewise. + * config/tc-arm.c (bad_args): Now a #define. + (bad_pc): Likewise. + * config/obj-vms.c (VMS_stab_parse): Changed type of + `long_const_msg'. + (global_symbol_directory): Unified strings to avoid i18n + problems. + * config/tc-m68k.c (get_reloc_code): Added some as_bad calls to + avoid i18n problems. + * config/tc-ns32k.c (reloc): Added as_bad to avoid i18n problems. + * config/tc-ppc.c (md_apply_fix3): Added as_bad_where to avoid + i18n problems. + * config/tc-sh.c (md_convert_frag): Added as_bad to avoid i18n + problems. + * config/tc-v850.c (md_assemble): Changed C++ comment into C + comment. + * config/tc-vax.c (md_assemble): Added as_warn to avoid i18n + problems. + * as.c (print_version_id): Added an fprintf to avoid i18n + problems. + * cond.c (cond_finish_check): Added as_bad call to avoid i18n + problems. + * expr.c (expr): Added as_warn call to avoid i18n problems. + * messages.c (as_assert): Changed code to avoid i18n problems. + (as_abort): Likewise. + * read.c (pseudo_set): Added as_bad call to avoid i18n problems. + (s_space): Likewise. + * po/Make-in, po/POTFILES.in, po/gas.pot: New files. + +Tue Apr 21 17:01:22 1998 Alan Modra + + * config/tc-i386.c (check_prefix): New static function, split out + from md_assemble. + (struct _i386_insn): Add wait_prefix field. + (md_assemble): Remove wait_prefix local variable. Use + check_prefix when adding a prefix. + + * config/tc-i386.c (current_templates): New static variable. + (md_assemble): Remove current_templates local variable. + (md_assemble, i386_operand): Improve error and warning messages in + many places. Add RESTORE_END_STRING in many places before error + return. Clarify some comments. + + * config/tc-i386.c (struct _i386_insn): Change seg field to a two + element array. + (md_assemble): Parse string instruction operands, looking for + segment override prefixes. Check for invalid segment prefixes on + string instruction. + (i386_operand): i.seg[] and max mem_operand changes for string + insns. + * config/tc-i386.h (EsSeg): Define. + + * config/tc-i386.h (regKludge): Define. + (iclrKludge, imulKludge): Don't define. + * config/tc-i386.c (md_assemble): Merge imulKludge and iclrKludge + code. Move ReverseRegRegmem fudges into Modrm case. Reorder + opcode_modifier checks to look for more common cases first. Add + default_seg for IsString case. + +Tue Apr 21 16:18:12 1998 Ian Lance Taylor + + * configure.in: Call AM_PROG_LEX rather than AC_PROG_LEX and + AC_DECL_YYTEXT. + * configure: Rebuild with new automake and libtool. + * aclocal.m4, Makefile.in: Likewise. + + * doc/Makefile.am (as.dvi): New target. + * doc/Makefile.in: Rebuild. + +Sat Apr 18 01:21:04 1998 Stan Cox + + * configure.in: Added sparc86x support. + + * configure: Rebuild. + + * config/tc-sparc.c (lookup_arch): Added arch_type to struct + sparc_arch. + (md_parse_option): Warn if -EL is not supported for this architecture. + + * config/tc-sparc.h (SPARC_BIENDIAN) Always define. + +Sat Apr 18 01:19:01 1998 Jeffrey A Law (law@cygnus.com) + + * config/tc-mips.c (mips_ip): Note when we use get match on + the full instruction name. + +Wed Apr 15 15:17:27 1998 Richard Henderson + + * symbols.c (resolve_symbol_value) [O_symbol]: Also store the symbol + back into the expression to handle add/sub simplification correctly. + +Wed Apr 15 07:06:04 1998 Catherine Moore + + * config/tc-mips.c (hilo_interlocks): Remove 4300. + +Mon Apr 13 16:51:04 1998 Nick Clifton + + * config/tc-arm.c (do_msr): Support undocumented 'msr cpsr_flg, + #' instruction. + +Thu Apr 9 10:29:42 1998 Doug Evans + + * symbols.c (max_indent_level): New global. + (print_symbol_value_1): Use it. + * expr.h (expr_build_dot): Declare. + * expr.c (expr_build_dot): New function. + +Wed Apr 8 16:16:11 1998 Doug Evans + + * symbols.c (print_binary): New function. + (print_expr_1): Call it. + +Mon Apr 6 12:06:39 1998 Andreas Schwab + + * config/tc-m68k.c (m68k_ip, case "#B"): Install the offset of the + operand in the opcode. + +Fri Apr 3 11:58:19 1998 Alan Modra + + * config/tc-i386.h: Reorder operand flags and opcode modifier + flags for clarity. Remove unused definitions: Unknown, + ImmUnknown, DispUnknown, NoModrm. + * config/tc-i386.c (type_names): Add missing Debug type. + (md_assemble): Better duplicate prefix checking. Quicker string + instruction check via new opcode_modifier flag. + +Fri Apr 3 11:44:34 1998 Ian Lance Taylor + + * doc/as.texinfo (Invoking): Clarify -Wa example. + +Fri Apr 3 09:12:23 1998 Gavin Koch + + * config/tc-mips.c (mips_pseudo_table): Add weakext entry. + (s_mips_weakext): Define. + * ecoff.c (ecoff_directive_weakext): Don't define if defined(TC_MIPS). + * config/obj-ecoff.c (obj_pseudo_table): Don't add weakext if + defined(TC_MIPS). + +Thu Apr 2 22:42:02 1998 Jeffrey A Law (law@cygnus.com) + + * config/tc-mn10200.c (tc_gen_reloc): The difference of two symbols + is an error if the value can not be computed at assembly time. + * config/tc-mn10300.c (tc_gen-reloc): Likewise. + +Thu Apr 2 16:36:47 1998 Ian Lance Taylor + + * gasp.c (main): Set next field of new include_path structure to + NULL. From Avery Pennarun . + + * read.c (s_mri_sect): Call as_bad rather than abort for an + unsupported MRI target. + +Wed Apr 1 11:08:27 1998 Nick Clifton + + * config/tc-arm.c (arm_validate_fix): New function. Determine if + the destination of a branch instruction should be altered. + (find_real_start): New function: Locate the real, Thumb coded + start of a Thumb function. + (do_t_branch23): Alter the destination of branches to Thumb + functions. + + * config/tc-arm.h: Define TC_VALIDATE_FIX. + +Tue Mar 31 13:27:33 1998 Dean M. Deaver + + * config/tc-arm.c (decode_shift): Handle addressing mode 2 w/rrx + also. + +Wed Apr 1 13:13:20 1998 Andreas Schwab + + * doc/as.texinfo: Use @itemx for a secondary item in a table. + * doc/c-hppa.texi: Likewise. + +Tue Mar 31 17:52:40 1998 Ian Lance Taylor + + * Makefile.am: Rebuild dependencies. + * Makefile.in: Rebuild. + + * Makefile.am (DEP_INCLUDES): New variable. + (.dep1): Change to work when srcdir is not an absolute path. + (.tcdep, .objdep, .dep2, dep.sed): Likewise. + * Makefile.in: Rebuild. + +Mon Mar 30 12:46:48 1998 Ian Lance Taylor + + * config/tc-i386.h, config/tc-i386.c: Revert March 24 + LinearAddress patch. + + * configure.in: Set version to 2.9.1. + * configure: Rebuild. + + * Branched binutils 2.9. + +Mon Mar 30 11:22:08 1998 Alan Modra + + * config/tc-i386.h (FWait): Define. + * config/tc-i386.c (md_assemble): Emit fwait prefix before any + other prefixes. Check FWait flag in opcode table to see which + instructions require an fwait prefix. + +Mon Mar 30 10:12:00 1998 Andreas Schwab + + * stabs.c (get_stab_string_offset): Always create a stab string + section. + +Sat Mar 28 22:28:02 1998 Ian Lance Taylor + + Fix some gcc -Wall warnings: + * atof-generic.c (atof_generic): Add casts to avoid warnings. + * ehopt.c (eh_frame_code_alignment): Likewise. + * expr.c (integer_constant, operand): Likewise. + * frags.c (frag_align): Likewise. + * gasp.c (level_0, change_base, doinstr): Likewise. + * hash.c (hash_ask): Likewise. + * listing.c (listing_page, calc_hex, print_lines): Likewise. + (debugging_pseudo): Likewise. + * macro.c (define_macro, check_macro): Likewise. + * read.c (read_a_source_file, s_align, s_float_space): Likewise. + (ignore_rest_of_line, float_cons): Likewise. + * symbols.c (decode_local_label_name): Likewise. + * write.c (record_alignment, cvs_frag_to_fill): Likewise. + (fixup_segment, number_to_chars_bigendian): Likewise. + (number_to_chars_littleendian): Likewise. + * config/atof-ieee.c (gen_to_words): Likewise. + * config/tc-sparc.c (md_begin, md_assemble): Likewise. + (sparc_ip, parse_keyword_arg, s_common): Likewise. + * read.c (output_big_sleb128): Initialize locals to avoid + warnings. + (output_big_uleb128, equals): Likewise. + * atof-generic.c (atof_generic): Change number_of_digits_* locals + to unsigned int. Change zeros to unsigned int. + * cond.c (s_if): Add return to default case. + * frags.c (frag_now_fix): Change return type to addressT. + * frags.h (frag_now_fix): Update declaration. + * listing.c (file_info_struct): Change linenum to unsigned int. + (struct list_info_struct): Change hll_line to unsigned int. + (print_source): Update format string. + * read.c (emit_expr): Change scan to unsigned int, and don't + bother to initialize it. + * symbols.c (dollar_label_count): Change to unsigned long. + * write.c (adjust_reloc_syms): Remove unused label reduce_fixup. + * config/tc-sparc.c (sparc_memory_model): Only define if OBJ_ELF. + * config/tc-sparc.c (tc_gen_reloc): Add return to default case. + +Fri Mar 27 12:46:47 1998 Ian Lance Taylor + + * config/tc-m68k.c (m68k_ip): Check legal addressing modes for + mcf5200 just as we do for m68000. + (m68k_init_after_args): Likewise. + (md_estimate_size_before_relax): Likewise. + +Fri Mar 27 10:30:01 1998 Catherine Moore + + * config/tc-v850.c (md_assemble): Store relocation addend in + fixup instead of instruction. + +Thu Mar 26 23:07:18 1998 Alan Modra + + * config/tc-i386.c (md_assemble): Swap template arguments to + CONSISTENT_REGISTER_MATCH macro in reverse direction test. + This macro is currently symmetric, so passing them the wrong + way didn't cause any problem, but may if the macro is changed + in the future. + After copying template to i.tm, use i.tm. rather than t-> to + access fields, and make t a const* + Move i.tm.operand_types[] swap to immediately after the copy. + +Wed Mar 25 13:44:18 1998 Doug Evans + + * expr.h (expr_build_uconstant): Add prototype. + (expr_build_unary,expr_build_binary): Add prototypes. + * expr.c (expr_build_uconstant): New function. + (expr_build_unary,expr_build_binary): New functions. + +Wed Mar 25 13:10:42 1998 Bruno Haible + + * gasp.c (IS*): Cast argument to unsigned char, not unsigned int. + * macro.c (macro_expand_body): Increase buffer size. + * messages.c (as_warn): Likewise. + (as_warn_where, as_bad, as_bad_where): Likewise. + +Wed Mar 25 12:59:07 1998 Ian Lance Taylor + + Based on patch from H.J. Lu : + * Makefile.am (DISTSTUFF): New variable. + (diststuff): New target. + * Makefile.in: Rebuild. + +Tue Mar 24 16:51:29 1998 Nick Clifton + + * config/tc-m32r.h (md_cleanup, md_elf_section_change_hook): Call + m32r_elf_section_change_hook. + + * config/tc-m32r.c (m32r_elf_section_change_hook): New function to + emit a nop if a section ends with a 16 bit instruction. + +Tue Mar 24 19:48:09 1998 Ian Lance Taylor + + * config/obj-coff.c (obj_coff_bss): Compile unconditionally. Call + s_lcomm rather than obj_coff_lcomm. + (obj_pseudo_table): Compile .bss pseudo-op unconditionally. + +Tue Mar 24 18:30:58 1998 H.J. Lu + + * config/tc-i386.h (LinearAddress): Define. + * config/tc-i386.c (md_assemble): If LinearAddress is set for the + instruction, don't use a default segment. + +Mon Mar 23 18:53:40 1998 Joel Sherrill + + * configure.in: (sh*-*-rtems*): Switched from ELF to COFF. + * configure: Rebuild. + +Fri Mar 20 19:15:44 1998 Ian Lance Taylor + + * aclocal.m4, configure: Rebuild with libtool 1.2. + +Thu Mar 19 16:03:12 1998 Nick Clifton + + * config/tc-arm.c (md_apply_fix3): fix code to test the range of + PC relative branches. Patch courtesy of Jonathan Walton. + + +Wed Mar 18 09:29:51 1998 Nick Clifton + + * configure.in (emulations): Add thumb-pe target. + + * configure (emulations): Add thumb-pe target. + +1998-03-17 Ken Raeburn + + * itbl-lex.l (yywrap): Don't define if already defined as a + macro. + +Fri Mar 13 16:31:38 1998 Tom Tromey + + * depend.c (quote_string_for_make): New function. + (wrap_output): Use it. + +Thu Mar 12 18:28:22 1998 Nick Clifton + + * config/obj-elf.c (obj_elf_section): Set bss flag in seg_info + structure if type is SHT_NOBITS. [Bug fix courtesy of rth] + +Sat Feb 28 17:28:55 1998 Richard Henderson + + * config/tc-alpha.c (md_shortopts, md_longopts, md_parse_option): + Recognize -GN and -relax. + (md_begin): Initialize gp size from -G switch. + (alpha_force_relocation): Always force if -relax. + (alpha_align): Take a new argument that will specify when to + emit an R_ALPHA_ALIGN relocation (though we don't do that now). + Change all callers. Emit nop alignment padding as nop+unop pair. + +Sat Feb 28 17:06:22 1998 Richard Henderson + + * config/obj-elf.c [TC_ALPHA]: Include . + * config/tc-alpha.h (ELF_TC_SPECIAL_SECTIONS): New. + +Thu Feb 26 15:49:04 1998 Michael Meissner + + * config/tc-d30v.c (write_2_short): Delayed jsr instructions don't + require padding to the next long word boundary. + +Mon Feb 23 11:29:06 1998 Doug Evans + + * cgen.c: #include symcat.h. + * config/tc-m32r.c: Likewise. + +Mon Feb 23 10:27:40 1998 Jeffrey A Law (law@cygnus.com) + + * config/tc-mips.c (mips_ip, case 'P'): Make 'P' arguments be + absolute expressions instead of '$' prefixed register names. + +Sat Feb 21 22:36:52 1998 Richard Henderson + + * read.c (s_set): Record file and line info for symbols when -as. + (pseudo_set): Don't overwrite that dummy fragment. + +Fri Feb 20 15:03:13 1998 Ian Lance Taylor + + * config/tc-ppc.c (md_pseudo_table): Add "section". + (ppc_named_section): New static function. + +Thu Feb 19 22:25:42 1998 Richard Henderson + + * 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 + + * config/tc-d30v.c (parallel_ok): For the explicitly parallel + case, allow the parallel instructions to modify the same flag + bits. + +Thu Feb 19 16:08:15 1998 Richard Henderson + + * listing.c (list_symbol_table): Categorize symbols by + undefined_section rather than sy_frag->line == NULL. + +Wed Feb 18 23:39:46 1998 Richard Henderson + + * Makefile.am (install-exec-local): Install properly when ln + fails or tooldir == prefix. + +Tue Feb 17 18:58:51 1998 Doug Evans + + * cgen.c (cgen_md_apply_fix3): Delete call to validate_operand. + Test result of insert_operand for error. + +Fri Feb 13 16:41:42 1998 Ian Lance Taylor + + * Makefile.am (AUTOMAKE_OPTIONS): Add cygnus. + * configure, Makefile.in, aclocal.m4: Rebuild with automake 1.2e. + * doc/Makefile.am (AUTOMAKE_OPTIONS): Define. + * doc/Makefile.in: Rebuild. + +Fri Feb 13 00:47:44 1998 Ian Lance Taylor + + * config/tc-mips.c (macro_build): Handle operand type 'C'. + (macro): Fix handling of M_COP[0-3]. + +Thu Feb 12 14:06:59 1998 Ian Lance Taylor + + Based on patches from Ross Harvey : + * macro.c (ISSEP): Only treat '<' and '>' as separator characters + if macro_alternate or macro_mri. + (getstring): Remove support for byte constants between < and >. + (get_any_string): '<' only starts a string if macro_alternate or + macro_mri. + (macro_expand_body): Permit keyword parameters following + positional parameters. + + NetBSD patches from Gordon W. Ross : + * configure.in (alpha*-*-netbsd*): New target. + * config/te-nbsd.h (LOCAL_LABELS_FB): Define. + * configure: Rebuild. + + * as.h (flag_warn_suppress_instructionswap): Move from here... + * config/tc-d10v.c (flag_warn_suppress_instructionswap): ...to + here, and make static. + + * ehopt.c (eh_frame_code_alignment): Only use seg_info if + BFD_ASSEMBLER or MANY_SEGMENTS. + + * as.c (show_usage): Update bug-gnu-utils address. + * gasp.c (show_usage): Likewise. + * doc/as.texinfo (Bug Reporting): Likewise. + +Wed Feb 11 23:26:28 1998 Jeffrey A Law (law@cygnus.com) + + * config/tc-mips.c (load_address): Don't use mips III or mips IV + insns regardless of the size of a pointer if we're in mips I or + MIPS II mode. + (macro, macro2, s_cprestore, s_cpadd): Likewise. + +Thu Feb 12 03:41:00 1998 J"orn Rennecke + + Fix rac to accept only a0: + * tc-d10v.c (parallel_ok, find_opcode): + Split OPERAND_ACC into OPERAND_ACC0 and OPERAND_ACC1. + Introduce OPERAND_GPR. + +Wed Feb 11 16:28:13 1998 Richard Henderson + + * read.c (s_fill): Handle non-constant repeat counts by creating + an rs_space fragment. + +Tue Feb 10 18:31:31 1998 Ian Lance Taylor + + * config/tc-i386.c (i386_operand): Change error added Jan 2 1998 + from as_bad to as_warn. + +Tue Feb 10 18:04:00 1998 Jim Lemke + + * as.c: (perform_an_assembly_pass): Use [TEXT|DATA|BSS]_SECTION_NAME + * as.h: Define default values of [TEXT|DATA|BSS]_SECTION_NAME + * config/obj-elf.c (elf_begin): Use [TEXT|DATA|BSS]_SECTION_NAME + +Tue Feb 10 17:58:18 1998 Ian Lance Taylor + + * ehopt.c (eh_frame_code_alignment): If not BFD_ASSEMBLER, use + seg_fix_rotP rather than fix_root from seg_info. + +Tue Feb 10 15:32:22 1998 Ian Carmichael + + * expr.c: Add support for 0x1_2_3_4 bignums. + +Tue Feb 10 14:43:40 1998 Ian Lance Taylor + + * configure.in: Change -linux* to -linux-gnu*. + * configure: Rebuild. + + * app.c (do_scrub_begin): Treat \r as whitespace. + +Mon Feb 9 14:16:11 1998 Ian Lance Taylor + + * Makefile.am: Update dependencies. + * Makefile.in: Rebuild. + +Sat Feb 7 15:33:51 1998 Ian Lance Taylor + + * configure, aclocal.m4: Rebuild with new libtool. + +Fri Feb 6 16:08:30 1998 Jeffrey A Law (law@cygnus.com) + + * config/tc-mips.c (md_begin): If mips_cpu is set, then use it as + the argument to bfd_set_arch_mach. + (load_address): Use bfd_arch_bits_per_address to determine the + bit size of an address instead of looking at the isa level. + (macro, macro2, s_cprestore, s_cpadd): Likewise. + +Fri Feb 6 14:44:34 1998 Nick Clifton + + * config/tc-v850.c (md_parse_option): Add -mv850any command line option. + +Thu Feb 5 12:39:08 1998 Ian Lance Taylor + + * ehopt.c: New file. + * as.h (enum _relax_state): Add rs_cfa. + (check_eh_frame, eh_frame_estimate_size_before_relax): Declare. + (eh_frame_relax_frag, eh_frame_convert_frag): Declare. + * read.c (emit_expr): Call check_eh_frame. + * write.c (cvt_frag_to_fill): Handle rs_cfa. + (relax_segment): Likewise. + * Makefile.am: Rebuild dependencies. + (GAS_CFILES): Add ehopt.c. + (GENERIC_OBJS): Add ehopt.o. + * doc/internals.texi (Frags): Document rs_cfa. + + * as.c (show_usage): Mention --traditional-format. + (parse_args): Accept --traditional-format. + * as.h (flag_traditional_format): Declare. + * output-file.c (output_file_create): If flag_traditional_format, + set BFD_TRADITIONAL_FORMAT on stdoutput. + * doc/as.texinfo, doc/as.1: Document --traditional-format. + + * config/tc-mips.c (append_insn): Make sure that if we have a + fixup for an unmatched %hi reloc, it does not associated with a + variant frag. + + * configure, Makefile.in, aclocal.m4: Rebuild with new libtool. + * doc/Makefile.in: Likewise. + +Wed Feb 4 15:41:54 1998 Nick Clifton + + * config/tc-m32r.c (check_for_side_effects): New function. + (can_make_parallel): Add checks for instruction side effects + clashing with the other instruction. + (assemble_parallel_insn): Improve warning messages. Return error + message from non-swapped instruction order. + +Wed Feb 4 20:00:26 1998 James G. Smith + + * config/tc-arm.c: Rename arm_after_pass_hook() to arm_cleanup(). + + * config/tc-arm.h: Replace md_after_pass_hook definition with a + md_cleanup definition. This moves the forced literal output to + the end of the source pass, and avoids macro's inserting literals + into the code immediately after the macro expansion. + +Wed Feb 4 13:17:19 1998 Ian Lance Taylor + + * config/tc-sparc.h (tc_fix_adjustable) [OBJ_ELF]: A reloc against + a gas internal symbol is adjustable. + * config/tc-ppc.h (tc_fix_adjustable): Likewise. + + * as.h: If gcc version greater than 2.6, use `__format__' and + `__printf__' in function attributes, rather than `format' and + `printf'. + +Mon Feb 2 18:38:18 1998 Ian Lance Taylor + + * config/tc-sparc.c: Only include elf/sparc.h if OBJ_ELF. + +Mon Feb 2 18:30:34 1998 Steve Haworth + + Add tms320c30 support: + * config/tc-tic30.h: New file. + * config/tc-tic30.c: New file. + * config/obj-coff.h: If TC_TIC30, include coff/tic30.h and define + TARGET_FORMAT as "coff-tic30". + * configure.in (tic30-*-*aout*, tic30-*-*coff*): New targets. + * Makefile.am: Rebuild dependencies. + (CPU_TYPES): Add tic30. + (CPU_OBJ_VALID): tic30-aout is valid. + (TARGET_CPU_CFILES): Add config/tc-tic30.c. + (TARGET_CPU_HFILES): Add config/tc-tic30.h. + * configure, Makefile.in: Rebuild. + +Mon Feb 2 10:20:37 1998 Nick Clifton + + * config/tc-v850.c (md_assemble): Improvements to error messages. + +Mon Feb 2 12:39:05 1998 Geoff Keating + + * config/tc-ppc.c (md_apply_fix3): Change BFD_RELOC_HI16 and + BFD_RELOC_HI16_S to store the high bits of any value. + + * config/tc-ppc.h (tc_fix_adjustable): Undo change of Fri Jun 27. + (TC_RELOC_RTSYM_LOC_FIXUP): Don't let the + assembler calculate relocations to any external symbol at all. + * config/tc-ppc.c (md_apply_fix3) [OBJ_ELF]: Correct bugs + involving generation of pc-relative relocs. + (md_pcrel_from_section) [OBJ_ELF]: The job this code used to do + has been moved to md_apply_fix3. + + * config/tc-ppc.c (md_apply_fix3): Fix test for too-far branch. + (ppc_elf_suffix): Warn about 'identifier+constant@got' syntax, + which actually means (the address of identifier's GOT entry) + + constant, which is not particularly useful. + +Fri Jan 30 11:02:35 1998 Doug Evans + + * read.h (include_dirs): Declare. + (include_dir_count,include_dir_maxlen): Declare. + +Fri Jan 30 11:47:02 1998 Ian Lance Taylor + + * configure.in: Correct check for shared opcodes library. + * configure: Rebuild. + + * listing.c (buffer_line): If we can't open the file, set at_end. + (listing_print): Remove unused local variable fi. + + * config/m68k-parse.y (reglistpair): Handle register list in + either order. + + * config/vms-conf.h: Don't undef VERSION. + +Thu Jan 29 14:42:44 1998 Pat Rankin + + * Makefile.am (CONFIG_OBJS): New variable, containing part of old + OBJS variable. + (GENERIC_OBJS): New variable, with the rest of the old OBJS + variable. + (OBJS): Now just $(CONFIG_OBJS) and $(GENERIC_OBJS). + ($(srcdir)/make-gas.com): Rename from make-gas.com. + (stamp-mk.com): Replace $(OBJS) with $(GENERIC_OBJS). + (EXTRA_DIST): Define. + * vmsconf.sh: Handle {targ-cpu, obj-format, atof-targ} modules + explicitly rather than via the list of object files. + (gcc-as.opt): New file created when make-gas.com is run. + * config-gas.com: Create {targ-cpu.h, obj-format.h, targ-env.h, + itbl-cpu.h} to #include appropriate file rather than copying that + file. + * config/vms-conf.h: Synchronize with current config.in. + * Makefile.in: Rebuild. + +Thu Jan 29 18:48:19 1998 Bill Moyer + + * config/tc-d30v.c (do_assemble): Added flag_explicitly_parallel. + (parallel_ok): Relaxed parallel subinstruction dependency check. + +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" + command line argument. + * tc-d10v.c (write_2_short): emit "Swapping instructions" + warning only if flag_warn_suppress_instructionswap is false. + +Wed Jan 28 16:41:19 1998 J.J. van der Heijden + + * configure.in (i386-*-mingw32*): New target. + * configure: Rebuild. + +Wed Jan 28 14:51:18 1998 Ian Lance Taylor + + * symbols.c (resolve_symbol_value): Don't set the segment if it + hasn't changed, and this is OBJ_AOUT without BFD_ASSEMBLER. + + * config/obj-aout.h (S_IS_LOCAL): Correct typo--pass argument to + S_GET_SEGMENT. + +Wed Jan 28 13:54:50 1998 Pat Rankin + + as.h (unlink): Reverse 13-Feb-97 change; use of unlink vs remove + depends upon HAVE_{UNLINK,REMOVE} values rather than host + compiler. + +Wed Jan 28 13:48:08 1998 Ian Lance Taylor + + * config/obj-coff.h (RESOLVE_SYMBOL_REDEFINITION): Define. + +Wed Jan 28 09:52:00 1998 Nick Clifton + + * config/tc-v850.c (v850_insert_operand): Display instruction when + an error is encountered. + +Tue Jan 27 13:32:01 1998 Robert Lipe + + * configure.in (i386-*-sco3.2v5*): Defaults to ELF now. + (i386-*-sco3.2v5*coff): New target. + (i386-*-sco3.2*): New target. + * configure: Rebuild. + +Tue Jan 27 11:06:52 1998 Nick Clifton + + * config/tc-v850.c: Tidy error message production. + +Tue Jan 27 12:24:32 1998 Ian Lance Taylor + + * config/tc-arm.c (md_apply_fix3): Add new variable newimm to hold + validate_immediate return value in the right type for comparisons + to FAIL. + +Tue Jan 27 06:51:59 1998 Richard Henderson + + * listing.c (MAX_BYTES): Use listing variables not constants. + (data_buffer): No longer an array, but a pointer. + (calc_hex): sizeof(data_buffer) -> MAX_BYTES. + (listing_listing): Allocate data_buffer. + +Tue Jan 27 06:38:35 1998 Richard Henderson + + * as.c (parse_args): Add --listing-lhs-width, --listing-lhs-width2, + --listing-rhs-width, --listing-cont-lines. + (show_usage): Update. + * listing.c (listing_lhs_width, listing_lhs_width_second): New vars. + (listing_lhs_cont_lines, listing_rhs_width): New vars. + (print_lines): Use the variables instead of the constants. + (listing_listing): Likewise. + * listing.h: Declare the new vars. + +Tue Jan 27 05:32:05 1998 Richard Henderson + + * as.c (parse_args): Add --keep-locals alias for -L. + Add --strip-local-absolute. + (show_usage): Update. + * as.h (flag_strip_local_absolute): New flag. + * symbols.c (S_IS_LOCAL): Use it. + * config/obj-aout.h (S_IS_LOCAL): Likewise. + * config/obj-bout.h (S_IS_LOCAL): Likewise. + * config/obj-coff.h (S_IS_LOCAL): Likewise. + +Mon Jan 26 13:07:41 1998 Nick Clifton + + * config/tc-m32r.c: Detect if explicitly parallel instructions + might have an io conflict and issue a warning message. + +Thu Jan 22 17:51:44 1998 Nick Clifton + + * cgen.c (cgen_save_fixups, cgen_restore_fixups, + cgen_swap_fixups): Functions to save, restore and swap the fixup + chain with a backup copy. + (cgen_asm_finish_insn): Returns address of constructed insn. + +Wed Jan 21 16:49:10 1998 Richard Henderson + + * listing.c (file_info_struct): Remove FILE, add POS. + (last_open_file_info, last_open_file): New; a one entry FILE* cache. + (file_info): Don't open the file. + (buffer_line): Check for the file in the last_open cache, updating + as necessary. + (print_source): Don't reference file_info->file. + (listing_listing): Likewise. + (listing_print): Close the file in the cache, if any. + +Fri Jan 16 14:51:48 1998 Ian Lance Taylor + + * read.c (dwarf_file_string): New file static variable. + (emit_expr): Look for constant sequence that leads up to a file + name in DWARF debugging output. + (stringer): Use dwarf_file_string to decide whether to accept a + string as a file name. + +Fri Jan 16 11:30:37 1998 Richard Henderson + + * 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. + +Thu Jan 15 13:46:48 1998 Richard Henderson + + * tc-h8300.c (parse_reg): Take the length of the symbol into + account when attempting to match a register name. + * tc-h8500.c (parse_reg): Likewise. + +Wed Jan 14 17:52:33 1998 Nick Clifton + + * cgen.c: Formatting changes to improve readability. + +Wed Jan 14 15:41:41 1998 Jeffrey A Law (law@cygnus.com) + + * config/tc-mips.c (macro): Rework division code to avoid unfilled + delay slot. + +Wed Jan 14 18:04:20 1998 Michael Meissner + + Based on a patch from Jim Wilson + * config/tc-d30v.c (do_assemble): Remove non-ansi default case. + (tc_gen_reloc): Handle cross section PC relative relocs + correctly. + +Wed Jan 14 15:02:19 1998 Doug Evans + + * config/tc-mips.c (mips_ip): Don't test pinfo flags if INSN_MACRO. + +Mon Jan 12 13:04:57 1998 Doug Evans + + * cgen.c: #include setjmp.h. Clean up pass over `struct foo' usage. + (expr_jmp_buf): New static local. + (cgen_parse_operand): Allow use of longjmp in parsing to handle errors. + (cgen_md_operand): New function. + * tc-m32r.c: Clean up pass over `struct foo' usage. + (md_estimate_size_before_relax): Use CGEN_INSN_MNEMONIC. + +Tue Jan 6 15:36:02 1998 Richard Henderson + + * symbols.c (S_SET_SEGMENT): Don't set the segment for section syms. + (S_IS_EXTERNAL, S_IS_LOCAL): Correct parenthetication. + +Fri Jan 2 16:08:54 1998 Ian Lance Taylor + + * config/tc-i386.c (i386_operand): Give an error if there are + unrecognized characters after an expression. + +For older changes see ChangeLog-9697 diff --git a/gnu/dist/toolchain/gas/MAINTAINERS b/gnu/dist/toolchain/gas/MAINTAINERS new file mode 100644 index 000000000000..d59a3bd7f889 --- /dev/null +++ b/gnu/dist/toolchain/gas/MAINTAINERS @@ -0,0 +1 @@ +See ../binutils/MAINTAINERS diff --git a/gnu/dist/toolchain/gas/Makefile.am b/gnu/dist/toolchain/gas/Makefile.am index 49b52f73a9cb..47b625352b3d 100644 --- a/gnu/dist/toolchain/gas/Makefile.am +++ b/gnu/dist/toolchain/gas/Makefile.am @@ -12,6 +12,9 @@ tooldir = $(exec_prefix)/$(target_alias) YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo @YACC@ ; fi` LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo @LEX@ ; fi` +WARN_CFLAGS = @WARN_CFLAGS@ +AM_CFLAGS = $(WARN_CFLAGS) + MKDEP = gcc -MM TARG_CPU = @target_cpu_type@ @@ -39,17 +42,20 @@ CPU_TYPES = \ arc \ arm \ avr \ + cris \ d10v \ d30v \ fr30 \ h8300 \ h8500 \ hppa \ + ia64 \ i370 \ i386 \ i860 \ i960 \ m32r \ + m68hc11 \ m68k \ m88k \ mcore \ @@ -63,6 +69,7 @@ CPU_TYPES = \ sparc \ tahoe \ tic30 \ + tic54x \ tic80 \ vax \ w65 \ @@ -93,14 +100,18 @@ CPU_OBJ_VALID = \ case $$o in \ aout) \ case $$c in \ - a29k | arm | i386 | i860 | m68k | mips | ns32k | sparc | tahoe | tic30 | vax) \ + a29k | arm | cris | i386 | m68k | mips | ns32k | sparc | tahoe | tic30 | vax) \ valid=yes ;; \ esac ;; \ bout) \ case $$c in \ i960) valid=yes ;; \ esac ;; \ - coff) valid=yes ;; \ + coff) valid=yes; \ + case $$c in \ + cris | i860) \ + valid= ;; \ + esac ;; \ ecoff) \ case $$c in \ mips | alpha) valid=yes ;; \ @@ -122,16 +133,19 @@ CPU_OBJ_VALID = \ # These are like CPU_TYPES and CPU_OBJ_VALID, for the obj=multi case. -MULTI_CPU_TYPES = i386 mips +MULTI_CPU_TYPES = i386 mips cris MULTI_CPU_OBJ_VALID = \ valid= ; \ case $$o in \ aout) \ case $$c in \ - i386) valid=yes ;; \ + i386 | cris) valid=yes ;; \ + esac ;; \ + coff) \ + case $$c in \ + i386 | mips) valid=yes ;; \ esac ;; \ - coff) valid=yes ;; \ ecoff) \ case $$c in \ mips) valid=yes ;; \ @@ -209,17 +223,20 @@ TARGET_CPU_CFILES = \ config/tc-arc.c \ config/tc-arm.c \ config/tc-avr.c \ + config/tc-cris.c \ config/tc-d10v.c \ config/tc-d30v.c \ config/tc-fr30.c \ config/tc-h8300.c \ config/tc-h8500.c \ config/tc-hppa.c \ + config/tc-ia64.c \ config/tc-i370.c \ config/tc-i386.c \ config/tc-i860.c \ config/tc-i960.c \ config/tc-m32r.c \ + config/tc-m68hc11.c \ config/tc-m68k.c \ config/tc-m88k.c \ config/tc-mcore.c \ @@ -233,6 +250,7 @@ TARGET_CPU_CFILES = \ config/tc-sparc.c \ config/tc-tahoe.c \ config/tc-tic30.c \ + config/tc-tic54x.c \ config/tc-tic80.c \ config/tc-vax.c \ config/tc-w65.c \ @@ -245,17 +263,20 @@ TARGET_CPU_HFILES = \ config/tc-arc.h \ config/tc-arm.h \ config/tc-avr.h \ + config/tc-cris.h \ config/tc-d10v.h \ config/tc-d30v.h \ config/tc-fr30.h \ config/tc-h8300.h \ config/tc-h8500.h \ config/tc-hppa.h \ + config/tc-ia64.h \ config/tc-i370.h \ config/tc-i386.h \ config/tc-i860.h \ config/tc-i960.h \ config/tc-m32r.h \ + config/tc-m68hc11.h \ config/tc-m68k.h \ config/tc-m88k.h \ config/tc-mcore.h \ @@ -269,6 +290,7 @@ TARGET_CPU_HFILES = \ config/tc-sparc.h \ config/tc-tahoe.h \ config/tc-tic30.h \ + config/tc-tic54x.h \ config/tc-tic80.h \ config/tc-vax.h \ config/tc-w65.h \ @@ -322,7 +344,6 @@ TARG_ENV_HFILES = \ config/te-lynx.h \ config/te-mach.h \ config/te-macos.h \ - config/te-multi.h \ config/te-nbsd.h \ config/te-nbsd532.h \ config/te-pc532mach.h \ @@ -338,6 +359,8 @@ TARG_ENV_HFILES = \ # Multi files in config MULTI_CFILES = \ + config/e-crisaout.c \ + config/e-criself.c \ config/e-i386aout.c \ config/e-i386coff.c \ config/e-i386elf.c \ @@ -437,15 +460,16 @@ $(OBJS): @ALL_OBJ_DEPS@ as_new_SOURCES = $(GAS_CFILES) as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ - $(extra_objects) $(GASLIBS) $(INTLLIBS) + $(extra_objects) $(GASLIBS) $(INTLLIBS) $(LIBM) as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ $(extra_objects) $(GASLIBS) $(INTLDEPS) # Stuff that every object file depends upon. If anything is removed # from this list, remove it from dep-in.sed as well. -$(OBJS): config.h as.h $(TARG_ENV_H) $(OBJ_FORMAT_H) $(TARG_CPU_H) flonum.h \ - expr.h write.h frags.h hash.h read.h symbols.h tc.h \ - obj.h listing.h bignum.h bit_fix.h $(INCDIR)/libiberty.h asintl.h +$(OBJS): $(INCDIR)/bin-bugs.h $(INCDIR)/libiberty.h $(INCDIR)/progress.h \ + $(OBJ_FORMAT_H) $(TARG_CPU_H) $(TARG_ENV_H) \ + as.h asintl.h bignum.h bit_fix.h config.h emul.h expr.h flonum.h \ + frags.h hash.h listing.h obj.h read.h symbols.h tc.h write.h gasp_new_SOURCES = gasp.c macro.c sb.c hash.c gasp_new_LDADD = ../libiberty/libiberty.a $(INTLLIBS) @@ -485,7 +509,7 @@ check-DEJAGNU: site.exp # The implicit .c.o rule doesn't work for these, perhaps because of # the variables, or perhaps because the sources are not on vpath. -$(TARG_CPU_O): $(TARG_CPU_C) $(TARG_CPU_DEP_@target_cpu_type@) +$(TARG_CPU_O): $(TARG_CPU_C) $(COMPILE) -c $(TARG_CPU_C) $(ATOF_TARG_O): $(ATOF_TARG_C) $(COMPILE) -c $(ATOF_TARG_C) @@ -532,6 +556,10 @@ e-i386coff.o: $(srcdir)/config/e-i386coff.c $(COMPILE) -c $(srcdir)/config/e-i386coff.c e-i386elf.o: $(srcdir)/config/e-i386elf.c $(COMPILE) -c $(srcdir)/config/e-i386elf.c +e-crisaout.o: $(srcdir)/config/e-crisaout.c + $(COMPILE) -c $(srcdir)/config/e-crisaout.c +e-criself.o: $(srcdir)/config/e-criself.c + $(COMPILE) -c $(srcdir)/config/e-criself.c # The m68k operand parser. @@ -604,7 +632,7 @@ MOSTLYCLEANFILES = $(STAGESTUFF) core stamp-mk.com \ testsuite/*.o testsuite/*.out testsuite/gas.log testsuite/gas.sum \ testsuite/site.exp site.bak site.exp stage stage1 stage2 -CLEANFILES = dep.sed DEPTC DEPTCA DEPOBJ DEPOBJA DEP2 DEP2a DEP1 DEPA DEP DEPDIR +CLEANFILES = dep.sed DEPTC DEPTCA DEPOBJ DEPOBJA DEP2 DEP2A DEP1 DEPA DEP DEPDIR .PHONY: install-exec-local install-data-local .PHONY: install-exec-bindir install-exec-tooldir @@ -708,27 +736,36 @@ de-stage3: - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..) - rmdir stage3 -# Automatic dependency computation. This is a real pain, because the -# dependencies change based on target_cpu_type and obj_format. We -# currently ignore any dependencies caused by emulation files. - DEP_FILE_DEPS = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \ $(TARGET_CPU_HFILES) $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES) +# 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 +# dependency variable assignments from the dependency rules, and tacks +# on a .NOEXPORT at the end of Makefile.in. + DEP: dep.sed $(DEP_FILE_DEPS) DEPTC DEPOBJ DEP2 - rm -f DEP1 + rm -f DEP1 # delete because we use $? in DEP1 rule srcdir=`cd $(srcdir); pwd`; \ $(MAKE) MKDEP="$(MKDEP)" srcdir="$${srcdir}" VPATH="$${srcdir}" DEP1 rm -rf DEPDIR - sed -f dep.sed < DEP1 > DEPA + echo 'AMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW.' > DEPA sed -f dep.sed < DEPTC >> DEPA sed -f dep.sed < DEPOBJ >> DEPA sed -f dep.sed < DEP2 >> DEPA + echo 'BMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE.' >> DEPA + echo '#MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW.' >> DEPA + sed -f dep.sed < DEP1 >> DEPA echo '$$(OBJS): $$(DEP_@target''_cpu_type@_@obj''_format@)' >> DEPA echo '$$(TARG_CPU_O): $$(DEPTC_@target''_cpu_type@_@obj''_format@)' >> DEPA echo '$$(OBJ_FORMAT_O): $$(DEPOBJ_@target''_cpu_type@_@obj''_format@)' >> DEPA - echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> DEPA - mv -f DEPA $@ + echo '#MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE.' >> DEPA + if grep ' /' DEPA > /dev/null 2> /dev/null; then \ + echo 'make DEP failed!'; exit 1; \ + else \ + mv -f DEPA $@; \ + fi DEP1: $(CFILES) $(MULTI_CFILES) if [ -d DEPDIR ]; then true; else mkdir DEPDIR; fi @@ -739,9 +776,7 @@ DEP1: $(CFILES) $(MULTI_CFILES) echo '' > targ-env.h; \ echo '' > itbl-cpu.h; \ echo '' > itbl-parse.h; \ - echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > DEP; \ - echo '# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.' >> DEP; \ - $(MKDEP) -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) $? >> DEP + $(MKDEP) -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) $? > DEP mv -f DEPDIR/DEP $@ # Work out the special dependencies for the tc-*.c files. @@ -772,7 +807,7 @@ DEPTC: $(TARGET_CPU_CFILES) echo ' $$(INCDIR)/obstack.h $$(BFDDIR)/libhppa.h \' >> DEPTCA echo ' $$(INCDIR)/opcode/hppa.h $$(BFDDIR)/som.h' >> DEPTCA for c in $(MULTI_CPU_TYPES); do \ - echo 'DEPTC_'"$${c}"'_multi = \' >> DEPTCA; \ + echo "DEPTC_$${c}"'_multi = \' >> DEPTCA; \ for o in $(OBJ_FORMATS); do \ $(MULTI_CPU_OBJ_VALID) \ if [ x$${valid} = xyes ]; then \ @@ -811,7 +846,7 @@ DEPOBJ: $(OBJ_FORMAT_CFILES) echo ' $$(BFDDIR)/som.h $$(INCDIR)/aout/stab_gnu.h \' >> DEPOBJA echo ' $$(INCDIR)/aout/stab.def' >> DEPOBJA for c in $(MULTI_CPU_TYPES); do \ - echo 'DEPOBJ_'"$${c}"'_multi = \' >> DEPOBJA; \ + echo "DEPOBJ_$${c}"'_multi = \' >> DEPOBJA; \ for o in $(OBJ_FORMATS); do \ $(MULTI_CPU_OBJ_VALID) \ if [ x$${valid} = xyes ]; then \ @@ -825,7 +860,7 @@ DEPOBJ: $(OBJ_FORMAT_CFILES) # Work out the dependencies for each CPU/OBJ combination. # Note that SOM is a special case, because it only works native. DEP2: $(TARGET_CPU_HFILES) $(OBJ_FORMAT_HFILES) - rm -f DEP2a + rm -f DEP2A if [ -d DEPDIR ]; then true; else mkdir DEPDIR; fi srcdir=`cd $(srcdir); pwd`; \ cd DEPDIR; \ @@ -836,22 +871,22 @@ DEP2: $(TARGET_CPU_HFILES) $(OBJ_FORMAT_HFILES) 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 | \ - sed -e "s/dummy.o: dummy.c/DEP_$${c}_$${o} =/" >> ../DEP2a; \ + sed -e "s/dummy.o: dummy.c/DEP_$${c}_$${o} =/" >> ../DEP2A; \ else true; fi; \ done; \ done - echo 'DEP_hppa_som = $$(BFDDIR)/som.h' >> DEP2a + echo 'DEP_hppa_som = $$(BFDDIR)/som.h' >> DEP2A for c in $(MULTI_CPU_TYPES); do \ - echo 'DEP_'"$${c}"'_multi = \' >> DEP2a; \ + echo "DEP_$${c}"'_multi = \' >> DEP2A; \ for o in $(OBJ_FORMATS); do \ $(MULTI_CPU_OBJ_VALID) \ if [ x$${valid} = xyes ]; then \ - echo '$$(DEP_'"$${c}_$${o}"') \' >> DEP2a; \ + echo '$$(DEP_'"$${c}_$${o}"') \' >> DEP2A; \ else true; fi; \ done; \ - echo '' >> DEP2a; \ + echo '' >> DEP2A; \ done - mv -f DEP2a DEP2 + mv -f DEP2A DEP2 dep.sed: dep-in.sed config.status srcdir=`cd $(srcdir); pwd`; \ @@ -861,444 +896,379 @@ dep.sed: dep-in.sed config.status -e "s!@SRCDIR@!$${srcdir}!" dep: DEP - sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile + sed -e '/^.MKDEP.*WARNING BELOW./,/^.MKDEP.*WARNING ABOVE./d' \ + < Makefile > tmp-Makefile cat DEP >> tmp-Makefile $(SHELL) $(srcdir)/../move-if-change tmp-Makefile Makefile dep-in: DEP - sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in + sed -e '/^.MKDEP.*WARNING BELOW./,/^.MKDEP.*WARNING ABOVE./d' \ + < $(srcdir)/Makefile.in > tmp-Makefile.in cat DEP >> tmp-Makefile.in $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in dep-am: DEP - sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.am > tmp-Makefile.am + sed -e '/^.MKDEP.*WARNING BELOW./,/^.MKDEP.*WARNING ABOVE./d' \ + < $(srcdir)/Makefile.am > tmp-Makefile.am cat DEP >> tmp-Makefile.am $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am +# HEED THE MKDEP WARNINGS. +# ANYTHING CHANGED OR ADDED BETWEEN THE WARNING LINES MAY GO AWAY. .PHONY: dep dep-in dep-am -# DO NOT DELETE THIS LINE -- mkdep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -app.o: app.c $(INCDIR)/bin-bugs.h emul.h -as.o: as.c $(INCDIR)/bin-bugs.h emul.h subsegs.h $(INCDIR)/obstack.h \ - output-file.h sb.h macro.h -atof-generic.o: atof-generic.c $(INCDIR)/bin-bugs.h \ - emul.h -bignum-copy.o: bignum-copy.c $(INCDIR)/bin-bugs.h emul.h -cond.o: cond.c $(INCDIR)/bin-bugs.h emul.h macro.h \ - sb.h $(INCDIR)/obstack.h -depend.o: depend.c $(INCDIR)/bin-bugs.h emul.h -dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/bin-bugs.h emul.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h -ecoff.o: ecoff.c $(INCDIR)/bin-bugs.h emul.h ecoff.h -ehopt.o: ehopt.c $(INCDIR)/bin-bugs.h emul.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h -expr.o: expr.c $(INCDIR)/bin-bugs.h emul.h $(INCDIR)/obstack.h -flonum-copy.o: flonum-copy.c $(INCDIR)/bin-bugs.h emul.h -flonum-konst.o: flonum-konst.c -flonum-mult.o: flonum-mult.c -frags.o: frags.c $(INCDIR)/bin-bugs.h emul.h subsegs.h \ - $(INCDIR)/obstack.h -hash.o: hash.c $(INCDIR)/bin-bugs.h emul.h $(INCDIR)/obstack.h -input-file.o: input-file.c $(INCDIR)/bin-bugs.h emul.h \ - input-file.h -input-scrub.o: input-scrub.c $(INCDIR)/bin-bugs.h emul.h \ - input-file.h sb.h -listing.o: listing.c $(INCDIR)/bin-bugs.h emul.h input-file.h \ - subsegs.h -literal.o: literal.c $(INCDIR)/bin-bugs.h emul.h subsegs.h \ - $(INCDIR)/obstack.h -macro.o: macro.c sb.h macro.h -messages.o: messages.c $(INCDIR)/bin-bugs.h emul.h -output-file.o: output-file.c $(INCDIR)/bin-bugs.h emul.h \ - output-file.h -read.o: read.c $(INCDIR)/bin-bugs.h emul.h subsegs.h \ - $(INCDIR)/obstack.h sb.h macro.h ecoff.h -sb.o: sb.c sb.h -stabs.o: stabs.c $(INCDIR)/bin-bugs.h emul.h $(INCDIR)/obstack.h \ - subsegs.h ecoff.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def -subsegs.o: subsegs.c $(INCDIR)/bin-bugs.h emul.h subsegs.h \ - $(INCDIR)/obstack.h -symbols.o: symbols.c $(INCDIR)/bin-bugs.h emul.h $(INCDIR)/obstack.h \ - subsegs.h struc-symbol.h -write.o: write.c $(INCDIR)/bin-bugs.h emul.h subsegs.h \ - $(INCDIR)/obstack.h output-file.h -gasp.o: gasp.c $(INCDIR)/bin-bugs.h sb.h macro.h -itbl-ops.o: itbl-ops.c itbl-ops.h $(INCDIR)/bin-bugs.h \ - emul.h itbl-parse.h -e-i386aout.o: $(srcdir)/config/e-i386aout.c $(INCDIR)/bin-bugs.h \ - emul.h emul-target.h -e-i386coff.o: $(srcdir)/config/e-i386coff.c $(INCDIR)/bin-bugs.h \ - emul.h emul-target.h -e-i386elf.o: $(srcdir)/config/e-i386elf.c $(INCDIR)/bin-bugs.h \ - emul.h emul-target.h -e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c $(INCDIR)/bin-bugs.h \ - emul.h emul-target.h -e-mipself.o: $(srcdir)/config/e-mipself.c $(INCDIR)/bin-bugs.h \ - emul.h emul-target.h -DEPTC_a29k_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-a29k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/opcode/a29k.h -DEPTC_a29k_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-a29k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/a29k.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/opcode/a29k.h -DEPTC_a29k_elf = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/opcode/a29k.h -DEPTC_alpha_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.h \ - $(INCDIR)/obstack.h struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h \ - $(srcdir)/config/atof-vax.c -DEPTC_alpha_ecoff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-alpha.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h emul.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/opcode/alpha.h $(srcdir)/config/atof-vax.c -DEPTC_alpha_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h struc-symbol.h \ +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 \ - $(INCDIR)/opcode/alpha.h $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ + subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/alpha.h \ $(srcdir)/config/atof-vax.c -DEPTC_alpha_evax = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-evax.h \ - $(srcdir)/config/tc-alpha.h emul.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h $(srcdir)/config/atof-vax.c -DEPTC_arc_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.h \ +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 \ + 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 \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h \ + $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.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 subsegs.h \ $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h $(INCDIR)/elf/arc.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_arc_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h \ - $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_arm_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h -DEPTC_arm_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arm.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/arm.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h -DEPTC_arm_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/arm.h \ - $(INCDIR)/elf/reloc-macros.h -DEPTC_avr_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.h \ - $(INCDIR)/obstack.h -DEPTC_avr_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h -DEPTC_d10v_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d10v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.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 \ + 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 \ + $(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 \ + 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)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d10v.h \ - $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_d30v_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.h \ +DEPTC_d30v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d30v.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.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_d30v_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d30v.h -DEPTC_fr30_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.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 \ $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/fr30-opc.h \ cgen.h -DEPTC_fr30_elf = $(INCDIR)/bin-bugs.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 \ - emul.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_h8300_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8300.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h -DEPTC_h8300_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/h8300.h -DEPTC_h8500_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8500.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/h8500-opc.h -DEPTC_h8500_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/h8500-opc.h -DEPTC_hppa_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.h \ - $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(BFDDIR)/libbfd.h \ - $(INCDIR)/opcode/hppa.h -DEPTC_i370_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.h \ - $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/i370.h -DEPTC_i370_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h struc-symbol.h \ - $(INCDIR)/opcode/i370.h $(INCDIR)/elf/i370.h -DEPTC_i386_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i386.h -DEPTC_i386_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i386.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i386.h -DEPTC_i386_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i386.h -DEPTC_i860_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-i860.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/opcode/i860.h -DEPTC_i860_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i860.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/opcode/i860.h -DEPTC_i860_elf = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/opcode/i860.h -DEPTC_i960_bout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-bout.h \ - $(srcdir)/config/tc-i960.h emul.h $(INCDIR)/obstack.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 \ + 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 \ + 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 \ + 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 \ + 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 \ + 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 \ + $(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 \ $(INCDIR)/opcode/i960.h -DEPTC_i960_coff = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h -DEPTC_i960_elf = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h -DEPTC_m32r_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.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 \ $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/m32r-opc.h \ cgen.h -DEPTC_m32r_elf = $(INCDIR)/bin-bugs.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 \ - emul.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_m68k_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/opcode/m68k.h \ - $(srcdir)/config/m68k-parse.h -DEPTC_m68k_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/opcode/m68k.h \ - $(srcdir)/config/m68k-parse.h -DEPTC_m68k_elf = $(INCDIR)/bin-bugs.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 \ - emul.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 = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-hp300.h \ - $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.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 \ + $(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_m88k_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m88k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m88k.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/config/m88k-opcode.h -DEPTC_m88k_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/config/m88k-opcode.h -DEPTC_mcore_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mcore.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.h -DEPTC_mcore_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.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 \ + $(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_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 \ + $(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 = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-mips.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.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_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mipspe.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.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)/bin-bugs.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-mips.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h emul.h subsegs.h $(INCDIR)/obstack.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 \ $(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)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mips.h \ - itbl-ops.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.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_mn10200_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.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 \ + 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)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10200.h -DEPTC_mn10300_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10300.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10300.h -DEPTC_mn10300_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10300.h -DEPTC_ns32k_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h -DEPTC_ns32k_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ns32k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/opcode/ns32k.h \ +DEPTC_mn10300_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-mn10300.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10300.h \ + 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_elf = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h -DEPTC_pj_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/opcode/pj.h -DEPTC_pj_elf = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/opcode/pj.h -DEPTC_ppc_coff = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/ppc.h -DEPTC_ppc_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/ppc.h \ - $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_sh_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sh.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h -DEPTC_sh_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ - $(INCDIR)/elf/sh.h $(INCDIR)/elf/reloc-macros.h -DEPTC_sparc_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h -DEPTC_sparc_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sparc.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h -DEPTC_sparc_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.h -DEPTC_tahoe_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tahoe.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h -DEPTC_tahoe_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tahoe.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.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 \ + $(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_pj_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pj.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.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 +DEPTC_sh_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-sh.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/sh.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ + 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)/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_elf = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h -DEPTC_tic30_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/opcode/tic30.h -DEPTC_tic30_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic30.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic30.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/opcode/tic30.h -DEPTC_tic30_elf = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/opcode/tic30.h -DEPTC_tic80_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic80.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic80.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/opcode/tic80.h -DEPTC_tic80_elf = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/opcode/tic80.h -DEPTC_vax_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/vax.h -DEPTC_vax_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-vax.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(srcdir)/config/vax-inst.h \ +DEPTC_tahoe_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tahoe.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h +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 \ + 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 \ + $(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_elf = $(INCDIR)/bin-bugs.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 \ - emul.h $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/vax.h -DEPTC_vax_vms = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-vms.h \ - $(srcdir)/config/tc-vax.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def emul.h $(srcdir)/config/vax-inst.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_w65_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-w65.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/w65.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.h -DEPTC_w65_elf = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-elf.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 \ + $(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 \ + 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 \ + $(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 \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.h -DEPTC_v850_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-v850.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h -DEPTC_v850_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h -DEPTC_z8k_coff = $(srcdir)/../opcodes/z8k-opc.h $(INCDIR)/bin-bugs.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 emul.h -DEPTC_z8k_elf = $(srcdir)/../opcodes/z8k-opc.h $(INCDIR)/bin-bugs.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 emul.h + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h DEPTC_hppa_som = $(srcdir)/config/tc-hppa.h subsegs.h \ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h \ $(BFDDIR)/som.h @@ -1306,332 +1276,323 @@ DEPTC_i386_multi = $(DEPTC_i386_aout) $(DEPTC_i386_coff) \ $(DEPTC_i386_elf) DEPTC_mips_multi = $(DEPTC_mips_coff) $(DEPTC_mips_ecoff) \ $(DEPTC_mips_elf) -DEPOBJ_a29k_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-a29k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_a29k_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-a29k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/a29k.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_a29k_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_alpha_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_alpha_ecoff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-alpha.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h emul.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(BFDDIR)/libecoff.h -DEPOBJ_alpha_elf = $(INCDIR)/bin-bugs.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 \ - emul.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 = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-evax.h \ - $(srcdir)/config/tc-alpha.h emul.h -DEPOBJ_arc_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_arc_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_arm_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_arm_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arm.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/arm.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_arm_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_avr_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_avr_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_d10v_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d10v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_d10v_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_d30v_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_d30v_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_fr30_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_fr30_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_h8300_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8300.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_h8300_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_h8500_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8500.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_h8500_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_hppa_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_i370_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_i370_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/i370.h \ - $(INCDIR)/aout/aout64.h -DEPOBJ_i386_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_i386_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i386.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_i386_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_i860_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-i860.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_i860_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i860.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_i860_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_i960_bout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-bout.h \ - $(srcdir)/config/tc-i960.h emul.h $(INCDIR)/obstack.h -DEPOBJ_i960_coff = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_i960_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_m32r_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_m32r_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_m68k_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_m68k_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_m68k_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_m68k_hp300 = $(srcdir)/config/obj-aout.c $(INCDIR)/bin-bugs.h \ - $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/aout/aout64.h \ +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_m88k_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m88k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m88k.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_m88k_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_mcore_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mcore.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_mcore_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_mips_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-mips.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_mips_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mipspe.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_mips_ecoff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-mips.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h emul.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(BFDDIR)/libecoff.h -DEPOBJ_mips_elf = $(INCDIR)/bin-bugs.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 \ - emul.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 \ +DEPOBJ_a29k_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-a29k.h \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/a29k.h $(BFDDIR)/libcoff.h \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h +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 \ + 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_mn10200_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.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 \ + $(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 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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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_elf = $(srcdir)/config/obj-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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ subsegs.h -DEPOBJ_mn10200_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_mn10300_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10300.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_mn10300_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_ns32k_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_ns32k_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ns32k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_ns32k_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_pj_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_pj_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_ppc_coff = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_ppc_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/ppc.h \ - $(INCDIR)/elf/reloc-macros.h $(INCDIR)/aout/aout64.h -DEPOBJ_sh_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sh.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_sh_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_sparc_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_sparc_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sparc.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_sparc_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_tahoe_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tahoe.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_tahoe_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tahoe.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_tahoe_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_tic30_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_tic30_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic30.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic30.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_tic30_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_tic80_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic80.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic80.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_tic80_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_vax_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h -DEPOBJ_vax_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-vax.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_vax_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_vax_vms = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-vms.h \ - $(srcdir)/config/tc-vax.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def emul.h subsegs.h $(INCDIR)/obstack.h -DEPOBJ_w65_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-w65.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/w65.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_w65_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_v850_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-v850.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h -DEPOBJ_v850_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h -DEPOBJ_z8k_coff = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_z8k_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.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 \ + $(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 \ + $(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 \ + $(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_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 @@ -1639,6 +1600,7 @@ DEPOBJ_i386_multi = $(DEPOBJ_i386_aout) $(DEPOBJ_i386_coff) \ $(DEPOBJ_i386_elf) DEPOBJ_mips_multi = $(DEPOBJ_mips_coff) $(DEPOBJ_mips_ecoff) \ $(DEPOBJ_mips_elf) +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 \ @@ -1673,6 +1635,11 @@ DEP_avr_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-avr.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_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_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 \ @@ -1702,6 +1669,15 @@ DEP_h8500_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.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 +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_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 \ @@ -1715,10 +1691,6 @@ DEP_i386_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i386.h \ DEP_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h -DEP_i860_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i860.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h -DEP_i860_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i860.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h DEP_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h @@ -1734,6 +1706,12 @@ DEP_m32r_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-m32r.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)/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_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 \ @@ -1823,6 +1801,12 @@ DEP_tic30_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-tic30.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_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 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 @@ -1860,7 +1844,52 @@ DEP_i386_multi = $(DEP_i386_aout) $(DEP_i386_coff) \ $(DEP_i386_elf) DEP_mips_multi = $(DEP_mips_coff) $(DEP_mips_ecoff) \ $(DEP_mips_elf) +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 +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 \ + $(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 +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 +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 +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 $(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@) -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY +#MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE. diff --git a/gnu/dist/toolchain/gas/Makefile.in b/gnu/dist/toolchain/gas/Makefile.in index 569b98eb535e..bd1a89e7889f 100644 --- a/gnu/dist/toolchain/gas/Makefile.in +++ b/gnu/dist/toolchain/gas/Makefile.in @@ -69,9 +69,13 @@ BFDLIB = @BFDLIB@ CATALOGS = @CATALOGS@ CATOBJEXT = @CATOBJEXT@ CC = @CC@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ DATADIRNAME = @DATADIRNAME@ DLLTOOL = @DLLTOOL@ EXEEXT = @EXEEXT@ +GCJ = @GCJ@ +GCJFLAGS = @GCJFLAGS@ GDBINIT = @GDBINIT@ GMOFILES = @GMOFILES@ GMSGFMT = @GMSGFMT@ @@ -81,6 +85,7 @@ INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@ INSTOBJEXT = @INSTOBJEXT@ INTLDEPS = @INTLDEPS@ INTLOBJS = @INTLOBJS@ +LIBM = @LIBM@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ MAINT = @MAINT@ @@ -88,11 +93,13 @@ MAKEINFO = @MAKEINFO@ MKINSTALLDIRS = @MKINSTALLDIRS@ MSGFMT = @MSGFMT@ OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ OPCODES_LIB = @OPCODES_LIB@ PACKAGE = @PACKAGE@ POFILES = @POFILES@ POSUB = @POSUB@ RANLIB = @RANLIB@ +STRIP = @STRIP@ USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ USE_NLS = @USE_NLS@ VERSION = @VERSION@ @@ -116,6 +123,9 @@ tooldir = $(exec_prefix)/$(target_alias) YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo @YACC@ ; fi` LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo @LEX@ ; fi` +WARN_CFLAGS = @WARN_CFLAGS@ +AM_CFLAGS = $(WARN_CFLAGS) + MKDEP = gcc -MM TARG_CPU = @target_cpu_type@ @@ -143,17 +153,20 @@ CPU_TYPES = \ arc \ arm \ avr \ + cris \ d10v \ d30v \ fr30 \ h8300 \ h8500 \ hppa \ + ia64 \ i370 \ i386 \ i860 \ i960 \ m32r \ + m68hc11 \ m68k \ m88k \ mcore \ @@ -167,6 +180,7 @@ CPU_TYPES = \ sparc \ tahoe \ tic30 \ + tic54x \ tic80 \ vax \ w65 \ @@ -199,14 +213,18 @@ CPU_OBJ_VALID = \ case $$o in \ aout) \ case $$c in \ - a29k | arm | i386 | i860 | m68k | mips | ns32k | sparc | tahoe | tic30 | vax) \ + a29k | arm | cris | i386 | m68k | mips | ns32k | sparc | tahoe | tic30 | vax) \ valid=yes ;; \ esac ;; \ bout) \ case $$c in \ i960) valid=yes ;; \ esac ;; \ - coff) valid=yes ;; \ + coff) valid=yes; \ + case $$c in \ + cris | i860) \ + valid= ;; \ + esac ;; \ ecoff) \ case $$c in \ mips | alpha) valid=yes ;; \ @@ -229,16 +247,19 @@ CPU_OBJ_VALID = \ # These are like CPU_TYPES and CPU_OBJ_VALID, for the obj=multi case. -MULTI_CPU_TYPES = i386 mips +MULTI_CPU_TYPES = i386 mips cris MULTI_CPU_OBJ_VALID = \ valid= ; \ case $$o in \ aout) \ case $$c in \ - i386) valid=yes ;; \ + i386 | cris) valid=yes ;; \ + esac ;; \ + coff) \ + case $$c in \ + i386 | mips) valid=yes ;; \ esac ;; \ - coff) valid=yes ;; \ ecoff) \ case $$c in \ mips) valid=yes ;; \ @@ -319,17 +340,20 @@ TARGET_CPU_CFILES = \ config/tc-arc.c \ config/tc-arm.c \ config/tc-avr.c \ + config/tc-cris.c \ config/tc-d10v.c \ config/tc-d30v.c \ config/tc-fr30.c \ config/tc-h8300.c \ config/tc-h8500.c \ config/tc-hppa.c \ + config/tc-ia64.c \ config/tc-i370.c \ config/tc-i386.c \ config/tc-i860.c \ config/tc-i960.c \ config/tc-m32r.c \ + config/tc-m68hc11.c \ config/tc-m68k.c \ config/tc-m88k.c \ config/tc-mcore.c \ @@ -343,6 +367,7 @@ TARGET_CPU_CFILES = \ config/tc-sparc.c \ config/tc-tahoe.c \ config/tc-tic30.c \ + config/tc-tic54x.c \ config/tc-tic80.c \ config/tc-vax.c \ config/tc-w65.c \ @@ -356,17 +381,20 @@ TARGET_CPU_HFILES = \ config/tc-arc.h \ config/tc-arm.h \ config/tc-avr.h \ + config/tc-cris.h \ config/tc-d10v.h \ config/tc-d30v.h \ config/tc-fr30.h \ config/tc-h8300.h \ config/tc-h8500.h \ config/tc-hppa.h \ + config/tc-ia64.h \ config/tc-i370.h \ config/tc-i386.h \ config/tc-i860.h \ config/tc-i960.h \ config/tc-m32r.h \ + config/tc-m68hc11.h \ config/tc-m68k.h \ config/tc-m88k.h \ config/tc-mcore.h \ @@ -380,6 +408,7 @@ TARGET_CPU_HFILES = \ config/tc-sparc.h \ config/tc-tahoe.h \ config/tc-tic30.h \ + config/tc-tic54x.h \ config/tc-tic80.h \ config/tc-vax.h \ config/tc-w65.h \ @@ -436,7 +465,6 @@ TARG_ENV_HFILES = \ config/te-lynx.h \ config/te-mach.h \ config/te-macos.h \ - config/te-multi.h \ config/te-nbsd.h \ config/te-nbsd532.h \ config/te-pc532mach.h \ @@ -453,6 +481,8 @@ TARG_ENV_HFILES = \ # Multi files in config MULTI_CFILES = \ + config/e-crisaout.c \ + config/e-criself.c \ config/e-i386aout.c \ config/e-i386coff.c \ config/e-i386elf.c \ @@ -544,7 +574,7 @@ STAGESTUFF = *.o $(noinst_PROGRAMS) as_new_SOURCES = $(GAS_CFILES) as_new_LDADD = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ - $(extra_objects) $(GASLIBS) $(INTLLIBS) + $(extra_objects) $(GASLIBS) $(INTLLIBS) $(LIBM) as_new_DEPENDENCIES = $(TARG_CPU_O) $(OBJ_FORMAT_O) $(ATOF_TARG_O) \ $(extra_objects) $(GASLIBS) $(INTLDEPS) @@ -586,463 +616,456 @@ MOSTLYCLEANFILES = $(STAGESTUFF) core stamp-mk.com \ testsuite/site.exp site.bak site.exp stage stage1 stage2 -CLEANFILES = dep.sed DEPTC DEPTCA DEPOBJ DEPOBJA DEP2 DEP2a DEP1 DEPA DEP DEPDIR +CLEANFILES = dep.sed DEPTC DEPTCA DEPOBJ DEPOBJA DEP2 DEP2A DEP1 DEPA DEP DEPDIR against = stage2 -# Automatic dependency computation. This is a real pain, because the -# dependencies change based on target_cpu_type and obj_format. We -# currently ignore any dependencies caused by emulation files. - DEP_FILE_DEPS = $(CFILES) $(HFILES) $(TARGET_CPU_CFILES) \ $(TARGET_CPU_HFILES) $(OBJ_FORMAT_CFILES) $(OBJ_FORMAT_HFILES) -DEPTC_a29k_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-a29k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/opcode/a29k.h -DEPTC_a29k_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-a29k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/a29k.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/opcode/a29k.h +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_elf = $(INCDIR)/bin-bugs.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 \ - emul.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_alpha_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.h \ - $(INCDIR)/obstack.h struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.h \ - $(srcdir)/config/atof-vax.c +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_ecoff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-alpha.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h emul.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h $(INCDIR)/opcode/alpha.h $(srcdir)/config/atof-vax.c +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_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h struc-symbol.h \ +DEPTC_alpha_ecoff = $(srcdir)/config/obj-ecoff.h $(srcdir)/config/tc-alpha.h \ ecoff.h $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h \ - $(INCDIR)/opcode/alpha.h $(INCDIR)/elf/alpha.h $(INCDIR)/elf/reloc-macros.h \ + subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/alpha.h \ $(srcdir)/config/atof-vax.c -DEPTC_alpha_evax = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-evax.h \ - $(srcdir)/config/tc-alpha.h emul.h subsegs.h $(INCDIR)/obstack.h \ - struc-symbol.h ecoff.h $(INCDIR)/opcode/alpha.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_arc_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.h \ +DEPTC_alpha_evax = $(srcdir)/config/obj-evax.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 \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h \ + $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.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 subsegs.h \ $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h $(INCDIR)/elf/arc.h \ $(INCDIR)/elf/reloc-macros.h -DEPTC_arc_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/arc.h \ - $(INCDIR)/elf/arc.h $(INCDIR)/elf/reloc-macros.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_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.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_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arm.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/arm.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.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)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/arm.h \ - $(INCDIR)/elf/reloc-macros.h +DEPTC_avr_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-avr.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/avr.h -DEPTC_avr_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.h \ - $(INCDIR)/obstack.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)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.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 \ + $(INCDIR)/opcode/cris.h dwarf2dbg.h -DEPTC_d10v_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d10v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.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 \ + 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)/bin-bugs.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 \ - emul.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 \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/d30v.h -DEPTC_d30v_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.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_d30v_elf = $(INCDIR)/bin-bugs.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 \ - emul.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_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.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 \ $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/fr30-opc.h \ cgen.h -DEPTC_fr30_elf = $(INCDIR)/bin-bugs.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 \ - emul.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_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_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8300.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.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_h8300_elf = $(INCDIR)/bin-bugs.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 \ - emul.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_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8500.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.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_h8500_elf = $(INCDIR)/bin-bugs.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 \ - emul.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 \ + subsegs.h $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h -DEPTC_hppa_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.h \ - $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(BFDDIR)/libbfd.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 \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/hppa.h \ + dwarf2dbg.h -DEPTC_i370_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.h \ - $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/i370.h +DEPTC_ia64_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-ia64.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h -DEPTC_i370_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h struc-symbol.h \ - $(INCDIR)/opcode/i370.h $(INCDIR)/elf/i370.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_i386_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i386.h +DEPTC_i370_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i370.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/i370.h -DEPTC_i386_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i386.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i386.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_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i386.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 \ + dwarf2dbg.h $(INCDIR)/opcode/i386.h -DEPTC_i860_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-i860.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/opcode/i860.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_i860_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i860.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/opcode/i860.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 \ + $(INCDIR)/obstack.h dwarf2dbg.h $(INCDIR)/opcode/i386.h -DEPTC_i860_elf = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/opcode/i860.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 = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-bout.h \ - $(srcdir)/config/tc-i960.h emul.h $(INCDIR)/obstack.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 \ $(INCDIR)/opcode/i960.h -DEPTC_i960_coff = $(INCDIR)/bin-bugs.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 \ - emul.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_elf = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/obstack.h $(INCDIR)/opcode/i960.h - -DEPTC_m32r_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.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 \ $(INCDIR)/opcode/cgen.h $(srcdir)/../opcodes/m32r-opc.h \ cgen.h -DEPTC_m32r_elf = $(INCDIR)/bin-bugs.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 \ - emul.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_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_m68k_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/opcode/m68k.h \ - $(srcdir)/config/m68k-parse.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 \ + $(INCDIR)/obstack.h $(INCDIR)/opcode/m68hc11.h dwarf2dbg.h -DEPTC_m68k_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h $(INCDIR)/opcode/m68k.h \ - $(srcdir)/config/m68k-parse.h - -DEPTC_m68k_elf = $(INCDIR)/bin-bugs.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 \ - emul.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 = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-hp300.h \ - $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.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_m88k_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m88k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m88k.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/config/m88k-opcode.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_m88k_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/config/m88k-opcode.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_mcore_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mcore.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.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 \ + $(srcdir)/config/m68k-parse.h -DEPTC_mcore_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/mcore-opc.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 \ + $(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 = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-mips.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.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_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mipspe.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.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)/bin-bugs.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-mips.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h emul.h subsegs.h $(INCDIR)/obstack.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 \ $(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)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mips.h \ - itbl-ops.h $(INCDIR)/elf/mips.h $(INCDIR)/elf/reloc-macros.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_mn10200_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.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 \ + 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)/bin-bugs.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 \ - emul.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 \ + subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10300.h \ + dwarf2dbg.h -DEPTC_mn10300_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10300.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10300.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)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/mn10300.h - -DEPTC_ns32k_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h - -DEPTC_ns32k_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ns32k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/opcode/ns32k.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_elf = $(INCDIR)/bin-bugs.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 \ - emul.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 \ + $(INCDIR)/opcode/ns32k.h $(INCDIR)/obstack.h -DEPTC_pj_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/opcode/pj.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_pj_elf = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/opcode/pj.h +DEPTC_pj_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-pj.h \ + $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ + $(INCDIR)/opcode/pj.h -DEPTC_ppc_coff = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/ppc.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_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/ppc.h \ - $(INCDIR)/elf/ppc.h $(INCDIR)/elf/reloc-macros.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_sh_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sh.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.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 -DEPTC_sh_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ - $(INCDIR)/elf/sh.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 \ + $(INCDIR)/bfdlink.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/sh-opc.h \ + struc-symbol.h dwarf2dbg.h -DEPTC_sparc_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.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_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sparc.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.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_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/sparc.h \ - $(INCDIR)/elf/sparc.h $(INCDIR)/elf/reloc-macros.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_tahoe_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tahoe.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.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_tahoe_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tahoe.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.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_elf = $(INCDIR)/bin-bugs.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 \ - emul.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 \ + $(INCDIR)/obstack.h $(INCDIR)/opcode/tahoe.h -DEPTC_tic30_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/opcode/tic30.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_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic30.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic30.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/opcode/tic30.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_elf = $(INCDIR)/bin-bugs.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 \ - emul.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_tic80_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic80.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic80.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/opcode/tic80.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_tic80_elf = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/opcode/tic80.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 \ + subsegs.h $(INCDIR)/obstack.h struc-symbol.h $(INCDIR)/opcode/tic54x.h -DEPTC_vax_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(srcdir)/config/vax-inst.h $(INCDIR)/obstack.h \ - $(INCDIR)/opcode/vax.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 \ + $(INCDIR)/coff/internal.h $(INCDIR)/coff/tic54x.h $(INCDIR)/coff/ti.h \ + $(BFDDIR)/libcoff.h -DEPTC_vax_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-vax.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(srcdir)/config/vax-inst.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_elf = $(INCDIR)/bin-bugs.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 \ - emul.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_vms = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-vms.h \ - $(srcdir)/config/tc-vax.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def emul.h $(srcdir)/config/vax-inst.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_w65_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-w65.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/w65.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.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_elf = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-elf.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 \ + $(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 \ + 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 \ + $(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 \ $(BFDDIR)/elf-bfd.h $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h \ - $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-w65.h \ - emul.h subsegs.h $(INCDIR)/obstack.h $(srcdir)/../opcodes/w65-opc.h - -DEPTC_v850_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-v850.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h - -DEPTC_v850_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/opcode/v850.h - -DEPTC_z8k_coff = $(srcdir)/../opcodes/z8k-opc.h $(INCDIR)/bin-bugs.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 emul.h - -DEPTC_z8k_elf = $(srcdir)/../opcodes/z8k-opc.h $(INCDIR)/bin-bugs.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 emul.h + $(INCDIR)/elf/external.h $(INCDIR)/bfdlink.h $(srcdir)/config/tc-z8k.h DEPTC_hppa_som = $(srcdir)/config/tc-hppa.h subsegs.h \ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(INCDIR)/opcode/hppa.h \ @@ -1054,415 +1077,412 @@ DEPTC_i386_multi = $(DEPTC_i386_aout) $(DEPTC_i386_coff) \ DEPTC_mips_multi = $(DEPTC_mips_coff) $(DEPTC_mips_ecoff) \ $(DEPTC_mips_elf) -DEPOBJ_a29k_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-a29k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_a29k_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-a29k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/a29k.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_a29k_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_alpha_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-alpha.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_alpha_ecoff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-alpha.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h emul.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(BFDDIR)/libecoff.h - -DEPOBJ_alpha_elf = $(INCDIR)/bin-bugs.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 \ - emul.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 = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-evax.h \ - $(srcdir)/config/tc-alpha.h emul.h - -DEPOBJ_arc_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arc.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_arc_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_arm_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-arm.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_arm_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-arm.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/arm.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_arm_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_avr_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-avr.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_avr_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_d10v_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d10v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_d10v_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_d30v_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-d30v.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_d30v_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_fr30_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-fr30.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_fr30_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_h8300_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8300.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8300.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_h8300_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_h8500_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-h8500.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/h8500.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_h8500_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_hppa_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-hppa.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_i370_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i370.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_i370_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/i370.h \ - $(INCDIR)/aout/aout64.h - -DEPOBJ_i386_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-i386.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_i386_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i386.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/i386.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_i386_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_i860_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-i860.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_i860_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-i860.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_i860_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_i960_bout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-bout.h \ - $(srcdir)/config/tc-i960.h emul.h $(INCDIR)/obstack.h - -DEPOBJ_i960_coff = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_i960_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_m32r_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m32r.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_m32r_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_m68k_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-m68k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_m68k_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m68k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m68k.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_m68k_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_m68k_hp300 = $(srcdir)/config/obj-aout.c $(INCDIR)/bin-bugs.h \ - $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/aout/aout64.h \ +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_m88k_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-m88k.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/m88k.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.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 \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_m88k_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.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_mcore_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mcore.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mcore.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.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_mcore_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.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_mips_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-mips.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_mips_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mips.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/mipspe.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_mips_ecoff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-ecoff.h \ - $(srcdir)/config/tc-mips.h ecoff.h $(INCDIR)/coff/sym.h \ - $(INCDIR)/coff/ecoff.h emul.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(BFDDIR)/libecoff.h - -DEPOBJ_mips_elf = $(INCDIR)/bin-bugs.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 \ - emul.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 \ +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_mn10200_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10200.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.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 \ + $(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 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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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_elf = $(srcdir)/config/obj-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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(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 \ + $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h \ subsegs.h -DEPOBJ_mn10200_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.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_mn10300_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-mn10300.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.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_mn10300_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.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_ns32k_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-ns32k.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.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_ns32k_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-ns32k.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.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_ns32k_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.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_pj_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-pj.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.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 \ + $(INCDIR)/obstack.h -DEPOBJ_pj_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.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 \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_ppc_coff = $(INCDIR)/bin-bugs.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 \ - emul.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_ppc_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/ppc.h \ - $(INCDIR)/elf/reloc-macros.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_sh_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sh.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sh.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.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_sh_elf = $(INCDIR)/bin-bugs.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 \ - emul.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 \ + $(INCDIR)/bfdlink.h $(INCDIR)/obstack.h subsegs.h -DEPOBJ_sparc_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-sparc.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_sparc_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-sparc.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/sparc.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_sparc_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_tahoe_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tahoe.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_tahoe_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tahoe.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_tahoe_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_tic30_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-tic30.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_tic30_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic30.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic30.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_tic30_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_tic80_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-tic80.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/tic80.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_tic80_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_vax_aout = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-aout.h \ - $(srcdir)/config/tc-vax.h $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/aout/aout64.h $(INCDIR)/obstack.h - -DEPOBJ_vax_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-vax.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_vax_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_vax_vms = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-vms.h \ - $(srcdir)/config/tc-vax.h $(INCDIR)/aout/stab_gnu.h \ - $(INCDIR)/aout/stab.def emul.h subsegs.h $(INCDIR)/obstack.h - -DEPOBJ_w65_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-w65.h $(INCDIR)/coff/internal.h \ - $(INCDIR)/coff/w65.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h \ - emul.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_w65_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_v850_coff = $(INCDIR)/bin-bugs.h $(srcdir)/config/obj-coff.h \ - $(srcdir)/config/tc-v850.h $(INCDIR)/coff/internal.h \ - $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h emul.h $(INCDIR)/obstack.h \ - subsegs.h - -DEPOBJ_v850_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.h - -DEPOBJ_z8k_coff = $(INCDIR)/bin-bugs.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 \ - emul.h $(INCDIR)/obstack.h subsegs.h - -DEPOBJ_z8k_elf = $(INCDIR)/bin-bugs.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 \ - emul.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/aout/aout64.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_hppa_som = $(srcdir)/config/obj-som.h subsegs.h \ $(INCDIR)/obstack.h $(BFDDIR)/libhppa.h $(BFDDIR)/som.h \ @@ -1474,6 +1494,7 @@ DEPOBJ_i386_multi = $(DEPOBJ_i386_aout) $(DEPOBJ_i386_coff) \ DEPOBJ_mips_multi = $(DEPOBJ_mips_coff) $(DEPOBJ_mips_ecoff) \ $(DEPOBJ_mips_elf) +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 @@ -1521,6 +1542,13 @@ 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_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_d10v_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-d10v.h \ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h @@ -1561,6 +1589,18 @@ DEP_h8500_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.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 + +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_i370_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i370.h \ $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h @@ -1579,12 +1619,6 @@ DEP_i386_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i386.h -DEP_i860_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-i860.h \ - $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h - -DEP_i860_coff = $(srcdir)/config/obj-coff.h $(srcdir)/config/tc-i860.h \ - $(INCDIR)/coff/internal.h $(BFDDIR)/libcoff.h $(INCDIR)/bfdlink.h - DEP_i860_elf = $(srcdir)/config/obj-elf.h $(BFDDIR)/elf-bfd.h \ $(INCDIR)/elf/common.h $(INCDIR)/elf/internal.h $(INCDIR)/elf/external.h \ $(INCDIR)/bfdlink.h $(srcdir)/config/tc-i860.h @@ -1605,6 +1639,14 @@ 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)/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_m68k_aout = $(srcdir)/config/obj-aout.h $(srcdir)/config/tc-m68k.h \ $(BFDDIR)/libaout.h $(INCDIR)/bfdlink.h @@ -1728,6 +1770,14 @@ 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_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 + 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 @@ -1779,6 +1829,8 @@ DEP_i386_multi = $(DEP_i386_aout) $(DEP_i386_coff) \ DEP_mips_multi = $(DEP_mips_coff) $(DEP_mips_ecoff) \ $(DEP_mips_elf) +DEP_cris_multi = $(DEP_cris_aout) $(DEP_cris_elf) +BMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE. ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs CONFIG_HEADER = config.h @@ -1791,17 +1843,22 @@ DEFS = @DEFS@ -I. -I$(srcdir) -I. CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ -itbl_test_OBJECTS = itbl-parse.o itbl-lex.o +itbl_test_OBJECTS = itbl-parse.$(OBJEXT) itbl-lex.$(OBJEXT) itbl_test_DEPENDENCIES = itbl-tops.o itbl-test.o \ ../libiberty/libiberty.a itbl_test_LDFLAGS = -as_new_OBJECTS = app.o as.o atof-generic.o bignum-copy.o cond.o \ -depend.o dwarf2dbg.o ecoff.o ehopt.o expr.o flonum-copy.o \ -flonum-konst.o flonum-mult.o frags.o hash.o input-file.o input-scrub.o \ -listing.o literal.o macro.o messages.o output-file.o read.o sb.o \ -stabs.o subsegs.o symbols.o write.o +as_new_OBJECTS = app.$(OBJEXT) as.$(OBJEXT) atof-generic.$(OBJEXT) \ +bignum-copy.$(OBJEXT) cond.$(OBJEXT) depend.$(OBJEXT) \ +dwarf2dbg.$(OBJEXT) ecoff.$(OBJEXT) ehopt.$(OBJEXT) expr.$(OBJEXT) \ +flonum-copy.$(OBJEXT) flonum-konst.$(OBJEXT) flonum-mult.$(OBJEXT) \ +frags.$(OBJEXT) hash.$(OBJEXT) input-file.$(OBJEXT) \ +input-scrub.$(OBJEXT) listing.$(OBJEXT) literal.$(OBJEXT) \ +macro.$(OBJEXT) messages.$(OBJEXT) output-file.$(OBJEXT) read.$(OBJEXT) \ +sb.$(OBJEXT) stabs.$(OBJEXT) subsegs.$(OBJEXT) symbols.$(OBJEXT) \ +write.$(OBJEXT) as_new_LDFLAGS = -gasp_new_OBJECTS = gasp.o macro.o sb.o hash.o +gasp_new_OBJECTS = gasp.$(OBJEXT) macro.$(OBJEXT) sb.$(OBJEXT) \ +hash.$(OBJEXT) gasp_new_LDFLAGS = SCRIPTS = $(noinst_SCRIPTS) @@ -1820,14 +1877,14 @@ configure configure.in gdbinit.in itbl-lex.c itbl-parse.c DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) -TAR = tar +TAR = gtar GZIP_ENV = --best SOURCES = $(itbl_test_SOURCES) $(as_new_SOURCES) $(EXTRA_as_new_SOURCES) $(gasp_new_SOURCES) OBJECTS = $(itbl_test_OBJECTS) $(as_new_OBJECTS) $(gasp_new_OBJECTS) all: all-redirect .SUFFIXES: -.SUFFIXES: .S .c .l .lo .o .s .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 @@ -1885,6 +1942,11 @@ maintainer-clean-noinstPROGRAMS: .c.o: $(COMPILE) -c $< +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + .s.o: $(COMPILE) -c $< @@ -1893,6 +1955,7 @@ maintainer-clean-noinstPROGRAMS: mostlyclean-compile: -rm -f *.o core *.core + -rm -f *.$(OBJEXT) clean-compile: @@ -2219,9 +2282,10 @@ $(OBJS): @ALL_OBJ_DEPS@ # Stuff that every object file depends upon. If anything is removed # from this list, remove it from dep-in.sed as well. -$(OBJS): config.h as.h $(TARG_ENV_H) $(OBJ_FORMAT_H) $(TARG_CPU_H) flonum.h \ - expr.h write.h frags.h hash.h read.h symbols.h tc.h \ - obj.h listing.h bignum.h bit_fix.h $(INCDIR)/libiberty.h asintl.h +$(OBJS): $(INCDIR)/bin-bugs.h $(INCDIR)/libiberty.h $(INCDIR)/progress.h \ + $(OBJ_FORMAT_H) $(TARG_CPU_H) $(TARG_ENV_H) \ + as.h asintl.h bignum.h bit_fix.h config.h emul.h expr.h flonum.h \ + frags.h hash.h listing.h obj.h read.h symbols.h tc.h write.h check-DEJAGNU: site.exp if [ -d testsuite ]; then \ @@ -2248,7 +2312,7 @@ check-DEJAGNU: site.exp # The implicit .c.o rule doesn't work for these, perhaps because of # the variables, or perhaps because the sources are not on vpath. -$(TARG_CPU_O): $(TARG_CPU_C) $(TARG_CPU_DEP_@target_cpu_type@) +$(TARG_CPU_O): $(TARG_CPU_C) $(COMPILE) -c $(TARG_CPU_C) $(ATOF_TARG_O): $(ATOF_TARG_C) $(COMPILE) -c $(ATOF_TARG_C) @@ -2295,6 +2359,10 @@ e-i386coff.o: $(srcdir)/config/e-i386coff.c $(COMPILE) -c $(srcdir)/config/e-i386coff.c e-i386elf.o: $(srcdir)/config/e-i386elf.c $(COMPILE) -c $(srcdir)/config/e-i386elf.c +e-crisaout.o: $(srcdir)/config/e-crisaout.c + $(COMPILE) -c $(srcdir)/config/e-crisaout.c +e-criself.o: $(srcdir)/config/e-criself.c + $(COMPILE) -c $(srcdir)/config/e-criself.c # If m68k-parse.y is in a different directory, then ylwrap will use an # absolute path when it invokes yacc, which will cause yacc to put the @@ -2447,20 +2515,33 @@ de-stage3: - (cd stage3 ; rm -f as$(EXEEXT) ; mv -f * ..) - rmdir stage3 +# Automatic dependency computation. This is a real pain, because the +# dependencies change based on target_cpu_type and obj_format. +# Just to make things even more complicated, automake separates the +# dependency variable assignments from the dependency rules, and tacks +# on a .NOEXPORT at the end of Makefile.in. + DEP: dep.sed $(DEP_FILE_DEPS) DEPTC DEPOBJ DEP2 - rm -f DEP1 + rm -f DEP1 # delete because we use $? in DEP1 rule srcdir=`cd $(srcdir); pwd`; \ $(MAKE) MKDEP="$(MKDEP)" srcdir="$${srcdir}" VPATH="$${srcdir}" DEP1 rm -rf DEPDIR - sed -f dep.sed < DEP1 > DEPA + echo 'AMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW.' > DEPA sed -f dep.sed < DEPTC >> DEPA sed -f dep.sed < DEPOBJ >> DEPA sed -f dep.sed < DEP2 >> DEPA + echo 'BMKDEP = #DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE.' >> DEPA + echo '#MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING BELOW.' >> DEPA + sed -f dep.sed < DEP1 >> DEPA echo '$$(OBJS): $$(DEP_@target''_cpu_type@_@obj''_format@)' >> DEPA echo '$$(TARG_CPU_O): $$(DEPTC_@target''_cpu_type@_@obj''_format@)' >> DEPA echo '$$(OBJ_FORMAT_O): $$(DEPOBJ_@target''_cpu_type@_@obj''_format@)' >> DEPA - echo '# IF YOU PUT ANYTHING HERE IT WILL GO AWAY' >> DEPA - mv -f DEPA $@ + echo '#MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE.' >> DEPA + if grep ' /' DEPA > /dev/null 2> /dev/null; then \ + echo 'make DEP failed!'; exit 1; \ + else \ + mv -f DEPA $@; \ + fi DEP1: $(CFILES) $(MULTI_CFILES) if [ -d DEPDIR ]; then true; else mkdir DEPDIR; fi @@ -2471,9 +2552,7 @@ DEP1: $(CFILES) $(MULTI_CFILES) echo '' > targ-env.h; \ echo '' > itbl-cpu.h; \ echo '' > itbl-parse.h; \ - echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > DEP; \ - echo '# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.' >> DEP; \ - $(MKDEP) -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) $? >> DEP + $(MKDEP) -DBFD_ASSEMBLER -I. -I.. -I$${srcdir} -I../../bfd $(DEP_INCLUDES) $? > DEP mv -f DEPDIR/DEP $@ # Work out the special dependencies for the tc-*.c files. @@ -2504,7 +2583,7 @@ DEPTC: $(TARGET_CPU_CFILES) echo ' $$(INCDIR)/obstack.h $$(BFDDIR)/libhppa.h \' >> DEPTCA echo ' $$(INCDIR)/opcode/hppa.h $$(BFDDIR)/som.h' >> DEPTCA for c in $(MULTI_CPU_TYPES); do \ - echo 'DEPTC_'"$${c}"'_multi = \' >> DEPTCA; \ + echo "DEPTC_$${c}"'_multi = \' >> DEPTCA; \ for o in $(OBJ_FORMATS); do \ $(MULTI_CPU_OBJ_VALID) \ if [ x$${valid} = xyes ]; then \ @@ -2543,7 +2622,7 @@ DEPOBJ: $(OBJ_FORMAT_CFILES) echo ' $$(BFDDIR)/som.h $$(INCDIR)/aout/stab_gnu.h \' >> DEPOBJA echo ' $$(INCDIR)/aout/stab.def' >> DEPOBJA for c in $(MULTI_CPU_TYPES); do \ - echo 'DEPOBJ_'"$${c}"'_multi = \' >> DEPOBJA; \ + echo "DEPOBJ_$${c}"'_multi = \' >> DEPOBJA; \ for o in $(OBJ_FORMATS); do \ $(MULTI_CPU_OBJ_VALID) \ if [ x$${valid} = xyes ]; then \ @@ -2557,7 +2636,7 @@ DEPOBJ: $(OBJ_FORMAT_CFILES) # Work out the dependencies for each CPU/OBJ combination. # Note that SOM is a special case, because it only works native. DEP2: $(TARGET_CPU_HFILES) $(OBJ_FORMAT_HFILES) - rm -f DEP2a + rm -f DEP2A if [ -d DEPDIR ]; then true; else mkdir DEPDIR; fi srcdir=`cd $(srcdir); pwd`; \ cd DEPDIR; \ @@ -2568,22 +2647,22 @@ DEP2: $(TARGET_CPU_HFILES) $(OBJ_FORMAT_HFILES) 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 | \ - sed -e "s/dummy.o: dummy.c/DEP_$${c}_$${o} =/" >> ../DEP2a; \ + sed -e "s/dummy.o: dummy.c/DEP_$${c}_$${o} =/" >> ../DEP2A; \ else true; fi; \ done; \ done - echo 'DEP_hppa_som = $$(BFDDIR)/som.h' >> DEP2a + echo 'DEP_hppa_som = $$(BFDDIR)/som.h' >> DEP2A for c in $(MULTI_CPU_TYPES); do \ - echo 'DEP_'"$${c}"'_multi = \' >> DEP2a; \ + echo "DEP_$${c}"'_multi = \' >> DEP2A; \ for o in $(OBJ_FORMATS); do \ $(MULTI_CPU_OBJ_VALID) \ if [ x$${valid} = xyes ]; then \ - echo '$$(DEP_'"$${c}_$${o}"') \' >> DEP2a; \ + echo '$$(DEP_'"$${c}_$${o}"') \' >> DEP2A; \ else true; fi; \ done; \ - echo '' >> DEP2a; \ + echo '' >> DEP2A; \ done - mv -f DEP2a DEP2 + mv -f DEP2A DEP2 dep.sed: dep-in.sed config.status srcdir=`cd $(srcdir); pwd`; \ @@ -2593,85 +2672,73 @@ dep.sed: dep-in.sed config.status -e "s!@SRCDIR@!$${srcdir}!" dep: DEP - sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile + sed -e '/^.MKDEP.*WARNING BELOW./,/^.MKDEP.*WARNING ABOVE./d' \ + < Makefile > tmp-Makefile cat DEP >> tmp-Makefile $(SHELL) $(srcdir)/../move-if-change tmp-Makefile Makefile dep-in: DEP - sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in + sed -e '/^.MKDEP.*WARNING BELOW./,/^.MKDEP.*WARNING ABOVE./d' \ + < $(srcdir)/Makefile.in > tmp-Makefile.in cat DEP >> tmp-Makefile.in $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in dep-am: DEP - sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.am > tmp-Makefile.am + sed -e '/^.MKDEP.*WARNING BELOW./,/^.MKDEP.*WARNING ABOVE./d' \ + < $(srcdir)/Makefile.am > tmp-Makefile.am cat DEP >> tmp-Makefile.am $(SHELL) $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am +# HEED THE MKDEP WARNINGS. +# ANYTHING CHANGED OR ADDED BETWEEN THE WARNING LINES MAY GO AWAY. .PHONY: dep dep-in dep-am - -# DO NOT DELETE THIS LINE -- mkdep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. -app.o: app.c $(INCDIR)/bin-bugs.h emul.h -as.o: as.c $(INCDIR)/bin-bugs.h emul.h subsegs.h $(INCDIR)/obstack.h \ - output-file.h sb.h macro.h -atof-generic.o: atof-generic.c $(INCDIR)/bin-bugs.h \ - emul.h -bignum-copy.o: bignum-copy.c $(INCDIR)/bin-bugs.h emul.h -cond.o: cond.c $(INCDIR)/bin-bugs.h emul.h macro.h \ - sb.h $(INCDIR)/obstack.h -depend.o: depend.c $(INCDIR)/bin-bugs.h emul.h -dwarf2dbg.o: dwarf2dbg.c $(INCDIR)/bin-bugs.h emul.h \ - dwarf2dbg.h subsegs.h $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h -ecoff.o: ecoff.c $(INCDIR)/bin-bugs.h emul.h ecoff.h -ehopt.o: ehopt.c $(INCDIR)/bin-bugs.h emul.h subsegs.h \ - $(INCDIR)/obstack.h $(INCDIR)/elf/dwarf2.h -expr.o: expr.c $(INCDIR)/bin-bugs.h emul.h $(INCDIR)/obstack.h -flonum-copy.o: flonum-copy.c $(INCDIR)/bin-bugs.h emul.h +#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 +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 \ + $(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 flonum-konst.o: flonum-konst.c flonum-mult.o: flonum-mult.c -frags.o: frags.c $(INCDIR)/bin-bugs.h emul.h subsegs.h \ - $(INCDIR)/obstack.h -hash.o: hash.c $(INCDIR)/bin-bugs.h emul.h $(INCDIR)/obstack.h -input-file.o: input-file.c $(INCDIR)/bin-bugs.h emul.h \ - input-file.h -input-scrub.o: input-scrub.c $(INCDIR)/bin-bugs.h emul.h \ - input-file.h sb.h -listing.o: listing.c $(INCDIR)/bin-bugs.h emul.h input-file.h \ - subsegs.h -literal.o: literal.c $(INCDIR)/bin-bugs.h emul.h subsegs.h \ - $(INCDIR)/obstack.h +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 $(INCDIR)/bin-bugs.h emul.h -output-file.o: output-file.c $(INCDIR)/bin-bugs.h emul.h \ - output-file.h -read.o: read.c $(INCDIR)/bin-bugs.h emul.h subsegs.h \ - $(INCDIR)/obstack.h sb.h macro.h ecoff.h +messages.o: messages.c +output-file.o: output-file.c output-file.h +read.o: read.c subsegs.h $(INCDIR)/obstack.h sb.h macro.h \ + ecoff.h sb.o: sb.c sb.h -stabs.o: stabs.c $(INCDIR)/bin-bugs.h emul.h $(INCDIR)/obstack.h \ - subsegs.h ecoff.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def -subsegs.o: subsegs.c $(INCDIR)/bin-bugs.h emul.h subsegs.h \ - $(INCDIR)/obstack.h -symbols.o: symbols.c $(INCDIR)/bin-bugs.h emul.h $(INCDIR)/obstack.h \ - subsegs.h struc-symbol.h -write.o: write.c $(INCDIR)/bin-bugs.h emul.h subsegs.h \ - $(INCDIR)/obstack.h output-file.h -gasp.o: gasp.c $(INCDIR)/bin-bugs.h sb.h macro.h -itbl-ops.o: itbl-ops.c itbl-ops.h $(INCDIR)/bin-bugs.h \ - emul.h itbl-parse.h -e-i386aout.o: $(srcdir)/config/e-i386aout.c $(INCDIR)/bin-bugs.h \ - emul.h emul-target.h -e-i386coff.o: $(srcdir)/config/e-i386coff.c $(INCDIR)/bin-bugs.h \ - emul.h emul-target.h -e-i386elf.o: $(srcdir)/config/e-i386elf.c $(INCDIR)/bin-bugs.h \ - emul.h emul-target.h -e-mipsecoff.o: $(srcdir)/config/e-mipsecoff.c $(INCDIR)/bin-bugs.h \ - emul.h emul-target.h -e-mipself.o: $(srcdir)/config/e-mipself.c $(INCDIR)/bin-bugs.h \ - emul.h emul-target.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 +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 $(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@) -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY +#MKDEP DO NOT PUT ANYTHING BETWEEN THIS LINE AND THE MATCHING WARNING ABOVE. # 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/gnu/dist/toolchain/gas/NEWS b/gnu/dist/toolchain/gas/NEWS index 4143540ef134..6c3439d5939b 100644 --- a/gnu/dist/toolchain/gas/NEWS +++ b/gnu/dist/toolchain/gas/NEWS @@ -1,5 +1,27 @@ -*- text -*- +Changes in 2.11: + +x86 gas now supports the full Pentium4 instruction set. + +Support for AMD x86-64 architecture, by Jan Hubicka, SuSE Labs. + +Support for Motorola 68HC11 and 68HC12. + +Support for Texas Instruments TMS320C54x (tic54x). + +Support for IA-64. + +Support for i860, by Jason Eckhardt. + +Support for CRIS (Axis Communications ETRAX series). + +x86 gas has a new .arch pseudo op to specify the target CPU architecture. + +x86 gas -q command line option quietens warnings about register size changes +due to suffix, indirect jmp/call without `*', stand-alone prefixes, and +translating various deprecated floating point instructions. + Changes in 2.10: Support for the ARM msr instruction was changed to only allow an immediate diff --git a/gnu/dist/toolchain/gas/README b/gnu/dist/toolchain/gas/README index 4ac27db82fe0..87666dfefdc8 100644 --- a/gnu/dist/toolchain/gas/README +++ b/gnu/dist/toolchain/gas/README @@ -229,7 +229,7 @@ warning message when this happens. REPORTING BUGS IN GAS ===================== -Bugs in gas should be reported to bug-gnu-utils@gnu.org. They may be +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. diff --git a/gnu/dist/toolchain/gas/acinclude.m4 b/gnu/dist/toolchain/gas/acinclude.m4 index 31a2c1632f17..f16eefc10fc1 100644 --- a/gnu/dist/toolchain/gas/acinclude.m4 +++ b/gnu/dist/toolchain/gas/acinclude.m4 @@ -54,3 +54,19 @@ for _gas_uniq_i in _gas_uniq_dummy [$]_gas_uniq_list ; do done $1=[$]_gas_uniq_newlist ])dnl + +sinclude(../libtool.m4) +dnl The lines below arrange for aclocal not to bring libtool.m4 +dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake +dnl to add a definition of LIBTOOL to Makefile.in. +ifelse(yes,no,[ +AC_DEFUN([AM_PROG_LIBTOOL],) +AC_DEFUN([AC_CHECK_LIBM],) +AC_SUBST(LIBTOOL) +]) + +sinclude(../gettext.m4) +ifelse(yes,no,[ +AC_DEFUN([CY_WITH_NLS],) +AC_SUBST(INTLLIBS) +]) diff --git a/gnu/dist/toolchain/gas/aclocal.m4 b/gnu/dist/toolchain/gas/aclocal.m4 index 4b4ca84b06c1..338b221387fd 100644 --- a/gnu/dist/toolchain/gas/aclocal.m4 +++ b/gnu/dist/toolchain/gas/aclocal.m4 @@ -67,6 +67,40 @@ done $1=[$]_gas_uniq_newlist ])dnl +sinclude(../libtool.m4) +dnl The lines below arrange for aclocal not to bring libtool.m4 +dnl AM_PROG_LIBTOOL into aclocal.m4, while still arranging for automake +dnl to add a definition of LIBTOOL to Makefile.in. +ifelse(yes,no,[ +AC_DEFUN([AM_PROG_LIBTOOL],) +AC_DEFUN([AC_CHECK_LIBM],) +AC_SUBST(LIBTOOL) +]) + +sinclude(../gettext.m4) +ifelse(yes,no,[ +AC_DEFUN([CY_WITH_NLS],) +AC_SUBST(INTLLIBS) +]) + +#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. @@ -159,415 +193,6 @@ else fi AC_SUBST($1)]) - -# serial 40 AC_PROG_LIBTOOL -AC_DEFUN(AC_PROG_LIBTOOL, -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl - -# Save cache, so that ltconfig can load it -AC_CACHE_SAVE - -# Actually configure libtool. ac_aux_dir is where install-sh is found. -CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ -LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ -LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ -DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ -${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ -$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ -|| AC_MSG_ERROR([libtool configure failed]) - -# Reload cache, that may have been modified by ltconfig -AC_CACHE_LOAD - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Redirect the config.log output again, so that the ltconfig log is not -# clobbered by the next message. -exec 5>>./config.log -]) - -AC_DEFUN(AC_LIBTOOL_SETUP, -[AC_PREREQ(2.13)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_RANLIB])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_NM])dnl -AC_REQUIRE([AC_PROG_LN_S])dnl -dnl - -case "$target" in -NONE) lt_target="$host" ;; -*) lt_target="$target" ;; -esac - -# Check for any special flags to pass to ltconfig. -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" -ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], -[libtool_flags="$libtool_flags --enable-dlopen"]) -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[libtool_flags="$libtool_flags --enable-win32-dll"]) -AC_ARG_ENABLE(libtool-lock, - [ --disable-libtool-lock avoid locking (might break parallel builds)]) -test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" -test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case "$lt_target" in -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case "`/usr/bin/file conftest.o`" in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; - -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -]) -esac -]) - -# AC_LIBTOOL_DLOPEN - enable checks for dlopen support -AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) - -# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's -AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) - -# AC_ENABLE_SHARED - implement the --enable-shared flag -# Usage: AC_ENABLE_SHARED[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_SHARED, [dnl -define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(shared, -changequote(<<, >>)dnl -<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_shared=yes ;; -no) enable_shared=no ;; -*) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl -]) - -# AC_DISABLE_SHARED - set the default shared flag to --disable-shared -AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no)]) - -# AC_ENABLE_STATIC - implement the --enable-static flag -# Usage: AC_ENABLE_STATIC[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_STATIC, [dnl -define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(static, -changequote(<<, >>)dnl -<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_static=yes ;; -no) enable_static=no ;; -*) - enable_static=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_static=AC_ENABLE_STATIC_DEFAULT)dnl -]) - -# AC_DISABLE_STATIC - set the default static flag to --disable-static -AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no)]) - - -# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag -# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] -# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to -# `yes'. -AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl -define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE(fast-install, -changequote(<<, >>)dnl -<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], -changequote([, ])dnl -[p=${PACKAGE-default} -case "$enableval" in -yes) enable_fast_install=yes ;; -no) enable_fast_install=no ;; -*) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," - for pkg in $enableval; do - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$ac_save_ifs" - ;; -esac], -enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl -]) - -# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install -AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no)]) - -# AC_PROG_LD - find the path to the GNU or non-GNU linker -AC_DEFUN(AC_PROG_LD, -[AC_ARG_WITH(gnu-ld, -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$ac_cv_prog_gcc" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) - ac_prog=`($CC -print-prog-name=ld) 2>&5` - case "$ac_prog" in - # Accept absolute paths. -changequote(,)dnl - [\\/]* | [A-Za-z]:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' -changequote([,])dnl - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(ac_cv_path_LD, -[if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" - 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" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then - test "$with_gnu_ld" != no && break - else - test "$with_gnu_ld" != yes && break - fi - fi - done - IFS="$ac_save_ifs" -else - ac_cv_path_LD="$LD" # Let the user override the test with a path. -fi]) -LD="$ac_cv_path_LD" -if test -n "$LD"; then - AC_MSG_RESULT($LD) -else - AC_MSG_RESULT(no) -fi -test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) -AC_PROG_LD_GNU -]) - -AC_DEFUN(AC_PROG_LD_GNU, -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. -if $LD -v 2>&1 &5; then - ac_cv_prog_gnu_ld=yes -else - ac_cv_prog_gnu_ld=no -fi]) -]) - -# AC_PROG_NM - find the path to a BSD-compatible name lister -AC_DEFUN(AC_PROG_NM, -[AC_MSG_CHECKING([for BSD-compatible nm]) -AC_CACHE_VAL(ac_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - ac_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 - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -B" - break - elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then - ac_cv_path_NM="$ac_dir/nm -p" - break - else - ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - fi - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm -fi]) -NM="$ac_cv_path_NM" -AC_MSG_RESULT([$NM]) -]) - -# AC_CHECK_LIBM - check for math library -AC_DEFUN(AC_CHECK_LIBM, -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case "$lt_target" in -*-*-beos* | *-*-cygwin*) - # These system don't have libm - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, main, LIBM="-lm") - ;; -esac -]) - -# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl convenience library, adds --enable-ltdl-convenience to -# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor -# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed -# to be `${top_builddir}/libltdl'. Make sure you start DIR with -# '${top_builddir}/' (note the single quotes!) if your package is not -# flat, and, if you're not using automake, define top_builddir as -# appropriate in the Makefiles. -AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case "$enable_ltdl_convenience" in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la - INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) -]) - -# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for -# the libltdl installable library, and adds --enable-ltdl-install to -# the configure arguments. Note that LIBLTDL is not AC_SUBSTed, nor -# is AC_CONFIG_SUBDIRS called. If DIR is not provided, it is assumed -# to be `${top_builddir}/libltdl'. Make sure you start DIR with -# '${top_builddir}/' (note the single quotes!) if your package is not -# flat, and, if you're not using automake, define top_builddir as -# appropriate in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, main, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la - INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - INCLTDL= - fi -]) - -dnl old names -AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl -AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl -AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl -AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl -AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl -AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl -AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl - -dnl This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL])dnl - # Like AC_CONFIG_HEADER, but automatically create stamp file. AC_DEFUN(AM_CONFIG_HEADER, @@ -600,351 +225,6 @@ AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex") AC_PROG_LEX AC_DECL_YYTEXT]) -# This file is derived from `gettext.m4'. The difference is that the -# included macros assume Cygnus-style source and build trees. - -# Macro to add for using GNU gettext. -# Ulrich Drepper , 1995. -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -# serial 3 - -AC_DEFUN(CY_WITH_NLS, - [AC_MSG_CHECKING([whether NLS is requested]) - dnl Default is enabled NLS - AC_ARG_ENABLE(nls, - [ --disable-nls do not use Native Language Support], - USE_NLS=$enableval, USE_NLS=yes) - AC_MSG_RESULT($USE_NLS) - AC_SUBST(USE_NLS) - - USE_INCLUDED_LIBINTL=no - - dnl If we use NLS figure out what method - if test "$USE_NLS" = "yes"; then - AC_DEFINE(ENABLE_NLS, 1, [Define to 1 if NLS is requested]) - AC_MSG_CHECKING([whether included gettext is requested]) - AC_ARG_WITH(included-gettext, - [ --with-included-gettext use the GNU gettext library included here], - nls_cv_force_use_gnu_gettext=$withval, - nls_cv_force_use_gnu_gettext=no) - AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) - - nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" - if test "$nls_cv_force_use_gnu_gettext" != "yes"; then - dnl User does not insist on using GNU NLS library. Figure out what - dnl to use. If gettext or catgets are available (in this order) we - dnl use this. Else we have to fall back to GNU NLS library. - dnl catgets is only used if permitted by option --with-catgets. - nls_cv_header_intl= - nls_cv_header_libgt= - CATOBJEXT=NONE - - AC_CHECK_HEADER(libintl.h, - [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc, - [AC_TRY_LINK([#include ], [return (int) gettext ("")], - gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)]) - - if test "$gt_cv_func_gettext_libc" != "yes"; then - AC_CHECK_LIB(intl, bindtextdomain, - [AC_CACHE_CHECK([for gettext in libintl], - gt_cv_func_gettext_libintl, - [AC_TRY_LINK([], [return (int) gettext ("")], - gt_cv_func_gettext_libintl=yes, - gt_cv_func_gettext_libintl=no)])]) - fi - - if test "$gt_cv_func_gettext_libc" = "yes" \ - || test "$gt_cv_func_gettext_libintl" = "yes"; then - AC_DEFINE(HAVE_GETTEXT, 1, - [Define as 1 if you have gettext and don't want to use GNU gettext.]) - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl - if test "$MSGFMT" != "no"; then - AC_CHECK_FUNCS(dcgettext) - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) - AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; - return _nl_msg_cat_cntr], - [CATOBJEXT=.gmo - DATADIRNAME=share], - [CATOBJEXT=.mo - DATADIRNAME=lib]) - INSTOBJEXT=.mo - fi - fi - ]) - - dnl In the standard gettext, we would now check for catgets. - dnl However, we never want to use catgets for our releases. - - if test "$CATOBJEXT" = "NONE"; then - dnl Neither gettext nor catgets in included in the C library. - dnl Fall back on GNU gettext library. - nls_cv_use_gnu_gettext=yes - fi - fi - - if test "$nls_cv_use_gnu_gettext" = "yes"; then - dnl Mark actions used to generate GNU NLS library. - INTLOBJS="\$(GETTOBJS)" - AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt) - AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) - AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, - [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) - AC_SUBST(MSGFMT) - USE_INCLUDED_LIBINTL=yes - CATOBJEXT=.gmo - INSTOBJEXT=.mo - DATADIRNAME=share - INTLDEPS='$(top_builddir)/../intl/libintl.a' - INTLLIBS=$INTLDEPS - LIBS=`echo $LIBS | sed -e 's/-lintl//'` - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - dnl Test whether we really found GNU xgettext. - if test "$XGETTEXT" != ":"; then - dnl If it is no GNU xgettext we define it as : so that the - dnl Makefiles still can work. - if $XGETTEXT --omit-header /dev/null 2> /dev/null; then - : ; - else - AC_MSG_RESULT( - [found xgettext programs is not GNU xgettext; ignore it]) - XGETTEXT=":" - fi - fi - - # We need to process the po/ directory. - POSUB=po - else - DATADIRNAME=share - nls_cv_header_intl=libintl.h - nls_cv_header_libgt=libgettext.h - fi - - # If this is used in GNU gettext we have to set USE_NLS to `yes' - # because some of the sources are only built for this goal. - if test "$PACKAGE" = gettext; then - USE_NLS=yes - USE_INCLUDED_LIBINTL=yes - fi - - dnl These rules are solely for the distribution goal. While doing this - dnl we only have to keep exactly one list of the available catalogs - dnl in configure.in. - for lang in $ALL_LINGUAS; do - GMOFILES="$GMOFILES $lang.gmo" - POFILES="$POFILES $lang.po" - done - - dnl Make all variables we use known to autoconf. - AC_SUBST(USE_INCLUDED_LIBINTL) - AC_SUBST(CATALOGS) - AC_SUBST(CATOBJEXT) - AC_SUBST(DATADIRNAME) - AC_SUBST(GMOFILES) - AC_SUBST(INSTOBJEXT) - AC_SUBST(INTLDEPS) - AC_SUBST(INTLLIBS) - AC_SUBST(INTLOBJS) - AC_SUBST(POFILES) - AC_SUBST(POSUB) - ]) - -AC_DEFUN(CY_GNU_GETTEXT, - [AC_REQUIRE([AC_PROG_MAKE_SET])dnl - AC_REQUIRE([AC_PROG_CC])dnl - AC_REQUIRE([AC_PROG_RANLIB])dnl - AC_REQUIRE([AC_ISC_POSIX])dnl - AC_REQUIRE([AC_HEADER_STDC])dnl - AC_REQUIRE([AC_C_CONST])dnl - AC_REQUIRE([AC_C_INLINE])dnl - AC_REQUIRE([AC_TYPE_OFF_T])dnl - AC_REQUIRE([AC_TYPE_SIZE_T])dnl - AC_REQUIRE([AC_FUNC_ALLOCA])dnl - AC_REQUIRE([AC_FUNC_MMAP])dnl - - AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \ -unistd.h values.h sys/param.h]) - AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \ -__argz_count __argz_stringify __argz_next]) - - if test "${ac_cv_func_stpcpy+set}" != "set"; then - AC_CHECK_FUNCS(stpcpy) - fi - if test "${ac_cv_func_stpcpy}" = "yes"; then - AC_DEFINE(HAVE_STPCPY, 1, [Define if you have the stpcpy function]) - fi - - AM_LC_MESSAGES - CY_WITH_NLS - - if test "x$CATOBJEXT" != "x"; then - if test "x$ALL_LINGUAS" = "x"; then - LINGUAS= - else - AC_MSG_CHECKING(for catalogs to be installed) - NEW_LINGUAS= - for lang in ${LINGUAS=$ALL_LINGUAS}; do - case "$ALL_LINGUAS" in - *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;; - esac - done - LINGUAS=$NEW_LINGUAS - AC_MSG_RESULT($LINGUAS) - fi - - dnl Construct list of names of catalog files to be constructed. - if test -n "$LINGUAS"; then - for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done - fi - fi - - dnl The reference to in the installed file - dnl must be resolved because we cannot expect the users of this - dnl to define HAVE_LOCALE_H. - if test $ac_cv_header_locale_h = yes; then - INCLUDE_LOCALE_H="#include " - else - INCLUDE_LOCALE_H="\ -/* The system does not provide the header . Take care yourself. */" - fi - AC_SUBST(INCLUDE_LOCALE_H) - - dnl Determine which catalog format we have (if any is needed) - dnl For now we know about two different formats: - dnl Linux libc-5 and the normal X/Open format - if test -f $srcdir/po2tbl.sed.in; then - if test "$CATOBJEXT" = ".cat"; then - AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen) - - dnl Transform the SED scripts while copying because some dumb SEDs - dnl cannot handle comments. - sed -e '/^#/d' $srcdir/$msgformat-msg.sed > po2msg.sed - fi - dnl po2tbl.sed is always needed. - sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \ - $srcdir/po2tbl.sed.in > po2tbl.sed - fi - - dnl In the intl/Makefile.in we have a special dependency which makes - dnl only sense for gettext. We comment this out for non-gettext - dnl packages. - if test "$PACKAGE" = "gettext"; then - GT_NO="#NO#" - GT_YES= - else - GT_NO= - GT_YES="#YES#" - fi - AC_SUBST(GT_NO) - AC_SUBST(GT_YES) - - MKINSTALLDIRS="\$(srcdir)/../../mkinstalldirs" - AC_SUBST(MKINSTALLDIRS) - - dnl *** For now the libtool support in intl/Makefile is not for real. - l= - AC_SUBST(l) - - dnl Generate list of files to be processed by xgettext which will - dnl be included in po/Makefile. But only do this if the po directory - dnl exists in srcdir. - if test -d $srcdir/po; then - test -d po || mkdir po - if test "x$srcdir" != "x."; then - if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then - posrcprefix="$srcdir/" - else - posrcprefix="../$srcdir/" - fi - else - posrcprefix="../" - fi - rm -f po/POTFILES - sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \ - < $srcdir/po/POTFILES.in > po/POTFILES - fi - ]) - -# Search path for a program which passes the given test. -# Ulrich Drepper , 1996. -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -# serial 1 - -dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, -dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) -AC_DEFUN(AM_PATH_PROG_WITH_TEST, -[# Extract the first word of "$2", so it can be a program name with args. -set dummy $2; ac_word=[$]2 -AC_MSG_CHECKING([for $ac_word]) -AC_CACHE_VAL(ac_cv_path_$1, -[case "[$]$1" in - /*) - ac_cv_path_$1="[$]$1" # Let the user override the test with a path. - ;; - *) - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" - for ac_dir in ifelse([$5], , $PATH, [$5]); do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if [$3]; then - ac_cv_path_$1="$ac_dir/$ac_word" - break - fi - fi - done - IFS="$ac_save_ifs" -dnl If no 4th arg is given, leave the cache variable unset, -dnl so AC_PATH_PROGS will keep looking. -ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" -])dnl - ;; -esac])dnl -$1="$ac_cv_path_$1" -if test -n "[$]$1"; then - AC_MSG_RESULT([$]$1) -else - AC_MSG_RESULT(no) -fi -AC_SUBST($1)dnl -]) - -# Check whether LC_MESSAGES is available in . -# Ulrich Drepper , 1995. -# -# This file file be copied and used freely without restrictions. It can -# be used in projects which are not available under the GNU Public License -# but which still want to provide support for the GNU gettext functionality. -# Please note that the actual code is *not* freely available. - -# serial 1 - -AC_DEFUN(AM_LC_MESSAGES, - [if test $ac_cv_header_locale_h = yes; then - AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, - [AC_TRY_LINK([#include ], [return LC_MESSAGES], - am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) - if test $am_cv_val_LC_MESSAGES = yes; then - AC_DEFINE(HAVE_LC_MESSAGES, 1, - [Define if your locale.h file contains LC_MESSAGES.]) - fi - fi]) - # Add --enable-maintainer-mode option to configure. # From Jim Meyering diff --git a/gnu/dist/toolchain/gas/app.c b/gnu/dist/toolchain/gas/app.c index 2613e7440b36..46273c2823b6 100644 --- a/gnu/dist/toolchain/gas/app.c +++ b/gnu/dist/toolchain/gas/app.c @@ -48,7 +48,7 @@ static int scrub_m68k_mri; static const char mri_pseudo[] = ".mri 0"; #if defined TC_ARM && defined OBJ_ELF -/* The pseudo-op for which we need to special-case `@' characters. +/* The pseudo-op for which we need to special-case `@' characters. See the comment in do_scrub_chars. */ static const char symver_pseudo[] = ".symver"; static const char * symver_state; @@ -88,9 +88,9 @@ static int process_escape PARAMS ((int)); /* FIXME-soon: The entire lexer/parser thingy should be built statically at compile time rather than dynamically - each and every time the assembler is run. xoxorich. */ + each and every time the assembler is run. xoxorich. */ -void +void do_scrub_begin (m68k_mri) int m68k_mri ATTRIBUTE_UNUSED; { @@ -101,7 +101,6 @@ do_scrub_begin (m68k_mri) lex['\t'] = LEX_IS_WHITESPACE; lex['\r'] = LEX_IS_WHITESPACE; lex['\n'] = LEX_IS_NEWLINE; - lex[';'] = LEX_IS_LINE_SEPARATOR; lex[':'] = LEX_IS_COLON; #ifdef TC_M68K @@ -212,24 +211,23 @@ static char mri_last_ch; state at the time .include is interpreted is completely unrelated. That's why we have to save it all. */ -struct app_save - { - int state; - int old_state; - char * out_string; - char out_buf[sizeof (out_buf)]; - int add_newlines; - char * saved_input; - int saved_input_len; +struct app_save { + int state; + int old_state; + char * out_string; + char out_buf[sizeof (out_buf)]; + int add_newlines; + char * saved_input; + int saved_input_len; #ifdef TC_M68K - int scrub_m68k_mri; + int scrub_m68k_mri; #endif - const char * mri_state; - char mri_last_ch; + const char * mri_state; + char mri_last_ch; #if defined TC_ARM && defined OBJ_ELF - const char * symver_state; + const char * symver_state; #endif - }; +}; char * app_push () @@ -259,7 +257,7 @@ app_push () saved->symver_state = symver_state; #endif - /* do_scrub_begin() is not useful, just wastes time. */ + /* do_scrub_begin() is not useful, just wastes time. */ state = 0; saved_input = NULL; @@ -267,13 +265,13 @@ app_push () return (char *) saved; } -void +void app_pop (arg) char *arg; { register struct app_save *saved = (struct app_save *) arg; - /* There is no do_scrub_end (). */ + /* There is no do_scrub_end (). */ state = saved->state; old_state = saved->old_state; out_string = saved->out_string; @@ -303,7 +301,7 @@ app_pop (arg) /* @@ This assumes that \n &c are the same on host and target. This is not necessarily true. */ -static int +static int process_escape (ch) int ch; { @@ -780,19 +778,20 @@ do_scrub_chars (get, tostart, tolen) } #ifdef KEEP_WHITE_AROUND_COLON - if (lex[ch] == LEX_IS_COLON) - { - /* only keep this white if there's no white *after* the colon */ - ch2 = GET (); - UNGET (ch2); - if (!IS_WHITESPACE (ch2)) - { - state = 9; - UNGET (ch); - PUT (' '); - break; - } - } + if (lex[ch] == LEX_IS_COLON) + { + /* Only keep this white if there's no white *after* the + colon. */ + ch2 = GET (); + UNGET (ch2); + if (!IS_WHITESPACE (ch2)) + { + state = 9; + UNGET (ch); + PUT (' '); + break; + } + } #endif if (IS_COMMENT (ch) || ch == '/' @@ -913,6 +912,21 @@ do_scrub_chars (get, tostart, tolen) ch = ' '; goto recycle; } +#ifdef DOUBLESLASH_LINE_COMMENTS + else if (ch2 == '/') + { + do + { + ch = GET (); + } + while (ch != EOF && !IS_NEWLINE (ch)); + if (ch == EOF) + as_warn ("end of file in comment; newline inserted"); + state = 0; + PUT ('\n'); + break; + } +#endif else { if (ch2 != EOF) @@ -1000,7 +1014,7 @@ do_scrub_chars (get, tostart, tolen) case LEX_IS_COLON: #ifdef KEEP_WHITE_AROUND_COLON - state = 9; + state = 9; #else if (state == 9 || state == 10) state = 3; @@ -1017,7 +1031,7 @@ do_scrub_chars (get, tostart, tolen) --add_newlines; UNGET (ch); } - /* fall thru into... */ + /* Fall through. */ case LEX_IS_LINE_SEPARATOR: state = 0; @@ -1026,13 +1040,13 @@ do_scrub_chars (get, tostart, tolen) #ifdef TC_V850 case LEX_IS_DOUBLEDASH_1ST: - ch2 = GET(); + ch2 = GET (); if (ch2 != '-') { UNGET (ch2); goto de_fault; } - /* read and skip to end of line */ + /* Read and skip to end of line. */ do { ch = GET (); @@ -1045,10 +1059,10 @@ do_scrub_chars (get, tostart, tolen) state = 0; PUT ('\n'); break; -#endif +#endif #ifdef DOUBLEBAR_PARALLEL case LEX_IS_DOUBLEBAR_1ST: - ch2 = GET(); + ch2 = GET (); if (ch2 != '|') { UNGET (ch2); @@ -1060,7 +1074,7 @@ do_scrub_chars (get, tostart, tolen) PUT ('|'); PUT ('|'); break; -#endif +#endif case LEX_IS_LINE_COMMENT_START: /* FIXME-someday: The two character comment stuff was badly thought out. On i386, we want '/' as line comment start @@ -1109,7 +1123,7 @@ do_scrub_chars (get, tostart, tolen) PUT ('\n'); break; } - /* Loks like `# 123 "filename"' from cpp. */ + /* Looks like `# 123 "filename"' from cpp. */ UNGET (ch); old_state = 4; state = -1; @@ -1126,12 +1140,14 @@ do_scrub_chars (get, tostart, tolen) Trap is the only short insn that has a first operand that is neither register nor label. We must prevent exef0f ||trap #1 to degenerate to exef0f ||trap#1 . - We can't make '#' LEX_IS_SYMBOL_COMPONENT because it is already - LEX_IS_LINE_COMMENT_START. However, it is the only character in - line_comment_chars for d10v, hence we can recognize it as such. */ + We can't make '#' LEX_IS_SYMBOL_COMPONENT because it is + already LEX_IS_LINE_COMMENT_START. However, it is the + only character in line_comment_chars for d10v, hence we + can recognize it as such. */ /* An alternative approach would be to reset the state to 1 when we see '||', '<'- or '->', but that seems to be overkill. */ - if (state == 10) PUT (' '); + if (state == 10) + PUT (' '); #endif /* We have a line comment character which is not at the start of a line. If this is also a normal comment @@ -1151,11 +1167,15 @@ do_scrub_chars (get, tostart, tolen) #if defined TC_ARM && defined OBJ_ELF /* On the ARM, `@' is the comment character. Unfortunately this is also a special character in ELF .symver - directives (and .type, though we deal with those another way). So - we check if this line is such a directive, and treat the character - as default if so. This is a hack. */ + directives (and .type, though we deal with those another way). + So we check if this line is such a directive, and treat + the character as default if so. This is a hack. */ if ((symver_state != NULL) && (*symver_state == 0)) goto de_fault; +#endif +#ifdef WARN_COMMENTS + if (!found_comment) + as_where (&found_comment_file, &found_comment); #endif do { @@ -1199,7 +1219,7 @@ do_scrub_chars (get, tostart, tolen) { int type; - ch2 = * (unsigned char *) s; + ch2 = *(unsigned char *) s; type = lex[ch2]; if (type != 0 && type != LEX_IS_SYMBOL_COMPONENT) @@ -1236,7 +1256,7 @@ do_scrub_chars (get, tostart, tolen) case 2: *to++ = *from++; case 1: *to++ = *from++; } - } + } ch = GET (); } } diff --git a/gnu/dist/toolchain/gas/as.c b/gnu/dist/toolchain/gas/as.c index f02c42a9b1b5..8c7493db2a49 100644 --- a/gnu/dist/toolchain/gas/as.c +++ b/gnu/dist/toolchain/gas/as.c @@ -1,5 +1,5 @@ /* as.c - GAS main program. - Copyright (C) 1987, 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright (C) 1987, 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -17,21 +17,18 @@ 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. */ + 02111-1307, USA. */ -/* - * Main program for AS; a 32-bit assembler of GNU. +/* Main program for AS; a 32-bit assembler of GNU. * Understands command arguments. * Has a few routines that don't fit in other modules because they * are shared. * - * * bugs * * : initialisers * Since no-one else says they will support them in future: I * don't support them now. - * */ #include "ansidecl.h" @@ -43,6 +40,7 @@ #include "output-file.h" #include "sb.h" #include "macro.h" +#include "dwarf2dbg.h" #ifdef HAVE_ITBL_CPU #include "itbl-ops.h" @@ -63,19 +61,21 @@ static void dump_statistics PARAMS ((void)); static void perform_an_assembly_pass PARAMS ((int argc, char **argv)); static int macro_expr PARAMS ((const char *, int, sb *, int *)); -int listing; /* true if a listing is wanted */ +/* True if a listing is wanted. */ +int listing; -static char *listing_filename = NULL; /* Name of listing file. */ +/* Name of listing file. */ +static char *listing_filename = NULL; /* Type of debugging to generate. */ -enum debug_info_type debug_type = DEBUG_NONE; +enum debug_info_type debug_type = DEBUG_UNSPECIFIED; /* Maximum level of macro nesting. */ - int max_macro_nest = 100; -char *myname; /* argv[0] */ +/* argv[0] */ +char *myname; #ifdef BFD_ASSEMBLER segT reg_section, expr_section; segT text_section, data_section, bss_section; @@ -92,8 +92,7 @@ int debug_memory = 0; /* We build a list of defsyms as we read the options, and then define them after we have initialized everything. */ -struct defsym_list -{ +struct defsym_list { struct defsym_list *next; char *name; valueT value; @@ -101,10 +100,9 @@ struct defsym_list static struct defsym_list *defsyms; -/* Keep a record of the itbl files we read in. */ +/* Keep a record of the itbl files we read in. */ -struct itbl_file_list -{ +struct itbl_file_list { struct itbl_file_list *next; char *name; }; @@ -117,6 +115,7 @@ static struct itbl_file_list *itbl_files; extern struct emulation mipsbelf, mipslelf, mipself; extern struct emulation mipsbecoff, mipslecoff, mipsecoff; extern struct emulation i386coff, i386elf, i386aout; +extern struct emulation crisaout, criself; static struct emulation *const emulations[] = { EMULATIONS }; static const int n_emulations = sizeof (emulations) / sizeof (emulations[0]); @@ -142,7 +141,7 @@ select_emulation_mode (argc, argv) if (p) p++; else - p = argv[i+1]; + p = argv[i + 1]; if (!p || !*p) as_fatal (_("missing emulation mode name")); @@ -246,12 +245,12 @@ Options:\n\ fprintf (stream, "\ --em=["); - for (i = 0; i < n_emulations-1; i++) + for (i = 0; i < n_emulations - 1; i++) fprintf (stream, "%s | ", emulations[i]->name); fprintf (stream, "%s]\n", emulations[i]->name); def_em = getenv (EMULATION_ENVIRON); - if (!def_em) + if (!def_em) def_em = DEFAULT_EMULATION; fprintf (stream, _("\ emulate output (default %s)\n"), def_em); @@ -266,6 +265,8 @@ Options:\n\ fprintf (stream, _("\ --help show this message and exit\n")); fprintf (stream, _("\ + --target-help show target specific options\n")); + fprintf (stream, _("\ -I DIR add DIR to search list for .include directives\n")); fprintf (stream, _("\ -J don't warn about signed overflow\n")); @@ -326,16 +327,14 @@ Options:\n\ fprintf (stream, _("Report bugs to %s\n"), REPORT_BUGS_TO); } -/* - * Since it is easy to do here we interpret the special arg "-" - * to mean "use stdin" and we set that argv[] pointing to "". - * After we have munged argv[], the only things left are source file - * name(s) and ""(s) denoting stdin. These file names are used - * (perhaps more than once) later. - * - * check for new machine-dep cmdline options in - * md_parse_option definitions in config/tc-*.c - */ +/* Since it is easy to do here we interpret the special arg "-" + to mean "use stdin" and we set that argv[] pointing to "". + After we have munged argv[], the only things left are source file + name(s) and ""(s) denoting stdin. These file names are used + (perhaps more than once) later. + + check for new machine-dep cmdline options in + md_parse_option definitions in config/tc-*.c. */ static void parse_args (pargc, pargv) @@ -352,24 +351,23 @@ parse_args (pargc, pargv) char *shortopts; extern CONST char *md_shortopts; - static const char std_shortopts[] = - { - '-', 'J', + static const char std_shortopts[] = { + '-', 'J', #ifndef WORKING_DOT_WORD - /* -K is not meaningful if .word is not being hacked. */ - 'K', + /* -K is not meaningful if .word is not being hacked. */ + 'K', #endif - 'L', 'M', 'R', 'W', 'Z', 'f', 'a', ':', ':', 'D', 'I', ':', 'o', ':', + 'L', 'M', 'R', 'W', 'Z', 'f', 'a', ':', ':', 'D', 'I', ':', 'o', ':', #ifndef VMS - /* -v takes an argument on VMS, so we don't make it a generic - option. */ - 'v', + /* -v takes an argument on VMS, so we don't make it a generic + option. */ + 'v', #endif - 'w', 'X', - /* New option for extending instruction set (see also --itbl below) */ - 't', ':', - '\0' - }; + 'w', 'X', + /* New option for extending instruction set (see also --itbl below) */ + 't', ':', + '\0' + }; struct option *longopts; extern struct option md_longopts[]; extern size_t md_longopts_size; @@ -421,17 +419,26 @@ parse_args (pargc, pargv) {"no-warn", no_argument, NULL, 'W'}, #define OPTION_WARN (OPTION_STD_BASE + 18) {"warn", no_argument, NULL, OPTION_WARN}, -#define OPTION_WARN_FATAL (OPTION_STD_BASE + 19) +#define OPTION_TARGET_HELP (OPTION_STD_BASE + 19) + {"target-help", no_argument, NULL, OPTION_TARGET_HELP}, +#define OPTION_WARN_FATAL (OPTION_STD_BASE + 20) {"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL} + /* When you add options here, check that they do not collide with + OPTION_MD_BASE. See as.h. */ }; - /* Construct the option lists from the standard list and the - target dependent list. */ + /* Construct the option lists from the standard list and the target + dependent list. Include space for an extra NULL option and + always NULL terminate. */ shortopts = concat (std_shortopts, md_shortopts, (char *) NULL); - longopts = (struct option *) xmalloc (sizeof (std_longopts) + md_longopts_size); + longopts = (struct option *) xmalloc (sizeof (std_longopts) + + md_longopts_size + + sizeof (struct option)); memcpy (longopts, std_longopts, sizeof (std_longopts)); memcpy ((char *) longopts + sizeof (std_longopts), md_longopts, md_longopts_size); + memset ((char *) longopts + sizeof (std_longopts) + md_longopts_size, + 0, sizeof (struct option)); /* Make a local copy of the old argv. */ old_argc = *pargc; @@ -471,7 +478,7 @@ parse_args (pargc, pargv) VMS code in md_parse_option can return 0 in that case, but it has no way of pushing the filename argument back. */ if (optarg && *optarg) - new_argv[new_argc++] = optarg, new_argv[new_argc] = NULL; + new_argv[new_argc++] = optarg, new_argv[new_argc] = NULL; else #else case 'v': @@ -480,7 +487,7 @@ parse_args (pargc, pargv) print_version_id (); break; } - /*FALLTHRU*/ + /* Fall through. */ case '?': exit (EXIT_FAILURE); @@ -492,6 +499,10 @@ parse_args (pargc, pargv) new_argv[new_argc] = NULL; break; + case OPTION_TARGET_HELP: + md_show_usage (stdout); + exit (EXIT_SUCCESS); + case OPTION_HELP: show_usage (stdout); exit (EXIT_SUCCESS); @@ -514,7 +525,7 @@ 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 2000 Free Software Foundation, Inc.\n")); + printf (_("Copyright 2001 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")); @@ -546,7 +557,7 @@ the GNU General Public License. This program has absolutely no warranty.\n")); case OPTION_DEFSYM: { char *s; - long i; + valueT i; struct defsym_list *n; for (s = optarg; *s != '\0' && *s != '='; s++) @@ -554,7 +565,11 @@ the GNU General Public License. This program has absolutely no warranty.\n")); if (*s == '\0') as_fatal (_("bad defsym; format is --defsym name=value")); *s++ = '\0'; +#ifdef BFD_ASSEMBLER + i = bfd_scan_vma (s, (const char **) NULL, 0); +#else i = strtol (s, (char **) NULL, 0); +#endif n = (struct defsym_list *) xmalloc (sizeof *n); n->next = defsyms; n->name = optarg; @@ -566,29 +581,29 @@ the GNU General Public License. This program has absolutely no warranty.\n")); case OPTION_INSTTBL: case 't': { - /* optarg is the name of the file containing the instruction - formats, opcodes, register names, etc. */ + /* optarg is the name of the file containing the instruction + formats, opcodes, register names, etc. */ struct itbl_file_list *n; if (optarg == NULL) { - as_warn ( _("No file name following -t option\n") ); + as_warn (_("No file name following -t option\n")); break; } - + n = (struct itbl_file_list *) xmalloc (sizeof *n); n->next = itbl_files; n->name = optarg; itbl_files = n; /* Parse the file and add the new instructions to our internal - table. If multiple instruction tables are specified, the - information from this table gets appended onto the existing - internal table. */ + table. If multiple instruction tables are specified, the + information from this table gets appended onto the existing + internal table. */ itbl_files->name = xstrdup (optarg); if (itbl_parse (itbl_files->name) != 0) { - fprintf (stderr, _("Failed to read instruction table %s\n"), + fprintf (stderr, _("Failed to read instruction table %s\n"), itbl_files->name); exit (EXIT_SUCCESS); } @@ -602,7 +617,7 @@ the GNU General Public License. This program has absolutely no warranty.\n")); case OPTION_GSTABS: debug_type = DEBUG_STABS; break; - + case OPTION_GDWARF2: debug_type = DEBUG_DWARF2; break; @@ -622,22 +637,22 @@ the GNU General Public License. This program has absolutely no warranty.\n")); break; case OPTION_LISTING_LHS_WIDTH: - listing_lhs_width = atoi(optarg); + listing_lhs_width = atoi (optarg); if (listing_lhs_width_second < listing_lhs_width) listing_lhs_width_second = listing_lhs_width; break; case OPTION_LISTING_LHS_WIDTH2: { - int tmp = atoi(optarg); + int tmp = atoi (optarg); if (tmp > listing_lhs_width) listing_lhs_width_second = tmp; } break; case OPTION_LISTING_RHS_WIDTH: - listing_rhs_width = atoi(optarg); + listing_rhs_width = atoi (optarg); break; case OPTION_LISTING_CONT_LINES: - listing_lhs_cont_lines = atoi(optarg); + listing_lhs_cont_lines = atoi (optarg); break; case 'M': @@ -672,6 +687,9 @@ the GNU General Public License. This program has absolutely no warranty.\n")); case 'a': if (optarg) { + if (md_parse_option (optc, optarg) != 0) + break; + while (*optarg) { switch (*optarg) @@ -713,8 +731,8 @@ the GNU General Public License. This program has absolutely no warranty.\n")); break; case 'D': - /* DEBUG is implemented: it debugs different */ - /* things from other people's assemblers. */ + /* DEBUG is implemented: it debugs different + things from other people's assemblers. */ flag_debug = 1; break; @@ -723,7 +741,7 @@ the GNU General Public License. This program has absolutely no warranty.\n")); break; case 'I': - { /* Include file directory */ + { /* Include file directory. */ char *temp = xstrdup (optarg); add_include_dir (temp); break; @@ -737,7 +755,7 @@ the GNU General Public License. This program has absolutely no warranty.\n")); break; case 'X': - /* -X means treat warnings as errors */ + /* -X means treat warnings as errors. */ break; } } @@ -751,7 +769,7 @@ the GNU General Public License. This program has absolutely no warranty.\n")); static long start_time; -int +int main (argc, argv) int argc; char **argv; @@ -806,7 +824,7 @@ main (argc, argv) symbol_begin (); frag_init (); subsegs_begin (); - parse_args (&argc, &argv); + parse_args (&argc, &argv); read_begin (); input_scrub_begin (); expr_begin (); @@ -859,7 +877,8 @@ main (argc, argv) PROGRESS (1); - perform_an_assembly_pass (argc, argv); /* Assemble it. */ + /* Assemble it. */ + perform_an_assembly_pass (argc, argv); cond_finish_check (-1); @@ -867,6 +886,10 @@ main (argc, argv) md_end (); #endif + /* If we've been collecting dwarf2 .debug_line info, either for + assembly debugging or on behalf of the compiler, emit it now. */ + dwarf2_finish (); + if (seen_at_least_1_file () && (flag_always_generate_output || had_errors () == 0)) keep_it = 1; @@ -895,8 +918,8 @@ main (argc, argv) output_file_close (out_file_name); #endif - if (flag_fatal_warnings && had_warnings() > 0 && had_errors () == 0) - as_bad (_("%d warnings, treating warnings as errors"), had_warnings()); + if (flag_fatal_warnings && had_warnings () > 0 && had_errors () == 0) + as_bad (_("%d warnings, treating warnings as errors"), had_warnings ()); if (had_errors () > 0 && ! flag_always_generate_output) keep_it = 0; @@ -947,19 +970,16 @@ dump_statistics () #endif } +/* Here to attempt 1 pass over each input file. + We scan argv[*] looking for filenames or exactly "" which is + shorthand for stdin. Any argv that is NULL is not a file-name. + We set need_pass_2 TRUE if, after this, we still have unresolved + expressions of the form (unknown value)+-(unknown value). -/* perform_an_assembly_pass() - * - * Here to attempt 1 pass over each input file. - * We scan argv[*] looking for filenames or exactly "" which is - * shorthand for stdin. Any argv that is NULL is not a file-name. - * We set need_pass_2 TRUE if, after this, we still have unresolved - * expressions of the form (unknown value)+-(unknown value). - * - * Note the un*x semantics: there is only 1 logical input file, but it - * may be a catenation of many 'physical' input files. - */ -static void + Note the un*x semantics: there is only 1 logical input file, but it + may be a catenation of many 'physical' input files. */ + +static void perform_an_assembly_pass (argc, argv) int argc; char **argv; @@ -978,7 +998,7 @@ perform_an_assembly_pass (argc, argv) for (i = SEG_E0; i < SEG_UNKNOWN; i++) segment_info[i].fix_root = 0; } - /* Create the three fixed ones */ + /* Create the three fixed ones. */ { segT seg; @@ -1009,7 +1029,7 @@ perform_an_assembly_pass (argc, argv) data_section = subseg_new (DATA_SECTION_NAME, 0); bss_section = subseg_new (BSS_SECTION_NAME, 0); /* @@ FIXME -- we're setting the RELOC flag so that sections are assumed - to have relocs, otherwise we don't find out in time. */ + to have relocs, otherwise we don't find out in time. */ applicable = bfd_applicable_section_flags (stdoutput); bfd_set_section_flags (stdoutput, text_section, applicable & (SEC_ALLOC | SEC_LOAD | SEC_RELOC @@ -1036,22 +1056,24 @@ perform_an_assembly_pass (argc, argv) obj_begin (); #endif - argv++; /* skip argv[0] */ - argc--; /* skip argv[0] */ + /* Skip argv[0]. */ + argv++; + argc--; + while (argc--) { if (*argv) - { /* Is it a file-name argument? */ + { /* Is it a file-name argument? */ PROGRESS (1); saw_a_file++; - /* argv->"" if stdin desired, else->filename */ + /* argv->"" if stdin desired, else->filename */ read_a_source_file (*argv); } - argv++; /* completed that argv */ + argv++; /* completed that argv */ } if (!saw_a_file) read_a_source_file (""); -} /* perform_an_assembly_pass() */ +} /* The interface between the macro code and gas expression handling. */ @@ -1080,5 +1102,3 @@ macro_expr (emsg, idx, in, val) return idx; } - -/* end of as.c */ diff --git a/gnu/dist/toolchain/gas/as.h b/gnu/dist/toolchain/gas/as.h index e56d6cda7821..a98acfe19756 100644 --- a/gnu/dist/toolchain/gas/as.h +++ b/gnu/dist/toolchain/gas/as.h @@ -21,8 +21,7 @@ #ifndef GAS #define GAS 1 -/* - * I think this stuff is largely out of date. xoxorich. +/* I think this stuff is largely out of date. xoxorich. * * CAPITALISED names are #defined. * "lowercaseH" is #defined if "lowercase.h" has been #include-d. @@ -80,7 +79,7 @@ extern void *alloca (); /* Now, tend to the rest of the configuration. */ -/* System include files first... */ +/* System include files first... */ #include #include #ifdef HAVE_STRING_H @@ -106,8 +105,8 @@ extern void *alloca (); 150 isn't special; it's just an arbitrary non-ASCII char value. */ #define OPTION_STD_BASE 150 /* The first getopt value for machine-dependent long options. - 170 gives the standard options room to grow. */ -#define OPTION_MD_BASE 170 + 190 gives the standard options room to grow. */ +#define OPTION_MD_BASE 190 #ifdef DEBUG #undef NDEBUG @@ -136,8 +135,7 @@ extern void *alloca (); #endif - -/* Now GNU header files... */ +/* Now GNU header files... */ #include "ansidecl.h" #ifdef BFD_ASSEMBLER #include "bfd.h" @@ -185,9 +183,9 @@ extern char **environ; /* Make Saber happier on obstack.h. */ #ifdef SABER #undef __PTR_TO_INT -#define __PTR_TO_INT(P) ((int)(P)) +#define __PTR_TO_INT(P) ((int) (P)) #undef __INT_TO_PTR -#define __INT_TO_PTR(P) ((char *)(P)) +#define __INT_TO_PTR(P) ((char *) (P)) #endif #ifndef __LINE__ @@ -222,11 +220,11 @@ extern char **environ; #include "asintl.h" -#define BAD_CASE(val) \ -{ \ - as_fatal(_("Case value %ld unexpected at line %d of file \"%s\"\n"), \ - (long) val, __LINE__, __FILE__); \ - } +#define BAD_CASE(val) \ + { \ + as_fatal (_("Case value %ld unexpected at line %d of file \"%s\"\n"), \ + (long) val, __LINE__, __FILE__); \ + } #include "flonum.h" @@ -246,7 +244,7 @@ typedef addressT valueT; #ifndef COMMON #ifdef TEST -#define COMMON /* declare our COMMONs storage here. */ +#define COMMON /* declare our COMMONs storage here. */ #else #define COMMON extern /* our commons live elswhere */ #endif @@ -263,12 +261,9 @@ typedef addressT valueT; /* input_scrub.c */ -/* - * Supplies sanitised buffers to read.c. - * Also understands printing line-number part of error messages. - */ +/* Supplies sanitised buffers to read.c. + Also understands printing line-number part of error messages. */ - /* subsegs.c Sub-segments. Also, segment(=expression type)s.*/ #ifndef BFD_ASSEMBLER @@ -291,20 +286,19 @@ typedef addressT valueT; #define SEG_LIST SEG_TEXT,SEG_DATA,SEG_BSS #endif -typedef enum _segT - { - SEG_ABSOLUTE = 0, - SEG_LIST, - SEG_UNKNOWN, - SEG_GOOF, /* Only happens if AS has a logic error. */ - /* Invented so we don't crash printing */ - /* error message involving weird segment. */ - SEG_EXPR, /* Intermediate expression values. */ - SEG_DEBUG, /* Debug segment */ - SEG_NTV, /* Transfert vector preload segment */ - SEG_PTV, /* Transfert vector postload segment */ - SEG_REGISTER /* Mythical: a register-valued expression */ - } segT; +typedef enum _segT { + SEG_ABSOLUTE = 0, + SEG_LIST, + SEG_UNKNOWN, + SEG_GOOF, /* Only happens if AS has a logic error. */ + /* Invented so we don't crash printing */ + /* error message involving weird segment. */ + SEG_EXPR, /* Intermediate expression values. */ + SEG_DEBUG, /* Debug segment */ + SEG_NTV, /* Transfert vector preload segment */ + SEG_PTV, /* Transfert vector postload segment */ + SEG_REGISTER /* Mythical: a register-valued expression */ +} segT; #define SEG_MAXIMUM_ORDINAL (SEG_REGISTER) #else @@ -319,7 +313,7 @@ typedef int subsegT; /* What subseg we are accreting now? */ COMMON subsegT now_subseg; -/* Segment our instructions emit to. */ +/* Segment our instructions emit to. */ COMMON segT now_seg; #ifdef BFD_ASSEMBLER @@ -351,51 +345,57 @@ extern segT text_section, data_section, bss_section; /* relax() */ -enum _relax_state - { - /* Variable chars to be repeated fr_offset times. - Fr_symbol unused. Used with fr_offset == 0 for a - constant length frag. */ - rs_fill = 1, +enum _relax_state { + /* Variable chars to be repeated fr_offset times. + Fr_symbol unused. Used with fr_offset == 0 for a + constant length frag. */ + rs_fill = 1, - /* Align. The fr_offset field holds the power of 2 to which to - align. The fr_var field holds the number of characters in the - fill pattern. The fr_subtype field holds the maximum number of - bytes to skip when aligning, or 0 if there is no maximum. */ - rs_align, + /* Align. The fr_offset field holds the power of 2 to which to + align. The fr_var field holds the number of characters in the + fill pattern. The fr_subtype field holds the maximum number of + bytes to skip when aligning, or 0 if there is no maximum. */ + rs_align, - /* Align code. The fr_offset field holds the power of 2 to which - to align. This type is only generated by machine specific - code, which is normally responsible for handling the fill - pattern. The fr_subtype field holds the maximum number of - bytes to skip when aligning, or 0 if there is no maximum. */ - rs_align_code, + /* Align code. The fr_offset field holds the power of 2 to which + to align. This type is only generated by machine specific + code, which is normally responsible for handling the fill + pattern. The fr_subtype field holds the maximum number of + bytes to skip when aligning, or 0 if there is no maximum. */ + rs_align_code, - /* Org: Fr_offset, fr_symbol: address. 1 variable char: fill - character. */ - rs_org, + /* Test for alignment. Like rs_align, but used by several targets + to warn if data is not properly aligned. */ + rs_align_test, + + /* Org: Fr_offset, fr_symbol: address. 1 variable char: fill + character. */ + rs_org, #ifndef WORKING_DOT_WORD - /* JF: gunpoint */ - rs_broken_word, + /* JF: gunpoint */ + rs_broken_word, #endif - /* machine-specific relaxable (or similarly alterable) instruction */ - rs_machine_dependent, + /* machine-specific relaxable (or similarly alterable) instruction */ + rs_machine_dependent, - /* .space directive with expression operand that needs to be computed - later. Similar to rs_org, but different. - fr_symbol: operand - 1 variable char: fill character */ - rs_space, + /* .space directive with expression operand that needs to be computed + later. Similar to rs_org, but different. + fr_symbol: operand + 1 variable char: fill character */ + rs_space, - /* A DWARF leb128 value; only ELF uses this. The subtype is 0 for - unsigned, 1 for signed. */ - rs_leb128, + /* A DWARF leb128 value; only ELF uses this. The subtype is 0 for + unsigned, 1 for signed. */ + rs_leb128, - /* Exception frame information which we may be able to optimize. */ - rs_cfa - }; + /* Exception frame information which we may be able to optimize. */ + rs_cfa, + + /* Cross-fragment dwarf2 line number optimization. */ + rs_dwarf2dbg +}; typedef enum _relax_state relax_stateT; @@ -436,7 +436,7 @@ COMMON int flag_fatal_warnings; /* --fatal-warnings */ are detected. */ COMMON unsigned char flag_always_generate_output; /* -Z */ -/* This is true if the assembler should output time and space usage. */ +/* This is true if the assembler should output time and space usage. */ COMMON unsigned char flag_print_statistics; /* True if local absolute symbols are to be stripped. */ @@ -451,7 +451,7 @@ COMMON char *out_file_name; /* name of file defining extensions to the basic instruction set */ COMMON char *insttbl_file_name; -/* TRUE if we need a second pass. */ +/* TRUE if we need a second pass. */ COMMON int need_pass_2; /* TRUE if we should do no relaxing, and @@ -461,18 +461,22 @@ COMMON int linkrelax; /* TRUE if we should produce a listing. */ extern int listing; -/* Type of debugging information we should generate. We currently - support stabs, ECOFF, and DWARF2. */ +/* Type of debugging information we should generate. We currently support + stabs, ECOFF, and DWARF2. -enum debug_info_type - { - DEBUG_UNSPECIFIED, - DEBUG_NONE, - DEBUG_STABS, - DEBUG_ECOFF, - DEBUG_DWARF, - DEBUG_DWARF2 - }; + NOTE! This means debug information about the assembly source code itself + and _not_ about possible debug information from a high-level language. + This is especially relevant to DWARF2, since the compiler may emit line + number directives that the assembler resolves. */ + +enum debug_info_type { + DEBUG_UNSPECIFIED, + DEBUG_NONE, + DEBUG_STABS, + DEBUG_ECOFF, + DEBUG_DWARF, + DEBUG_DWARF2 +}; extern enum debug_info_type debug_type; @@ -483,15 +487,14 @@ extern int max_macro_nest; increase malloc calls for monitoring memory allocation. */ extern int chunksize; -struct _pseudo_type - { - /* assembler mnemonic, lower case, no '.' */ - const char *poc_name; - /* Do the work */ - void (*poc_handler) PARAMS ((int)); - /* Value to pass to handler */ - int poc_val; - }; +struct _pseudo_type { + /* assembler mnemonic, lower case, no '.' */ + const char *poc_name; + /* Do the work */ + void (*poc_handler) PARAMS ((int)); + /* Value to pass to handler */ + int poc_val; +}; typedef struct _pseudo_type pseudo_typeS; @@ -619,6 +622,10 @@ void eh_frame_convert_frag PARAMS ((fragS *)); /* this one starts the chain of target dependant headers */ #include "targ-env.h" +#ifdef TC_ARC +#include "struc-symbol.h" +#endif + #include "write.h" #include "frags.h" #include "hash.h" @@ -640,6 +647,12 @@ COMMON int flag_m68k_mri; #define flag_m68k_mri 0 #endif +#ifdef WARN_COMMENTS +COMMON int warn_comment; +COMMON unsigned int found_comment; +COMMON char *found_comment_file; +#endif + #ifndef NUMBERS_WITH_SUFFIX #define NUMBERS_WITH_SUFFIX 0 #endif @@ -677,5 +690,3 @@ COMMON int flag_m68k_mri; #endif #endif /* GAS */ - -/* end of as.h */ diff --git a/gnu/dist/toolchain/gas/asintl.h b/gnu/dist/toolchain/gas/asintl.h index b733c85f0f39..5b6369fcac61 100644 --- a/gnu/dist/toolchain/gas/asintl.h +++ b/gnu/dist/toolchain/gas/asintl.h @@ -1,5 +1,5 @@ /* asintl.h - gas-specific header for gettext code. - Copyright (C) 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. Written by Tom Tromey @@ -18,7 +18,7 @@ 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. */ + 02111-1307, USA. */ #ifdef HAVE_LOCALE_H # include @@ -33,12 +33,11 @@ # define N_(String) (String) # endif #else -/* Stubs that do something close enough. */ -# define textdomain(String) (String) -# define gettext(String) (String) -# define dgettext(Domain,Message) (Message) -# define dcgettext(Domain,Message,Type) (Message) -# define bindtextdomain(Domain,Directory) (Domain) +# define gettext(Msgid) (Msgid) +# define dgettext(Domainname, Msgid) (Msgid) +# define dcgettext(Domainname, Msgid, Category) (Msgid) +# define textdomain(Domainname) while (0) /* nothing */ +# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ # define _(String) (String) # define N_(String) (String) #endif diff --git a/gnu/dist/toolchain/gas/atof-generic.c b/gnu/dist/toolchain/gas/atof-generic.c index de29f21341f8..93eadc116dff 100644 --- a/gnu/dist/toolchain/gas/atof-generic.c +++ b/gnu/dist/toolchain/gas/atof-generic.c @@ -1,5 +1,5 @@ /* atof_generic.c - turn a string of digits into a Flonum - Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 1998 + Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 98, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -15,8 +15,9 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with GAS; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ #include #include @@ -78,14 +79,14 @@ atof_generic (address_of_string_pointer, string_of_decimal_marks, string_of_decimal_exponent_marks, address_of_generic_floating_point_number) - /* return pointer to just AFTER number we read. */ + /* return pointer to just AFTER number we read. */ char **address_of_string_pointer; - /* At most one per number. */ + /* At most one per number. */ const char *string_of_decimal_marks; const char *string_of_decimal_exponent_marks; FLONUM_TYPE *address_of_generic_floating_point_number; { - int return_value; /* 0 means OK. */ + int return_value; /* 0 means OK. */ char *first_digit; unsigned int number_of_digits_before_decimal; unsigned int number_of_digits_after_decimal; @@ -184,9 +185,9 @@ atof_generic (address_of_string_pointer, } else { - break; /* p -> char after pre-decimal digits. */ + break; /* p -> char after pre-decimal digits. */ } - } /* For each digit before decimal mark. */ + } /* For each digit before decimal mark. */ #ifndef OLD_FLOAT_READS /* Ignore trailing 0's after the decimal point. The original code here @@ -222,7 +223,7 @@ atof_generic (address_of_string_pointer, { if (isdigit ((unsigned char) c)) { - /* This may be retracted below. */ + /* This may be retracted below. */ number_of_digits_after_decimal++; if ( /* seen_significant_digit || */ c > '0') @@ -238,7 +239,7 @@ atof_generic (address_of_string_pointer, } break; } - } /* For each digit after decimal mark. */ + } /* For each digit after decimal mark. */ } while (number_of_digits_after_decimal @@ -295,8 +296,6 @@ atof_generic (address_of_string_pointer, *address_of_string_pointer = p; - - number_of_digits_available = number_of_digits_before_decimal + number_of_digits_after_decimal; return_value = 0; @@ -311,7 +310,7 @@ atof_generic (address_of_string_pointer, } else { - int count; /* Number of useful digits left to scan. */ + int count; /* Number of useful digits left to scan. */ LITTLENUM_TYPE *digits_binary_low; unsigned int precision; @@ -326,7 +325,7 @@ atof_generic (address_of_string_pointer, precision = (address_of_generic_floating_point_number->high - address_of_generic_floating_point_number->low - + 1); /* Number of destination littlenums. */ + + 1); /* Number of destination littlenums. */ /* Includes guard bits (two littlenums worth) */ #if 0 /* The integer version below is very close, and it doesn't @@ -335,12 +334,12 @@ atof_generic (address_of_string_pointer, maximum_useful_digits = (((double) (precision - 2)) * ((double) (LITTLENUM_NUMBER_OF_BITS)) / (LOG_TO_BASE_2_OF_10)) - + 2; /* 2 :: guard digits. */ + + 2; /* 2 :: guard digits. */ #else maximum_useful_digits = (((precision - 2)) * ( (LITTLENUM_NUMBER_OF_BITS)) * 1000000 / 3321928) - + 2; /* 2 :: guard digits. */ + + 2; /* 2 :: guard digits. */ #endif if (number_of_digits_available > maximum_useful_digits) @@ -388,7 +387,7 @@ atof_generic (address_of_string_pointer, memset ((char *) digits_binary_low, '\0', size_of_digits_in_chars); - /* Digits_binary_low[] is allocated and zeroed. */ + /* Digits_binary_low[] is allocated and zeroed. */ /* * Parse the decimal digits as if * digits_low was in the units position. @@ -440,11 +439,10 @@ atof_generic (address_of_string_pointer, } else { - ++count; /* '.' doesn't alter digits used count. */ + ++count; /* '.' doesn't alter digits used count. */ } } - /* * Digits_binary_low[] properly encodes the value of the digits. * Forget about any high-order littlenums that are 0. @@ -480,7 +478,7 @@ atof_generic (address_of_string_pointer, LITTLENUM_TYPE *power_binary_low; int decimal_exponent_is_negative; - /* This refers to the "-56" in "12.34E-56". */ + /* This refers to the "-56" in "12.34E-56". */ /* FALSE: decimal_exponent is positive (or 0) */ /* TRUE: decimal_exponent is negative */ FLONUM_TYPE temporary_flonum; @@ -489,7 +487,7 @@ atof_generic (address_of_string_pointer, unsigned int size_of_power_in_chars; size_of_power_in_littlenums = precision; - /* Precision has a built-in fudge factor so we get a few guard bits. */ + /* Precision has a built-in fudge factor so we get a few guard bits. */ decimal_exponent_is_negative = decimal_exponent < 0; if (decimal_exponent_is_negative) @@ -497,7 +495,7 @@ atof_generic (address_of_string_pointer, decimal_exponent = -decimal_exponent; } - /* From now on: the decimal exponent is > 0. Its sign is separate. */ + /* From now on: the decimal exponent is > 0. Its sign is separate. */ size_of_power_in_chars = size_of_power_in_littlenums * sizeof (LITTLENUM_TYPE) + 2; @@ -530,7 +528,7 @@ atof_generic (address_of_string_pointer, int place_number_limit; /* Any 10^(2^n) whose "n" exceeds this */ /* value will fall off the end of */ - /* flonum_XXXX_powers_of_ten[]. */ + /* flonum_XXXX_powers_of_ten[]. */ int place_number; const FLONUM_TYPE *multiplicand; /* -> 10^(2^n) */ @@ -540,8 +538,8 @@ atof_generic (address_of_string_pointer, ? flonum_negative_powers_of_ten : flonum_positive_powers_of_ten); - for (place_number = 1;/* Place value of this bit of exponent. */ - decimal_exponent;/* Quit when no more 1 bits in exponent. */ + for (place_number = 1;/* Place value of this bit of exponent. */ + decimal_exponent;/* Quit when no more 1 bits in exponent. */ decimal_exponent >>= 1, place_number++) { if (decimal_exponent & 1) @@ -586,7 +584,7 @@ atof_generic (address_of_string_pointer, (void) putchar ('\n'); #endif } /* If this bit of decimal_exponent was computable.*/ - } /* If this bit of decimal_exponent was set. */ + } /* If this bit of decimal_exponent was set. */ } /* For each bit of binary representation of exponent */ #ifdef TRACE printf ("after computing power_of_10_flonum:\n"); @@ -605,7 +603,7 @@ atof_generic (address_of_string_pointer, */ flonum_multip (&power_of_10_flonum, &digits_flonum, address_of_generic_floating_point_number); - /* Assert sign of the number we made is '+'. */ + /* Assert sign of the number we made is '+'. */ address_of_generic_floating_point_number->sign = digits_sign_char; } diff --git a/gnu/dist/toolchain/gas/bignum-copy.c b/gnu/dist/toolchain/gas/bignum-copy.c index 2bffcbfea4c9..8384ff13a335 100644 --- a/gnu/dist/toolchain/gas/bignum-copy.c +++ b/gnu/dist/toolchain/gas/bignum-copy.c @@ -1,5 +1,6 @@ /* bignum_copy.c - copy a bignum - Copyright (C) 1987, 1990, 1991, 1992 Free Software Foundation, Inc. + Copyright (C) 1987, 1990, 1991, 1992, 2000 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -15,7 +16,7 @@ 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 "as.h" @@ -43,7 +44,7 @@ bignum_copy (in, in_length, out, out_length) if (out_length < in_length) { LITTLENUM_TYPE *p; /* -> most significant (non-zero) input - littlenum. */ + littlenum. */ memcpy ((void *) out, (void *) in, (unsigned int) out_length << LITTLENUM_SHIFT); diff --git a/gnu/dist/toolchain/gas/bit_fix.h b/gnu/dist/toolchain/gas/bit_fix.h index 6a729a700c67..b9768fd98d8f 100644 --- a/gnu/dist/toolchain/gas/bit_fix.h +++ b/gnu/dist/toolchain/gas/bit_fix.h @@ -1,6 +1,5 @@ -/* write.h - - Copyright (C) 1987, 1992 Free Software Foundation, Inc. +/* bit_fix.h + Copyright (C) 1987, 1992, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -15,8 +14,9 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with GAS; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ /* The bit_fix was implemented to support machines that need variables to be inserted in bitfields other than 1, 2 and 4 bytes. @@ -33,19 +33,16 @@ #ifndef __bit_fix_h__ #define __bit_fix_h__ -struct bit_fix - { - int fx_bit_size; /* Length of bitfield */ - int fx_bit_offset; /* Bit offset to bitfield */ - long fx_bit_base; /* Where do we apply the bitfix. - If this is zero, default is assumed. */ - long fx_bit_base_adj; /* Adjustment of base */ - long fx_bit_max; /* Signextended max for bitfield */ - long fx_bit_min; /* Signextended min for bitfield */ - long fx_bit_add; /* Or mask, used for huffman prefix */ - }; +struct bit_fix { + int fx_bit_size; /* Length of bitfield */ + int fx_bit_offset; /* Bit offset to bitfield */ + long fx_bit_base; /* Where do we apply the bitfix. + If this is zero, default is assumed. */ + long fx_bit_base_adj; /* Adjustment of base */ + long fx_bit_max; /* Signextended max for bitfield */ + long fx_bit_min; /* Signextended min for bitfield */ + long fx_bit_add; /* Or mask, used for huffman prefix */ +}; typedef struct bit_fix bit_fixS; #endif /* __bit_fix_h__ */ - -/* end of bit_fix.h */ diff --git a/gnu/dist/toolchain/gas/cgen.c b/gnu/dist/toolchain/gas/cgen.c index e15e1b65346b..271d39166342 100644 --- a/gnu/dist/toolchain/gas/cgen.c +++ b/gnu/dist/toolchain/gas/cgen.c @@ -1,5 +1,5 @@ /* GAS interface for targets using CGEN: Cpu tools GENerator. - Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -15,7 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GAS; see the file COPYING. If not, write to the Free Software -Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "ansidecl.h" @@ -26,6 +26,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "as.h" #include "subsegs.h" #include "cgen.h" +#include "dwarf2dbg.h" /* Opcode table descriptor, must be set by md_begin. */ @@ -37,13 +38,13 @@ CGEN_CPU_DESC gas_cgen_cpu_desc; void cgen_asm_record_register (name, number) - char * name; + char *name; int number; { /* Use symbol_create here instead of symbol_new so we don't try to output registers into the object file's symbol table. */ symbol_table_insert (symbol_create (name, reg_section, - number, & zero_address_frag)); + number, &zero_address_frag)); } /* We need to keep a list of fixups. We can't simply generate them as @@ -57,14 +58,13 @@ cgen_asm_record_register (name, number) OPINDEX is the index in the operand table. OPINFO is something the caller chooses to help in reloc determination. */ -struct fixup -{ +struct fixup { int opindex; int opinfo; expressionS exp; }; -static struct fixup fixups [GAS_CGEN_MAX_FIXUPS]; +static struct fixup fixups[GAS_CGEN_MAX_FIXUPS]; static int num_fixups; /* Prepare to parse an instruction. @@ -81,12 +81,13 @@ gas_cgen_init_parse () static void queue_fixup (opindex, opinfo, expP) int opindex; + int opinfo; expressionS * expP; { /* We need to generate a fixup for this expression. */ if (num_fixups >= GAS_CGEN_MAX_FIXUPS) as_fatal (_("too many fixups")); - fixups[num_fixups].exp = * expP; + fixups[num_fixups].exp = *expP; fixups[num_fixups].opindex = opindex; fixups[num_fixups].opinfo = opinfo; ++ num_fixups; @@ -99,14 +100,14 @@ queue_fixup (opindex, opinfo, expP) /* ??? I think with cgen_asm_finish_insn (or something else) there is no more need for this. */ -static struct fixup saved_fixups [GAS_CGEN_MAX_FIXUPS]; +static struct fixup saved_fixups[GAS_CGEN_MAX_FIXUPS]; static int saved_num_fixups; void gas_cgen_save_fixups () { saved_num_fixups = num_fixups; - + memcpy (saved_fixups, fixups, sizeof (fixups[0]) * num_fixups); num_fixups = 0; @@ -116,7 +117,7 @@ void gas_cgen_restore_fixups () { num_fixups = saved_num_fixups; - + memcpy (fixups, saved_fixups, sizeof (fixups[0]) * num_fixups); saved_num_fixups = 0; @@ -141,7 +142,7 @@ gas_cgen_swap_fixups () tmp = saved_num_fixups; saved_num_fixups = num_fixups; num_fixups = tmp; - + for (tmp = GAS_CGEN_MAX_FIXUPS; tmp--;) { tmp_fixup = saved_fixups [tmp]; @@ -175,7 +176,7 @@ gas_cgen_record_fixup (frag, where, insn, length, operand, opinfo, symbol, offse symbolS * symbol; offsetT offset; { - fixS * fixP; + fixS *fixP; /* It may seem strange to use operand->attrs and not insn->attrs here, but it is the operand that has a pc relative relocation. */ @@ -214,7 +215,7 @@ gas_cgen_record_fixup_exp (frag, where, insn, length, operand, opinfo, exp) int opinfo; expressionS * exp; { - fixS * fixP; + fixS *fixP; /* It may seem strange to use operand->attrs and not insn->attrs here, but it is the operand that has a pc relative relocation. */ @@ -232,6 +233,7 @@ gas_cgen_record_fixup_exp (frag, where, insn, length, operand, opinfo, exp) /* Used for communication between the next two procedures. */ static jmp_buf expr_jmp_buf; +static int expr_jmp_buf_p; /* Callback for cgen interface. Parse the expression at *STRP. The result is an error message or NULL for success (in which case @@ -246,23 +248,23 @@ static jmp_buf expr_jmp_buf; const char * gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP) - CGEN_CPU_DESC cd; + CGEN_CPU_DESC cd ATTRIBUTE_UNUSED; enum cgen_parse_operand_type want; - const char ** strP; + const char **strP; int opindex; int opinfo; - enum cgen_parse_operand_result * resultP; - bfd_vma * valueP; + enum cgen_parse_operand_result *resultP; + bfd_vma *valueP; { #ifdef __STDC__ /* These are volatile to survive the setjmp. */ char * volatile hold; enum cgen_parse_operand_result * volatile resultP_1; #else - static char * hold; - static enum cgen_parse_operand_result * resultP_1; + static char *hold; + static enum cgen_parse_operand_result *resultP_1; #endif - const char * errmsg = NULL; + const char *errmsg = NULL; expressionS exp; if (want == CGEN_PARSE_OPERAND_INIT) @@ -273,46 +275,49 @@ gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP) resultP_1 = resultP; hold = input_line_pointer; - input_line_pointer = (char *) * strP; + input_line_pointer = (char *) *strP; /* We rely on md_operand to longjmp back to us. This is done via gas_cgen_md_operand. */ if (setjmp (expr_jmp_buf) != 0) { + expr_jmp_buf_p = 0; input_line_pointer = (char *) hold; - * resultP_1 = CGEN_PARSE_OPERAND_RESULT_ERROR; + *resultP_1 = CGEN_PARSE_OPERAND_RESULT_ERROR; return "illegal operand"; } - expression (& exp); + expr_jmp_buf_p = 1; + expression (&exp); + expr_jmp_buf_p = 0; - * strP = input_line_pointer; + *strP = input_line_pointer; input_line_pointer = hold; /* FIXME: Need to check `want'. */ switch (exp.X_op) { - case O_illegal : + case O_illegal: errmsg = _("illegal operand"); - * resultP = CGEN_PARSE_OPERAND_RESULT_ERROR; + *resultP = CGEN_PARSE_OPERAND_RESULT_ERROR; break; - case O_absent : + case O_absent: errmsg = _("missing operand"); - * resultP = CGEN_PARSE_OPERAND_RESULT_ERROR; + *resultP = CGEN_PARSE_OPERAND_RESULT_ERROR; break; - case O_constant : - * valueP = exp.X_add_number; - * resultP = CGEN_PARSE_OPERAND_RESULT_NUMBER; + case O_constant: + *valueP = exp.X_add_number; + *resultP = CGEN_PARSE_OPERAND_RESULT_NUMBER; break; - case O_register : - * valueP = exp.X_add_number; - * resultP = CGEN_PARSE_OPERAND_RESULT_REGISTER; + case O_register: + *valueP = exp.X_add_number; + *resultP = CGEN_PARSE_OPERAND_RESULT_REGISTER; break; - default : - queue_fixup (opindex, opinfo, & exp); - * valueP = 0; - * resultP = CGEN_PARSE_OPERAND_RESULT_QUEUED; + default: + queue_fixup (opindex, opinfo, &exp); + *valueP = 0; + *resultP = CGEN_PARSE_OPERAND_RESULT_QUEUED; break; } @@ -326,9 +331,11 @@ gas_cgen_parse_operand (cd, want, strP, opindex, opinfo, resultP, valueP) void gas_cgen_md_operand (expressionP) - expressionS * expressionP; + expressionS *expressionP ATTRIBUTE_UNUSED; { - longjmp (expr_jmp_buf, 1); + /* Don't longjmp if we're not called from within cgen_parse_operand(). */ + if (expr_jmp_buf_p) + longjmp (expr_jmp_buf, 1); } /* Finish assembling instruction INSN. @@ -340,15 +347,15 @@ gas_cgen_md_operand (expressionP) void gas_cgen_finish_insn (insn, buf, length, relax_p, result) - const CGEN_INSN * insn; + const CGEN_INSN *insn; CGEN_INSN_BYTES_PTR buf; unsigned int length; int relax_p; - finished_insnS * result; + finished_insnS *result; { int i; int relax_operand; - char * f; + char *f; unsigned int byte_len = length / 8; /* ??? Target foo issues various warnings here, so one might want to provide @@ -364,7 +371,8 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result) space for the largest insn. */ if (CGEN_INSN_ATTR_VALUE (insn, CGEN_INSN_RELAX)) - abort (); /* These currently shouldn't get here. */ + /* These currently shouldn't get here. */ + abort (); /* Is there a relaxable insn with the relaxable operand needing a fixup? */ @@ -374,7 +382,7 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result) /* Scan the fixups for the operand affected by relaxing (i.e. the branch address). */ - for (i = 0; i < num_fixups; ++ i) + for (i = 0; i < num_fixups; ++i) { if (CGEN_OPERAND_ATTR_VALUE (cgen_operand_lookup_by_num (gas_cgen_cpu_desc, fixups[i].opindex), CGEN_OPERAND_RELAX)) @@ -388,7 +396,7 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result) if (relax_operand != -1) { int max_len; - fragS * old_frag; + fragS *old_frag; #ifdef TC_CGEN_MAX_RELAX max_len = TC_CGEN_MAX_RELAX (insn, byte_len); @@ -438,6 +446,9 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result) memcpy (f, buf, byte_len); #endif + /* Emit DWARF2 debugging information. */ + dwarf2_emit_insn (byte_len); + /* Create any fixups. */ for (i = 0; i < num_fixups; ++i) { @@ -457,12 +468,12 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result) #define md_cgen_record_fixup_exp gas_cgen_record_fixup_exp #endif - fixP = md_cgen_record_fixup_exp (frag_now, f - frag_now->fr_literal, - insn, length, operand, - fixups[i].opinfo, - & fixups[i].exp); - if (result) - result->fixups[i] = fixP; + fixP = md_cgen_record_fixup_exp (frag_now, f - frag_now->fr_literal, + insn, length, operand, + fixups[i].opinfo, + &fixups[i].exp); + if (result) + result->fixups[i] = fixP; } if (result) @@ -488,13 +499,13 @@ int gas_cgen_md_apply_fix3 (fixP, valueP, seg) fixS * fixP; valueT * valueP; - segT seg; + segT seg ATTRIBUTE_UNUSED; { - char * where = fixP->fx_frag->fr_literal + fixP->fx_where; + char *where = fixP->fx_frag->fr_literal + fixP->fx_where; valueT value; - /* canonical name, since used a lot */ + /* Canonical name, since used a lot. */ CGEN_CPU_DESC cd = gas_cgen_cpu_desc; - + /* FIXME FIXME FIXME: The value we are passed in *valuep includes the symbol values. Since we are using BFD_ASSEMBLER, if we are doing this relocation the code in write.c is going to call @@ -508,11 +519,11 @@ gas_cgen_md_apply_fix3 (fixP, valueP, seg) if (fixP->fx_addsy == (symbolS *) NULL) { - value = * valueP; + value = *valueP; fixP->fx_done = 1; } else if (fixP->fx_pcrel) - value = * valueP; + value = *valueP; else { value = fixP->fx_offset; @@ -523,7 +534,7 @@ gas_cgen_md_apply_fix3 (fixP, valueP, seg) else { /* We don'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")); } } @@ -553,16 +564,16 @@ gas_cgen_md_apply_fix3 (fixP, valueP, seg) CGEN_INSN_INT insn_value = cgen_get_insn_value (cd, where, CGEN_INSN_BITSIZE (insn)); - /* ??? 0 is passed for `pc' */ + /* ??? 0 is passed for `pc'. */ errmsg = CGEN_CPU_INSERT_OPERAND (cd) (cd, opindex, fields, &insn_value, (bfd_vma) 0); cgen_put_insn_value (cd, where, CGEN_INSN_BITSIZE (insn), insn_value); } #else - /* ??? 0 is passed for `pc' */ - errmsg = CGEN_CPU_INSERT_OPERAND (cd) (cd, opindex, fields, where, - (bfd_vma) 0); + /* ??? 0 is passed for `pc'. */ + errmsg = CGEN_CPU_INSERT_OPERAND (cd) (cd, opindex, fields, where, + (bfd_vma) 0); #endif if (errmsg) as_bad_where (fixP->fx_file, fixP->fx_line, "%s", errmsg); @@ -631,10 +642,10 @@ gas_cgen_md_apply_fix3 (fixP, valueP, seg) arelent * gas_cgen_tc_gen_reloc (section, fixP) - asection * section; + asection * section ATTRIBUTE_UNUSED; fixS * fixP; { - arelent * reloc; + arelent *reloc; reloc = (arelent *) xmalloc (sizeof (arelent)); @@ -652,12 +663,12 @@ gas_cgen_tc_gen_reloc (section, fixP) reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy); - /* Use fx_offset for these cases */ - if ( fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY + /* Use fx_offset for these cases. */ + if (fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY || fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT) - reloc->addend = fixP->fx_offset; + reloc->addend = fixP->fx_offset; else - reloc->addend = fixP->fx_addnumber; + reloc->addend = fixP->fx_addnumber; reloc->address = fixP->fx_frag->fr_address + fixP->fx_where; return reloc; diff --git a/gnu/dist/toolchain/gas/cgen.h b/gnu/dist/toolchain/gas/cgen.h index 2bc1732247f9..edf1637b5439 100644 --- a/gnu/dist/toolchain/gas/cgen.h +++ b/gnu/dist/toolchain/gas/cgen.h @@ -1,5 +1,5 @@ /* GAS cgen support. - Copyright (C) 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -26,7 +26,9 @@ extern CGEN_CPU_DESC gas_cgen_cpu_desc; /* Maximum number of fixups in an insn. If you need to change this, allow target to override and do so there. */ +#ifndef GAS_CGEN_MAX_FIXUPS #define GAS_CGEN_MAX_FIXUPS 3 +#endif /* Struct defining result of gas_cgen_finish_insn. */ typedef struct { @@ -54,7 +56,7 @@ 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)); - + /* Add a register to the assembler's hash table. This makes lets GAS parse registers for us. ??? This isn't currently used, but it could be in the future. */ diff --git a/gnu/dist/toolchain/gas/cond.c b/gnu/dist/toolchain/gas/cond.c index 025ca51b11a3..6c6e8adfa388 100644 --- a/gnu/dist/toolchain/gas/cond.c +++ b/gnu/dist/toolchain/gas/cond.c @@ -1,5 +1,5 @@ /* cond.c - conditional assembly pseudo-ops, and .include - Copyright (C) 1990, 91, 92, 93, 95, 96, 97, 98, 99, 2000 + Copyright 1990, 1991, 1992, 1993, 1995, 1997, 1998, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -24,11 +24,11 @@ #include "obstack.h" -/* This is allocated to grow and shrink as .ifdef/.endif pairs are scanned. */ +/* This is allocated to grow and shrink as .ifdef/.endif pairs are + scanned. */ struct obstack cond_obstack; -struct file_line -{ +struct file_line { char *file; unsigned int line; }; @@ -36,8 +36,7 @@ struct file_line /* We push one of these structures for each .if, and pop it at the .endif. */ -struct conditional_frame -{ +struct conditional_frame { /* The source file & line number of the "if". */ struct file_line if_file_line; /* The source file & line of the "else". */ @@ -48,7 +47,9 @@ struct conditional_frame int else_seen; /* Whether we are currently ignoring input. */ int ignoring; - /* Whether a conditional at a higher level is ignoring input. */ + /* Whether a conditional at a higher level is ignoring input. + Set also when a branch of an "if .. elseif .." tree has matched + to prevent further matches. */ int dead_tree; /* Macro nesting level at which this conditional was created. */ int macro_nest; @@ -59,15 +60,18 @@ static char *get_mri_string PARAMS ((int, int *)); static struct conditional_frame *current_cframe = NULL; -void +void s_ifdef (arg) int arg; { - register char *name; /* points to name of symbol */ - register symbolS *symbolP; /* Points to symbol */ + /* Points to name of symbol. */ + register char *name; + /* Points to symbol. */ + register symbolS *symbolP; struct conditional_frame cframe; - SKIP_WHITESPACE (); /* Leading whitespace is part of operand. */ + /* Leading whitespace is part of operand. */ + SKIP_WHITESPACE (); name = input_line_pointer; if (!is_name_beginner (*name)) @@ -98,9 +102,9 @@ s_ifdef (arg) demand_empty_rest_of_line (); } /* if a valid identifyer name */ -} /* s_ifdef() */ +} -void +void s_if (arg) int arg; { @@ -113,7 +117,8 @@ s_if (arg) if (flag_mri) stop = mri_comment_field (&stopc); - SKIP_WHITESPACE (); /* Leading whitespace is part of operand. */ + /* Leading whitespace is part of operand. */ + SKIP_WHITESPACE (); if (current_cframe != NULL && current_cframe->ignoring) { @@ -158,7 +163,7 @@ s_if (arg) mri_comment_end (stop, stopc); demand_empty_rest_of_line (); -} /* s_if() */ +} /* Get a string for the MRI IFC or IFNC pseudo-ops. */ @@ -246,17 +251,13 @@ s_ifc (arg) demand_empty_rest_of_line (); } -void +void s_elseif (arg) int arg; { - expressionS operand; - int t; - if (current_cframe == NULL) { as_bad (_("\".elseif\" without matching \".if\" - ignored")); - } else if (current_cframe->else_seen) { @@ -273,60 +274,60 @@ s_elseif (arg) as_where (¤t_cframe->else_file_line.file, ¤t_cframe->else_file_line.line); - if (!current_cframe->dead_tree) - { - current_cframe->ignoring = !current_cframe->ignoring; - if (LISTING_SKIP_COND ()) - { - if (! current_cframe->ignoring) - listing_list (1); - else - listing_list (2); - } - } /* if not a dead tree */ - } /* if error else do it */ + current_cframe->dead_tree |= !current_cframe->ignoring; + current_cframe->ignoring = current_cframe->dead_tree; + } - - SKIP_WHITESPACE (); /* Leading whitespace is part of operand. */ - - if (current_cframe != NULL && current_cframe->ignoring) + if (current_cframe == NULL || current_cframe->ignoring) { - operand.X_add_number = 0; while (! is_end_of_line[(unsigned char) *input_line_pointer]) ++input_line_pointer; + + if (current_cframe == NULL) + return; } else { + expressionS operand; + int t; + + /* Leading whitespace is part of operand. */ + SKIP_WHITESPACE (); + expression (&operand); if (operand.X_op != O_constant) as_bad (_("non-constant expression in \".elseif\" statement")); - } - - switch ((operatorT) arg) - { - case O_eq: t = operand.X_add_number == 0; break; - case O_ne: t = operand.X_add_number != 0; break; - case O_lt: t = operand.X_add_number < 0; break; - case O_le: t = operand.X_add_number <= 0; break; - case O_ge: t = operand.X_add_number >= 0; break; - case O_gt: t = operand.X_add_number > 0; break; - default: - abort (); - return; - } - current_cframe->ignoring = current_cframe->dead_tree || ! t; + switch ((operatorT) arg) + { + case O_eq: t = operand.X_add_number == 0; break; + case O_ne: t = operand.X_add_number != 0; break; + case O_lt: t = operand.X_add_number < 0; break; + case O_le: t = operand.X_add_number <= 0; break; + case O_ge: t = operand.X_add_number >= 0; break; + case O_gt: t = operand.X_add_number > 0; break; + default: + abort (); + return; + } + + current_cframe->ignoring = current_cframe->dead_tree || ! t; + } if (LISTING_SKIP_COND () - && current_cframe->ignoring && (current_cframe->previous_cframe == NULL || ! current_cframe->previous_cframe->ignoring)) - listing_list (2); + { + if (! current_cframe->ignoring) + listing_list (1); + else + listing_list (2); + } demand_empty_rest_of_line (); } -void +void s_endif (arg) int arg ATTRIBUTE_UNUSED; { @@ -356,16 +357,15 @@ s_endif (arg) } demand_empty_rest_of_line (); -} /* s_endif() */ +} -void +void s_else (arg) int arg ATTRIBUTE_UNUSED; { if (current_cframe == NULL) { as_bad (_(".else without matching .if - ignored")); - } else if (current_cframe->else_seen) { @@ -382,20 +382,21 @@ s_else (arg) as_where (¤t_cframe->else_file_line.file, ¤t_cframe->else_file_line.line); - if (!current_cframe->dead_tree) + current_cframe->ignoring = + current_cframe->dead_tree | !current_cframe->ignoring; + + if (LISTING_SKIP_COND () + && (current_cframe->previous_cframe == NULL + || ! current_cframe->previous_cframe->ignoring)) { - current_cframe->ignoring = !current_cframe->ignoring; - if (LISTING_SKIP_COND ()) - { - if (! current_cframe->ignoring) - listing_list (1); - else - listing_list (2); - } - } /* if not a dead tree */ + if (! current_cframe->ignoring) + listing_list (1); + else + listing_list (2); + } current_cframe->else_seen = 1; - } /* if error else do it */ + } if (flag_mri) { @@ -404,9 +405,9 @@ s_else (arg) } demand_empty_rest_of_line (); -} /* s_else() */ +} -void +void s_ifeqs (arg) int arg; { @@ -443,9 +444,9 @@ s_ifeqs (arg) listing_list (2); demand_empty_rest_of_line (); -} /* s_ifeqs() */ +} -int +int ignore_input () { char *s; @@ -477,9 +478,9 @@ ignore_input () return 0; return (current_cframe != NULL) && (current_cframe->ignoring); -} /* ignore_input() */ +} -static void +static void initialize_cframe (cframe) struct conditional_frame *cframe; { @@ -533,5 +534,3 @@ cond_exit_macro (nest) obstack_free (&cond_obstack, hold); } } - -/* end of cond.c */ diff --git a/gnu/dist/toolchain/gas/config.in b/gnu/dist/toolchain/gas/config.in index 81f2adac60b9..fc7ef2b5b88b 100644 --- a/gnu/dist/toolchain/gas/config.in +++ b/gnu/dist/toolchain/gas/config.in @@ -25,9 +25,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 @@ -151,6 +148,9 @@ /* Define if defaulting to ELF on SCO 5. */ #undef SCO_ELF +/* Using strict COFF? */ +#undef STRICTCOFF + /* Use ELF stabs for MIPS, not ECOFF stabs */ #undef MIPS_STABS_ELF diff --git a/gnu/dist/toolchain/gas/config/atof-ieee.c b/gnu/dist/toolchain/gas/config/atof-ieee.c index 2e3c0dc6d0f6..2a916cd82323 100644 --- a/gnu/dist/toolchain/gas/config/atof-ieee.c +++ b/gnu/dist/toolchain/gas/config/atof-ieee.c @@ -29,7 +29,7 @@ static void unget_bits PARAMS ((int)); static void make_invalid_floating_point_number PARAMS ((LITTLENUM_TYPE *)); extern const char EXP_CHARS[]; -/* Precision in LittleNums. */ +/* Precision in LittleNums. */ /* Don't count the gap in the m68k extended precision format. */ #define MAX_PRECISION (5) #define F_PRECISION (2) @@ -37,7 +37,7 @@ extern const char EXP_CHARS[]; #define X_PRECISION (5) #define P_PRECISION (5) -/* Length in LittleNums of guard bits. */ +/* Length in LittleNums of guard bits. */ #define GUARD (2) static const unsigned long mask[] = @@ -77,7 +77,6 @@ static const unsigned long mask[] = 0xffffffff, }; - static int bits_left_in_littlenum; static int littlenums_left; static LITTLENUM_TYPE *littlenum_pointer; @@ -100,18 +99,22 @@ next_bits (number_of_bits) { bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS - number_of_bits; --littlenum_pointer; - return_value |= (*littlenum_pointer >> bits_left_in_littlenum) & mask[number_of_bits]; + return_value |= + (*littlenum_pointer >> bits_left_in_littlenum) + & mask[number_of_bits]; } } else { bits_left_in_littlenum -= number_of_bits; - return_value = mask[number_of_bits] & (*littlenum_pointer >> bits_left_in_littlenum); + return_value = + mask[number_of_bits] & (*littlenum_pointer >> bits_left_in_littlenum); } - return (return_value); + return return_value; } -/* Num had better be less than LITTLENUM_NUMBER_OF_BITS */ +/* Num had better be less than LITTLENUM_NUMBER_OF_BITS. */ + static void unget_bits (num) int num; @@ -124,7 +127,8 @@ unget_bits (num) } else if (bits_left_in_littlenum + num > LITTLENUM_NUMBER_OF_BITS) { - bits_left_in_littlenum = num - (LITTLENUM_NUMBER_OF_BITS - bits_left_in_littlenum); + bits_left_in_littlenum = + num - (LITTLENUM_NUMBER_OF_BITS - bits_left_in_littlenum); ++littlenum_pointer; ++littlenums_left; } @@ -137,7 +141,8 @@ make_invalid_floating_point_number (words) LITTLENUM_TYPE *words; { as_bad (_("cannot create floating-point number")); - words[0] = (LITTLENUM_TYPE) ((unsigned) -1) >> 1; /* Zero the leftmost bit */ + /* Zero the leftmost bit. */ + words[0] = (LITTLENUM_TYPE) ((unsigned) -1) >> 1; words[1] = (LITTLENUM_TYPE) -1; words[2] = (LITTLENUM_TYPE) -1; words[3] = (LITTLENUM_TYPE) -1; @@ -145,29 +150,27 @@ make_invalid_floating_point_number (words) words[5] = (LITTLENUM_TYPE) -1; } -/************************************************************************\ - * Warning: this returns 16-bit LITTLENUMs. It is up to the caller * - * to figure out any alignment problems and to conspire for the * - * bytes/word to be emitted in the right order. Bigendians beware! * - * * -\************************************************************************/ +/* Warning: This returns 16-bit LITTLENUMs. It is up to the caller to + figure out any alignment problems and to conspire for the + bytes/word to be emitted in the right order. Bigendians beware! */ /* Note that atof-ieee always has X and P precisions enabled. it is up to md_atof to filter them out if the target machine does not support them. */ -/* Returns pointer past text consumed. */ +/* Returns pointer past text consumed. */ + char * atof_ieee (str, what_kind, words) - char *str; /* Text to convert to binary. */ - int what_kind; /* 'd', 'f', 'g', 'h' */ - LITTLENUM_TYPE *words; /* Build the binary here. */ + char *str; /* Text to convert to binary. */ + int what_kind; /* 'd', 'f', 'g', 'h'. */ + LITTLENUM_TYPE *words; /* Build the binary here. */ { - /* Extra bits for zeroed low-order bits. The 1st MAX_PRECISION are - zeroed, the last contain flonum bits. */ + /* Extra bits for zeroed low-order bits. + The 1st MAX_PRECISION are zeroed, the last contain flonum bits. */ static LITTLENUM_TYPE bits[MAX_PRECISION + MAX_PRECISION + GUARD]; char *return_value; - /* Number of 16-bit words in the format. */ + /* Number of 16-bit words in the format. */ int precision; long exponent_bits; FLONUM_TYPE save_gen_flonum; @@ -186,7 +189,7 @@ atof_ieee (str, what_kind, words) generic_floating_point_number.sign = '\0'; /* Use more LittleNums than seems necessary: the highest flonum may - have 15 leading 0 bits, so could be useless. */ + have 15 leading 0 bits, so could be useless. */ memset (bits, '\0', sizeof (LITTLENUM_TYPE) * MAX_PRECISION); @@ -247,6 +250,7 @@ atof_ieee (str, what_kind, words) } /* Turn generic_floating_point_number into a real float/double/extended. */ + int gen_to_words (words, precision, exponent_bits) LITTLENUM_TYPE *words; @@ -274,17 +278,17 @@ gen_to_words (words, precision, exponent_bits) if (generic_floating_point_number.low > generic_floating_point_number.leader) { - /* 0.0e0 seen. */ + /* 0.0e0 seen. */ if (generic_floating_point_number.sign == '+') words[0] = 0x0000; else words[0] = 0x8000; memset (&words[1], '\0', (words_end - words - 1) * sizeof (LITTLENUM_TYPE)); - return (return_value); + return return_value; } - /* NaN: Do the right thing */ + /* NaN: Do the right thing. */ if (generic_floating_point_number.sign == 0) { if (precision == F_PRECISION) @@ -301,17 +305,17 @@ gen_to_words (words, precision, exponent_bits) words[3] = 0xffff; words[4] = 0xffff; words[5] = 0xffff; -#else /* ! TC_M68K */ +#else /* ! TC_M68K */ #ifdef TC_I386 words[0] = 0xffff; words[1] = 0xc000; words[2] = 0; words[3] = 0; words[4] = 0; -#else /* ! TC_I386 */ +#else /* ! TC_I386 */ abort (); -#endif /* ! TC_I386 */ -#endif /* ! TC_M68K */ +#endif /* ! TC_I386 */ +#endif /* ! TC_M68K */ } else { @@ -324,7 +328,7 @@ gen_to_words (words, precision, exponent_bits) } else if (generic_floating_point_number.sign == 'P') { - /* +INF: Do the right thing */ + /* +INF: Do the right thing. */ if (precision == F_PRECISION) { words[0] = 0x7f80; @@ -339,17 +343,17 @@ gen_to_words (words, precision, exponent_bits) words[3] = 0; words[4] = 0; words[5] = 0; -#else /* ! TC_M68K */ +#else /* ! TC_M68K */ #ifdef TC_I386 words[0] = 0x7fff; words[1] = 0x8000; words[2] = 0; words[3] = 0; words[4] = 0; -#else /* ! TC_I386 */ +#else /* ! TC_I386 */ abort (); -#endif /* ! TC_I386 */ -#endif /* ! TC_M68K */ +#endif /* ! TC_I386 */ +#endif /* ! TC_M68K */ } else { @@ -358,11 +362,11 @@ gen_to_words (words, precision, exponent_bits) words[2] = 0; words[3] = 0; } - return (return_value); + return return_value; } else if (generic_floating_point_number.sign == 'N') { - /* Negative INF */ + /* Negative INF. */ if (precision == F_PRECISION) { words[0] = 0xff80; @@ -377,17 +381,17 @@ gen_to_words (words, precision, exponent_bits) words[3] = 0; words[4] = 0; words[5] = 0; -#else /* ! TC_M68K */ +#else /* ! TC_M68K */ #ifdef TC_I386 words[0] = 0xffff; words[1] = 0x8000; words[2] = 0; words[3] = 0; words[4] = 0; -#else /* ! TC_I386 */ +#else /* ! TC_I386 */ abort (); -#endif /* ! TC_I386 */ -#endif /* ! TC_M68K */ +#endif /* ! TC_I386 */ +#endif /* ! TC_M68K */ } else { @@ -396,46 +400,49 @@ gen_to_words (words, precision, exponent_bits) words[2] = 0x0; words[3] = 0x0; } - return (return_value); + return return_value; } - /* - * The floating point formats we support have: - * Bit 15 is sign bit. - * Bits 14:n are excess-whatever exponent. - * Bits n-1:0 (if any) are most significant bits of fraction. - * Bits 15:0 of the next word(s) are the next most significant bits. - * - * So we need: number of bits of exponent, number of bits of - * mantissa. - */ + + /* The floating point formats we support have: + Bit 15 is sign bit. + Bits 14:n are excess-whatever exponent. + Bits n-1:0 (if any) are most significant bits of fraction. + Bits 15:0 of the next word(s) are the next most significant bits. + + So we need: number of bits of exponent, number of bits of + mantissa. */ bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS; littlenum_pointer = generic_floating_point_number.leader; littlenums_left = (1 + generic_floating_point_number.leader - generic_floating_point_number.low); - /* Seek (and forget) 1st significant bit */ + + /* Seek (and forget) 1st significant bit. */ for (exponent_skippage = 0; !next_bits (1); ++exponent_skippage);; exponent_1 = (generic_floating_point_number.exponent + generic_floating_point_number.leader + 1 - generic_floating_point_number.low); - /* Radix LITTLENUM_RADIX, point just higher than - generic_floating_point_number.leader. */ - exponent_2 = exponent_1 * LITTLENUM_NUMBER_OF_BITS; - /* Radix 2. */ - exponent_3 = exponent_2 - exponent_skippage; - /* Forget leading zeros, forget 1st bit. */ - exponent_4 = exponent_3 + ((1 << (exponent_bits - 1)) - 2); - /* Offset exponent. */ + /* Radix LITTLENUM_RADIX, point just higher than + generic_floating_point_number.leader. */ + exponent_2 = exponent_1 * LITTLENUM_NUMBER_OF_BITS; + + /* Radix 2. */ + exponent_3 = exponent_2 - exponent_skippage; + + /* Forget leading zeros, forget 1st bit. */ + exponent_4 = exponent_3 + ((1 << (exponent_bits - 1)) - 2); + + /* Offset exponent. */ lp = words; - /* Word 1. Sign, exponent and perhaps high bits. */ + /* Word 1. Sign, exponent and perhaps high bits. */ word1 = ((generic_floating_point_number.sign == '+') ? 0 : (1 << (LITTLENUM_NUMBER_OF_BITS - 1))); - /* Assume 2's complement integers. */ + /* Assume 2's complement integers. */ if (exponent_4 <= 0) { int prec_bits; @@ -443,7 +450,8 @@ gen_to_words (words, precision, exponent_bits) unget_bits (1); num_bits = -exponent_4; - prec_bits = LITTLENUM_NUMBER_OF_BITS * precision - (exponent_bits + 1 + num_bits); + prec_bits = + LITTLENUM_NUMBER_OF_BITS * precision - (exponent_bits + 1 + num_bits); #ifdef TC_I386 if (precision == X_PRECISION && exponent_bits == 15) { @@ -457,14 +465,15 @@ gen_to_words (words, precision, exponent_bits) if (num_bits >= LITTLENUM_NUMBER_OF_BITS - exponent_bits) { - /* Bigger than one littlenum */ + /* Bigger than one littlenum. */ num_bits -= (LITTLENUM_NUMBER_OF_BITS - 1) - exponent_bits; *lp++ = word1; - if (num_bits + exponent_bits + 1 > precision * LITTLENUM_NUMBER_OF_BITS) + if (num_bits + exponent_bits + 1 + > precision * LITTLENUM_NUMBER_OF_BITS) { - /* Exponent overflow */ + /* Exponent overflow. */ make_invalid_floating_point_number (words); - return (return_value); + return return_value; } #ifdef TC_M68K if (precision == X_PRECISION && exponent_bits == 15) @@ -490,14 +499,15 @@ gen_to_words (words, precision, exponent_bits) } else { - word1 |= next_bits ((LITTLENUM_NUMBER_OF_BITS - 1) - (exponent_bits + num_bits)); + word1 |= next_bits ((LITTLENUM_NUMBER_OF_BITS - 1) + - (exponent_bits + num_bits)); *lp++ = word1; } } while (lp < words_end) *lp++ = next_bits (LITTLENUM_NUMBER_OF_BITS); - /* Round the mantissa up, but don't change the number */ + /* Round the mantissa up, but don't change the number. */ if (next_bits (1)) { --lp; @@ -570,15 +580,11 @@ gen_to_words (words, precision, exponent_bits) } else if ((unsigned long) exponent_4 >= mask[exponent_bits]) { - /* - * Exponent overflow. Lose immediately. - */ + /* Exponent overflow. Lose immediately. */ - /* - * We leave return_value alone: admit we read the - * number, but return a floating exception - * because we can't encode the number. - */ + /* We leave return_value alone: admit we read the + number, but return a floating exception + because we can't encode the number. */ make_invalid_floating_point_number (words); return return_value; } @@ -591,7 +597,7 @@ gen_to_words (words, precision, exponent_bits) *lp++ = word1; /* X_PRECISION is special: on the 68k, it has 16 bits of zero in the - middle. Either way, it is then followed by a 1 bit. */ + middle. Either way, it is then followed by a 1 bit. */ if (exponent_bits == 15 && precision == X_PRECISION) { #ifdef TC_M68K @@ -601,21 +607,19 @@ gen_to_words (words, precision, exponent_bits) | next_bits (LITTLENUM_NUMBER_OF_BITS - 1)); } - /* The rest of the words are just mantissa bits. */ + /* The rest of the words are just mantissa bits. */ while (lp < words_end) *lp++ = next_bits (LITTLENUM_NUMBER_OF_BITS); if (next_bits (1)) { unsigned long carry; - /* - * Since the NEXT bit is a 1, round UP the mantissa. - * The cunning design of these hidden-1 floats permits - * us to let the mantissa overflow into the exponent, and - * it 'does the right thing'. However, we lose if the - * highest-order bit of the lowest-order word flips. - * Is that clear? - */ + /* Since the NEXT bit is a 1, round UP the mantissa. + The cunning design of these hidden-1 floats permits + us to let the mantissa overflow into the exponent, and + it 'does the right thing'. However, we lose if the + highest-order bit of the lowest-order word flips. + Is that clear? */ /* #if (sizeof(carry)) < ((sizeof(bits[0]) * BITS_PER_CHAR) + 2) Please allow at least 1 more bit in carry than is in a LITTLENUM. @@ -640,33 +644,36 @@ gen_to_words (words, precision, exponent_bits) { #ifdef TC_M68K /* On the m68k there is a gap of 16 bits. We must - explicitly propagate the carry into the exponent. */ + explicitly propagate the carry into the exponent. */ words[0] += words[1]; words[1] = 0; lp++; #endif - /* Put back the integer bit. */ + /* Put back the integer bit. */ lp[1] |= 1 << (LITTLENUM_NUMBER_OF_BITS - 1); } - } + } if ((word1 ^ *words) & (1 << (LITTLENUM_NUMBER_OF_BITS - 1))) { - /* We leave return_value alone: admit we read the - * number, but return a floating exception - * because we can't encode the number. - */ + /* We leave return_value alone: admit we read the number, + but return a floating exception because we can't encode + the number. */ *words &= ~(1 << (LITTLENUM_NUMBER_OF_BITS - 1)); - /* make_invalid_floating_point_number (words); */ - /* return return_value; */ +#if 0 + make_invalid_floating_point_number (words); + return return_value; +#endif } } - return (return_value); + return return_value; } -#if 0 /* unused */ +#if 0 +/* Unused. */ /* This routine is a real kludge. Someone really should do it better, but I'm too lazy, and I don't understand this stuff all too well anyway. (JF) */ + static void int_to_gen (x) long x; @@ -705,13 +712,9 @@ print_gen (gen) sprintf (sbuf + strlen (sbuf), "%x %x %.12g\n", arr[0], arr[1], fv); if (gen) - { - generic_floating_point_number = f; - } + generic_floating_point_number = f; return (sbuf); } #endif - -/* end of atof-ieee.c */ diff --git a/gnu/dist/toolchain/gas/config/atof-tahoe.c b/gnu/dist/toolchain/gas/config/atof-tahoe.c index 760485c5fdee..844fbc16f1a5 100644 --- a/gnu/dist/toolchain/gas/config/atof-tahoe.c +++ b/gnu/dist/toolchain/gas/config/atof-tahoe.c @@ -1,27 +1,25 @@ - /* atof_tahoe.c - turn a string into a Tahoe floating point number - Copyright (C) 1987, 1998 Free Software Foundation, Inc. - */ + Copyright (C) 1987, 1998 Free Software Foundation, Inc. */ /* This is really a simplified version of atof_vax.c. I glommed it wholesale and then shaved it down. I don't even know how it works. (Don't you find - my honesty refreshing? bowen@cs.Buffalo.EDU (Devon E Bowen) + my honesty refreshing? Devon E Bowen - I don't allow uppercase letters in the precision descrpitors. Ie 'f' and - 'd' are allowed but 'F' and 'D' aren't */ + I don't allow uppercase letters in the precision descrpitors. + i.e. 'f' and 'd' are allowed but 'F' and 'D' aren't. */ #include "as.h" -/* Precision in LittleNums. */ +/* Precision in LittleNums. */ #define MAX_PRECISION (4) #define D_PRECISION (4) #define F_PRECISION (2) -/* Precision in chars. */ +/* Precision in chars. */ #define D_PRECISION_CHARS (8) #define F_PRECISION_CHARS (4) -/* Length in LittleNums of guard bits. */ +/* Length in LittleNums of guard bits. */ #define GUARD (2) static const long int mask[] = @@ -61,22 +59,21 @@ static const long int mask[] = 0xffffffff }; - -/* Shared between flonum_gen2tahoe and next_bits */ +/* Shared between flonum_gen2tahoe and next_bits. */ static int bits_left_in_littlenum; static LITTLENUM_TYPE *littlenum_pointer; static LITTLENUM_TYPE *littlenum_end; #if __STDC__ == 1 -int flonum_gen2tahoe (int format_letter, FLONUM_TYPE * f, LITTLENUM_TYPE * words); +int flonum_gen2tahoe (int format_letter, FLONUM_TYPE * f, + LITTLENUM_TYPE * words); -#else /* not __STDC__ */ +#else /* not __STDC__ */ int flonum_gen2tahoe (); -#endif /* not __STDC__ */ - +#endif /* not __STDC__ */ static int next_bits (number_of_bits) @@ -103,23 +100,29 @@ next_bits (number_of_bits) return_value = mask[number_of_bits] & ((*littlenum_pointer) >> bits_left_in_littlenum); } - return (return_value); + return return_value; } static void make_invalid_floating_point_number (words) LITTLENUM_TYPE *words; { - *words = 0x8000; /* Floating Reserved Operand Code */ + /* Floating Reserved Operand Code. */ + *words = 0x8000; } -static int /* 0 means letter is OK. */ +static int /* 0 means letter is OK. */ what_kind_of_float (letter, precisionP, exponent_bitsP) - char letter; /* In: lowercase please. What kind of float? */ - int *precisionP; /* Number of 16-bit words in the float. */ - long int *exponent_bitsP; /* Number of exponent bits. */ + /* In: lowercase please. What kind of float? */ + char letter; + + /* Number of 16-bit words in the float. */ + int *precisionP; + + /* Number of exponent bits. */ + long int *exponent_bitsP; { - int retval; /* 0: OK. */ + int retval; /* 0: OK. */ retval = 0; switch (letter) @@ -141,28 +144,23 @@ what_kind_of_float (letter, precisionP, exponent_bitsP) return (retval); } -/***********************************************************************\ -* * -* Warning: this returns 16-bit LITTLENUMs, because that is * -* what the VAX thinks in. It is up to the caller to figure * -* out any alignment problems and to conspire for the bytes/word * -* to be emitted in the right order. Bigendians beware! * -* * -\***********************************************************************/ +/* Warning: This returns 16-bit LITTLENUMs, because that is what the + VAX thinks in. It is up to the caller to figure out any alignment + problems and to conspire for the bytes/word to be emitted in the + right order. Bigendians beware! */ -char * /* Return pointer past text consumed. */ +char * /* Return pointer past text consumed. */ atof_tahoe (str, what_kind, words) - char *str; /* Text to convert to binary. */ + char *str; /* Text to convert to binary. */ char what_kind; /* 'd', 'f', 'g', 'h' */ - LITTLENUM_TYPE *words; /* Build the binary here. */ + LITTLENUM_TYPE *words; /* Build the binary here. */ { FLONUM_TYPE f; LITTLENUM_TYPE bits[MAX_PRECISION + MAX_PRECISION + GUARD]; - /* Extra bits for zeroed low-order bits. */ - /* The 1st MAX_PRECISION are zeroed, */ - /* the last contain flonum bits. */ + /* Extra bits for zeroed low-order bits. */ + /* The 1st MAX_PRECISION are zeroed, the last contain flonum bits. */ char *return_value; - int precision; /* Number of 16-bit words in the format. */ + int precision; /* Number of 16-bit words in the format. */ long int exponent_bits; return_value = str; @@ -174,51 +172,50 @@ atof_tahoe (str, what_kind, words) if (what_kind_of_float (what_kind, &precision, &exponent_bits)) { - return_value = NULL; /* We lost. */ + /* We lost. */ + return_value = NULL; make_invalid_floating_point_number (words); } if (return_value) { memset (bits, '\0', sizeof (LITTLENUM_TYPE) * MAX_PRECISION); - /* Use more LittleNums than seems */ - /* necessary: the highest flonum may have */ - /* 15 leading 0 bits, so could be useless. */ + /* Use more LittleNums than seems necessary: + the highest flonum may have 15 leading 0 bits, so could be + useless. */ f.high = f.low + precision - 1 + GUARD; if (atof_generic (&return_value, ".", "eE", &f)) { make_invalid_floating_point_number (words); - return_value = NULL; /* we lost */ + /* We lost. */ + return_value = NULL; } else { if (flonum_gen2tahoe (what_kind, &f, words)) - { - return_value = NULL; - } + return_value = NULL; } } - return (return_value); + return return_value; } -/* - * In: a flonum, a Tahoe floating point format. - * Out: a Tahoe floating-point bit pattern. - */ +/* In: a flonum, a Tahoe floating point format. + Out: a Tahoe floating-point bit pattern. */ -int /* 0: OK. */ +int /* 0: OK. */ flonum_gen2tahoe (format_letter, f, words) - char format_letter; /* One of 'd' 'f'. */ + char format_letter; /* One of 'd' 'f'. */ FLONUM_TYPE *f; - LITTLENUM_TYPE *words; /* Deliver answer here. */ + LITTLENUM_TYPE *words; /* Deliver answer here. */ { LITTLENUM_TYPE *lp; int precision; long int exponent_bits; - int return_value; /* 0 == OK. */ + int return_value; /* 0 == OK. */ - return_value = what_kind_of_float (format_letter, &precision, &exponent_bits); + return_value = + what_kind_of_float (format_letter, &precision, &exponent_bits); if (return_value != 0) { make_invalid_floating_point_number (words); @@ -227,7 +224,7 @@ flonum_gen2tahoe (format_letter, f, words) { if (f->low > f->leader) { - /* 0.0e0 seen. */ + /* 0.0e0 seen. */ memset (words, '\0', sizeof (LITTLENUM_TYPE) * precision); } else @@ -239,95 +236,91 @@ flonum_gen2tahoe (format_letter, f, words) int exponent_skippage; LITTLENUM_TYPE word1; - /* JF: Deal with new Nan, +Inf and -Inf codes */ + /* JF: Deal with new Nan, +Inf and -Inf codes. */ if (f->sign != '-' && f->sign != '+') { make_invalid_floating_point_number (words); return return_value; } - /* - * All tahoe floating_point formats have: - * Bit 15 is sign bit. - * Bits 14:n are excess-whatever exponent. - * Bits n-1:0 (if any) are most significant bits of fraction. - * Bits 15:0 of the next word are the next most significant bits. - * And so on for each other word. - * - * So we need: number of bits of exponent, number of bits of - * mantissa. - */ + /* All tahoe floating_point formats have: + Bit 15 is sign bit. + Bits 14:n are excess-whatever exponent. + Bits n-1:0 (if any) are most significant bits of fraction. + Bits 15:0 of the next word are the next most significant bits. + And so on for each other word. + + So we need: number of bits of exponent, number of bits of + mantissa. */ bits_left_in_littlenum = LITTLENUM_NUMBER_OF_BITS; littlenum_pointer = f->leader; littlenum_end = f->low; - /* Seek (and forget) 1st significant bit */ + + /* Seek (and forget) 1st significant bit. */ for (exponent_skippage = 0; !next_bits (1); exponent_skippage++) - { - } + ; + exponent_1 = f->exponent + f->leader + 1 - f->low; - /* Radix LITTLENUM_RADIX, point just higher than f -> leader. */ + + /* Radix LITTLENUM_RADIX, point just higher than f -> leader. */ exponent_2 = exponent_1 * LITTLENUM_NUMBER_OF_BITS; - /* Radix 2. */ + + /* Radix 2. */ exponent_3 = exponent_2 - exponent_skippage; - /* Forget leading zeros, forget 1st bit. */ + + /* Forget leading zeros, forget 1st bit. */ exponent_4 = exponent_3 + (1 << (exponent_bits - 1)); - /* Offset exponent. */ + + /* Offset exponent. */ if (exponent_4 & ~mask[exponent_bits]) { - /* - * Exponent overflow. Lose immediately. - */ + /* Exponent overflow. Lose immediately. */ make_invalid_floating_point_number (words); - /* - * We leave return_value alone: admit we read the - * number, but return a floating exception - * because we can't encode the number. - */ + /* We leave return_value alone: admit we read the + number, but return a floating exception because we + can't encode the number. */ } else { lp = words; - /* Word 1. Sign, exponent and perhaps high bits. */ - /* Assume 2's complement integers. */ - word1 = ((exponent_4 & mask[exponent_bits]) << (15 - exponent_bits)) + /* Word 1. Sign, exponent and perhaps high bits. */ + /* Assume 2's complement integers. */ + word1 = ((exponent_4 & mask[exponent_bits]) + << (15 - exponent_bits)) | ((f->sign == '+') ? 0 : 0x8000) | next_bits (15 - exponent_bits); *lp++ = word1; - /* The rest of the words are just mantissa bits. */ + /* The rest of the words are just mantissa bits. */ for (; lp < words + precision; lp++) - { - *lp = next_bits (LITTLENUM_NUMBER_OF_BITS); - } + *lp = next_bits (LITTLENUM_NUMBER_OF_BITS); if (next_bits (1)) { - /* - * Since the NEXT bit is a 1, round UP the mantissa. - * The cunning design of these hidden-1 floats permits - * us to let the mantissa overflow into the exponent, and - * it 'does the right thing'. However, we lose if the - * highest-order bit of the lowest-order word flips. - * Is that clear? - */ + /* Since the NEXT bit is a 1, round UP the mantissa. + The cunning design of these hidden-1 floats permits + us to let the mantissa overflow into the exponent, and + it 'does the right thing'. However, we lose if the + highest-order bit of the lowest-order word flips. + Is that clear? */ unsigned long int carry; - /* - #if (sizeof(carry)) < ((sizeof(bits[0]) * BITS_PER_CHAR) + 2) - Please allow at least 1 more bit in carry than is in a LITTLENUM. - We need that extra bit to hold a carry during a LITTLENUM carry - propagation. Another extra bit (kept 0) will assure us that we - don't get a sticky sign bit after shifting right, and that - permits us to propagate the carry without any masking of bits. - #endif - */ + /* #if (sizeof(carry)) < ((sizeof(bits[0]) * + BITS_PER_CHAR) + 2) Please allow at least 1 more + bit in carry than is in a LITTLENUM. We need + that extra bit to hold a carry during a LITTLENUM + carry propagation. Another extra bit (kept 0) + will assure us that we don't get a sticky sign + bit after shifting right, and that permits us to + propagate the carry without any masking of bits. + #endif */ for (carry = 1, lp--; carry && (lp >= words); lp--) @@ -337,26 +330,22 @@ flonum_gen2tahoe (format_letter, f, words) carry >>= LITTLENUM_NUMBER_OF_BITS; } - if ((word1 ^ *words) & (1 << (LITTLENUM_NUMBER_OF_BITS - 1))) + if ((word1 ^ *words) + & (1 << (LITTLENUM_NUMBER_OF_BITS - 1))) { make_invalid_floating_point_number (words); - /* - * We leave return_value alone: admit we read the - * number, but return a floating exception - * because we can't encode the number. - */ + /* We leave return_value alone: admit we read + the number, but return a floating exception + because we can't encode the number. */ } - } /* if (we needed to round up) */ - } /* if (exponent overflow) */ - } /* if (0.0e0) */ - } /* if (float_type was OK) */ - return (return_value); + } /* if (we needed to round up) */ + } /* if (exponent overflow) */ + } /* if (0.0e0) */ + } /* if (float_type was OK) */ + return return_value; } -/* - * md_atof() - * - * In: input_line_pointer -> the 1st character of a floating-point +/* In: input_line_pointer -> the 1st character of a floating-point * number. * 1 letter denoting the type of statement that wants a * binary floating point number returned. @@ -367,8 +356,7 @@ flonum_gen2tahoe (format_letter, f, words) * Out: Input_line_pointer -> of next char after floating number. * Error message, or 0. * Floating point literal. - * Number of chars we used for the literal. - */ + * Number of chars we used for the literal. */ char * md_atof (what_statement_type, literalP, sizeP) @@ -383,15 +371,15 @@ md_atof (what_statement_type, literalP, sizeP) switch (what_statement_type) { - case 'f': /* .ffloat */ - case 'd': /* .dfloat */ + case 'f': /* .ffloat */ + case 'd': /* .dfloat */ kind_of_float = what_statement_type; break; default: kind_of_float = 0; break; - }; + } if (kind_of_float) { @@ -400,12 +388,10 @@ md_atof (what_statement_type, literalP, sizeP) input_line_pointer = atof_tahoe (input_line_pointer, kind_of_float, words); - /* - * The atof_tahoe() builds up 16-bit numbers. - * Since the assembler may not be running on - * a different-endian machine, be very careful about - * converting words to chars. - */ + /* The atof_tahoe() builds up 16-bit numbers. + Since the assembler may not be running on + a different-endian machine, be very careful about + converting words to chars. */ number_of_chars = (kind_of_float == 'f' ? F_PRECISION_CHARS : (kind_of_float == 'd' ? D_PRECISION_CHARS : 0)); know (number_of_chars <= MAX_PRECISION * sizeof (LITTLENUM_TYPE)); @@ -417,15 +403,13 @@ md_atof (what_statement_type, literalP, sizeP) md_number_to_chars (literalP, *littlenum_pointer, sizeof (LITTLENUM_TYPE)); literalP += sizeof (LITTLENUM_TYPE); - }; + } } else { number_of_chars = 0; - }; + } *sizeP = number_of_chars; return kind_of_float ? 0 : _("Bad call to md_atof()"); } - -/* atof_tahoe.c */ diff --git a/gnu/dist/toolchain/gas/config/atof-vax.c b/gnu/dist/toolchain/gas/config/atof-vax.c index 76ff0782868a..c7b3425c88fc 100644 --- a/gnu/dist/toolchain/gas/config/atof-vax.c +++ b/gnu/dist/toolchain/gas/config/atof-vax.c @@ -27,20 +27,20 @@ static void make_invalid_floating_point_number PARAMS ((LITTLENUM_TYPE *)); static int what_kind_of_float PARAMS ((int, int *, long *)); static char *atof_vax PARAMS ((char *, int, LITTLENUM_TYPE *)); -/* Precision in LittleNums. */ +/* Precision in LittleNums. */ #define MAX_PRECISION (8) #define H_PRECISION (8) #define G_PRECISION (4) #define D_PRECISION (4) #define F_PRECISION (2) -/* Length in LittleNums of guard bits. */ +/* Length in LittleNums of guard bits. */ #define GUARD (2) int flonum_gen2vax PARAMS ((int format_letter, FLONUM_TYPE * f, LITTLENUM_TYPE * words)); -/* Number of chars in flonum type 'letter'. */ +/* Number of chars in flonum type 'letter'. */ static int atof_vax_sizeof (letter) int letter; @@ -154,13 +154,13 @@ make_invalid_floating_point_number (words) *words = 0x8000; /* Floating Reserved Operand Code */ } -static int /* 0 means letter is OK. */ +static int /* 0 means letter is OK. */ what_kind_of_float (letter, precisionP, exponent_bitsP) int letter; /* In: lowercase please. What kind of float? */ - int *precisionP; /* Number of 16-bit words in the float. */ - long *exponent_bitsP; /* Number of exponent bits. */ + int *precisionP; /* Number of 16-bit words in the float. */ + long *exponent_bitsP; /* Number of exponent bits. */ { - int retval; /* 0: OK. */ + int retval; /* 0: OK. */ retval = 0; switch (letter) @@ -201,19 +201,19 @@ what_kind_of_float (letter, precisionP, exponent_bitsP) * * \***********************************************************************/ -static char * /* Return pointer past text consumed. */ +static char * /* Return pointer past text consumed. */ atof_vax (str, what_kind, words) - char *str; /* Text to convert to binary. */ + char *str; /* Text to convert to binary. */ int what_kind; /* 'd', 'f', 'g', 'h' */ - LITTLENUM_TYPE *words; /* Build the binary here. */ + LITTLENUM_TYPE *words; /* Build the binary here. */ { FLONUM_TYPE f; LITTLENUM_TYPE bits[MAX_PRECISION + MAX_PRECISION + GUARD]; - /* Extra bits for zeroed low-order bits. */ + /* Extra bits for zeroed low-order bits. */ /* The 1st MAX_PRECISION are zeroed, */ - /* the last contain flonum bits. */ + /* the last contain flonum bits. */ char *return_value; - int precision; /* Number of 16-bit words in the format. */ + int precision; /* Number of 16-bit words in the format. */ long exponent_bits; return_value = str; @@ -225,7 +225,7 @@ atof_vax (str, what_kind, words) if (what_kind_of_float (what_kind, &precision, &exponent_bits)) { - return_value = NULL; /* We lost. */ + return_value = NULL; /* We lost. */ make_invalid_floating_point_number (words); } @@ -235,7 +235,7 @@ atof_vax (str, what_kind, words) /* Use more LittleNums than seems */ /* necessary: the highest flonum may have */ - /* 15 leading 0 bits, so could be useless. */ + /* 15 leading 0 bits, so could be useless. */ f.high = f.low + precision - 1 + GUARD; if (atof_generic (&return_value, ".", "eE", &f)) @@ -259,16 +259,16 @@ atof_vax (str, what_kind, words) * Out: a vax floating-point bit pattern. */ -int /* 0: OK. */ +int /* 0: OK. */ flonum_gen2vax (format_letter, f, words) - int format_letter; /* One of 'd' 'f' 'g' 'h'. */ + int format_letter; /* One of 'd' 'f' 'g' 'h'. */ FLONUM_TYPE *f; - LITTLENUM_TYPE *words; /* Deliver answer here. */ + LITTLENUM_TYPE *words; /* Deliver answer here. */ { LITTLENUM_TYPE *lp; int precision; long exponent_bits; - int return_value; /* 0 == OK. */ + int return_value; /* 0 == OK. */ return_value = what_kind_of_float (format_letter, &precision, &exponent_bits); @@ -280,7 +280,7 @@ flonum_gen2vax (format_letter, f, words) { if (f->low > f->leader) { - /* 0.0e0 seen. */ + /* 0.0e0 seen. */ memset (words, '\0', sizeof (LITTLENUM_TYPE) * precision); } else @@ -340,13 +340,13 @@ flonum_gen2vax (format_letter, f, words) exponent_skippage++);; exponent_1 = f->exponent + f->leader + 1 - f->low; - /* Radix LITTLENUM_RADIX, point just higher than f->leader. */ + /* Radix LITTLENUM_RADIX, point just higher than f->leader. */ exponent_2 = exponent_1 * LITTLENUM_NUMBER_OF_BITS; - /* Radix 2. */ + /* Radix 2. */ exponent_3 = exponent_2 - exponent_skippage; - /* Forget leading zeros, forget 1st bit. */ + /* Forget leading zeros, forget 1st bit. */ exponent_4 = exponent_3 + (1 << (exponent_bits - 1)); - /* Offset exponent. */ + /* Offset exponent. */ if (exponent_4 & ~mask[exponent_bits]) { @@ -366,14 +366,14 @@ flonum_gen2vax (format_letter, f, words) { lp = words; - /* Word 1. Sign, exponent and perhaps high bits. */ - /* Assume 2's complement integers. */ + /* Word 1. Sign, exponent and perhaps high bits. */ + /* Assume 2's complement integers. */ word1 = (((exponent_4 & mask[exponent_bits]) << (15 - exponent_bits)) | ((f->sign == '+') ? 0 : 0x8000) | next_bits (15 - exponent_bits)); *lp++ = word1; - /* The rest of the words are just mantissa bits. */ + /* The rest of the words are just mantissa bits. */ for (; lp < words + precision; lp++) { *lp = next_bits (LITTLENUM_NUMBER_OF_BITS); @@ -426,7 +426,6 @@ flonum_gen2vax (format_letter, f, words) return (return_value); } /* flonum_gen2vax() */ - /* JF this used to be in vax.c but this looks like a better place for it */ /* @@ -446,7 +445,7 @@ flonum_gen2vax (format_letter, f, words) * Number of chars we used for the literal. */ -#define MAXIMUM_NUMBER_OF_LITTLENUMS (8) /* For .hfloats. */ +#define MAXIMUM_NUMBER_OF_LITTLENUMS (8) /* For .hfloats. */ char * md_atof (what_statement_type, literalP, sizeP) diff --git a/gnu/dist/toolchain/gas/config/e-crisaout.c b/gnu/dist/toolchain/gas/config/e-crisaout.c new file mode 100644 index 000000000000..b10bb2c22779 --- /dev/null +++ b/gnu/dist/toolchain/gas/config/e-crisaout.c @@ -0,0 +1,17 @@ +#include "as.h" +#include "emul.h" + +static const char * +crisaout_bfd_name () +{ + abort (); + return NULL; +} + +#define emul_bfd_name crisaout_bfd_name +#define emul_format &aout_format_ops + +#define emul_name "crisaout" +#define emul_struct_name crisaout +#define emul_default_endian 0 +#include "emul-target.h" diff --git a/gnu/dist/toolchain/gas/config/e-criself.c b/gnu/dist/toolchain/gas/config/e-criself.c new file mode 100644 index 000000000000..e1826a14882d --- /dev/null +++ b/gnu/dist/toolchain/gas/config/e-criself.c @@ -0,0 +1,17 @@ +#include "as.h" +#include "emul.h" + +static const char * +criself_bfd_name () +{ + abort (); + return NULL; +} + +#define emul_bfd_name criself_bfd_name +#define emul_format &elf_format_ops + +#define emul_name "criself" +#define emul_struct_name criself +#define emul_default_endian 0 +#include "emul-target.h" diff --git a/gnu/dist/toolchain/gas/config/m68k-parse.h b/gnu/dist/toolchain/gas/config/m68k-parse.h index cdb5f60eb53d..d864686c0d6c 100644 --- a/gnu/dist/toolchain/gas/config/m68k-parse.h +++ b/gnu/dist/toolchain/gas/config/m68k-parse.h @@ -88,7 +88,7 @@ enum m68k_register MACSR, /* MAC Status Reg */ MASK, /* Modulus Reg */ - /* These have to be grouped together for the movec instruction to work. */ + /* These have to be grouped together for the movec instruction to work. */ USP, /* User Stack Pointer */ ISP, /* Interrupt stack pointer */ SFC, @@ -171,7 +171,7 @@ enum m68k_register ZADDR7, /* Upper and lower half of data and address registers. Order *must* - be DATAxL, ADDRxL, DATAxU, ADDRxU. */ + be DATAxL, ADDRxL, DATAxU, ADDRxU. */ DATA0L, /* lower half of data registers */ DATA1L, DATA2L, diff --git a/gnu/dist/toolchain/gas/config/m88k-opcode.h b/gnu/dist/toolchain/gas/config/m88k-opcode.h index 27464bc0fc93..6d755c457c83 100644 --- a/gnu/dist/toolchain/gas/config/m88k-opcode.h +++ b/gnu/dist/toolchain/gas/config/m88k-opcode.h @@ -54,7 +54,7 @@ struct m88k_opcode char *op_spec; }; -/* and introducing... the Motorola 88100 and 88110 instruction sets... */ +/* and introducing... the Motorola 88100 and 88110 instruction sets... */ /* By default, include the 88110 instructions. */ #define MC88110 diff --git a/gnu/dist/toolchain/gas/config/obj-bout.c b/gnu/dist/toolchain/gas/config/obj-bout.c index dc79718620a4..736afb4ef777 100644 --- a/gnu/dist/toolchain/gas/config/obj-bout.c +++ b/gnu/dist/toolchain/gas/config/obj-bout.c @@ -1,5 +1,5 @@ /* b.out object file format - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996 + Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -17,42 +17,43 @@ 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. */ + 02111-1307, USA. */ #include "as.h" #include "obstack.h" -const short /* in: segT out: N_TYPE bits */ - seg_N_TYPE[] = + +/* In: segT Out: N_TYPE bits */ +const short seg_N_TYPE[] = { N_ABS, N_TEXT, N_DATA, N_BSS, - N_UNDF, /* unknown */ - N_UNDF, /* error */ - N_UNDF, /* expression */ - N_UNDF, /* debug */ - N_UNDF, /* ntv */ - N_UNDF, /* ptv */ - N_REGISTER, /* register */ + N_UNDF, /* unknown */ + N_UNDF, /* error */ + N_UNDF, /* expression */ + N_UNDF, /* debug */ + N_UNDF, /* ntv */ + N_UNDF, /* ptv */ + N_REGISTER, /* register */ }; const segT N_TYPE_seg[N_TYPE + 2] = -{ /* N_TYPE == 0x1E = 32-2 */ - SEG_UNKNOWN, /* N_UNDF == 0 */ +{ /* N_TYPE == 0x1E = 32-2 */ + SEG_UNKNOWN, /* N_UNDF == 0 */ SEG_GOOF, - SEG_ABSOLUTE, /* N_ABS == 2 */ + SEG_ABSOLUTE, /* N_ABS == 2 */ SEG_GOOF, - SEG_TEXT, /* N_TEXT == 4 */ + SEG_TEXT, /* N_TEXT == 4 */ SEG_GOOF, - SEG_DATA, /* N_DATA == 6 */ + SEG_DATA, /* N_DATA == 6 */ SEG_GOOF, - SEG_BSS, /* N_BSS == 8 */ + SEG_BSS, /* N_BSS == 8 */ SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, SEG_GOOF, - SEG_REGISTER, /* dummy N_REGISTER for regs = 30 */ + SEG_REGISTER, /* dummy N_REGISTER for regs = 30 */ SEG_GOOF, }; @@ -60,9 +61,9 @@ static void obj_bout_line PARAMS ((int)); const pseudo_typeS obj_pseudo_table[] = { - {"line", obj_bout_line, 0}, /* source code line number */ + {"line", obj_bout_line, 0}, /* Source code line number. */ -/* coff debugging directives. Currently ignored silently */ +/* coff debugging directives. Currently ignored silently. */ {"def", s_ignore, 0}, {"dim", s_ignore, 0}, {"endef", s_ignore, 0}, @@ -77,20 +78,17 @@ const pseudo_typeS obj_pseudo_table[] = {"ABORT", s_ignore, 0}, {"ident", s_ignore, 0}, - {NULL} /* end sentinel */ -}; /* obj_pseudo_table */ + {NULL} /* End sentinel. */ +}; -/* Relocation. */ +/* Relocation. */ + +/* Crawl along a fixS chain. Emit the segment's relocations. */ -/* - * emit_relocations() - * - * Crawl along a fixS chain. Emit the segment's relocations. - */ void obj_emit_relocations (where, fixP, segment_address_in_file) char **where; - fixS *fixP; /* Fixup chain for this segment. */ + fixS *fixP; /* Fixup chain for this segment. */ relax_addressT segment_address_in_file; { for (; fixP; fixP = fixP->fx_next) @@ -108,33 +106,35 @@ obj_emit_relocations (where, fixP, segment_address_in_file) tc_bout_fix_to_chars (*where, fixP, segment_address_in_file); *where += sizeof (struct relocation_info); - } /* if there's a symbol */ - } /* for each fixup */ + } /* if there's a symbol */ + } /* for each fixup */ +} -} /* emit_relocations() */ +/* Aout file generation & utilities . */ -/* Aout file generation & utilities */ +/* Convert a lvalue to machine dependent data. */ -/* Convert a lvalue to machine dependent data */ void obj_header_append (where, headers) char **where; object_headers *headers; { - /* Always leave in host byte order */ + /* Always leave in host byte order. */ headers->header.a_talign = section_alignment[SEG_TEXT]; + /* Force to at least 2. */ if (headers->header.a_talign < 2) { headers->header.a_talign = 2; - } /* force to at least 2 */ + } headers->header.a_dalign = section_alignment[SEG_DATA]; headers->header.a_balign = section_alignment[SEG_BSS]; headers->header.a_tload = 0; - headers->header.a_dload = md_section_align (SEG_DATA, H_GET_TEXT_SIZE (headers)); + headers->header.a_dload = + md_section_align (SEG_DATA, H_GET_TEXT_SIZE (headers)); headers->header.a_relaxable = linkrelax; @@ -170,19 +170,27 @@ obj_header_append (where, headers) #else /* ! CROSS_COMPILE */ append (where, (char *) &headers->header, sizeof (headers->header)); #endif /* ! CROSS_COMPILE */ -} /* a_header_append() */ +} void obj_symbol_to_chars (where, symbolP) char **where; symbolS *symbolP; { - md_number_to_chars ((char *) &(S_GET_OFFSET (symbolP)), S_GET_OFFSET (symbolP), sizeof (S_GET_OFFSET (symbolP))); - md_number_to_chars ((char *) &(S_GET_DESC (symbolP)), S_GET_DESC (symbolP), sizeof (S_GET_DESC (symbolP))); - md_number_to_chars ((char *) &symbolP->sy_symbol.n_value, S_GET_VALUE (symbolP), sizeof (symbolP->sy_symbol.n_value)); + md_number_to_chars ((char *) &(S_GET_OFFSET (symbolP)), + S_GET_OFFSET (symbolP), + sizeof (S_GET_OFFSET (symbolP))); + + md_number_to_chars ((char *) &(S_GET_DESC (symbolP)), + S_GET_DESC (symbolP), + sizeof (S_GET_DESC (symbolP))); + + md_number_to_chars ((char *) &symbolP->sy_symbol.n_value, + S_GET_VALUE (symbolP), + sizeof (symbolP->sy_symbol.n_value)); append (where, (char *) &symbolP->sy_symbol, sizeof (obj_symbol_type)); -} /* obj_symbol_to_chars() */ +} void obj_emit_symbols (where, symbol_rootP) @@ -191,26 +199,24 @@ obj_emit_symbols (where, symbol_rootP) { symbolS *symbolP; - /* - * Emit all symbols left in the symbol chain. - */ + /* Emit all symbols left in the symbol chain. */ for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP)) { - /* Used to save the offset of the name. It is used to point - to the string in memory but must be a file offset. */ + /* Used to save the offset of the name. It is used to point to + the string in memory but must be a file offset. */ char *temp; temp = S_GET_NAME (symbolP); S_SET_OFFSET (symbolP, symbolP->sy_name_offset); - /* Any symbol still undefined and is not a dbg symbol is made N_EXT. */ + /* Any symbol still undefined and is not a dbg symbol is made N_EXT. */ if (!S_IS_DEBUG (symbolP) && !S_IS_DEFINED (symbolP)) S_SET_EXTERNAL (symbolP); obj_symbol_to_chars (where, symbolP); S_SET_NAME (symbolP, temp); } -} /* emit_symbols() */ +} void obj_symbol_new_hook (symbolP) @@ -224,12 +230,12 @@ static void obj_bout_line (ignore) int ignore; { - /* Assume delimiter is part of expression. */ - /* BSD4.2 as fails with delightful bug, so we */ - /* are not being incompatible here. */ + /* Assume delimiter is part of expression. */ + /* BSD4.2 as fails with delightful bug, so we are not being + incompatible here. */ new_logical_line ((char *) NULL, (int) (get_absolute_expression ())); demand_empty_rest_of_line (); -} /* obj_bout_line() */ +} void obj_read_begin_hook () @@ -246,13 +252,13 @@ obj_crawl_symbol_chain (headers) tc_crawl_symbol_chain (headers); - symbolPP = &symbol_rootP; /*->last symbol chain link. */ + symbolPP = &symbol_rootP; /* -> last symbol chain link. */ while ((symbolP = *symbolPP) != NULL) { if (flag_readonly_data_in_text && (S_GET_SEGMENT (symbolP) == SEG_DATA)) { S_SET_SEGMENT (symbolP, SEG_TEXT); - } /* if pusing data into text */ + } /* if pusing data into text */ resolve_symbol_value (symbolP, 1); @@ -267,63 +273,62 @@ obj_crawl_symbol_chain (headers) /* OK, here is how we decide which symbols go out into the brave new symtab. Symbols that do are: - + * symbols with no name (stabd's?) * symbols with debug info in their N_TYPE - + Symbols that don't are: * symbols that are registers * symbols with \1 as their 3rd character (numeric labels) * "local labels" as defined by S_LOCAL_NAME(name) if the -L switch was passed to gas. - - All other symbols are output. We complain if a deleted - symbol was marked external. */ + All other symbols are output. We complain if a deleted + symbol was marked external. */ if (1 && !S_IS_REGISTER (symbolP) && (!S_GET_NAME (symbolP) || S_IS_DEBUG (symbolP) #ifdef TC_I960 - /* FIXME-SOON this ifdef seems highly dubious to me. xoxorich. */ + /* FIXME-SOON this ifdef seems highly dubious to me. xoxorich. */ || !S_IS_DEFINED (symbolP) || S_IS_EXTERNAL (symbolP) #endif /* TC_I960 */ - || (S_GET_NAME (symbolP)[0] != '\001' && (flag_keep_locals || !S_LOCAL_NAME (symbolP))))) + || (S_GET_NAME (symbolP)[0] != '\001' + && (flag_keep_locals || !S_LOCAL_NAME (symbolP))))) { symbolP->sy_number = symbol_number++; - /* The + 1 after strlen account for the \0 at the - end of each string */ + /* The + 1 after strlen account for the \0 at the end of + each string. */ if (!S_IS_STABD (symbolP)) { - /* Ordinary case. */ + /* Ordinary case. */ symbolP->sy_name_offset = string_byte_count; string_byte_count += strlen (S_GET_NAME (symbolP)) + 1; } - else /* .Stabd case. */ + else /* .Stabd case. */ symbolP->sy_name_offset = 0; - symbolPP = &(symbol_next (symbolP)); + symbolPP = &(symbolP->sy_next); } else { if (S_IS_EXTERNAL (symbolP) || !S_IS_DEFINED (symbolP)) { - as_bad (_("Local symbol %s never defined"), S_GET_NAME (symbolP)); - } /* oops. */ + as_bad (_("Local symbol %s never defined"), + S_GET_NAME (symbolP)); + } /* Oops. */ - /* Unhook it from the chain */ + /* Unhook it from the chain. */ *symbolPP = symbol_next (symbolP); - } /* if this symbol should be in the output */ - } /* for each symbol */ + } /* if this symbol should be in the output */ + } /* for each symbol */ H_SET_SYMBOL_TABLE_SIZE (headers, symbol_number); } -/* - * Find strings by crawling along symbol table chain. - */ +/* Find strings by crawling along symbol table chain. */ void obj_emit_strings (where) @@ -336,14 +341,14 @@ obj_emit_strings (where) md_number_to_chars (*where, string_byte_count, sizeof (string_byte_count)); *where += sizeof (string_byte_count); #else /* CROSS_COMPILE */ - append (where, (char *) &string_byte_count, (unsigned long) sizeof (string_byte_count)); + append (where, (char *) &string_byte_count, + (unsigned long) sizeof (string_byte_count)); #endif /* CROSS_COMPILE */ for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP)) { if (S_GET_NAME (symbolP)) - append (where, S_GET_NAME (symbolP), (unsigned long) (strlen (S_GET_NAME (symbolP)) + 1)); - } /* walk symbol chain */ + append (where, S_GET_NAME (symbolP), + (unsigned long) (strlen (S_GET_NAME (symbolP)) + 1)); + } /* Walk symbol chain. */ } - -/* end of obj-bout.c */ diff --git a/gnu/dist/toolchain/gas/config/obj-bout.h b/gnu/dist/toolchain/gas/config/obj-bout.h index ec539a0cf445..4359e7014ef7 100644 --- a/gnu/dist/toolchain/gas/config/obj-bout.h +++ b/gnu/dist/toolchain/gas/config/obj-bout.h @@ -1,5 +1,5 @@ /* b.out object file format - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996 + Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -17,7 +17,7 @@ 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, Cambridge, MA - 02139, USA. */ + 02139, USA. */ /* * This file is a modified version of 'a.out.h'. It is to be used in all GNU @@ -56,7 +56,6 @@ * relocation info are never sent to the target. */ - #define OBJ_BOUT 1 #define OUTPUT_FLAVOR bfd_target_aout_flavour @@ -108,7 +107,7 @@ struct exec }; #define N_BADMAG(x) (((x).a_magic)!=BMAGIC) -#define N_TXTOFF(x) ( sizeof(struct exec) ) +#define N_TXTOFF(x) ( sizeof (struct exec) ) #define N_DATOFF(x) ( N_TXTOFF(x) + (x).a_text ) #define N_TROFF(x) ( N_DATOFF(x) + (x).a_data ) #define N_DROFF(x) ( N_TROFF(x) + (x).a_trsize ) @@ -240,14 +239,14 @@ struct relocation_info /* File header macro and type definition */ -#define H_GET_FILE_SIZE(h) (sizeof(struct exec) + \ +#define H_GET_FILE_SIZE(h) (sizeof (struct exec) + \ H_GET_TEXT_SIZE(h) + H_GET_DATA_SIZE(h) + \ H_GET_SYMBOL_TABLE_SIZE(h) + \ H_GET_TEXT_RELOCATION_SIZE(h) + \ H_GET_DATA_RELOCATION_SIZE(h) + \ (h)->string_table_size) -#define H_GET_HEADER_SIZE(h) (sizeof(struct exec)) +#define H_GET_HEADER_SIZE(h) (sizeof (struct exec)) #define H_GET_TEXT_SIZE(h) ((h)->header.a_text) #define H_GET_DATA_SIZE(h) ((h)->header.a_data) #define H_GET_BSS_SIZE(h) ((h)->header.a_bss) @@ -276,7 +275,7 @@ struct relocation_info #define H_SET_TEXT_RELOCATION_SIZE(h,v) ((h)->header.a_trsize = (v)) #define H_SET_DATA_RELOCATION_SIZE(h,v) ((h)->header.a_drsize = (v)) #define H_SET_SYMBOL_TABLE_SIZE(h,v) ((h)->header.a_syms = (v) * \ - sizeof(struct nlist)) + sizeof (struct nlist)) #define H_SET_MAGIC_NUMBER(h,v) ((h)->header.a_magic = (v)) @@ -292,12 +291,12 @@ struct relocation_info typedef struct { struct exec header; /* a.out header */ - long string_table_size; /* names + '\0' + sizeof(int) */ + long string_table_size; /* names + '\0' + sizeof (int) */ } object_headers; -/* unused hooks. */ +/* unused hooks. */ #define OBJ_EMIT_LINENO(a, b, c) {;} #define obj_pre_write_hook(a) {;} @@ -312,5 +311,3 @@ extern void tc_bout_fix_to_chars PARAMS ((char *where, relax_addressT segment_address)); #define AOUT_STABS - -/* end of obj-bout.h */ diff --git a/gnu/dist/toolchain/gas/config/obj-coff.c b/gnu/dist/toolchain/gas/config/obj-coff.c index a0847c4c600f..e16e5df651db 100644 --- a/gnu/dist/toolchain/gas/config/obj-coff.c +++ b/gnu/dist/toolchain/gas/config/obj-coff.c @@ -30,6 +30,13 @@ #define KEEP_RELOC_INFO #endif +/* The BFD_ASSEMBLER version of obj_coff_section will use this macro to set + a new section's attributes when a directive has no valid flags or the + "w" flag is used. This default should be appropriate for most. */ +#ifndef TC_COFF_SECTION_DEFAULT_ATTRIBUTES +#define TC_COFF_SECTION_DEFAULT_ATTRIBUTES (SEC_LOAD | SEC_DATA) +#endif + static void obj_coff_bss PARAMS ((int)); const char *s_get_name PARAMS ((symbolS * s)); static void obj_coff_ln PARAMS ((int)); @@ -204,7 +211,7 @@ obj_coff_weak (ignore) char *name; int c; symbolS *symbolP; - + do { name = input_line_pointer; @@ -213,7 +220,7 @@ obj_coff_weak (ignore) *input_line_pointer = c; SKIP_WHITESPACE (); -#ifdef BFD_ASSEMBLER +#if defined BFD_ASSEMBLER || defined S_SET_WEAK S_SET_WEAK (symbolP); #endif @@ -241,7 +248,7 @@ obj_coff_weak (ignore) static void SA_SET_SYM_TAGNDX PARAMS ((symbolS *, symbolS *)); #define GET_FILENAME_STRING(X) \ -((char*)(&((X)->sy_symbol.ost_auxent->x_file.x_n.x_offset))[1]) +((char*) (&((X)->sy_symbol.ost_auxent->x_file.x_n.x_offset))[1]) /* @@ Ick. */ static segT @@ -316,7 +323,7 @@ S_SET_STORAGE_CLASS (sym, val) return val; } -/* Merge a debug symbol containing debug information into a normal symbol. */ +/* Merge a debug symbol containing debug information into a normal symbol. */ void c_symbol_merge (debug, normal) @@ -340,13 +347,13 @@ c_symbol_merge (debug, normal) * sizeof (*SYM_AUXINFO (debug)))); } - /* Move the debug flags. */ + /* Move the debug flags. */ SF_SET_DEBUG_FIELD (normal, SF_GET_DEBUG_FIELD (debug)); } void c_dot_file_symbol (filename) - char *filename; + const char *filename; { symbolS *symbolP; @@ -401,7 +408,7 @@ coff_obj_symbol_new_hook (symbolP) { long sz = (OBJ_COFF_MAX_AUXENTRIES + 1) * sizeof (combined_entry_type); char * s = (char *) xmalloc (sz); - + memset (s, 0, sz); coffsymbol (symbol_get_bfdsym (symbolP))->native = (combined_entry_type *) s; @@ -411,7 +418,7 @@ coff_obj_symbol_new_hook (symbolP) if (S_IS_STRING (symbolP)) SF_SET_STRING (symbolP); - + if (S_IS_LOCAL (symbolP)) SF_SET_LOCAL (symbolP); } @@ -429,7 +436,7 @@ int coff_n_line_nos; static void add_lineno (frag, offset, num) fragS *frag; - int offset; + addressT offset; int num; { struct line_no *new_line = @@ -438,7 +445,7 @@ add_lineno (frag, offset, num) { abort (); } - if (num <= 0) + if (num <= 0) { /* Zero is used as an end marker in the file. */ as_warn (_("Line numbers must be positive integers\n")); @@ -652,7 +659,7 @@ static void obj_coff_endef (ignore) int ignore ATTRIBUTE_UNUSED; { - symbolS *symbolP; + symbolS *symbolP = NULL; /* DIM BUG FIX sac@cygnus.com */ dim_index = 0; @@ -663,7 +670,7 @@ obj_coff_endef (ignore) return; } /* if not inside .def/.endef */ - /* Set the section number according to storage class. */ + /* Set the section number according to storage class. */ switch (S_GET_STORAGE_CLASS (def_symbol_in_progress)) { case C_STRTAG: @@ -678,7 +685,7 @@ obj_coff_endef (ignore) break; case C_EFCN: - SF_SET_LOCAL (def_symbol_in_progress); /* Do not emit this symbol. */ + SF_SET_LOCAL (def_symbol_in_progress); /* Do not emit this symbol. */ /* intentional fallthrough */ case C_BLOCK: SF_SET_PROCESS (def_symbol_in_progress); /* Will need processing before writing */ @@ -693,7 +700,7 @@ obj_coff_endef (ignore) { switch (name[1]) { - case 'b': + case 'b': /* .bf */ if (! in_function ()) as_warn (_("`%s' symbol without preceding function"), name); @@ -702,12 +709,12 @@ obj_coff_endef (ignore) clear_function (); break; #ifdef TE_PE - case 'e': + case 'e': /* .ef */ /* The MS compilers output the actual endline, not the function-relative one... we want to match without changing the assembler input. */ - SA_SET_SYM_LNNO (def_symbol_in_progress, + SA_SET_SYM_LNNO (def_symbol_in_progress, (SA_GET_SYM_LNNO (def_symbol_in_progress) + coff_line_base)); break; @@ -725,16 +732,49 @@ obj_coff_endef (ignore) case C_ARG: case C_REGPARM: case C_FIELD: + + /* According to the COFF documentation: + + http://osr5doc.sco.com:1996/topics/COFF_SectNumFld.html + + A special section number (-2) marks symbolic debugging symbols, + including structure/union/enumeration tag names, typedefs, and + the name of the file. A section number of -1 indicates that the + symbol has a value but is not relocatable. Examples of + absolute-valued symbols include automatic and register variables, + function arguments, and .eos symbols. + + But from Ian Lance Taylor: + + http://sources.redhat.com/ml/binutils/2000-08/msg00202.html + + the actual tools all marked them as section -1. So the GNU COFF + assembler follows historical COFF assemblers. + + However, it causes problems for djgpp + + http://sources.redhat.com/ml/binutils/2000-08/msg00210.html + + By defining STRICTCOFF, a COFF port can make the assembler to + follow the documented behavior. */ +#ifdef STRICTCOFF + case C_MOS: + case C_MOE: + case C_MOU: + case C_EOS: +#endif SF_SET_DEBUG (def_symbol_in_progress); S_SET_SEGMENT (def_symbol_in_progress, absolute_section); break; +#ifndef STRICTCOFF case C_MOS: case C_MOE: case C_MOU: case C_EOS: S_SET_SEGMENT (def_symbol_in_progress, absolute_section); break; +#endif case C_EXT: case C_WEAKEXT: @@ -768,11 +808,11 @@ obj_coff_endef (ignore) lineno entry MUST point to the definition function or else it will point off into space when obj_crawl_symbol_chain() merges the debug symbol into the real symbol. Therefor, let's presume - the debug symbol is a real function reference. */ + the debug symbol is a real function reference. */ /* FIXME-SOON If for some reason the definition label/symbol is never seen, this will probably leave an undefined symbol at link - time. */ + time. */ if (S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_EFCN || S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_LABEL @@ -803,7 +843,7 @@ obj_coff_endef (ignore) symbols. [loic] */ /* The debug entry (def_symbol_in_progress) is merged into the - previous definition. */ + previous definition. */ c_symbol_merge (def_symbol_in_progress, symbolP); symbol_remove (def_symbol_in_progress, &symbol_rootP, &symbol_lastP); @@ -816,7 +856,7 @@ obj_coff_endef (ignore) { /* For functions, and tags, and static symbols, the symbol *must* be where the debug symbol appears. Move the - existing symbol to the current place. */ + existing symbol to the current place. */ /* If it already is at the end of the symbol list, do nothing */ if (def_symbol_in_progress != symbol_lastP) { @@ -846,7 +886,7 @@ obj_coff_endef (ignore) if (symbolP == NULL) { /* That is, if this is the first time we've seen the - function... */ + function... */ symbol_table_insert (def_symbol_in_progress); } /* definition follows debug */ } /* Create the line number entry pointing to the function being defined */ @@ -982,7 +1022,7 @@ obj_coff_tag (ignore) #endif /* Assume that the symbol referred to by .tag is always defined. - This was a bad assumption. I've added find_or_make. xoxorich. */ + This was a bad assumption. I've added find_or_make. xoxorich. */ SA_SET_SYM_TAGNDX (def_symbol_in_progress, tag_find_or_make (symbol_name)); if (SA_GET_SYM_TAGNDX (def_symbol_in_progress) == 0L) @@ -1065,7 +1105,7 @@ obj_coff_val (ignore) just below. */ } /* Otherwise, it is the name of a non debug symbol and its value - will be calculated later. */ + will be calculated later. */ *input_line_pointer = name_end; } else @@ -1079,7 +1119,7 @@ obj_coff_val (ignore) void coff_obj_read_begin_hook () { - /* These had better be the same. Usually 18 bytes. */ + /* These had better be the same. Usually 18 bytes. */ #ifndef BFD_HEADERS know (sizeof (SYMENT) == sizeof (AUXENT)); know (SYMESZ == AUXESZ); @@ -1087,7 +1127,6 @@ coff_obj_read_begin_hook () tag_init (); } - symbolS *coff_last_function; static symbolS *coff_last_bf; @@ -1132,11 +1171,14 @@ coff_frob_symbol (symp, punt) 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)) && real != symp) { c_symbol_merge (symp, real); *punt = 1; + return; } if (!S_IS_DEFINED (symp) && !SF_GET_LOCAL (symp)) { @@ -1196,7 +1238,7 @@ coff_frob_symbol (symp, punt) if (SF_GET_FUNCTION (symp)) symbol_get_bfdsym (symp)->flags |= BSF_FUNCTION; - /* more ... */ + /* more ... */ } /* Double check weak symbols. */ @@ -1353,7 +1395,7 @@ obj_coff_section (ignore) char c; char *name; unsigned int exp; - flagword flags; + flagword flags, oldflags; asection *sec; if (flag_mri) @@ -1375,7 +1417,7 @@ obj_coff_section (ignore) SKIP_WHITESPACE (); exp = 0; - flags = SEC_LOAD; + flags = SEC_NO_FLAGS; if (*input_line_pointer == ',') { @@ -1420,18 +1462,35 @@ obj_coff_section (ignore) sec = subseg_new (name, (subsegT) exp); - if (flags != SEC_NO_FLAGS) + oldflags = bfd_get_section_flags (stdoutput, sec); + if (oldflags == SEC_NO_FLAGS) { - flagword oldflags; + /* Set section flags for a new section just created by subseg_new. + Provide a default if no flags were parsed. */ + if (flags == SEC_NO_FLAGS) + flags = TC_COFF_SECTION_DEFAULT_ATTRIBUTES; - oldflags = bfd_get_section_flags (stdoutput, sec); - oldflags &= SEC_LINK_ONCE | SEC_LINK_DUPLICATES; - flags |= oldflags; +#ifdef COFF_LONG_SECTION_NAMES + /* Add SEC_LINK_ONCE and SEC_LINK_DUPLICATES_DISCARD to .gnu.linkonce + sections so adjust_reloc_syms in write.c will correctly handle + relocs which refer to non-local symbols in these sections. */ + if (strncmp (name, ".gnu.linkonce", sizeof (".gnu.linkonce") - 1) == 0) + flags |= SEC_LINK_ONCE | SEC_LINK_DUPLICATES_DISCARD; +#endif if (! bfd_set_section_flags (stdoutput, sec, flags)) - as_warn (_("error setting flags for \"%s\": %s"), - bfd_section_name (stdoutput, sec), - bfd_errmsg (bfd_get_error ())); + as_warn (_("error setting flags for \"%s\": %s"), + bfd_section_name (stdoutput, sec), + bfd_errmsg (bfd_get_error ())); + } + else if (flags != SEC_NO_FLAGS) + { + /* This section's attributes have already been set. Warn if the + attributes don't match. */ + flagword matchflags = SEC_ALLOC | SEC_LOAD | SEC_READONLY | SEC_CODE + | SEC_DATA | SEC_SHARED; + if ((flags ^ oldflags) & matchflags) + as_warn (_("Ignoring changed section attributes for %s"), name); } demand_empty_rest_of_line (); @@ -1459,14 +1518,26 @@ coff_frob_section (sec) rounded up to multiples of the corresponding section alignments, supposedly because standard COFF has no other way of encoding alignment for sections. If your COFF flavor has a different way of encoding - section alignment, then skip this step, as TICOFF does. */ + section alignment, then skip this step, as TICOFF does. */ size = bfd_get_section_size_before_reloc (sec); mask = ((bfd_vma) 1 << align_power) - 1; #if !defined(TICOFF) if (size & mask) { - size = (size + mask) & ~mask; - bfd_set_section_size (stdoutput, sec, size); + bfd_vma new_size; + fragS *last; + + new_size = (size + mask) & ~mask; + bfd_set_section_size (stdoutput, sec, new_size); + + /* If the size had to be rounded up, add some padding in + the last non-empty frag. */ + fragp = seg_info (sec)->frchainP->frch_root; + last = seg_info (sec)->frchainP->frch_last; + while (fragp->fr_next != last) + fragp = fragp->fr_next; + last->fr_address = size; + fragp->fr_offset += new_size - size; } #endif @@ -1526,9 +1597,9 @@ obj_coff_init_stab_section (seg) char *stabstr_name; unsigned int stroff; - /* Make space for this first symbol. */ + /* Make space for this first symbol. */ p = frag_more (12); - /* Zero it out. */ + /* Zero it out. */ memset (p, 0, 12); as_where (&file, (unsigned int *) NULL); stabstr_name = (char *) alloca (strlen (seg->name) + 4); @@ -1555,7 +1626,7 @@ symbol_dump () for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP)) { - printf(_("0x%lx: \"%s\" type = %ld, class = %d, segment = %d\n"), + printf (_("0x%lx: \"%s\" type = %ld, class = %d, segment = %d\n"), (unsigned long) symbolP, S_GET_NAME(symbolP), (long) S_GET_DATA_TYPE(symbolP), @@ -1569,7 +1640,7 @@ symbol_dump () #else /* not BFD_ASSEMBLER */ #include "frags.h" -/* This is needed because we include internal bfd things. */ +/* This is needed because we include internal bfd things. */ #include #include "libbfd.h" @@ -1616,7 +1687,7 @@ int function_lineoff = -1; /* Offset in line#s where the last function /* structure used to keep the filenames which are too long around so that we can stick them into the string table */ -struct filename_list +struct filename_list { char *filename; struct filename_list *next; @@ -1641,22 +1712,18 @@ bfd *abfd; static void fixup_segment PARAMS ((segment_info_type *segP, segT this_segment_type)); - static void fixup_mdeps PARAMS ((fragS *, object_headers *, segT)); - static void fill_section PARAMS ((bfd * abfd, object_headers *, unsigned long *)); - static int c_line_new PARAMS ((symbolS * symbol, long paddr, int line_number, fragS * frag)); - static void w_symbols PARAMS ((bfd * abfd, char *where, symbolS * symbol_rootP)); @@ -1717,7 +1784,6 @@ relax_align (address, alignment) return (new_address - address); } - segT s_get_segment (x) symbolS * x; @@ -1760,6 +1826,7 @@ size_section (abfd, idx) break; case rs_align: case rs_align_code: + case rs_align_test: { addressT off; @@ -1780,7 +1847,6 @@ size_section (abfd, idx) return size; } - static unsigned int count_entries_in_chain (idx) unsigned int idx; @@ -1986,7 +2052,6 @@ do_relocs_for (abfd, h, file_cursor) H_SET_RELOCATION_SIZE (h, *file_cursor - reloc_start, 0); } - /* run through a frag chain and write out the data to go with it, fill in the scnhdrs with the info on the file postions */ @@ -2071,6 +2136,7 @@ fill_section (abfd, h, file_cursor) case rs_fill: case rs_align: case rs_align_code: + case rs_align_test: case rs_org: if (frag->fr_fix) { @@ -2181,7 +2247,6 @@ coff_header_append (abfd, h) } } - char * symbol_to_chars (abfd, where, symbolP) bfd * abfd; @@ -2232,7 +2297,7 @@ coff_obj_symbol_new_hook (symbolP) char underscore = 0; /* Symbol has leading _ */ /* Effective symbol */ - /* Store the pointer in the offset. */ + /* Store the pointer in the offset. */ S_SET_ZEROES (symbolP, 0L); S_SET_DATA_TYPE (symbolP, T_NULL); S_SET_STORAGE_CLASS (symbolP, 0); @@ -2360,7 +2425,6 @@ obj_coff_def (what) unsigned int dim_index; - static void obj_coff_endef (ignore) int ignore ATTRIBUTE_UNUSED; @@ -2375,7 +2439,7 @@ obj_coff_endef (ignore) return; } /* if not inside .def/.endef */ - /* Set the section number according to storage class. */ + /* Set the section number according to storage class. */ switch (S_GET_STORAGE_CLASS (def_symbol_in_progress)) { case C_STRTAG: @@ -2390,7 +2454,7 @@ obj_coff_endef (ignore) break; case C_EFCN: - SF_SET_LOCAL (def_symbol_in_progress); /* Do not emit this symbol. */ + SF_SET_LOCAL (def_symbol_in_progress); /* Do not emit this symbol. */ /* intentional fallthrough */ case C_BLOCK: SF_SET_PROCESS (def_symbol_in_progress); /* Will need processing before writing */ @@ -2411,7 +2475,7 @@ obj_coff_endef (ignore) SF_SET_PROCESS (def_symbol_in_progress); function_lineoff = -1; } - /* Value is always set to . */ + /* Value is always set to . */ def_symbol_in_progress->sy_frag = frag_now; S_SET_VALUE (def_symbol_in_progress, (valueT) frag_now_fix ()); break; @@ -2462,11 +2526,11 @@ obj_coff_endef (ignore) lineno entry MUST point to the definition function or else it will point off into space when crawl_symbols() merges the debug symbol into the real symbol. Therefor, let's presume the debug - symbol is a real function reference. */ + symbol is a real function reference. */ /* FIXME-SOON If for some reason the definition label/symbol is never seen, this will probably leave an undefined symbol at link - time. */ + time. */ if (S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_EFCN || S_GET_STORAGE_CLASS (def_symbol_in_progress) == C_LABEL @@ -2492,7 +2556,7 @@ obj_coff_endef (ignore) previous definition. */ c_symbol_merge (def_symbol_in_progress, symbolP); - /* FIXME-SOON Should *def_symbol_in_progress be free'd? xoxorich. */ + /* FIXME-SOON Should *def_symbol_in_progress be free'd? xoxorich. */ def_symbol_in_progress = symbolP; if (SF_GET_FUNCTION (def_symbol_in_progress) @@ -2501,7 +2565,7 @@ obj_coff_endef (ignore) { /* For functions, and tags, and static symbols, the symbol *must* be where the debug symbol appears. Move the - existing symbol to the current place. */ + existing symbol to the current place. */ /* If it already is at the end of the symbol list, do nothing */ if (def_symbol_in_progress != symbol_lastP) { @@ -2535,7 +2599,7 @@ obj_coff_endef (ignore) if (symbolP == NULL) { /* That is, if this is the first time we've seen the - function... */ + function... */ symbol_table_insert (def_symbol_in_progress); } /* definition follows debug */ } /* Create the line number entry pointing to the function being defined */ @@ -2682,7 +2746,7 @@ obj_coff_tag (ignore) #endif /* Assume that the symbol referred to by .tag is always defined. - This was a bad assumption. I've added find_or_make. xoxorich. */ + This was a bad assumption. I've added find_or_make. xoxorich. */ SA_SET_SYM_TAGNDX (def_symbol_in_progress, (long) tag_find_or_make (symbol_name)); if (SA_GET_SYM_TAGNDX (def_symbol_in_progress) == 0L) @@ -2764,7 +2828,7 @@ obj_coff_val (ignore) just below. */ } /* Otherwise, it is the name of a non debug symbol and - its value will be calculated later. */ + its value will be calculated later. */ *input_line_pointer = name_end; /* FIXME: this is to avoid an error message in the @@ -2802,7 +2866,7 @@ obj_coff_pe_handle_link_once (type) void coff_obj_read_begin_hook () { - /* These had better be the same. Usually 18 bytes. */ + /* These had better be the same. Usually 18 bytes. */ #ifndef BFD_HEADERS know (sizeof (SYMENT) == sizeof (AUXENT)); know (SYMESZ == AUXESZ); @@ -2857,7 +2921,7 @@ yank_symbols () /* Debug symbols do not need all this rubbish */ symbolS *real_symbolP; - /* L* and C_EFCN symbols never merge. */ + /* L* and C_EFCN symbols never merge. */ if (!SF_GET_LOCAL (symbolP) && !SF_GET_STATICS (symbolP) && S_GET_STORAGE_CLASS (symbolP) != C_LABEL @@ -2866,12 +2930,12 @@ yank_symbols () && real_symbolP != symbolP) { /* FIXME-SOON: where do dups come from? - Maybe tag references before definitions? xoxorich. */ + Maybe tag references before definitions? xoxorich. */ /* Move the debug data from the debug symbol to the real symbol. Do NOT do the oposite (i.e. move from real symbol to debug symbol and remove real symbol from the list.) Because some pointers refer to the real symbol - whereas no pointers refer to the debug symbol. */ + whereas no pointers refer to the debug symbol. */ c_symbol_merge (symbolP, real_symbolP); /* Replace the current symbol by the real one */ /* The symbols will never be the last or the first @@ -2909,7 +2973,7 @@ yank_symbols () /* Mainly to speed up if not -g */ if (SF_GET_PROCESS (symbolP)) { - /* Handle the nested blocks auxiliary info. */ + /* Handle the nested blocks auxiliary info. */ if (S_GET_STORAGE_CLASS (symbolP) == C_BLOCK) { if (!strcmp (S_GET_NAME (symbolP), ".bb")) @@ -2927,7 +2991,7 @@ yank_symbols () /* If we are able to identify the type of a function, and we are out of a function (last_functionP == 0) then, the function symbol will be associated with an auxiliary - entry. */ + entry. */ if (last_functionP == (symbolS *) 0 && SF_GET_FUNCTION (symbolP)) { @@ -2938,7 +3002,7 @@ yank_symbols () S_SET_NUMBER_AUXILIARY (symbolP, 1); } /* make it at least 1 */ - /* Clobber possible stale .dim information. */ + /* Clobber possible stale .dim information. */ #if 0 /* Iffed out by steve - this fries the lnnoptr info too */ bzero (symbolP->sy_symbol.ost_auxent[0].x_sym.x_fcnary.x_ary.x_dimen, @@ -2971,7 +3035,7 @@ yank_symbols () else if (SF_GET_TAG (symbolP)) { /* First descriptor of a structure must point to - the first slot after the structure description. */ + the first slot after the structure description. */ last_tagP = symbolP; } @@ -3011,8 +3075,7 @@ yank_symbols () [21] foo external [22] .be ld will move the symbol 21 to the end of the list but - endndx will still be 22 instead of 21. */ - + endndx will still be 22 instead of 21. */ if (SF_GET_LOCAL (symbolP)) { @@ -3086,7 +3149,6 @@ yank_symbols () } - static unsigned int glue_symbols (head, tail) symbolS **head; @@ -3165,7 +3227,7 @@ crawl_symbols (h, abfd) * undefined symbols at the end of the list. */ - /* Is there a .file symbol ? If not insert one at the beginning. */ + /* Is there a .file symbol ? If not insert one at the beginning. */ if (symbol_rootP == NULL || S_GET_STORAGE_CLASS (symbol_rootP) != C_FILE) { @@ -3176,7 +3238,6 @@ crawl_symbols (h, abfd) * Build up static symbols for the sections, they are filled in later */ - for (i = SEG_E0; i < SEG_LAST; i++) if (segment_info[i].scnhdr.s_name[0]) segment_info[i].dot = c_section_symbol (segment_info[i].name, @@ -3272,7 +3333,6 @@ do_linenos_for (abfd, h, file_cursor) { segment_info_type *s = segment_info + idx; - if (s->scnhdr.s_nlnno != 0) { struct lineno_list *line_ptr; @@ -3301,7 +3361,6 @@ do_linenos_for (abfd, h, file_cursor) line_ptr->line.l_addr.l_paddr += ((struct frag *) (line_ptr->frag))->fr_address; } - (void) bfd_coff_swap_lineno_out (abfd, &(line_ptr->line), dst); dst++; @@ -3318,7 +3377,6 @@ do_linenos_for (abfd, h, file_cursor) H_SET_LINENO_SIZE (h, *file_cursor - start); } - /* Now we run through the list of frag chains in a segment and make all the subsegment frags appear at the end of the list, as if the seg 0 was extra long */ @@ -3359,7 +3417,6 @@ write_object_file () unsigned int addr; abfd = bfd_openw (out_file_name, TARGET_FORMAT); - if (abfd == 0) { as_perror (_("FATAL: Can't create %s"), out_file_name); @@ -3388,21 +3445,22 @@ write_object_file () md_do_align (SUB_SEGMENT_ALIGN (now_seg), (char *) NULL, 0, 0, alignment_done); #endif - frag_align (SUB_SEGMENT_ALIGN (now_seg), - subseg_text_p (now_seg) ? NOP_OPCODE : 0, - 0); + if (subseg_text_p (now_seg)) + frag_align_code (SUB_SEGMENT_ALIGN (now_seg), 0); + else + frag_align (SUB_SEGMENT_ALIGN (now_seg), 0, 0); + #ifdef md_do_align alignment_done: #endif + frag_wane (frag_now); frag_now->fr_fix = 0; know (frag_now->fr_next == NULL); } - remove_subsegs (); - for (i = SEG_E0; i < SEG_UNKNOWN; i++) { relax_segment (segment_info[i].frchainP->frch_root, i); @@ -3476,7 +3534,7 @@ write_object_file () } /* Look for ".stab" segments and fill in their initial symbols - correctly. */ + correctly. */ for (i = SEG_E0; i < SEG_UNKNOWN; i++) { name = segment_info[i].name; @@ -3537,7 +3595,7 @@ write_object_file () coff_header_append (abfd, &headers); #if 0 /* Recent changes to write need this, but where it should - go is up to Ken.. */ + go is up to Ken.. */ if (bfd_close_all_done (abfd) == false) as_fatal (_("Can't close %s: %s"), out_file_name, bfd_errmsg (bfd_get_error ())); @@ -3683,7 +3741,6 @@ obj_coff_section (ignore) demand_empty_rest_of_line (); } - static void obj_coff_text (ignore) int ignore ATTRIBUTE_UNUSED; @@ -3691,7 +3748,6 @@ obj_coff_text (ignore) subseg_new (".text", get_absolute_expression ()); } - static void obj_coff_data (ignore) int ignore ATTRIBUTE_UNUSED; @@ -3733,7 +3789,7 @@ c_symbol_merge (debug, normal) (unsigned int) (S_GET_NUMBER_AUXILIARY (debug) * AUXESZ)); } /* Move all the auxiliary information */ - /* Move the debug flags. */ + /* Move the debug flags. */ SF_SET_DEBUG_FIELD (normal, SF_GET_DEBUG_FIELD (debug)); } /* c_symbol_merge() */ @@ -3763,7 +3819,6 @@ c_line_new (symbol, paddr, line_number, frag) new_line->frag = (char *) frag; new_line->next = (struct lineno_list *) NULL; - if (s->lineno_list_head == (struct lineno_list *) NULL) { s->lineno_list_head = new_line; @@ -3805,13 +3860,13 @@ c_dot_file_symbol (filename) SA_SET_FILE_FNAME_ZEROS (symbolP, 0); SA_SET_FILE_FNAME_OFFSET (symbolP, 1); - if (filename_list_tail) + if (filename_list_tail) filename_list_tail->next = f; else filename_list_head = f; - filename_list_tail = f; + filename_list_tail = f; } - else + else { SA_SET_FILE_FNAME (symbolP, filename); } @@ -3930,7 +3985,7 @@ w_symbols (abfd, where, symbol_rootP) for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next (symbolP)) { /* Used to save the offset of the name. It is used to point - to the string in memory but must be a file offset. */ + to the string in memory but must be a file offset. */ register char *temp; /* We can't fix the lnnoptr field in yank_symbols with the other @@ -4042,6 +4097,7 @@ fixup_mdeps (frags, h, this_segment) { case rs_align: case rs_align_code: + case rs_align_test: case rs_org: #ifdef HANDLE_ALIGN HANDLE_ALIGN (frags); @@ -4112,7 +4168,7 @@ fixup_segment (segP, this_segment_type) if (fixP->fx_tcbit && SF_GET_CALLNAME (add_symbolP)) { /* Relocation should be done via the associated 'bal' entry - point symbol. */ + point symbol. */ if (!SF_GET_BALNAME (tc_get_bal_of_call (add_symbolP))) { @@ -4210,7 +4266,7 @@ fixup_segment (segP, this_segment_type) { /* Difference of 2 symbols from same segment. Can't make difference of 2 undefineds: 'value' means - something different for N_UNDF. */ + something different for N_UNDF. */ #ifdef TC_I960 /* Makes no sense to use the difference of 2 arbitrary symbols as the target of a call instruction. */ @@ -4237,7 +4293,7 @@ fixup_segment (segP, this_segment_type) } else { - /* Different segments in subtraction. */ + /* Different segments in subtraction. */ know (!(S_IS_EXTERNAL (sub_symbolP) && (S_GET_SEGMENT (sub_symbolP) == absolute_section))); if ((S_GET_SEGMENT (sub_symbolP) == absolute_section)) @@ -4246,7 +4302,7 @@ fixup_segment (segP, this_segment_type) } #ifdef DIFF_EXPR_OK else if (S_GET_SEGMENT (sub_symbolP) == this_segment_type -#if 0 /* Okay for 68k, at least... */ +#if 0 /* Okay for 68k, at least... */ && !pcrel #endif ) @@ -4306,7 +4362,7 @@ fixup_segment (segP, this_segment_type) the i386 are relaxed, this could only arise with a call instruction. */ - pcrel = 0; /* Lie. Don't want further pcrel processing. */ + pcrel = 0; /* Lie. Don't want further pcrel processing. */ if (!TC_FORCE_RELOCATION (fixP)) { fixP->fx_addsy = NULL; @@ -4332,7 +4388,6 @@ fixup_segment (segP, this_segment_type) break; default: - #if defined(TC_A29K) || (defined(TE_PE) && defined(TC_I386)) || defined(TC_M88K) /* This really should be handled in the linker, but backward compatibility forbids. */ @@ -4367,13 +4422,12 @@ fixup_segment (segP, this_segment_type) /* This is also true for 68k COFF on sysv machines (Checked on Motorola sysv68 R3V6 and R3V7.1, and also on UNIX System V/M68000, Release 1.0 from ATT/Bell Labs) - Philippe De Muyter . */ + Philippe De Muyter . */ if (S_IS_COMMON (add_symbolP)) add_number += S_GET_VALUE (add_symbolP); #endif break; - } /* switch on symbol seg */ } /* if not in local seg */ } /* if there was a + symbol */ @@ -4452,7 +4506,7 @@ fixup_segment (segP, this_segment_type) (unsigned long) (fragP->fr_address + where)); #endif } /* not a bit fix */ - } /* For each fixS in this segment. */ + } /* For each fixS in this segment. */ } /* fixup_segment() */ #endif @@ -4468,9 +4522,9 @@ obj_coff_init_stab_section (seg) char *stabstr_name; unsigned int stroff; - /* Make space for this first symbol. */ + /* Make space for this first symbol. */ p = frag_more (12); - /* Zero it out. */ + /* Zero it out. */ memset (p, 0, 12); as_where (&file, (unsigned int *) NULL); stabstr_name = (char *) alloca (strlen (segment_info[seg].name) + 4); @@ -4495,7 +4549,7 @@ adjust_stab_section(abfd, seg) int i, strsz = 0, nsyms; fragS *frag = segment_info[seg].frchainP->frch_root; - /* Look for the associated string table section. */ + /* Look for the associated string table section. */ secname = segment_info[seg].name; name = (char *) alloca (strlen (secname) + 4); @@ -4512,14 +4566,14 @@ adjust_stab_section(abfd, seg) } } - /* If we found the section, get its size. */ + /* If we found the section, get its size. */ if (stabstrseg != SEG_UNKNOWN) strsz = size_section (abfd, stabstrseg); nsyms = size_section (abfd, seg) / 12 - 1; /* Look for the first frag of sufficient size for the initial stab - symbol, and collect a pointer to it. */ + symbol, and collect a pointer to it. */ while (frag && frag->fr_fix < 12) frag = frag->fr_next; assert (frag != 0); @@ -4527,7 +4581,7 @@ adjust_stab_section(abfd, seg) assert (p != 0); /* Write in the number of stab symbols and the size of the string - table. */ + table. */ bfd_h_put_16 (abfd, (bfd_vma) nsyms, (bfd_byte *) p + 6); bfd_h_put_32 (abfd, (bfd_vma) strsz, (bfd_byte *) p + 8); } @@ -4582,6 +4636,7 @@ const pseudo_typeS coff_pseudo_table[] = /* Support for a COFF emulation. */ static void coff_pop_insert PARAMS ((void)); +static int coff_separate_stab_sections PARAMS ((void)); static void coff_pop_insert () @@ -4589,23 +4644,38 @@ coff_pop_insert () pop_insert (coff_pseudo_table); } +static int +coff_separate_stab_sections () +{ + return 1; +} + const struct format_ops coff_format_ops = { bfd_target_coff_flavour, 0, /* dfl_leading_underscore */ 1, /* emit_section_symbols */ + 0, /* begin */ + c_dot_file_symbol, coff_frob_symbol, 0, /* frob_file */ + 0, /* frob_file_before_adjust */ coff_frob_file_after_relocs, 0, /* s_get_size */ 0, /* s_set_size */ 0, /* s_get_align */ 0, /* s_set_align */ 0, /* s_get_other */ + 0, /* s_set_other */ 0, /* s_get_desc */ + 0, /* s_set_desc */ + 0, /* s_get_type */ + 0, /* s_set_type */ 0, /* copy_symbol_attributes */ 0, /* generate_asm_lineno */ 0, /* process_stab */ + coff_separate_stab_sections, + obj_coff_init_stab_section, 0, /* sec_sym_ok_for_reloc */ coff_pop_insert, 0, /* ecoff_set_ext */ diff --git a/gnu/dist/toolchain/gas/config/obj-coff.h b/gnu/dist/toolchain/gas/config/obj-coff.h index f60ae365fb91..8cf7999d8623 100644 --- a/gnu/dist/toolchain/gas/config/obj-coff.h +++ b/gnu/dist/toolchain/gas/config/obj-coff.h @@ -39,7 +39,7 @@ #include "bfd.h" /* This internal_lineno crap is to stop namespace pollution from the - bfd internal coff headerfile. */ + bfd internal coff headerfile. */ #define internal_lineno bfd_internal_lineno #include "coff/internal.h" #undef internal_lineno @@ -149,6 +149,11 @@ #define TARGET_FORMAT "coff-tic30" #endif +#ifdef TC_TIC54X +#include "coff/tic54x.h" +#define TARGET_FORMAT "coff1-c54x" +#endif + #ifdef TC_TIC80 #include "coff/tic80.h" #define TARGET_FORMAT "coff-tic80" @@ -250,7 +255,7 @@ extern void obj_coff_section PARAMS ((int)); /* The number of auxiliary entries */ #define S_SET_NUMBER_AUXILIARY(s,v) (S_GET_NUMBER_AUXILIARY (s) = (v)) -/* True if a symbol name is in the string table, i.e. its length is > 8. */ +/* True if a symbol name is in the string table, i.e. its length is > 8. */ #define S_IS_STRING(s) (strlen(S_GET_NAME(s)) > 8 ? 1 : 0) extern int S_SET_DATA_TYPE PARAMS ((symbolS *, int)); @@ -294,13 +299,13 @@ extern void SA_SET_SYM_ENDNDX PARAMS ((symbolS *, symbolS *)); * differently. */ -#define SF_I960_MASK (0x000001ff) /* Bits 0-8 are used by the i960 port. */ +#define SF_I960_MASK (0x000001ff) /* Bits 0-8 are used by the i960 port. */ #define SF_SYSPROC (0x0000003f) /* bits 0-5 are used to store the sysproc number */ #define SF_IS_SYSPROC (0x00000040) /* bit 6 marks symbols that are sysprocs */ #define SF_BALNAME (0x00000080) /* bit 7 marks BALNAME symbols */ #define SF_CALLNAME (0x00000100) /* bit 8 marks CALLNAME symbols */ -#define SF_NORMAL_MASK (0x0000ffff) /* bits 12-15 are general purpose. */ +#define SF_NORMAL_MASK (0x0000ffff) /* bits 12-15 are general purpose. */ #define SF_STATICS (0x00001000) /* Mark the .text & all symbols */ #define SF_DEFINED (0x00002000) /* Symbol is defined in this file */ @@ -314,8 +319,8 @@ extern void SA_SET_SYM_ENDNDX PARAMS ((symbolS *, symbolS *)); #define SF_TAGGED (0x00040000) /* Is associated with a tag */ #define SF_TAG (0x00080000) /* Is a tag */ #define SF_DEBUG (0x00100000) /* Is in debug or abs section */ -#define SF_GET_SEGMENT (0x00200000) /* Get the section of the forward symbol. */ -/* All other bits are unused. */ +#define SF_GET_SEGMENT (0x00200000) /* Get the section of the forward symbol. */ +/* All other bits are unused. */ /* Accessors */ #define SF_GET(s) (*symbol_get_obj (s)) @@ -341,7 +346,7 @@ extern void SA_SET_SYM_ENDNDX PARAMS ((symbolS *, symbolS *)); /* Modifiers */ #define SF_SET(s,v) (SF_GET (s) = (v)) -#define SF_SET_NORMAL_FIELD(s,v)(SF_GET (s) |= ((v) & SF_NORMAL_MASK)) +#define SF_SET_NORMAL_FIELD(s,v) (SF_GET (s) |= ((v) & SF_NORMAL_MASK)) #define SF_SET_DEBUG_FIELD(s,v) (SF_GET (s) |= ((v) & SF_DEBUG_MASK)) #define SF_SET_FILE(s) (SF_GET (s) |= SF_FILE) #define SF_SET_STATICS(s) (SF_GET (s) |= SF_STATICS) @@ -368,8 +373,7 @@ extern int coff_n_line_nos; #define obj_emit_lineno(WHERE,LINE,FILE_START) abort () extern void coff_add_linesym PARAMS ((symbolS *)); - -void c_dot_file_symbol PARAMS ((char *filename)); +void c_dot_file_symbol PARAMS ((const char *filename)); #define obj_app_file c_dot_file_symbol extern void coff_frob_symbol PARAMS ((symbolS *, int *)); @@ -430,10 +434,9 @@ hey ! Where is the C_LEAFSTAT definition ? i960 - coff support is depending on i extern const segT N_TYPE_seg[]; -/* Magic number of paged executable. */ +/* Magic number of paged executable. */ #define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE 0x8300 - /* SYMBOL TABLE */ /* Symbol table entry data type */ @@ -442,7 +445,7 @@ typedef struct { /* Basic symbol */ struct internal_syment ost_entry; - /* Auxiliary entry. */ + /* Auxiliary entry. */ union internal_auxent ost_auxent[OBJ_COFF_MAX_AUXENTRIES]; /* obj_coff internal use only flags */ unsigned int ost_flags; @@ -502,7 +505,7 @@ typedef struct */ #define S_IS_COMMON(s) ((s)->sy_symbol.ost_entry.n_scnum == 0 \ && S_GET_VALUE (s) != 0) -/* True if a symbol name is in the string table, i.e. its length is > 8. */ +/* True if a symbol name is in the string table, i.e. its length is > 8. */ #define S_IS_STRING(s) (strlen(S_GET_NAME(s)) > 8 ? 1 : 0) /* True if a symbol is defined as weak. */ @@ -517,7 +520,7 @@ typedef struct /* Accessors */ /* The name of the symbol */ -#define S_GET_NAME(s) ((char*)(s)->sy_symbol.ost_entry.n_offset) +#define S_GET_NAME(s) ((char*) (s)->sy_symbol.ost_entry.n_offset) /* The pointer to the string table */ #define S_GET_OFFSET(s) ((s)->sy_symbol.ost_entry.n_offset) /* The numeric value of the segment */ @@ -531,7 +534,7 @@ typedef struct /* Modifiers */ /* Set the name of the symbol */ -#define S_SET_NAME(s,v) ((s)->sy_symbol.ost_entry.n_offset = (unsigned long)(v)) +#define S_SET_NAME(s,v) ((s)->sy_symbol.ost_entry.n_offset = (unsigned long) (v)) /* Set the offset of the symbol */ #define S_SET_OFFSET(s,v) ((s)->sy_symbol.ost_entry.n_offset = (v)) /* The numeric value of the segment */ @@ -591,13 +594,13 @@ typedef struct * differently. */ -#define SF_I960_MASK (0x000001ff) /* Bits 0-8 are used by the i960 port. */ +#define SF_I960_MASK (0x000001ff) /* Bits 0-8 are used by the i960 port. */ #define SF_SYSPROC (0x0000003f) /* bits 0-5 are used to store the sysproc number */ #define SF_IS_SYSPROC (0x00000040) /* bit 6 marks symbols that are sysprocs */ #define SF_BALNAME (0x00000080) /* bit 7 marks BALNAME symbols */ #define SF_CALLNAME (0x00000100) /* bit 8 marks CALLNAME symbols */ -#define SF_NORMAL_MASK (0x0000ffff) /* bits 12-15 are general purpose. */ +#define SF_NORMAL_MASK (0x0000ffff) /* bits 12-15 are general purpose. */ #define SF_STATICS (0x00001000) /* Mark the .text & all symbols */ #define SF_DEFINED (0x00002000) /* Symbol is defined in this file */ @@ -611,9 +614,9 @@ typedef struct #define SF_TAGGED (0x00040000) /* Is associated with a tag */ #define SF_TAG (0x00080000) /* Is a tag */ #define SF_DEBUG (0x00100000) /* Is in debug or abs section */ -#define SF_GET_SEGMENT (0x00200000) /* Get the section of the forward symbol. */ +#define SF_GET_SEGMENT (0x00200000) /* Get the section of the forward symbol. */ #define SF_ADJ_LNNOPTR (0x00400000) /* Has a lnnoptr */ -/* All other bits are unused. */ +/* All other bits are unused. */ /* Accessors */ #define SF_GET(s) ((s)->sy_symbol.ost_flags) @@ -639,7 +642,7 @@ typedef struct /* Modifiers */ #define SF_SET(s,v) (SF_GET (s) = (v)) -#define SF_SET_NORMAL_FIELD(s,v)(SF_GET (s) |= ((v) & SF_NORMAL_MASK)) +#define SF_SET_NORMAL_FIELD(s,v) (SF_GET (s) |= ((v) & SF_NORMAL_MASK)) #define SF_SET_DEBUG_FIELD(s,v) (SF_GET (s) |= ((v) & SF_DEBUG_MASK)) #define SF_SET_FILE(s) (SF_GET (s) |= SF_FILE) #define SF_SET_STATICS(s) (SF_GET (s) |= SF_STATICS) @@ -674,31 +677,31 @@ typedef struct #endif /* OBJ_COFF_OMIT_OPTIONAL_HEADER */ #define H_GET_FILE_SIZE(h) \ - (long)(FILHSZ + OBJ_COFF_AOUTHDRSZ + \ + (long) (FILHSZ + OBJ_COFF_AOUTHDRSZ + \ H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ + \ H_GET_TEXT_SIZE(h) + H_GET_DATA_SIZE(h) + \ H_GET_RELOCATION_SIZE(h) + H_GET_LINENO_SIZE(h) + \ H_GET_SYMBOL_TABLE_SIZE(h) + \ (h)->string_table_size) #define H_GET_TEXT_FILE_OFFSET(h) \ - (long)(FILHSZ + OBJ_COFF_AOUTHDRSZ + \ + (long) (FILHSZ + OBJ_COFF_AOUTHDRSZ + \ H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ) #define H_GET_DATA_FILE_OFFSET(h) \ - (long)(FILHSZ + OBJ_COFF_AOUTHDRSZ + \ + (long) (FILHSZ + OBJ_COFF_AOUTHDRSZ + \ H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ + \ H_GET_TEXT_SIZE(h)) #define H_GET_BSS_FILE_OFFSET(h) 0 #define H_GET_RELOCATION_FILE_OFFSET(h) \ - (long)(FILHSZ + OBJ_COFF_AOUTHDRSZ + \ + (long) (FILHSZ + OBJ_COFF_AOUTHDRSZ + \ H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ + \ H_GET_TEXT_SIZE(h) + H_GET_DATA_SIZE(h)) #define H_GET_LINENO_FILE_OFFSET(h) \ - (long)(FILHSZ + OBJ_COFF_AOUTHDRSZ + \ + (long) (FILHSZ + OBJ_COFF_AOUTHDRSZ + \ H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ + \ H_GET_TEXT_SIZE(h) + H_GET_DATA_SIZE(h) + \ H_GET_RELOCATION_SIZE(h)) #define H_GET_SYMBOL_TABLE_FILE_OFFSET(h) \ - (long)(FILHSZ + OBJ_COFF_AOUTHDRSZ + \ + (long) (FILHSZ + OBJ_COFF_AOUTHDRSZ + \ H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ + \ H_GET_TEXT_SIZE(h) + H_GET_DATA_SIZE(h) + \ H_GET_RELOCATION_SIZE(h) + H_GET_LINENO_SIZE(h)) @@ -728,11 +731,11 @@ typedef struct #define H_GET_LINENO_SIZE(h) ((h)->lineno_size) #ifndef OBJ_COFF_OMIT_OPTIONAL_HEADER -#define H_GET_HEADER_SIZE(h) (sizeof(FILHDR) \ - + sizeof(AOUTHDR)\ +#define H_GET_HEADER_SIZE(h) (sizeof (FILHDR) \ + + sizeof (AOUTHDR)\ + (H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ)) #else /* OBJ_COFF_OMIT_OPTIONAL_HEADER */ -#define H_GET_HEADER_SIZE(h) (sizeof(FILHDR) \ +#define H_GET_HEADER_SIZE(h) (sizeof (FILHDR) \ + (H_GET_NUMBER_OF_SECTIONS(h) * SCNHSZ)) #endif /* OBJ_COFF_OMIT_OPTIONAL_HEADER */ @@ -767,17 +770,15 @@ typedef struct typedef struct { struct internal_aouthdr aouthdr; /* a.out header */ - struct internal_filehdr filehdr; /* File header, not machine dep. */ - long string_table_size; /* names + '\0' + sizeof(int) */ + struct internal_filehdr filehdr; /* File header, not machine dep. */ + long string_table_size; /* names + '\0' + sizeof (int) */ long relocation_size; /* Cumulated size of relocation information for all sections in - bytes. */ + bytes. */ long lineno_size; /* Size of the line number information table in bytes */ } object_headers; - - struct lineno_list { struct bfd_internal_lineno line; @@ -785,9 +786,6 @@ struct lineno_list struct lineno_list *next; /* Forward chain pointer */ }; - - - #define obj_segment_name(i) (segment_info[(int) (i)].scnhdr.s_name) #define obj_add_segment(s) obj_coff_add_segment (s) diff --git a/gnu/dist/toolchain/gas/config/obj-ecoff.c b/gnu/dist/toolchain/gas/config/obj-ecoff.c index 767dc588c829..3f80e7d9ce0b 100644 --- a/gnu/dist/toolchain/gas/config/obj-ecoff.c +++ b/gnu/dist/toolchain/gas/config/obj-ecoff.c @@ -34,6 +34,7 @@ static int ecoff_sec_sym_ok_for_reloc PARAMS ((asection *)); static void obj_ecoff_frob_symbol PARAMS ((symbolS *, int *)); static void ecoff_pop_insert PARAMS ((void)); +static int ecoff_separate_stab_sections PARAMS ((void)); /* These are the pseudo-ops we support in this file. Only those relating to debugging information are supported here. @@ -84,7 +85,7 @@ const pseudo_typeS obj_pseudo_table[] = { "extern", ecoff_directive_extern, 0 }, #ifndef TC_MIPS - /* For TC_MIPS, tc-mips.c adds this. */ + /* For TC_MIPS, tc-mips.c adds this. */ { "weakext", ecoff_directive_weakext, 0 }, #endif @@ -290,26 +291,44 @@ ecoff_pop_insert () pop_insert (obj_pseudo_table); } +static int +ecoff_separate_stab_sections () +{ + return 0; +} + const struct format_ops ecoff_format_ops = { bfd_target_ecoff_flavour, 0, /* dfl_leading_underscore */ + + /* FIXME: A comment why emit_section_symbols is different here (1) from + the single-format definition (0) would be in order. */ 1, /* emit_section_symbols */ + 0, /* begin */ + ecoff_new_file, obj_ecoff_frob_symbol, ecoff_frob_file, + 0, /* frob_file_before_adjust */ 0, /* frob_file_after_relocs */ 0, /* s_get_size */ 0, /* s_set_size */ 0, /* s_get_align */ 0, /* s_set_align */ 0, /* s_get_other */ + 0, /* s_set_other */ 0, /* s_get_desc */ + 0, /* s_set_desc */ + 0, /* s_get_type */ + 0, /* s_set_type */ 0, /* copy_symbol_attributes */ ecoff_generate_asm_lineno, ecoff_stab, + ecoff_separate_stab_sections, + 0, /* init_stab_section */ ecoff_sec_sym_ok_for_reloc, ecoff_pop_insert, ecoff_set_ext, ecoff_read_begin_hook, - ecoff_symbol_new_hook, + ecoff_symbol_new_hook }; diff --git a/gnu/dist/toolchain/gas/config/obj-elf.c b/gnu/dist/toolchain/gas/config/obj-elf.c index 21fd0fa22411..d56eaa9c35ca 100644 --- a/gnu/dist/toolchain/gas/config/obj-elf.c +++ b/gnu/dist/toolchain/gas/config/obj-elf.c @@ -17,7 +17,7 @@ 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. */ + 02111-1307, USA. */ #define OBJ_HEADER "obj-elf.h" #include "as.h" @@ -54,9 +54,12 @@ static bfd_vma elf_s_get_size PARAMS ((symbolS *)); 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 int elf_separate_stab_sections PARAMS ((void)); +static void elf_init_stab_section PARAMS ((segT)); #ifdef NEED_ECOFF_DEBUG static boolean elf_get_extr PARAMS ((asymbol *, EXTR *)); @@ -72,8 +75,6 @@ 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_symver PARAMS ((int)); -static void obj_elf_vtable_inherit PARAMS ((int)); -static void obj_elf_vtable_entry PARAMS ((int)); static void obj_elf_subsection PARAMS ((int)); static void obj_elf_popsection PARAMS ((int)); @@ -95,7 +96,7 @@ static const pseudo_typeS elf_pseudo_table[] = {"version", obj_elf_version, 0}, {"weak", obj_elf_weak, 0}, - /* These define symbol visibility. */ + /* These define symbol visibility. */ {"internal", obj_elf_visibility, STV_INTERNAL}, {"hidden", obj_elf_visibility, STV_HIDDEN}, {"protected", obj_elf_visibility, STV_PROTECTED}, @@ -110,10 +111,10 @@ static const pseudo_typeS elf_pseudo_table[] = {"subsection", obj_elf_subsection, 0}, /* These are GNU extensions to aid in garbage collecting C++ vtables. */ - {"vtable_inherit", obj_elf_vtable_inherit, 0}, - {"vtable_entry", obj_elf_vtable_entry, 0}, + {"vtable_inherit", (void (*) PARAMS ((int))) &obj_elf_vtable_inherit, 0}, + {"vtable_entry", (void (*) PARAMS ((int))) &obj_elf_vtable_entry, 0}, - /* These are used for dwarf. */ + /* These are used for dwarf. */ {"2byte", cons, 2}, {"4byte", cons, 4}, {"8byte", cons, 8}, @@ -233,6 +234,14 @@ elf_s_get_other (sym) return elf_symbol (symbol_get_bfdsym (sym))->internal_elf_sym.st_other; } +static void +elf_s_set_other (sym, other) + symbolS *sym; + int other; +{ + S_SET_OTHER (sym, other); +} + static void elf_copy_symbol_attributes (dest, src) symbolS *dest, *src; @@ -249,7 +258,7 @@ elf_sec_sym_ok_for_reloc (sec) void elf_file_symbol (s) - char *s; + const char *s; { symbolS *sym; @@ -533,7 +542,6 @@ obj_elf_visibility (visibility) demand_empty_rest_of_line (); } - static segT previous_section; static int previous_subsection; @@ -546,7 +554,6 @@ struct section_stack static struct section_stack *section_stack; - /* Handle the .section pseudo-op. This code supports two different syntaxes. @@ -617,8 +624,10 @@ obj_elf_change_section (name, type, attr, push) char *name; int type, attr, push; { - int new_sec; + asection *old_sec; segT sec; + flagword flags; + int i; #ifdef md_flush_pending_output md_flush_pending_output (); @@ -639,49 +648,57 @@ obj_elf_change_section (name, type, attr, push) previous_section = now_seg; previous_subsection = now_subseg; - new_sec = bfd_get_section_by_name (stdoutput, name) == NULL; + old_sec = bfd_get_section_by_name (stdoutput, name); sec = subseg_new (name, 0); - if (new_sec) - { - flagword flags; - symbolS *secsym; - int i; - - /* See if this is one of the special sections. */ - for (i = 0; special_sections[i].name != NULL; i++) - if (strcmp (name, special_sections[i].name) == 0) - { - if (type == SHT_NULL) - type = special_sections[i].type; - else if (type != special_sections[i].type) - as_warn (_("Setting incorrect section type for %s"), name); - - if ((attr &~ special_sections[i].attributes) != 0) + /* See if this is one of the special sections. */ + for (i = 0; special_sections[i].name != NULL; i++) + if (strcmp (name, special_sections[i].name) == 0) + { + if (type == SHT_NULL) + type = special_sections[i].type; + else if (type != special_sections[i].type) + { + if (old_sec == NULL) { - /* As a GNU extension, we permit a .note section to be - allocatable. If the linker sees an allocateable .note - section, it will create a PT_NOTE segment in the output - file. */ - if (strcmp (name, ".note") != 0 - || attr != SHF_ALLOC) - as_warn (_("Setting incorrect section attributes for %s"), - name); + as_warn (_("Setting incorrect section type for %s"), name); + } + else + { + as_warn (_("Ignoring incorrect section type for %s"), name); + type = special_sections[i].type; } - attr |= special_sections[i].attributes; - break; } + if ((attr &~ special_sections[i].attributes) != 0 + && old_sec == NULL) + { + /* As a GNU extension, we permit a .note section to be + allocatable. If the linker sees an allocateable .note + section, it will create a PT_NOTE segment in the output + file. */ + if (strcmp (name, ".note") != 0 + || attr != SHF_ALLOC) + as_warn (_("Setting incorrect section attributes for %s"), + name); + } + attr |= special_sections[i].attributes; + break; + } - /* Convert ELF type and flags to BFD flags. */ - flags = (SEC_RELOC - | ((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)); + /* Convert ELF type and flags to BFD flags. */ + flags = (SEC_RELOC + | ((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)); #ifdef md_elf_section_flags - flags = md_elf_section_flags (flags, attr, type); + flags = md_elf_section_flags (flags, attr, type); #endif + if (old_sec == NULL) + { + symbolS *secsym; + /* Prevent SEC_HAS_CONTENTS from being inadvertently set. */ if (type == SHT_NOBITS) seg_info (sec)->bss = 1; @@ -695,9 +712,19 @@ obj_elf_change_section (name, type, attr, push) else symbol_table_insert (section_symbol (sec)); } + else if (attr != 0) + { + /* If section attributes are specified the second time we see a + particular section, then check that they are the same as we + 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); + } #ifdef md_elf_section_change_hook - md_elf_section_change_hook (); + md_elf_section_change_hook (); #endif } @@ -802,7 +829,7 @@ obj_elf_section (push) char mri_type; #ifdef md_flush_pending_output - md_flush_pending_output (); + md_flush_pending_output (); #endif previous_section = now_seg; @@ -1054,7 +1081,7 @@ obj_elf_line (ignore) int ignore ATTRIBUTE_UNUSED; { /* Assume delimiter is part of expression. BSD4.2 as fails with - delightful bug, so we are not being incompatible here. */ + delightful bug, so we are not being incompatible here. */ new_logical_line ((char *) NULL, (int) (get_absolute_expression ())); demand_empty_rest_of_line (); } @@ -1080,14 +1107,6 @@ obj_elf_symver (ignore) *input_line_pointer = c; - if (symbol_get_obj (sym)->versioned_name != NULL) - { - as_bad (_("multiple .symver directives for symbol `%s'"), - S_GET_NAME (sym)); - ignore_rest_of_line (); - return; - } - SKIP_WHITESPACE (); if (*input_line_pointer != ',') { @@ -1106,16 +1125,34 @@ obj_elf_symver (ignore) *input_line_pointer++ = c; } - symbol_get_obj (sym)->versioned_name = xstrdup (name); - - *input_line_pointer = c; - - if (strchr (symbol_get_obj (sym)->versioned_name, ELF_VER_CHR) == NULL) + if (symbol_get_obj (sym)->versioned_name == NULL) { - as_bad (_("missing version name in `%s' for symbol `%s'"), - symbol_get_obj (sym)->versioned_name, S_GET_NAME (sym)); - ignore_rest_of_line (); - return; + symbol_get_obj (sym)->versioned_name = xstrdup (name); + + *input_line_pointer = c; + + if (strchr (symbol_get_obj (sym)->versioned_name, + ELF_VER_CHR) == NULL) + { + as_bad (_("missing version name in `%s' for symbol `%s'"), + symbol_get_obj (sym)->versioned_name, + S_GET_NAME (sym)); + ignore_rest_of_line (); + return; + } + } + else + { + if (strcmp (symbol_get_obj (sym)->versioned_name, name)) + { + as_bad (_("multiple versions [`%s'|`%s'] for symbol `%s'"), + name, symbol_get_obj (sym)->versioned_name, + S_GET_NAME (sym)); + ignore_rest_of_line (); + return; + } + + *input_line_pointer = c; } demand_empty_rest_of_line (); @@ -1125,7 +1162,7 @@ obj_elf_symver (ignore) to the linker the hierarchy in which a particular table resides. The syntax is ".vtable_inherit CHILDNAME, PARENTNAME". */ -static void +struct fix * obj_elf_vtable_inherit (ignore) int ignore ATTRIBUTE_UNUSED; { @@ -1158,7 +1195,7 @@ obj_elf_vtable_inherit (ignore) { as_bad ("expected comma after name in .vtable_inherit"); ignore_rest_of_line (); - return; + return NULL; } ++input_line_pointer; @@ -1185,19 +1222,19 @@ obj_elf_vtable_inherit (ignore) demand_empty_rest_of_line (); if (bad) - return; + return NULL; assert (symbol_get_value_expression (csym)->X_op == O_constant); - fix_new (symbol_get_frag (csym), - symbol_get_value_expression (csym)->X_add_number, 0, psym, 0, 0, - BFD_RELOC_VTABLE_INHERIT); + return fix_new (symbol_get_frag (csym), + symbol_get_value_expression (csym)->X_add_number, + 0, psym, 0, 0, BFD_RELOC_VTABLE_INHERIT); } /* This handles the .vtable_entry pseudo-op, which is used to indicate to the linker that a vtable slot was used. The syntax is ".vtable_entry tablename, offset". */ -static void +struct fix * obj_elf_vtable_entry (ignore) int ignore ATTRIBUTE_UNUSED; { @@ -1219,7 +1256,7 @@ obj_elf_vtable_entry (ignore) { as_bad ("expected comma after name in .vtable_entry"); ignore_rest_of_line (); - return; + return NULL; } ++input_line_pointer; @@ -1228,10 +1265,10 @@ obj_elf_vtable_entry (ignore) offset = get_absolute_expression (); - fix_new (frag_now, frag_now_fix (), 0, sym, offset, 0, - BFD_RELOC_VTABLE_ENTRY); - demand_empty_rest_of_line (); + + return fix_new (frag_now, frag_now_fix (), 0, sym, offset, 0, + BFD_RELOC_VTABLE_ENTRY); } void @@ -1277,7 +1314,7 @@ obj_elf_version (ignore) SKIP_WHITESPACE (); if (*input_line_pointer == '\"') { - ++input_line_pointer; /* -> 1st char of string. */ + ++input_line_pointer; /* -> 1st char of string. */ name = input_line_pointer; while (is_a_char (c = next_char_of_string ())) @@ -1370,7 +1407,7 @@ obj_elf_size (ignore) } /* Handle the ELF .type pseudo-op. This sets the type of a symbol. - There are four syntaxes: + There are five syntaxes: The first (used on Solaris) is .type SYM,#function @@ -1380,6 +1417,8 @@ obj_elf_size (ignore) .type SYM STT_FUNC The fourth (used on NetBSD/Arm and Linux/ARM) is .type SYM,%function + The fifth (used on SVR4/860) is + .type SYM,"function" */ static void @@ -1391,10 +1430,12 @@ obj_elf_type (ignore) int type; const char *typename; symbolS *sym; + elf_symbol_type *elfsym; name = input_line_pointer; c = get_symbol_end (); sym = symbol_find_or_make (name); + elfsym = (elf_symbol_type *) symbol_get_bfdsym (sym); *input_line_pointer = c; SKIP_WHITESPACE (); @@ -1404,6 +1445,7 @@ obj_elf_type (ignore) SKIP_WHITESPACE (); if ( *input_line_pointer == '#' || *input_line_pointer == '@' + || *input_line_pointer == '"' || *input_line_pointer == '%') ++input_line_pointer; @@ -1417,12 +1459,19 @@ obj_elf_type (ignore) else if (strcmp (typename, "object") == 0 || strcmp (typename, "STT_OBJECT") == 0) type = BSF_OBJECT; +#ifdef md_elf_symbol_type + else if ((type = md_elf_symbol_type (typename, sym, elfsym)) != -1) + ; +#endif else as_bad (_("ignoring unrecognized symbol type \"%s\""), typename); *input_line_pointer = c; - symbol_get_bfdsym (sym)->flags |= type; + if (*input_line_pointer == '"') + ++input_line_pointer; + + elfsym->symbol.flags |= type; demand_empty_rest_of_line (); } @@ -1471,9 +1520,9 @@ obj_elf_init_stab_section (seg) UnixWare ar crashes. */ bfd_set_section_alignment (stdoutput, seg, 2); - /* Make space for this first symbol. */ + /* Make space for this first symbol. */ p = frag_more (12); - /* Zero it out. */ + /* Zero it out. */ memset (p, 0, 12); as_where (&file, (unsigned int *) NULL); stabstr_name = (char *) alloca (strlen (segment_name (seg)) + 4); @@ -1605,6 +1654,11 @@ elf_frob_symbol (symp, puntp) if (sy_obj->versioned_name != NULL) { + char *p; + + p = strchr (sy_obj->versioned_name, ELF_VER_CHR); + know (p != NULL); + /* This symbol was given a new name with the .symver directive. If this is an external reference, just rename the symbol to @@ -1618,13 +1672,9 @@ elf_frob_symbol (symp, puntp) if (! S_IS_DEFINED (symp)) { - char *p; - /* Verify that the name isn't using the @@ syntax--this is reserved for definitions of the default version to link against. */ - p = strchr (sy_obj->versioned_name, ELF_VER_CHR); - know (p != NULL); if (p[1] == ELF_VER_CHR) { as_bad (_("invalid attempt to declare external version name as default in symbol `%s'"), @@ -1635,36 +1685,50 @@ elf_frob_symbol (symp, puntp) } else { - symbolS *symp2; + if (p [1] == ELF_VER_CHR && p [2] == ELF_VER_CHR) + { + size_t l; - /* FIXME: Creating a new symbol here is risky. We're in the - final loop over the symbol table. We can get away with - it only because the symbol goes to the end of the list, - where the loop will still see it. It would probably be - better to do this in obj_frob_file_before_adjust. */ + /* The @@@ syntax is a special case. It renames the + symbol name to versioned_name with one `@' removed. */ + l = strlen (&p[3]) + 1; + memmove (&p [2], &p[3], l); + S_SET_NAME (symp, sy_obj->versioned_name); + } + else + { + symbolS *symp2; - symp2 = symbol_find_or_make (sy_obj->versioned_name); + /* FIXME: Creating a new symbol here is risky. We're + in the final loop over the symbol table. We can + get away with it only because the symbol goes to + the end of the list, where the loop will still see + it. It would probably be better to do this in + obj_frob_file_before_adjust. */ - /* Now we act as though we saw symp2 = sym. */ + symp2 = symbol_find_or_make (sy_obj->versioned_name); - S_SET_SEGMENT (symp2, S_GET_SEGMENT (symp)); + /* Now we act as though we saw symp2 = sym. */ - /* Subtracting out the frag address here is a hack because - we are in the middle of the final loop. */ - S_SET_VALUE (symp2, - (S_GET_VALUE (symp) - - symbol_get_frag (symp)->fr_address)); + S_SET_SEGMENT (symp2, S_GET_SEGMENT (symp)); - symbol_set_frag (symp2, symbol_get_frag (symp)); + /* Subtracting out the frag address here is a hack + because we are in the middle of the final loop. */ + S_SET_VALUE (symp2, + (S_GET_VALUE (symp) + - symbol_get_frag (symp)->fr_address)); - /* This will copy over the size information. */ - copy_symbol_attributes (symp2, symp); + symbol_set_frag (symp2, symbol_get_frag (symp)); - if (S_IS_WEAK (symp)) - S_SET_WEAK (symp2); + /* This will copy over the size information. */ + copy_symbol_attributes (symp2, symp); - if (S_IS_EXTERNAL (symp)) - S_SET_EXTERNAL (symp2); + if (S_IS_WEAK (symp)) + S_SET_WEAK (symp2); + + if (S_IS_EXTERNAL (symp)) + S_SET_EXTERNAL (symp2); + } } } @@ -1715,6 +1779,42 @@ elf_frob_file () #endif } +/* It removes any unneeded versioned symbols from the symbol table. */ + +void +elf_frob_file_before_adjust () +{ + if (symbol_rootP) + { + symbolS *symp; + + for (symp = symbol_rootP; symp; symp = symbol_next (symp)) + if (symbol_get_obj (symp)->versioned_name) + { + if (!S_IS_DEFINED (symp)) + { + char *p; + + /* The @@@ syntax is a special case. If the symbol is + not defined, 2 `@'s will be removed from the + versioned_name. */ + + p = strchr (symbol_get_obj (symp)->versioned_name, + ELF_VER_CHR); + know (p != NULL); + if (p [1] == ELF_VER_CHR && p [2] == ELF_VER_CHR) + { + size_t l = strlen (&p[3]) + 1; + memmove (&p [1], &p[3], l); + } + if (symbol_used_p (symp) == 0 + && symbol_used_in_reloc_p (symp) == 0) + symbol_remove (symp, &symbol_rootP, &symbol_lastP); + } + } + } +} + /* It is required that we let write_relocs have the opportunity to optimize away fixups before output has begun, since it is possible to eliminate all fixups for a section and thus we never should @@ -1890,18 +1990,45 @@ sco_id () #endif /* SCO_ELF */ +static int +elf_separate_stab_sections () +{ +#ifdef NEED_ECOFF_DEBUG + return (!ECOFF_DEBUGGING); +#else + return 1; +#endif +} + +static void +elf_init_stab_section (seg) + segT seg; +{ +#ifdef NEED_ECOFF_DEBUG + if (!ECOFF_DEBUGGING) +#endif + obj_elf_init_stab_section (seg); +} + const struct format_ops elf_format_ops = { bfd_target_elf_flavour, 0, /* dfl_leading_underscore */ 1, /* emit_section_symbols */ + elf_begin, + elf_file_symbol, elf_frob_symbol, elf_frob_file, + elf_frob_file_before_adjust, elf_frob_file_after_relocs, elf_s_get_size, elf_s_set_size, elf_s_get_align, elf_s_set_align, elf_s_get_other, + elf_s_set_other, 0, /* s_get_desc */ + 0, /* s_set_desc */ + 0, /* s_get_type */ + 0, /* s_set_type */ elf_copy_symbol_attributes, #ifdef NEED_ECOFF_DEBUG ecoff_generate_asm_lineno, @@ -1910,6 +2037,8 @@ const struct format_ops elf_format_ops = 0, /* generate_asm_lineno */ 0, /* process_stab */ #endif + elf_separate_stab_sections, + elf_init_stab_section, elf_sec_sym_ok_for_reloc, elf_pop_insert, #ifdef NEED_ECOFF_DEBUG @@ -1918,5 +2047,5 @@ const struct format_ops elf_format_ops = 0, /* ecoff_set_ext */ #endif elf_obj_read_begin_hook, - elf_obj_symbol_new_hook, + elf_obj_symbol_new_hook }; diff --git a/gnu/dist/toolchain/gas/config/obj-elf.h b/gnu/dist/toolchain/gas/config/obj-elf.h index 722c5fdf94de..43daf64c0258 100644 --- a/gnu/dist/toolchain/gas/config/obj-elf.h +++ b/gnu/dist/toolchain/gas/config/obj-elf.h @@ -6,7 +6,7 @@ GAS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 1, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. GAS is distributed in the hope that it will be useful, @@ -19,7 +19,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - /* HP PA-RISC support was contributed by the Center for Software Science at the University of Utah. */ @@ -28,11 +27,14 @@ #define OBJ_ELF 1 +/* Note that all macros in this file should be wrapped in #ifndef, for + sake of obj-multi.h which includes this file. */ + #ifndef OUTPUT_FLAVOR #define OUTPUT_FLAVOR bfd_target_elf_flavour #endif -#include +#include "bfd.h" #define BYTES_IN_WORD 4 /* for now */ #include "bfd/elf-bfd.h" @@ -40,7 +42,7 @@ #include "targ-cpu.h" #ifdef TC_ALPHA -#define ECOFF_DEBUGGING alpha_flag_mdebug +#define ECOFF_DEBUGGING (alpha_flag_mdebug > 0) extern int alpha_flag_mdebug; #endif @@ -83,16 +85,26 @@ struct elf_obj_sy #define OBJ_SYMFIELD_TYPE struct elf_obj_sy +/* Symbol fields used by the ELF back end. */ +#define ELF_TARGET_SYMBOL_FIELDS int local:1; + +/* Don't change this; change ELF_TARGET_SYMBOL_FIELDS instead. */ +#define TARGET_SYMBOL_FIELDS ELF_TARGET_SYMBOL_FIELDS + +/* #include "targ-cpu.h" */ + #ifndef FALSE #define FALSE 0 #define TRUE !FALSE #endif +#ifndef obj_begin #define obj_begin() elf_begin () +#endif extern void elf_begin PARAMS ((void)); /* should be conditional on address size! */ -#define elf_symbol(asymbol) ((elf_symbol_type *)(&(asymbol)->the_bfd)) +#define elf_symbol(asymbol) ((elf_symbol_type *) (&(asymbol)->the_bfd)) #ifndef S_GET_SIZE #define S_GET_SIZE(S) \ @@ -128,13 +140,20 @@ extern asection *gdb_section; #endif extern void elf_frob_file PARAMS ((void)); +#ifndef obj_frob_file_before_adjust +#define obj_frob_file_before_adjust elf_frob_file_before_adjust +#endif +extern void elf_frob_file_before_adjust PARAMS ((void)); + #ifndef obj_frob_file_after_relocs #define obj_frob_file_after_relocs elf_frob_file_after_relocs #endif extern void elf_frob_file_after_relocs PARAMS ((void)); +#ifndef obj_app_file #define obj_app_file elf_file_symbol -extern void elf_file_symbol PARAMS ((char *)); +#endif +extern void elf_file_symbol PARAMS ((const char *)); extern void obj_elf_section_change_hook PARAMS ((void)); @@ -144,6 +163,8 @@ extern void obj_elf_version PARAMS ((int)); extern void obj_elf_common PARAMS ((int)); extern void obj_elf_data PARAMS ((int)); extern void obj_elf_text PARAMS ((int)); +extern struct fix *obj_elf_vtable_inherit PARAMS ((int)); +extern struct fix *obj_elf_vtable_entry PARAMS ((int)); /* BFD wants to write the udata field, which is a no-no for the globally defined sections. */ @@ -189,6 +210,12 @@ do \ while (0) #endif +#ifndef SEPARATE_STAB_SECTIONS +/* Avoid ifndef each separate macro setting by wrapping the whole of the + stab group on the assumption that whoever sets SEPARATE_STAB_SECTIONS + caters to ECOFF_DEBUGGING and the right setting of INIT_STAB_SECTIONS + and OBJ_PROCESS_STAB too, without needing the tweaks below. */ + /* Stabs go in a separate section. */ #define SEPARATE_STAB_SECTIONS 1 @@ -206,7 +233,7 @@ extern void obj_elf_init_stab_section PARAMS ((segT)); #undef INIT_STAB_SECTION #define INIT_STAB_SECTION(seg) \ - ((void)(ECOFF_DEBUGGING ? 0 : (obj_elf_init_stab_section (seg), 0))) + ((void) (ECOFF_DEBUGGING ? 0 : (obj_elf_init_stab_section (seg), 0))) #undef OBJ_PROCESS_STAB #define OBJ_PROCESS_STAB(seg, what, string, type, other, desc) \ @@ -214,6 +241,8 @@ extern void obj_elf_init_stab_section PARAMS ((segT)); ecoff_stab ((seg), (what), (string), (type), (other), (desc)) #endif /* ECOFF_DEBUGGING */ +#endif /* SEPARATE_STAB_SECTIONS not defined. */ + extern void elf_frob_symbol PARAMS ((symbolS *, int *)); #ifndef obj_frob_symbol #define obj_frob_symbol(symp, punt) elf_frob_symbol (symp, &punt) diff --git a/gnu/dist/toolchain/gas/config/obj-evax.h b/gnu/dist/toolchain/gas/config/obj-evax.h index 745b1feff976..351003c7598e 100644 --- a/gnu/dist/toolchain/gas/config/obj-evax.h +++ b/gnu/dist/toolchain/gas/config/obj-evax.h @@ -25,10 +25,10 @@ * object format specific header files. */ -/* define an obj specific macro off which target cpu back ends may key. */ +/* define an obj specific macro off which target cpu back ends may key. */ #define OBJ_EVAX 1 -/* include whatever target cpu is appropriate. */ +/* include whatever target cpu is appropriate. */ #include "targ-cpu.h" #ifdef BFD_ASSEMBLER @@ -60,7 +60,7 @@ typedef void *object_headers; #define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (0) /* your magic number */ -#define OBJ_EMIT_LINENO(a,b,c) /* must be *something*. This no-op's it out. */ +#define OBJ_EMIT_LINENO(a,b,c) /* must be *something*. This no-op's it out. */ #define obj_symbol_new_hook(s) {;} @@ -93,5 +93,3 @@ typedef void *object_headers; * fill-column: 131 * End: */ - -/* end of obj-evax.h */ diff --git a/gnu/dist/toolchain/gas/config/obj-generic.h b/gnu/dist/toolchain/gas/config/obj-generic.h index dc18e4397034..00e46382f58e 100644 --- a/gnu/dist/toolchain/gas/config/obj-generic.h +++ b/gnu/dist/toolchain/gas/config/obj-generic.h @@ -1,5 +1,5 @@ /* This file is obj-generic.h - Copyright (C) 1987-1992 Free Software Foundation, Inc. + Copyright (C) 1987-1992, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -14,18 +14,19 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with GAS; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ /* * This file is obj-generic.h and is intended to be a template for * object format specific header files. */ -/* define an obj specific macro off which target cpu back ends may key. */ +/* define an obj specific macro off which target cpu back ends may key. */ #define OBJ_GENERIC 1 -/* include whatever target cpu is appropriate. */ +/* include whatever target cpu is appropriate. */ #include "targ-cpu.h" /* @@ -65,10 +66,9 @@ typedef void *object_headers; /* symbols may or may not be defined */ #define S_IS_DEFINED(s) (0) - #define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE (0) /* your magic number */ -#define OBJ_EMIT_LINENO(a,b,c) /* must be *something*. This no-op's it out. */ +#define OBJ_EMIT_LINENO(a,b,c) /* must be *something*. This no-op's it out. */ /* * Local Variables: @@ -76,5 +76,3 @@ typedef void *object_headers; * fill-column: 131 * End: */ - -/* end of obj-generic.h */ diff --git a/gnu/dist/toolchain/gas/config/obj-hp300.c b/gnu/dist/toolchain/gas/config/obj-hp300.c index 6e9cc53927a5..22a403206885 100644 --- a/gnu/dist/toolchain/gas/config/obj-hp300.c +++ b/gnu/dist/toolchain/gas/config/obj-hp300.c @@ -1,5 +1,5 @@ /* This file is obj-hp300.h - Copyright (C) 1993 Free Software Foundation, Inc. + Copyright (C) 1993, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -14,8 +14,9 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with GAS; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ #include "config/obj-aout.c" @@ -36,17 +37,17 @@ hp300_header_append (where, headers) DO (a_info); DO (a_spare1); DO (a_spare2); - DO (a_text); - DO (a_data); - DO (a_bss); - DO (a_trsize); + DO (a_text); + DO (a_data); + DO (a_bss); + DO (a_trsize); DO (a_drsize); DO (a_spare3); DO (a_spare4); DO (a_spare5); - DO (a_entry); + DO (a_entry); DO (a_spare6); DO (a_spare7); - DO (a_syms); + DO (a_syms); DO (a_spare8); } diff --git a/gnu/dist/toolchain/gas/config/obj-hp300.h b/gnu/dist/toolchain/gas/config/obj-hp300.h index ff4006b60402..88733d8c6f25 100644 --- a/gnu/dist/toolchain/gas/config/obj-hp300.h +++ b/gnu/dist/toolchain/gas/config/obj-hp300.h @@ -1,5 +1,5 @@ /* This file is obj-hp300.h - Copyright (C) 1993 Free Software Foundation, Inc. + Copyright (C) 1993, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -14,8 +14,9 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with GAS; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ #define __STRUCT_EXEC_OVERRIDE__ @@ -47,18 +48,18 @@ struct exec unsigned long a_info; unsigned long a_spare1; unsigned long a_spare2; - unsigned long a_text; - unsigned long a_data; - unsigned long a_bss; - unsigned long a_trsize; + unsigned long a_text; + unsigned long a_data; + unsigned long a_bss; + unsigned long a_trsize; unsigned long a_drsize; unsigned long a_spare3; unsigned long a_spare4; unsigned long a_spare5; - unsigned long a_entry; + unsigned long a_entry; unsigned long a_spare6; unsigned long a_spare7; - unsigned long a_syms; + unsigned long a_syms; unsigned long a_spare8; }; @@ -66,6 +67,6 @@ struct exec #define AOUT_VERSION 0x02 #define AOUT_MACHTYPE 0x0c #define OMAGIC 0x106 - + #define obj_header_append hp300_header_append #include "config/obj-aout.h" diff --git a/gnu/dist/toolchain/gas/config/obj-ieee.c b/gnu/dist/toolchain/gas/config/obj-ieee.c index 30a0798e2952..35b49da2bd7d 100644 --- a/gnu/dist/toolchain/gas/config/obj-ieee.c +++ b/gnu/dist/toolchain/gas/config/obj-ieee.c @@ -1,5 +1,6 @@ /* obj-format for ieee-695 records. - Copyright (C) 1991, 92, 93, 94, 95, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1991, 92, 93, 94, 95, 97, 98, 2000 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -16,19 +17,12 @@ 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. */ + 02111-1307, USA. */ +/* Created by Steve Chamberlain . */ -/* - created by - - steve chamberlain steve@cygnus.com - */ - -/* - this will hopefully become the port through which bfd and gas talk, - for the moment, only ieee is known to work well. - */ +/* This will hopefully become the port through which bfd and gas talk, + for the moment, only ieee is known to work well. */ #include "bfd.h" #include "as.h" @@ -38,11 +32,15 @@ bfd *abfd; -/* How many addresses does the .align take? */ +/* How many addresses does the .align take? */ + static relax_addressT relax_align (address, alignment) - register relax_addressT address; /* Address now. */ - register long alignment; /* Alignment (binary). */ + /* Address now. */ + register relax_addressT address; + + /* Alignment (binary). */ + register long alignment; { relax_addressT mask; relax_addressT new_address; @@ -50,18 +48,20 @@ relax_align (address, alignment) mask = ~((~0) << alignment); new_address = (address + mask) & (~mask); return (new_address - address); -} /* relax_align() */ +} + +/* Calculate the size of the frag chain + and create a bfd section to contain all of it. */ -/* calculate the size of the frag chain and create a bfd section - to contain all of it */ static void -DEFUN (size_section, (abfd, idx), - bfd * abfd AND - unsigned int idx) +size_section (abfd, idx) + bfd *abfd; + unsigned int idx; { asection *sec; unsigned int size = 0; fragS *frag = segment_info[idx].frag_root; + while (frag) { if (frag->fr_address != size) @@ -92,25 +92,28 @@ DEFUN (size_section, (abfd, idx), if (size) { char *name = segment_info[idx].name; + if (name == (char *) NULL) - { - name = ".data"; - } - segment_info[idx].user_stuff = (char *) (sec = bfd_make_section (abfd, name)); - /* Make it output through itself */ + name = ".data"; + + segment_info[idx].user_stuff = + (char *) (sec = bfd_make_section (abfd, name)); + /* Make it output through itself. */ sec->output_section = sec; sec->flags |= SEC_HAS_CONTENTS; bfd_set_section_size (abfd, sec, size); } } -/* run through a frag chain and write out the data to go with it */ +/* Run through a frag chain and write out the data to go with it. */ + static void -DEFUN (fill_section, (abfd, idx), - bfd * abfd AND - unsigned int idx) +fill_section (abfd, idx) + bfd *abfd; + unsigned int idx; { asection *sec = segment_info[idx].user_stuff; + if (sec) { fragS *frag = segment_info[idx].frag_root; @@ -156,16 +159,16 @@ DEFUN (fill_section, (abfd, idx), } } -/* Count the relocations in a chain */ +/* Count the relocations in a chain. */ static unsigned int -DEFUN (count_entries_in_chain, (idx), - unsigned int idx) +count_entries_in_chain (idx) + unsigned int idx; { unsigned int nrelocs; fixS *fixup_ptr; - /* Count the relocations */ + /* Count the relocations. */ fixup_ptr = segment_info[idx].fix_root; nrelocs = 0; while (fixup_ptr != (fixS *) NULL) @@ -176,10 +179,11 @@ DEFUN (count_entries_in_chain, (idx), return nrelocs; } -/* output all the relocations for a section */ +/* Output all the relocations for a section. */ + void -DEFUN (do_relocs_for, (idx), - unsigned int idx) +do_relocs_for (idx) + unsigned int idx; { unsigned int nrelocs; arelent **reloc_ptr_vector; @@ -188,11 +192,13 @@ DEFUN (do_relocs_for, (idx), asection *section = (asection *) (segment_info[idx].user_stuff); unsigned int i; fixS *from; + if (section) { nrelocs = count_entries_in_chain (idx); - reloc_ptr_vector = (arelent **) malloc ((nrelocs + 1) * sizeof (arelent *)); + reloc_ptr_vector = + (arelent **) malloc ((nrelocs + 1) * sizeof (arelent *)); reloc_vector = (arelent *) malloc (nrelocs * sizeof (arelent)); ptrs = (asymbol **) malloc (nrelocs * sizeof (asymbol *)); from = segment_info[idx].fix_root; @@ -203,8 +209,10 @@ DEFUN (do_relocs_for, (idx), reloc_ptr_vector[i] = to; to->howto = (reloc_howto_type *) (from->fx_r_type); -#if 0 /* We can't represent complicated things in a reloc yet */ - if (from->fx_addsy == 0 || from->fx_subsy != 0) abort(); +#if 0 + /* We can't represent complicated things in a reloc yet. */ + if (from->fx_addsy == 0 || from->fx_subsy != 0) + abort (); #endif s = &(from->fx_addsy->sy_symbol.sy); @@ -218,7 +226,7 @@ DEFUN (do_relocs_for, (idx), If this relocation is pcrelative, and we know the destination, we still want to keep the relocation - since the linker might relax some of the bytes, but it stops - being pc relative and turns into an absolute relocation. */ + being pc relative and turns into an absolute relocation. */ if (s) { if ((s->flags & BSF_UNDEFINED) == 0) @@ -233,10 +241,9 @@ DEFUN (do_relocs_for, (idx), to->sym_ptr_ptr = 0; if (to->howto->pcrel_offset) - { - /* This is a pcrel relocation, the addend should be adjusted */ - to->addend -= to->address + 1; - } + /* This is a pcrel relocation, the addend should + be adjusted. */ + to->addend -= to->address + 1; } else { @@ -245,33 +252,30 @@ DEFUN (do_relocs_for, (idx), to->sym_ptr_ptr = ptrs; if (to->howto->pcrel_offset) - { - /* This is a pcrel relocation, the addend should be adjusted */ - to->addend -= to->address - 1; - } + /* This is a pcrel relocation, the addend should + be adjusted. */ + to->addend -= to->address - 1; } - } else - { - to->section = 0; - } + to->section = 0; ptrs++; from = from->fx_next; } - /* attatch to the section */ + /* Attatch to the section. */ section->orelocation = reloc_ptr_vector; section->reloc_count = nrelocs; section->flags |= SEC_LOAD; } } -/* do the symbols.. */ +/* Do the symbols. */ + static void -DEFUN (do_symbols, (abfd), - bfd * abfd) +do_symbols (abfd) + bfd *abfd; { extern symbolS *symbol_rootP; symbolS *ptr; @@ -280,7 +284,6 @@ DEFUN (do_symbols, (abfd), unsigned int count = 0; unsigned int index; - for (ptr = symbol_rootP; ptr != (symbolS *) NULL; ptr = ptr->sy_next) @@ -291,9 +294,7 @@ DEFUN (do_symbols, (abfd), (asection *) (segment_info[ptr->sy_symbol.seg].user_stuff); S_SET_VALUE (ptr, S_GET_VALUE (ptr) + ptr->sy_frag->fr_address); if (ptr->sy_symbol.sy.flags == 0) - { - ptr->sy_symbol.sy.flags = BSF_LOCAL; - } + ptr->sy_symbol.sy.flags = BSF_LOCAL; } else { @@ -330,18 +331,15 @@ DEFUN (do_symbols, (abfd), } /* The generic as->bfd converter. Other backends may have special case - code */ + code. */ void -DEFUN_VOID (bfd_as_write_hook) +bfd_as_write_hook () { int i; for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - size_section (abfd, i); - } - + size_section (abfd, i); for (i = SEG_E0; i < SEG_UNKNOWN; i++) fill_section (abfd, i); @@ -350,7 +348,6 @@ DEFUN_VOID (bfd_as_write_hook) for (i = SEG_E0; i < SEG_UNKNOWN; i++) do_relocs_for (i); - } S_SET_SEGMENT (x, y) @@ -437,7 +434,8 @@ obj_ieee_section (ignore) char *p = input_line_pointer; char *s = p; int i; - /* Look up the name, if it doesn't exist, make it */ + + /* Look up the name, if it doesn't exist, make it. */ while (*p && *p != ' ' && *p != ',' && !is_end_of_line[*p]) { p++; @@ -447,10 +445,7 @@ obj_ieee_section (ignore) if (segment_info[i].hadone) { if (strncmp (segment_info[i].name, s, p - s) == 0) - { - goto ok; - - } + goto ok; } else break; @@ -470,32 +465,26 @@ ok: while (!is_end_of_line[*p]) p++; input_line_pointer = p; - } - void cons (); void s_ignore (); - void s_globl (); const pseudo_typeS obj_pseudo_table[] = { {"section", obj_ieee_section, 0}, - {"data.b", cons, 1}, - {"data.w", cons, 2}, - {"data.l", cons, 4}, - {"export", s_globl, 0}, - {"option", s_ignore, 0}, - {"end", s_ignore, 0}, - {"import", s_ignore, 0}, - {"sdata", stringer, 0}, + {"data.b" , cons , 1}, + {"data.w" , cons , 2}, + {"data.l" , cons , 4}, + {"export" , s_globl , 0}, + {"option" , s_ignore , 0}, + {"end" , s_ignore , 0}, + {"import" , s_ignore , 0}, + {"sdata" , stringer , 0}, 0, - }; - - void obj_symbol_new_hook (symbolP) symbolS *symbolP; @@ -503,13 +492,9 @@ obj_symbol_new_hook (symbolP) symbolP->sy_symbol.sy.the_bfd = abfd; } - - - - #if 1 extern void -DEFUN_VOID (write_object_file) +write_object_file () { int i; struct frchain *frchain_ptr; @@ -531,10 +516,10 @@ DEFUN_VOID (write_object_file) frchain_ptr != (struct frchain *) NULL; frchain_ptr = frchain_ptr->frch_next) { - /* Run through all the sub-segments and align them up. Also close any - open frags. We tack a .fill onto the end of the frag chain so - that any .align's size can be worked by looking at the next - frag. */ + /* Run through all the sub-segments and align them up. Also + close any open frags. We tack a .fill onto the end of the + frag chain so that any .align's size can be worked by looking + at the next frag. */ subseg_set (frchain_ptr->frch_seg, frchain_ptr->frch_subseg); #ifndef SUB_SEGMENT_ALIGN @@ -547,18 +532,19 @@ DEFUN_VOID (write_object_file) } /* Now build one big frag chain for each segment, linked through - fr_next. */ + fr_next. */ for (i = SEG_E0; i < SEG_UNKNOWN; i++) { - fragS **prev_frag_ptr_ptr; struct frchain *next_frchain_ptr; - /* struct frag **head_ptr = segment_info[i].frag_root;*/ +#if 0 + struct frag **head_ptr = segment_info[i].frag_root; +#endif segment_info[i].frag_root = segment_info[i].frchainP->frch_root; #if 0 - /* Im not sure what this is for */ + /* I'm not sure what this is for. */ for (frchain_ptr = segment_info[i].frchainP->frch_root; frchain_ptr != (struct frchain *) NULL; frchain_ptr = frchain_ptr->frch_next) @@ -566,17 +552,13 @@ DEFUN_VOID (write_object_file) *head_ptr = frchain_ptr; head_ptr = &frchain_ptr->next; } - - #endif } for (i = SEG_E0; i < SEG_UNKNOWN; i++) - { - relax_segment (segment_info[i].frag_root, i); - } + relax_segment (segment_info[i].frag_root, i); - /* Now the addresses of the frags are correct within the segment */ + /* Now the addresses of the frags are correct within the segment. */ bfd_as_write_hook (); bfd_close (abfd); @@ -623,5 +605,3 @@ H_GET_TEXT_RELOCATION_SIZE () { abort (); } - -/* end of obj-ieee.c */ diff --git a/gnu/dist/toolchain/gas/config/obj-ieee.h b/gnu/dist/toolchain/gas/config/obj-ieee.h index 4a0f126ebe43..fbef1cd2578a 100644 --- a/gnu/dist/toolchain/gas/config/obj-ieee.h +++ b/gnu/dist/toolchain/gas/config/obj-ieee.h @@ -1,6 +1,5 @@ /* This file is obj-ieee.h - - Copyright (C) 1987-1992 Free Software Foundation, Inc. + Copyright (C) 1987-1992, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -15,12 +14,13 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + along with GAS; see the file COPYING. If not, write to the Free + Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. */ #define BFD 1 -#include +#include "bfd.h" typedef struct { @@ -41,10 +41,6 @@ object_headers; #define DEFAULT_MAGIC_NUMBER_FOR_OBJECT_FILE 1 - int lineno_rootP; - #define IEEE_STYLE - -/* end of obj-ieee.h */ diff --git a/gnu/dist/toolchain/gas/config/obj-multi.h b/gnu/dist/toolchain/gas/config/obj-multi.h index 42b7eb33e3c4..1d68a0c87316 100644 --- a/gnu/dist/toolchain/gas/config/obj-multi.h +++ b/gnu/dist/toolchain/gas/config/obj-multi.h @@ -6,7 +6,7 @@ GAS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 1, or (at your option) + the Free Software Foundation; either version 2, or (at your option) any later version. GAS is distributed in the hope that it will be useful, @@ -32,6 +32,16 @@ #define OUTPUT_FLAVOR \ (this_format->flavor) +#define obj_begin() \ + (this_format->begin \ + ? (*this_format->begin) () \ + : (void) 0) + +#define obj_app_file(NAME) \ + (this_format->app_file \ + ? (*this_format->app_file) (NAME) \ + : (void) 0) + #define obj_frob_symbol(S,P) \ (*this_format->frob_symbol) (S, &(P)) @@ -40,6 +50,11 @@ ? (*this_format->frob_file) () \ : (void) 0) +#define obj_frob_file_before_adjust() \ + (this_format->frob_file_before_adjust \ + ? (*this_format->frob_file_before_adjust) () \ + : (void) 0) + #define obj_frob_file_after_relocs() \ (this_format->frob_file_after_relocs \ ? (*this_format->frob_file_after_relocs) () \ @@ -69,21 +84,43 @@ #define S_GET_SIZE \ (*this_format->s_get_size) -#define S_SET_SIZE \ - (*this_format->s_set_size) +#define S_SET_SIZE(S, N) \ + (this_format->s_set_size \ + ? (*this_format->s_set_size) (S, N) \ + : (void) 0) #define S_GET_ALIGN \ (*this_format->s_get_align) -#define S_SET_ALIGN \ - (*this_format->s_set_align) +#define S_SET_ALIGN(S, N) \ + (this_format->s_set_align \ + ? (*this_format->s_set_align) (S, N) \ + : (void) 0) #define S_GET_OTHER \ (*this_format->s_get_other) +#define S_SET_OTHER(S, O) \ + (this_format->s_set_other \ + ? (*this_format->s_set_other) (S, O) \ + : (void) 0) + #define S_GET_DESC \ (*this_format->s_get_desc) +#define S_SET_DESC(S, D) \ + (this_format->s_set_desc \ + ? (*this_format->s_set_desc) (S, D) \ + : (void) 0) + +#define S_GET_TYPE \ + (*this_format->s_get_desc) + +#define S_SET_TYPE(S, T) \ + (this_format->s_set_type \ + ? (*this_format->s_set_type) (S, T) \ + : (void) 0) + #define OBJ_COPY_SYMBOL_ATTRIBUTES(d,s) \ (this_format->copy_symbol_attributes \ ? (*this_format->copy_symbol_attributes) (d, s) \ @@ -94,11 +131,27 @@ ? (*this_format->process_stab) (SEG,W,S,T,O,D) \ : (void) 0) +#define SEPARATE_STAB_SECTIONS \ + ((*this_format->separate_stab_sections) ()) + +#define INIT_STAB_SECTION(S) \ + (this_format->init_stab_section \ + ? (*this_format->init_stab_section) (S) \ + : (void) 0) + +#define EMIT_SECTION_SYMBOLS (this_format->emit_section_symbols) + #ifdef OBJ_MAYBE_ELF /* We need OBJ_SYMFIELD_TYPE so that symbol_get_obj is defined in symbol.c We also need various STAB defines for stab.c */ #include "obj-elf.h" #endif +#ifdef OBJ_MAYBE_AOUT +/* We want aout_process_stab in stabs.c for the aout table. Defining this + macro will have no other effect. */ +#define AOUT_STABS +#endif + #endif /* !OBJ_HEADER */ #endif /* _OBJ_MULTI_H */ diff --git a/gnu/dist/toolchain/gas/config/obj-som.c b/gnu/dist/toolchain/gas/config/obj-som.c index 65d4adad58cc..f878192397e5 100644 --- a/gnu/dist/toolchain/gas/config/obj-som.c +++ b/gnu/dist/toolchain/gas/config/obj-som.c @@ -1,5 +1,5 @@ /* SOM object file format. - Copyright (C) 1993, 1998 Free Software Foundation, Inc. + Copyright (C) 1993, 1998, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -30,7 +30,8 @@ static void obj_som_weak PARAMS ((int)); const pseudo_typeS obj_pseudo_table[] = { - {"weak", obj_som_weak, 0} + {"weak", obj_som_weak, 0}, + {NULL, NULL, 0} }; static int version_seen = 0; @@ -38,12 +39,16 @@ static int copyright_seen = 0; static int compiler_seen = 0; /* Unused by SOM. */ -void obj_read_begin_hook () {} + +void +obj_read_begin_hook () +{ +} /* Handle a .compiler directive. This is intended to create the compilation unit auxiliary header for MPE such that the linkeditor can handle SOM extraction from archives. The format of the quoted - string is "sourcefile language version" and is delimited by blanks.*/ + string is "sourcefile language version" and is delimited by blanks. */ void obj_som_compiler (unused) @@ -93,8 +98,9 @@ obj_som_compiler (unused) } *p = '\000'; - language_name = ++p; - while (*p != ' ' && *p != '\000') p++; + language_name = ++p; + while (*p != ' ' && *p != '\000') + p++; if (*p == '\000') { as_bad (".compiler directive missing version"); @@ -102,8 +108,9 @@ obj_som_compiler (unused) } *p = '\000'; - version_id = ++p; - while (*p != '\000') p++; + version_id = ++p; + while (*p != '\000') + p++; /* Remove the trailing quote. */ *(--p) = '\000'; @@ -154,7 +161,8 @@ obj_som_version (unused) if (bfd_som_attach_aux_hdr (stdoutput, VERSION_AUX_ID, version) == false) { bfd_perror (stdoutput->filename); - as_perror (_("FATAL: Attaching version header %s"), stdoutput->filename); + as_perror (_("FATAL: Attaching version header %s"), + stdoutput->filename); exit (EXIT_FAILURE); } *input_line_pointer = c; @@ -199,7 +207,8 @@ obj_som_copyright (unused) if (bfd_som_attach_aux_hdr (stdoutput, COPYRIGHT_AUX_ID, copyright) == false) { bfd_perror (stdoutput->filename); - as_perror (_("FATAL: Attaching copyright header %s"), stdoutput->filename); + as_perror (_("FATAL: Attaching copyright header %s"), + stdoutput->filename); exit (EXIT_FAILURE); } *input_line_pointer = c; @@ -227,7 +236,7 @@ obj_som_init_stab_section (seg) space = bfd_make_section_old_way (stdoutput, "$GDB_DEBUG$"); /* Set SOM specific attributes for the space. In particular we set - the space "defined", "private", "sort_key", and "spnum" values. + the space "defined", "private", "sort_key", and "spnum" values. Due to a bug in pxdb (called by hpux linker), the sort keys of the various stabs spaces/subspaces need to be "small". We @@ -244,7 +253,7 @@ obj_som_init_stab_section (seg) /* Make some space for the first special stab entry and zero the memory. It contains information about the length of this file's - stab string and the like. Using it avoids the need to + stab string and the like. Using it avoids the need to relocate the stab strings. The $GDB_STRINGS$ space will be created as a side effect of @@ -313,7 +322,7 @@ obj_som_weak (ignore) char *name; int c; symbolS *symbolP; - + do { name = input_line_pointer; @@ -326,14 +335,13 @@ obj_som_weak (ignore) symbol_get_obj (symbolP)->local = 1; #endif if (c == ',') - { - input_line_pointer++; - SKIP_WHITESPACE (); - if (*input_line_pointer == '\n') - c = '\n'; - } + { + input_line_pointer++; + SKIP_WHITESPACE (); + if (*input_line_pointer == '\n') + c = '\n'; + } } while (c == ','); demand_empty_rest_of_line (); } - diff --git a/gnu/dist/toolchain/gas/config/obj-som.h b/gnu/dist/toolchain/gas/config/obj-som.h index 62087b125f7a..6ed56b96a606 100644 --- a/gnu/dist/toolchain/gas/config/obj-som.h +++ b/gnu/dist/toolchain/gas/config/obj-som.h @@ -26,7 +26,7 @@ #define OBJ_SOM 1 -#include +#include "bfd.h" #include "bfd/som.h" #include "targ-cpu.h" @@ -36,7 +36,7 @@ #endif /* should be conditional on address size! */ -#define som_symbol(asymbol) ((som_symbol_type *)(&(asymbol)->the_bfd)) +#define som_symbol(asymbol) ((som_symbol_type *) (&(asymbol)->the_bfd)) extern void som_file_symbol PARAMS ((char *)); extern void obj_som_version PARAMS ((int)); diff --git a/gnu/dist/toolchain/gas/config/obj-vms.c b/gnu/dist/toolchain/gas/config/obj-vms.c index 0f08f8eb3f32..0e765f3c2f52 100644 --- a/gnu/dist/toolchain/gas/config/obj-vms.c +++ b/gnu/dist/toolchain/gas/config/obj-vms.c @@ -1,5 +1,6 @@ /* vms.c -- Write out a VAX/VMS object file - Copyright (C) 1987, 88, 92, 94, 95, 97, 1998 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 92, 94, 95, 97, 98, 2000 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -30,10 +31,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "subsegs.h" #include "obstack.h" -/* What we do if there is a goof. */ +/* What we do if there is a goof. */ #define error as_fatal -#ifdef VMS /* These are of no use if we are cross assembling. */ +#ifdef VMS /* These are of no use if we are cross assembling. */ #include /* Define File Access Block */ #include /* Define NAM Block */ #include /* Define XAB - all different types*/ @@ -102,7 +103,6 @@ struct input_file static struct input_file *file_root = (struct input_file *) NULL; - /* * Styles of PSECTS (program sections) that we generate; just shorthand * to avoid lists of section attributes. Used by VMS_Psect_Spec(). @@ -154,7 +154,7 @@ struct VMS_DBG_Symbol }; #define SYMTYPLST_SIZE (1<<4) /* 16; must be power of two */ -#define SYMTYP_HASH(x) ((unsigned)(x) & (SYMTYPLST_SIZE-1)) +#define SYMTYP_HASH(x) ((unsigned) (x) & (SYMTYPLST_SIZE-1)) struct VMS_DBG_Symbol *VMS_Symbol_type_list[SYMTYPLST_SIZE]; /* @@ -253,10 +253,9 @@ static int total_len; /* used to calculate the total length of variable descriptor plus array descriptor - used for len byte*/ /* Flag if we have told user about finding global constants in the text - section. */ + section. */ static int gave_compiler_message = 0; - /* * Global data (Object records limited to 512 bytes by VAX-11 "C" runtime) */ @@ -269,8 +268,8 @@ static int Current_Object_Record_Type; /* Type of record in above */ * Macros for moving data around. Must work on big-endian systems. */ #ifdef VMS /* These are more efficient for VMS->VMS systems */ -#define COPY_LONG(dest,val) ( *(long *)(dest) = (val) ) -#define COPY_SHORT(dest,val) ( *(short *)(dest) = (val) ) +#define COPY_LONG(dest,val) ( *(long *) (dest) = (val) ) +#define COPY_SHORT(dest,val) ( *(short *) (dest) = (val) ) #else #define COPY_LONG(dest,val) md_number_to_chars ((dest), (val), 4) #define COPY_SHORT(dest,val) md_number_to_chars ((dest), (val), 2) @@ -447,7 +446,6 @@ const pseudo_typeS obj_pseudo_table[] = {0, 0, 0}, }; /* obj_pseudo_table */ - /* Routine to perform RESOLVE_SYMBOL_REDEFINITION(). */ int @@ -484,7 +482,6 @@ vms_resolve_symbol_redef (sym) return 0; } - /* `tc_frob_label' handler for colon(symbols.c), used to examine the dummy label(s) gcc inserts at the beginning of each file it generates. gcc 1.x put "gcc_compiled."; gcc 2.x (as of 2.7) puts "gcc2_compiled." @@ -518,14 +515,12 @@ symbolS *symbolP; return; } - void obj_read_begin_hook () { return; } - void obj_crawl_symbol_chain (headers) object_headers *headers; @@ -534,7 +529,7 @@ obj_crawl_symbol_chain (headers) symbolS **symbolPP; int symbol_number = 0; - symbolPP = &symbol_rootP; /* -> last symbol chain link. */ + symbolPP = &symbol_rootP; /* -> last symbol chain link. */ while ((symbolP = *symbolPP) != NULL) { resolve_symbol_value (symbolP, 1); @@ -564,7 +559,7 @@ obj_crawl_symbol_chain (headers) if (S_IS_EXTERNAL (symbolP) || !S_IS_DEFINED (symbolP)) { as_bad (_("Local symbol %s never defined"), S_GET_NAME (symbolP)); - } /* oops. */ + } /* oops. */ /* Unhook it from the chain. */ *symbolPP = symbol_next (symbolP); @@ -579,7 +574,6 @@ obj_crawl_symbol_chain (headers) /****** VMS OBJECT FILE HACKING ROUTINES *******/ - /* Create the VMS object file. */ static void @@ -600,7 +594,6 @@ Create_VMS_Object_File () Current_Object_Record_Type = -1; } - /* Flush the object record buffer to the object file. */ static void @@ -610,7 +603,7 @@ Flush_VMS_Object_Record_Buffer () if (Object_Record_Offset == 0) return; -#ifndef VMS /* For cross-assembly purposes. */ +#ifndef VMS /* For cross-assembly purposes. */ { char RecLen[2]; @@ -640,7 +633,6 @@ Flush_VMS_Object_Record_Buffer () Object_Record_Offset = 0; } - /* Declare a particular type of object file record. */ static void @@ -656,7 +648,6 @@ Set_VMS_Object_File_Record (Type) Current_Object_Record_Type = Type; } - /* Close the VMS Object file. */ static void @@ -665,7 +656,7 @@ Close_VMS_Object_File () /* Flush (should never be necessary) and reset saved record-type context. */ Set_VMS_Object_File_Record (-1); -#ifndef VMS /* For cross-assembly purposes. */ +#ifndef VMS /* For cross-assembly purposes. */ { char RecLen[2]; int minus_one = -1; @@ -689,7 +680,6 @@ Close_VMS_Object_File () /****** Text Information and Relocation routines ******/ - /* Stack Psect base followed by signed, varying-sized offset. Common to several object records. */ @@ -709,15 +699,15 @@ vms_tir_stack_psect (Psect_Index, Offset, Force) switch (Sta_P(psect_width,offset_width)) { case Sta_P(1,1): PUT_CHAR (TIR_S_C_STA_PB); - PUT_CHAR ((char)(unsigned char) Psect_Index); + PUT_CHAR ((char) (unsigned char) Psect_Index); PUT_CHAR ((char) Offset); break; case Sta_P(1,2): PUT_CHAR (TIR_S_C_STA_PW); - PUT_CHAR ((char)(unsigned char) Psect_Index); + PUT_CHAR ((char) (unsigned char) Psect_Index); PUT_SHORT (Offset); break; case Sta_P(1,4): PUT_CHAR (TIR_S_C_STA_PL); - PUT_CHAR ((char)(unsigned char) Psect_Index); + PUT_CHAR ((char) (unsigned char) Psect_Index); PUT_LONG (Offset); break; case Sta_P(2,1): PUT_CHAR (TIR_S_C_STA_WPB); @@ -736,7 +726,6 @@ vms_tir_stack_psect (Psect_Index, Offset, Force) #undef Sta_P } - /* Store immediate data in current Psect. */ static void @@ -773,7 +762,6 @@ VMS_Store_Immediate_Data (Pointer, Size, Record_Type) Flush_VMS_Object_Record_Buffer (); } - /* Make a data reference. */ static void @@ -796,7 +784,6 @@ VMS_Set_Data (Psect_Index, Offset, Record_Type, Force) Flush_VMS_Object_Record_Buffer (); } - /* Make a debugger reference to a struct, union or enum. */ static void @@ -817,7 +804,6 @@ VMS_Store_Struct (Struct_Index) Flush_VMS_Object_Record_Buffer (); } - /* Make a debugger reference to partially define a struct, union or enum. */ static void @@ -854,7 +840,6 @@ VMS_Set_Struct (Struct_Index) /****** Traceback Information routines ******/ - /* Write the Traceback Module Begin record. */ static void @@ -888,7 +873,6 @@ VMS_TBT_Module_Begin () VMS_Store_Immediate_Data (Local, Size, OBJ_S_C_TBT); } - /* Write the Traceback Module End record. */ static void @@ -903,7 +887,6 @@ VMS_TBT_Module_End () VMS_Store_Immediate_Data (Local, 2, OBJ_S_C_TBT); } - /* Write a Traceback Routine Begin record. */ static void @@ -949,7 +932,6 @@ VMS_TBT_Routine_Begin (symbolP, Psect) VMS_Store_Immediate_Data (Local, Size, OBJ_S_C_TBT); } - /* Write a Traceback Routine End record. We *must* search the symbol table to find the next routine, since the @@ -1006,7 +988,6 @@ VMS_TBT_Routine_End (Max_Size, sp) VMS_Store_Immediate_Data (Local, 7, OBJ_S_C_TBT); } - /* Write a Traceback Block Begin record. */ static void @@ -1050,7 +1031,6 @@ VMS_TBT_Block_Begin (symbolP, Psect, Name) VMS_Store_Immediate_Data (Local, Size, OBJ_S_C_DBG); } - /* Write a Traceback Block End record. */ static void @@ -1281,13 +1261,12 @@ VMS_TBT_Source_File (Filename, ID_Number) /* Library module name (none). */ *cp++ = 0; /* Now that size is known, fill it in and write out the record. */ - Local[4] = cp - &Local[5]; /* source file declaration size */ + Local[4] = cp - &Local[5]; /* source file declaration size */ Local[0] = cp - &Local[1]; /* TBT record size */ VMS_Store_Immediate_Data (Local, cp - Local, OBJ_S_C_TBT); return 1; } - /* Traceback information is described in terms of lines from compiler listing files, not lines from source files. We need to set up the correlation between listing line numbers and source line numbers. @@ -1302,7 +1281,7 @@ VMS_TBT_Source_Lines (ID_Number, Starting_Line_Number, Number_Of_Lines) { char *cp; int chunk_limit; - char Local[128]; /* room enough to describe 1310700 lines... */ + char Local[128]; /* room enough to describe 1310700 lines... */ cp = &Local[1]; /* Put size in Local[0] later. */ *cp++ = DST_S_C_SOURCE; /* DST type is "source file". */ @@ -1347,7 +1326,6 @@ VMS_TBT_Source_Lines (ID_Number, Starting_Line_Number, Number_Of_Lines) /****** Debugger Information support routines ******/ - /* This routine locates a file in the list of files. If an entry does not exist, one is created. For include files, a new entry is always created such that inline functions can be properly debugged. */ @@ -1394,7 +1372,6 @@ find_file (sp) return fpnt; } - /* This routine converts a number string into an integer, and stops when it sees an invalid character. The return value is the address of the character just past the last character read. No error is generated. */ @@ -1426,7 +1403,6 @@ cvt_integer (str, rtn) * sections have already been output. */ - /* This routine fixes the names that are generated by C++, ".this" is a good example. The period does not work for the debugger, since it looks like the syntax for a structure element, and thus it gets mightily confused. @@ -1468,7 +1444,6 @@ fix_name (pnt) return pnt; } - /* When defining a structure, this routine is called to find the name of the actual structure. It is assumed that str points to the equal sign in the definition, and it moves backward until it finds the start of the @@ -1497,7 +1472,6 @@ get_struct_name (str) return pnt; } - /* Search symbol list for type number dbx_type. Return a pointer to struct. */ @@ -1519,7 +1493,6 @@ find_symbol (dbx_type) return find_symbol (spnt->type2); } - #if 0 /* obsolete */ /* this routine puts info into either Local or Asuffix, depending on the sign * of size. The reason is that it is easier to build the variable descriptor @@ -1556,7 +1529,6 @@ push (value, size1) } #endif - static void fpush (value, size) int value, size; @@ -1595,7 +1567,6 @@ rpush (value, size) } } - /* This routine generates the array descriptor for a given array. */ static void @@ -1652,7 +1623,6 @@ array_suffix (spnt2) } } - /* This routine generates the start of a variable descriptor based upon a struct/union/enum that has yet to be defined. We define this spot as a new location, and save four bytes for the address. When the struct is @@ -1675,7 +1645,6 @@ new_forward_ref (dbx_type) struct_number = -fpnt->struc_numb; } - /* This routine generates the variable descriptor used to describe non-basic variables. It calls itself recursively until it gets to the bottom of it all, and then builds the descriptor backwards. It is easiest to do it @@ -1780,7 +1749,6 @@ gen1 (spnt, array_suffix_len) return 0; } - /* This generates a suffix for a variable. If it is not a defined type yet, then dbx_type contains the type we are expecting so we can generate a forward reference. This calls gen1 to build most of the descriptor, and @@ -1860,7 +1828,6 @@ generate_suffix (spnt, dbx_type) Lpnt = 0; } - /* "novel length" type doesn't work for simple atomic types */ #define USE_BITSTRING_DESCRIPTOR(t) ((t)->advanced == BASIC) #undef SETUP_BASIC_TYPES @@ -1887,7 +1854,6 @@ bitfield_suffix (spnt, width) VMS_Store_Struct (spnt->struc_numb); /* output 4 more bytes */ } - /* Formally define a builtin type, so that it can serve as the target of an indirect reference. It makes bitfield_suffix() easier by avoiding the need to use a forward reference for the first occurrence of each @@ -1942,7 +1908,6 @@ setup_basic_type (spnt) return; } - /* This routine generates a symbol definition for a C symbol for the debugger. It takes a psect and offset for global symbols; if psect < 0, then this is a local variable and the offset is relative to FP. In this case it can @@ -1988,7 +1953,6 @@ VMS_DBG_record (spnt, Psect, Offset, Name) generate_suffix (spnt, 0); } - /* This routine parses the stabs entries in order to make the definition for the debugger of local symbols and function parameters. */ @@ -2046,7 +2010,7 @@ VMS_local_stab_Parse (sp) str1++; } if (*str1 == ':' && *pnt2 == ':') - return; /* they are the same! lets skip this one */ + return; /* They are the same! Let's skip this one. */ } /* for */ pnt++; /* skip p in case no register */ } /* if */ @@ -2062,7 +2026,6 @@ VMS_local_stab_Parse (sp) return; } - /* This routine parses a stabs entry to find the information required to define a variable. It is used for global and static variables. Basically we need to know the address of the symbol. With older @@ -2170,7 +2133,6 @@ VMS_stab_parse (sp, expected_type, type1, type2, Text_Psect) return; } - /* Simpler interfaces into VMS_stab_parse(). */ static void @@ -2197,7 +2159,6 @@ VMS_STSYM_Parse (sp, Text_Psect) VMS_stab_parse (sp, 'S', N_DATA, -1, Text_Psect); } - /* For register symbols, we must figure out what range of addresses within the psect are valid. We will use the brackets in the stab directives to give us guidance as to the PC range that this variable @@ -2319,7 +2280,6 @@ VMS_RSYM_Parse (sp, Current_Routine, Text_Psect) generate_suffix (spnt, 0); } - /* This function examines a structure definition, checking all of the elements to make sure that all of them are fully defined. The only thing that we kick out are arrays of undefined structs, since we do not know how big @@ -2353,7 +2313,6 @@ forward_reference (pnt) return 0; /* no forward refences found */ } - /* Used to check a single element of a structure on the final pass. */ static int @@ -2372,7 +2331,6 @@ final_forward_reference (spnt) return 0; /* no forward refences found */ } - /* This routine parses the stabs directives to find any definitions of dbx type numbers. It makes a note of all of them, creating a structure element of VMS_DBG_Symbol that describes it. This also generates the @@ -2802,7 +2760,6 @@ VMS_typedef_parse (str) return 0; } - /* This is the root routine that parses the stabs entries for definitions. it calls VMS_typedef_parse, which can in turn call itself. We need to be careful, since sometimes there are forward references to other symbol @@ -2947,7 +2904,6 @@ VMS_LSYM_Parse () } } - static void Define_Local_Symbols (s0P, s2P, Current_Routine, Text_Psect) symbolS *s0P, *s2P; @@ -2987,7 +2943,6 @@ Define_Local_Symbols (s0P, s2P, Current_Routine, Text_Psect) } /* for */ } - /* This function crawls the symbol chain searching for local symbols that need to be described to the debugger. When we enter a new scope with a "{", it creates a new "block", which helps the debugger keep track @@ -3072,7 +3027,6 @@ get_VMS_time_on_unix (Now) } #endif /* not VMS */ - /* Write the MHD (Module Header) records. */ static void @@ -3179,7 +3133,6 @@ Write_VMS_MHD_Records () Flush_VMS_Object_Record_Buffer (); } - /* Write the EOM (End Of Module) record. */ static void @@ -3195,7 +3148,7 @@ Write_VMS_EOM_Record (Psect, Offset) */ Set_VMS_Object_File_Record (OBJ_S_C_EOM); PUT_CHAR (OBJ_S_C_EOM); /* Record type. */ - PUT_CHAR (0); /* Error severity level (we ignore it). */ + PUT_CHAR (0); /* Error severity level (we ignore it). */ /* * Store the entry point, if it exists */ @@ -3417,7 +3370,6 @@ VMS_Case_Hack_Symbol (In, Out) #define GLOBALSYMBOL_BIT 0x10000 #define GLOBALVALUE_BIT 0x20000 - static void VMS_Modify_Psect_Attributes (Name, Attribute_Pointer) const char *Name; @@ -3525,7 +3477,7 @@ VMS_Modify_Psect_Attributes (Name, Attribute_Pointer) #define GBLSYM_REF 0 #define GBLSYM_DEF 1 #define GBLSYM_VAL 2 -#define GBLSYM_LCL 4 /* not GBL after all... */ +#define GBLSYM_LCL 4 /* not GBL after all... */ #define GBLSYM_WEAK 8 /* @@ -3663,30 +3615,30 @@ VMS_Psect_Spec (Name, Size, Type, vsp) switch (Type) { case ps_TEXT: - /* Text psects are PIC,noOVR,REL,noGBL,SHR,EXE,RD,noWRT. */ + /* Text psects are PIC,noOVR,REL,noGBL,SHR,EXE,RD,noWRT. */ Psect_Attributes = (GPS_S_M_PIC|GPS_S_M_REL|GPS_S_M_SHR|GPS_S_M_EXE |GPS_S_M_RD); break; case ps_DATA: - /* Data psects are PIC,noOVR,REL,noGBL,noSHR,noEXE,RD,WRT. */ + /* Data psects are PIC,noOVR,REL,noGBL,noSHR,noEXE,RD,WRT. */ Psect_Attributes = (GPS_S_M_PIC|GPS_S_M_REL|GPS_S_M_RD|GPS_S_M_WRT); break; case ps_COMMON: - /* Common block psects are: PIC,OVR,REL,GBL,noSHR,noEXE,RD,WRT. */ + /* Common block psects are: PIC,OVR,REL,GBL,noSHR,noEXE,RD,WRT. */ Psect_Attributes = (GPS_S_M_PIC|GPS_S_M_OVR|GPS_S_M_REL|GPS_S_M_GBL |GPS_S_M_RD|GPS_S_M_WRT); break; case ps_CONST: - /* Const data psects are: PIC,OVR,REL,GBL,noSHR,noEXE,RD,noWRT. */ + /* Const data psects are: PIC,OVR,REL,GBL,noSHR,noEXE,RD,noWRT. */ Psect_Attributes = (GPS_S_M_PIC|GPS_S_M_OVR|GPS_S_M_REL|GPS_S_M_GBL |GPS_S_M_RD); break; case ps_CTORS: - /* Ctor psects are PIC,noOVR,REL,GBL,noSHR,noEXE,RD,noWRT. */ + /* Ctor psects are PIC,noOVR,REL,GBL,noSHR,noEXE,RD,noWRT. */ Psect_Attributes = (GPS_S_M_PIC|GPS_S_M_REL|GPS_S_M_GBL|GPS_S_M_RD); break; case ps_DTORS: - /* Dtor psects are PIC,noOVR,REL,GBL,noSHR,noEXE,RD,noWRT. */ + /* Dtor psects are PIC,noOVR,REL,GBL,noSHR,noEXE,RD,noWRT. */ Psect_Attributes = (GPS_S_M_PIC|GPS_S_M_REL|GPS_S_M_GBL|GPS_S_M_RD); break; default: @@ -3805,7 +3757,6 @@ VMS_Initialized_Data_Size (s0P, End_Of_Data) return (offsetT) (nearest_val - s0P_val); } - /* Check symbol names for the Psect hack with a globalvalue, and then generate globalvalues for those that have it. */ @@ -3883,7 +3834,7 @@ VMS_Emit_Globalvalues (text_siz, data_siz, Data_Segment) Size = VMS_Initialized_Data_Size (sp, text_siz + data_siz); if (Size > 4) error (_("Invalid data type for globalvalue")); - globalvalue = md_chars_to_number (Data_Segment + + globalvalue = md_chars_to_number (Data_Segment + S_GET_VALUE (sp) - text_siz , Size); /* Three times for good luck. The linker seems to get confused if there are fewer than three */ @@ -4533,7 +4484,6 @@ struct vms_obj_state { #define Local_Initd_Data_Size vms_obj_state.local_initd_data_size #define Data_Segment vms_obj_state.data_segment - #define IS_GXX_VTABLE(symP) (strncmp (S_GET_NAME (symP), "__vt.", 5) == 0) #define IS_GXX_XTOR(symP) (strncmp (S_GET_NAME (symP), "__GLOBAL_.", 10) == 0) #define XTOR_SIZE 4 @@ -4671,7 +4621,6 @@ synthesize_data_segment (data_siz, text_siz, data_frag_root) return; } - /* Perform data segment fixups. */ static void @@ -5105,7 +5054,6 @@ local_symbols_DST (s0P, Current_Routine) } } - /* Construct and output the debug symbol table. */ static void @@ -5429,7 +5377,6 @@ vms_write_object_file (text_siz, data_siz, bss_siz, text_frag_root, if (data_siz > 0) synthesize_data_segment (data_siz, text_siz, data_frag_root); - /******* Global Symbol Directory *******/ /* @@ -5473,7 +5420,6 @@ vms_write_object_file (text_siz, data_siz, bss_siz, text_frag_root, vsp->Psect_Index = Data_Psect; } - if (Ctors_Symbols != 0) { char *ps_name = "$ctors"; @@ -5524,12 +5470,10 @@ vms_write_object_file (text_siz, data_siz, bss_siz, text_frag_root, vms_fixup_xtors_section (Dtors_Symbols, Dtors_Psect); } - /******* Debugger Symbol Table Records *******/ vms_build_DST (text_siz); - /******* Wrap things up *******/ /* @@ -5545,5 +5489,3 @@ vms_write_object_file (text_siz, data_siz, bss_siz, text_frag_root, */ Close_VMS_Object_File (); } - -/* end of obj-vms.c */ diff --git a/gnu/dist/toolchain/gas/config/obj-vms.h b/gnu/dist/toolchain/gas/config/obj-vms.h index ad8fdce00dda..11e4bafe814f 100644 --- a/gnu/dist/toolchain/gas/config/obj-vms.h +++ b/gnu/dist/toolchain/gas/config/obj-vms.h @@ -1,5 +1,5 @@ /* VMS object file format - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 1999 + Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 99, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -17,7 +17,7 @@ the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GAS; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ +02111-1307, USA. */ /* Tag to validate a.out object file format processing */ #define OBJ_VMS 1 @@ -48,7 +48,7 @@ extern unsigned char const_flag; #define IN_DEFAULT_SECTION 0x80 -/* These are defined in obj-vms.c. */ +/* These are defined in obj-vms.c. */ extern const short seg_N_TYPE[]; extern const segT N_TYPE_seg[]; @@ -59,7 +59,7 @@ enum reloc_type }; #define N_BADMAG(x) (0) -#define N_TXTOFF(x) ( sizeof(struct exec) ) +#define N_TXTOFF(x) ( sizeof (struct exec) ) #define N_DATOFF(x) ( N_TXTOFF(x) + (x).a_text ) #define N_TROFF(x) ( N_DATOFF(x) + (x).a_data ) #define N_DROFF(x) ( N_TROFF(x) + (x).a_trsize ) @@ -84,7 +84,7 @@ struct exec typedef struct { struct exec header; /* a.out header */ - long string_table_size; /* names + '\0' + sizeof(int) */ + long string_table_size; /* names + '\0' + sizeof (int) */ } object_headers; @@ -145,7 +145,7 @@ typedef struct nlist obj_symbol_type; /* Symbol table entry */ #define S_IS_DEBUG(s) ((s)->sy_symbol.n_type & N_STAB) /* True if a symbol is local symbol name */ /* A symbol name whose name begin with ^A is a gas internal pseudo symbol - nameless symbols come from .stab directives. */ + nameless symbols come from .stab directives. */ #define S_IS_LOCAL(s) (S_GET_NAME(s) && \ !S_IS_DEBUG(s) && \ (strchr(S_GET_NAME(s), '\001') != 0 || \ @@ -191,7 +191,6 @@ typedef struct nlist obj_symbol_type; /* Symbol table entry */ /* Set the n_type expression value */ #define S_SET_TYPE(s,v) ((s)->sy_symbol.n_type = (v)) - /* File header macro and type definition */ #define H_GET_TEXT_SIZE(h) ((h)->header.a_text) @@ -204,9 +203,9 @@ typedef struct nlist obj_symbol_type; /* Symbol table entry */ #define H_SET_STRING_SIZE(h,v) ((h)->string_table_size = (v)) #define H_SET_SYMBOL_TABLE_SIZE(h,v) ((h)->header.a_syms = (v) * \ - sizeof(struct nlist)) + sizeof (struct nlist)) -/* line numbering stuff. */ +/* line numbering stuff. */ #define OBJ_EMIT_LINENO(a, b, c) {;} #define obj_symbol_new_hook(s) {;} @@ -223,7 +222,7 @@ extern void tc_aout_fix_to_chars PARAMS ((char *,struct fix *,relax_addressT)); extern int vms_resolve_symbol_redef PARAMS ((symbolS *)); #define RESOLVE_SYMBOL_REDEFINITION(X) vms_resolve_symbol_redef(X) -/* Compiler-generated label "__vax_g_doubles" is used to augment .stabs. */ +/* Compiler-generated label "__vax_g_doubles" is used to augment .stabs. */ extern void vms_check_for_special_label PARAMS ((symbolS *)); #define obj_frob_label(X) vms_check_for_special_label(X) @@ -547,5 +546,3 @@ extern void vms_write_object_file PARAMS ((unsigned,unsigned,unsigned, #define DBG_S_C_COMPLEX_ARRAY DST_K_TS_ARRAY #endif /* WANT_VMS_OBJ_DEFS */ - -/* end of obj-vms.h */ diff --git a/gnu/dist/toolchain/gas/config/tc-a29k.c b/gnu/dist/toolchain/gas/config/tc-a29k.c index 600fec58857c..a0c2346f7ae2 100644 --- a/gnu/dist/toolchain/gas/config/tc-a29k.c +++ b/gnu/dist/toolchain/gas/config/tc-a29k.c @@ -1,5 +1,5 @@ /* tc-a29k.c -- Assemble for the AMD 29000. - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1998 + Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 98, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -98,7 +98,7 @@ const char comment_chars[] = ";"; .line and .file directives will appear in the pre-processed output */ /* Note that input_file.c hand checks for '#' at the beginning of the first line of the input file. This is because the compiler outputs - #NO_APP at the beginning of its output. */ + #NO_APP at the beginning of its output. */ /* Also note that comments like this one will always work */ const char line_comment_chars[] = "#"; @@ -148,7 +148,7 @@ s_use (ignore) return; } /* Literals can't go in the text segment because you can't read from - instruction memory on some 29k's. So, into initialized data. */ + instruction memory on some 29k's. So, into initialized data. */ if (strncmp (input_line_pointer, ".lit", 4) == 0) { input_line_pointer += 4; @@ -283,7 +283,7 @@ md_begin () } /* Hack to avoid multiple opcode entries. We pre-locate all the - variations (b/i field and P/A field) and handle them. */ + variations (b/i field and P/A field) and handle them. */ if (!strcmp (name, machine_opcodes[i + 1].name)) { @@ -427,7 +427,7 @@ machine_ip (str) /* Build the opcode, checking as we go to make sure that the operands match. - + If an operand matches, we modify the_insn or opcode appropriately, and do a "continue". If an operand fails to match, we "break". */ @@ -445,7 +445,7 @@ machine_ip (str) case '\0': /* end of args */ if (*s == '\0') { - /* We are truly done. */ + /* We are truly done. */ the_insn.opcode = opcode; return; } @@ -669,7 +669,6 @@ machine_ip (str) } break; - case 'f': /* FS bits of CONVERT */ if (operand->X_op == O_constant && operand->X_add_number < 4) @@ -710,8 +709,8 @@ machine_ip (str) but I'm not sure. Turn a string in input_line_pointer into a floating point constant - of type type, and store the appropriate bytes in *litP. The number - of LITTLENUMS emitted is stored in *sizeP . An error message is + of type TYPE, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. An error message is returned, or NULL on OK. */ /* Equal to MAX_PRECISION in atof-ieee.c */ @@ -792,7 +791,6 @@ md_apply_fix (fixP, val) fixP->fx_addnumber = val; /* Remember value for emit_reloc */ - know (fixP->fx_size == 4); know (fixP->fx_r_type < NO_RELOC); @@ -1004,7 +1002,7 @@ print_insn (insn) On sparc/29k: first 4 bytes are normal unsigned long address, next three bytes are index, most sig. byte first. Byte 7 is broken up with bit 7 as external, bits 6 & 5 unused, and the lower - five bits as relocation type. Next 4 bytes are long addend. */ + five bits as relocation type. Next 4 bytes are long addend. */ /* Thanx and a tip of the hat to Michael Bloom, mb@ttidca.tti.com */ #ifdef OBJ_AOUT @@ -1042,7 +1040,7 @@ CONST char *md_shortopts = ""; struct option md_longopts[] = { {NULL, no_argument, NULL, 0} }; -size_t md_longopts_size = sizeof(md_longopts); +size_t md_longopts_size = sizeof (md_longopts); int md_parse_option (c, arg) @@ -1121,7 +1119,7 @@ md_undefined_symbol (name) long maxreg; /* Parse the number, make sure it has no extra zeroes or - trailing chars. */ + trailing chars. */ regnum = atol (&name[2]); if (name[0] == 's' || name[0] == 'S') @@ -1235,7 +1233,7 @@ md_operand (expressionP) type = 'x'; fieldlimit = 4; } - else + else { return; } @@ -1266,7 +1264,7 @@ md_operand (expressionP) SKIP_WHITESPACE (); input_line_pointer = s; - expressionP->X_op = O_constant; + expressionP->X_op = O_constant; expressionP->X_unsigned = 1; expressionP->X_add_number = ((floatbuf[fieldnum * 2] << LITTLENUM_NUMBER_OF_BITS) @@ -1292,5 +1290,3 @@ md_pcrel_from (fixP) { return fixP->fx_where + fixP->fx_frag->fr_address; } - -/* end of tc-a29k.c */ diff --git a/gnu/dist/toolchain/gas/config/tc-alpha.h b/gnu/dist/toolchain/gas/config/tc-alpha.h index 632b04ebc3cf..7edc412aff83 100644 --- a/gnu/dist/toolchain/gas/config/tc-alpha.h +++ b/gnu/dist/toolchain/gas/config/tc-alpha.h @@ -90,6 +90,11 @@ extern void alpha_define_label PARAMS ((symbolS *)); #define md_cons_align(nbytes) alpha_cons_align (nbytes) extern void alpha_cons_align PARAMS ((int)); +#define HANDLE_ALIGN(fragp) alpha_handle_align (fragp) +extern void alpha_handle_align PARAMS ((struct frag *)); + +#define MAX_MEM_FOR_RS_ALIGN_CODE (3 + 4 + 8) + #ifdef OBJ_ECOFF #define tc_frob_file_before_adjust() alpha_frob_file_before_adjust () extern void alpha_frob_file_before_adjust PARAMS ((void)); @@ -146,3 +151,5 @@ do { \ (long)fixP->tc_fix_data.next_lituse); \ } while (0) #endif + +#define DWARF2_LINE_MIN_INSN_LENGTH 4 diff --git a/gnu/dist/toolchain/gas/config/tc-arc.c b/gnu/dist/toolchain/gas/config/tc-arc.c index 3aafea364810..39ce4038711f 100644 --- a/gnu/dist/toolchain/gas/config/tc-arc.c +++ b/gnu/dist/toolchain/gas/config/tc-arc.c @@ -1,5 +1,5 @@ /* tc-arc.c -- Assembler for the ARC - Copyright (C) 1994, 1995, 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1997, 2000 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). This file is part of GAS, the GNU Assembler. @@ -17,36 +17,81 @@ 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. */ + 02111-1307, USA. */ #include #include +#include "libiberty.h" #include "as.h" #include "subsegs.h" #include "opcode/arc.h" +#include "../opcodes/arc-ext.h" #include "elf/arc.h" extern int arc_get_mach PARAMS ((char *)); +extern int arc_operand_type PARAMS ((int)); +extern int arc_insn_not_jl PARAMS ((arc_insn)); +extern int arc_limm_fixup_adjust PARAMS ((arc_insn)); +extern int arc_get_noshortcut_flag PARAMS ((void)); +extern int arc_set_ext_seg PARAMS ((void)); +extern void arc_code_symbol PARAMS ((expressionS *)); static arc_insn arc_insert_operand PARAMS ((arc_insn, const struct arc_operand *, int, const struct arc_operand_value *, offsetT, char *, unsigned int)); static void arc_common PARAMS ((int)); -static void arc_cpu PARAMS ((int)); -/*static void arc_rename PARAMS ((int));*/ +static 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 *, expressionS *)); -const pseudo_typeS md_pseudo_table[] = -{ - { "align", s_align_bytes, 0 }, /* Defaulting is invalid (0) */ +const struct suffix_classes { + char *name; + int len; +} suffixclass[] = { + { "SUFFIX_COND|SUFFIX_FLAG",23 }, + { "SUFFIX_FLAG", 11 }, + { "SUFFIX_COND", 11 }, + { "SUFFIX_NONE", 11 } +}; + +#define MAXSUFFIXCLASS (sizeof (suffixclass) / sizeof (struct suffix_classes)) + +const struct syntax_classes { + char *name; + int len; + int class; +} syntaxclass[] = { + { "SYNTAX_3OP|OP1_MUST_BE_IMM", 26, SYNTAX_3OP|OP1_MUST_BE_IMM|SYNTAX_VALID }, + { "OP1_MUST_BE_IMM|SYNTAX_3OP", 26, OP1_MUST_BE_IMM|SYNTAX_3OP|SYNTAX_VALID }, + { "SYNTAX_2OP|OP1_IMM_IMPLIED", 26, SYNTAX_2OP|OP1_IMM_IMPLIED|SYNTAX_VALID }, + { "OP1_IMM_IMPLIED|SYNTAX_2OP", 26, OP1_IMM_IMPLIED|SYNTAX_2OP|SYNTAX_VALID }, + { "SYNTAX_3OP", 10, SYNTAX_3OP|SYNTAX_VALID }, + { "SYNTAX_2OP", 10, SYNTAX_2OP|SYNTAX_VALID } +}; + +#define MAXSYNTAXCLASS (sizeof (syntaxclass) / sizeof (struct syntax_classes)) + +const pseudo_typeS md_pseudo_table[] = { + { "align", s_align_bytes, 0 }, /* Defaulting is invalid (0) */ + { "comm", arc_common, 0 }, { "common", arc_common, 0 }, -/*{ "hword", cons, 2 }, - already exists */ + { "lcomm", arc_common, 1 }, + { "lcommon", arc_common, 1 }, + { "2byte", cons, 2 }, + { "half", cons, 2 }, + { "short", cons, 2 }, + { "3byte", cons, 3 }, + { "4byte", cons, 4 }, { "word", cons, 4 }, -/*{ "xword", cons, 8 },*/ - { "cpu", arc_cpu, 0 }, -/*{ "rename", arc_rename, 0 },*/ + { "option", arc_option, 0 }, + { "block", s_space, 0 }, + { "extcondcode", arc_extoper, 0 }, + { "extcoreregister", arc_extoper, 1 }, + { "extauxregister", arc_extoper, 2 }, + { "extinstruction", arc_extinst, 0 }, { NULL, 0, 0 }, }; @@ -59,9 +104,9 @@ const char comment_chars[] = "#;"; .line and .file directives will appear in the pre-processed output */ /* Note that input_file.c hand checks for '#' at the beginning of the first line of the input file. This is because the compiler outputs - #NO_APP at the beginning of its output. */ + #NO_APP at the beginning of its output. */ /* Also note that comments started like this one will always - work if '/' isn't otherwise defined. */ + work if '/' isn't otherwise defined. */ const char line_comment_chars[] = "#"; const char line_separator_chars[] = ""; @@ -79,8 +124,10 @@ extern int target_big_endian; const char *arc_target_format = DEFAULT_TARGET_FORMAT; static int byte_order = DEFAULT_BYTE_ORDER; -/* One of bfd_mach_arc_xxx. */ -static int arc_mach_type = bfd_mach_arc_base; +static segT arcext_section; + +/* One of bfd_mach_arc_n. */ +static int arc_mach_type = bfd_mach_arc_5; /* Non-zero if the cpu type has been explicitly specified. */ static int mach_type_specified_p = 0; @@ -92,30 +139,53 @@ static int cpu_tables_init_p = 0; static struct hash_control *arc_suffix_hash = NULL; const char *md_shortopts = ""; -struct option md_longopts[] = -{ +struct option md_longopts[] = { #define OPTION_EB (OPTION_MD_BASE + 0) {"EB", no_argument, NULL, OPTION_EB}, #define OPTION_EL (OPTION_MD_BASE + 1) {"EL", no_argument, NULL, OPTION_EL}, +#define OPTION_ARC5 (OPTION_MD_BASE + 2) + {"marc5", no_argument, NULL, OPTION_ARC5}, +#define OPTION_ARC6 (OPTION_MD_BASE + 3) + {"marc6", no_argument, NULL, OPTION_ARC6}, +#define OPTION_ARC7 (OPTION_MD_BASE + 4) + {"marc7", no_argument, NULL, OPTION_ARC7}, +#define OPTION_ARC8 (OPTION_MD_BASE + 5) + {"marc8", no_argument, NULL, OPTION_ARC8}, +#define OPTION_ARC (OPTION_MD_BASE + 6) + {"marc", no_argument, NULL, OPTION_ARC}, { NULL, no_argument, NULL, 0 } }; size_t md_longopts_size = sizeof (md_longopts); -/* - * md_parse_option - * - * Invocation line includes a switch not recognized by the base assembler. - * See if it's a processor-specific option. - */ +#define IS_SYMBOL_OPERAND(o) \ + ((o) == 'b' || (o) == 'c' || (o) == 's' || (o) == 'o' || (o) == 'O') + +struct arc_operand_value *get_ext_suffix (char *s); + +/* Invocation line includes a switch not recognized by the base assembler. + See if it's a processor-specific option. */ int md_parse_option (c, arg) int c; - char *arg; + char *arg ATTRIBUTE_UNUSED; { switch (c) { + case OPTION_ARC: + case OPTION_ARC5: + arc_mach_type = bfd_mach_arc_5; + break; + case OPTION_ARC6: + arc_mach_type = bfd_mach_arc_6; + break; + case OPTION_ARC7: + arc_mach_type = bfd_mach_arc_7; + break; + case OPTION_ARC8: + arc_mach_type = bfd_mach_arc_8; + break; case OPTION_EB: byte_order = BIG_ENDIAN; arc_target_format = "elf32-bigarc"; @@ -134,10 +204,11 @@ void md_show_usage (stream) FILE *stream; { - fprintf (stream, _("\ -ARC options:\n\ --EB generate big endian output\n\ --EL generate little endian output\n")); + fprintf (stream, "\ +ARC Options:\n\ + -marc[5|6|7|8] select processor variant (default arc%d)\n\ + -EB assemble code for a big endian cpu\n\ + -EL assemble code for a little endian cpu\n", arc_mach_type + 5); } /* This function is called once, at assembler startup time. It should @@ -152,12 +223,12 @@ md_begin () target_big_endian = byte_order == BIG_ENDIAN; if (!bfd_set_arch_mach (stdoutput, bfd_arch_arc, arc_mach_type)) - as_warn (_("could not set architecture and machine")); + as_warn ("could not set architecture and machine"); - /* Assume the base cpu. This call is necessary because we need to + /* This call is necessary because we need to initialize `arc_operand_map' which may be needed before we see the first insn. */ - arc_opcode_init_tables (arc_get_opcode_mach (bfd_mach_arc_base, + arc_opcode_init_tables (arc_get_opcode_mach (arc_mach_type, target_big_endian)); } @@ -168,14 +239,14 @@ static void init_opcode_tables (mach) int mach; { - register unsigned int i; + int i; char *last; if ((arc_suffix_hash = hash_new ()) == NULL) - as_fatal (_("virtual memory exhausted")); + as_fatal ("virtual memory exhausted"); if (!bfd_set_arch_mach (stdoutput, bfd_arch_arc, mach)) - as_warn (_("could not set architecture and machine")); + as_warn ("could not set architecture and machine"); /* This initializes a few things in arc-opc.c that we need. This must be called before the various arc_xxx_supported fns. */ @@ -186,8 +257,6 @@ init_opcode_tables (mach) last = ""; for (i = 0; i < arc_suffixes_count; i++) { - if (! arc_opval_supported (&arc_suffixes[i])) - continue; if (strcmp (arc_suffixes[i].name, last) != 0) hash_insert (arc_suffix_hash, arc_suffixes[i].name, (PTR) (arc_suffixes + i)); last = arc_suffixes[i].name; @@ -196,18 +265,22 @@ init_opcode_tables (mach) /* Since registers don't have a prefix, we put them in the symbol table so they can't be used as symbols. This also simplifies argument parsing as we can let gas parse registers for us. The recorded register number is - the index in `arc_reg_names'. */ + the address of the register's entry in arc_reg_names. + + If the register name is already in the table, then the existing + definition is assumed to be from an .ExtCoreRegister pseudo-op. */ + for (i = 0; i < arc_reg_names_count; i++) { - if (! arc_opval_supported (&arc_reg_names[i])) + if (symbol_find (arc_reg_names[i].name)) continue; /* Use symbol_create here instead of symbol_new so we don't try to output registers into the object file's symbol table. */ symbol_table_insert (symbol_create (arc_reg_names[i].name, reg_section, - i, &zero_address_frag)); + (int) &arc_reg_names[i], &zero_address_frag)); } - /* Tell `s_cpu' it's too late. */ + /* Tell `.option' it's too late. */ cpu_tables_init_p = 1; } @@ -251,7 +324,7 @@ arc_insert_operand (insn, operand, mods, reg, val, file, line) if (test < (offsetT) min || test > (offsetT) max) { const char *err = - _("operand out of range (%s not between %ld and %ld)"); + "operand out of range (%s not between %ld and %ld)"; char buf[100]; sprint_value (buf, test); @@ -282,8 +355,7 @@ arc_insert_operand (insn, operand, mods, reg, val, file, line) we go, because that would require us to first create the frag, and that would screw up references to ``.''. */ -struct arc_fixup -{ +struct arc_fixup { /* index into `arc_operands' */ int opindex; expressionS exp; @@ -300,7 +372,10 @@ md_assemble (str) char *str; { const struct arc_opcode *opcode; + const struct arc_opcode *std_opcode; + struct arc_opcode *ext_opcode; char *start; + const char *last_errmsg = 0; arc_insn insn; static int init_tables_p = 0; @@ -319,19 +394,26 @@ md_assemble (str) /* The instructions are stored in lists hashed by the first letter (though we needn't care how they're hashed). Get the first in the list. */ - opcode = arc_opcode_lookup_asm (str); + ext_opcode = arc_ext_opcodes; + std_opcode = arc_opcode_lookup_asm (str); /* Keep looking until we find a match. */ start = str; - for ( ; opcode != NULL; opcode = ARC_OPCODE_NEXT_ASM (opcode)) + for (opcode = (ext_opcode ? ext_opcode : std_opcode); + opcode != NULL; + opcode = (ARC_OPCODE_NEXT_ASM (opcode) + ? ARC_OPCODE_NEXT_ASM (opcode) + : (ext_opcode ? ext_opcode = NULL, std_opcode : NULL))) { int past_opcode_p, fc, num_suffixes; + int fix_up_at = 0; char *syn; struct arc_fixup fixups[MAX_FIXUPS]; /* Used as a sanity check. If we need a limm reloc, make sure we ask for an extra 4 bytes from frag_more. */ int limm_reloc_p; + int ext_suffix_p; const struct arc_operand_value *insn_suffixes[MAX_SUFFIXES]; /* Is this opcode supported by the selected cpu? */ @@ -346,10 +428,11 @@ md_assemble (str) past_opcode_p = 0; num_suffixes = 0; limm_reloc_p = 0; + ext_suffix_p = 0; /* We don't check for (*str != '\0') here because we want to parse any trailing fake arguments in the syntax string. */ - for (str = start, syn = opcode->syntax; *syn != '\0'; ) + for (str = start, syn = opcode->syntax; *syn != '\0';) { int mods; const struct arc_operand *operand; @@ -379,14 +462,14 @@ md_assemble (str) /* We have an operand. Pick out any modifiers. */ mods = 0; - while (ARC_MOD_P (arc_operands[arc_operand_map[*syn]].flags)) + while (ARC_MOD_P (arc_operands[arc_operand_map[(int) *syn]].flags)) { - mods |= arc_operands[arc_operand_map[*syn]].flags & ARC_MOD_BITS; + mods |= arc_operands[arc_operand_map[(int) *syn]].flags & ARC_MOD_BITS; ++syn; } - operand = arc_operands + arc_operand_map[*syn]; + operand = arc_operands + arc_operand_map[(int) *syn]; if (operand->fmt == 0) - as_fatal (_("unknown syntax format character `%c'"), *syn); + as_fatal ("unknown syntax format character `%c'", *syn); if (operand->flags & ARC_OPERAND_FAKE) { @@ -394,9 +477,25 @@ md_assemble (str) if (operand->insert) { insn = (*operand->insert) (insn, operand, mods, NULL, 0, &errmsg); - /* If we get an error, go on to try the next insn. */ - if (errmsg) - break; + if (errmsg != (const char *) NULL) + { + last_errmsg = errmsg; + if (operand->flags & ARC_OPERAND_ERROR) + { + as_bad (errmsg); + return; + } + else if (operand->flags & ARC_OPERAND_WARN) + as_warn (errmsg); + break; + } + if (limm_reloc_p + && (operand->flags && operand->flags & ARC_OPERAND_LIMM) + && (operand->flags & + (ARC_OPERAND_ABSOLUTE_BRANCH | ARC_OPERAND_ADDRESS))) + { + fixups[fix_up_at].opindex = arc_operand_map[operand->fmt]; + } } ++syn; } @@ -405,8 +504,9 @@ md_assemble (str) { int found; char c; - char *s,*t; - const struct arc_operand_value *suf,*suffix,*suffix_end; + char *s, *t; + const struct arc_operand_value *suf, *suffix_end; + const struct arc_operand_value *suffix = NULL; if (!(operand->flags & ARC_OPERAND_SUFFIX)) abort (); @@ -439,53 +539,75 @@ md_assemble (str) } /* Pick the suffix out and look it up via the hash table. */ - for (t = s; *t && isalpha (*t); ++t) + for (t = s; *t && isalnum (*t); ++t) continue; c = *t; *t = '\0'; - suf = hash_find (arc_suffix_hash, s); - *t = c; + if ((suf = get_ext_suffix (s))) + ext_suffix_p = 1; + else + suf = hash_find (arc_suffix_hash, s); if (!suf) { /* This can happen in "blle foo" and we're currently using the template "b%q%.n %j". The "bl" insn occurs later in the table so "lle" isn't an illegal suffix. */ + *t = c; break; } /* Is it the right type? Note that the same character is used - several times, so we have to examine all of them. This is + several times, so we have to examine all of them. This is relatively efficient as equivalent entries are kept together. If it's not the right type, don't increment `str' so we try the next one in the series. */ found = 0; - suffix_end = arc_suffixes + arc_suffixes_count; - for (suffix = suf; - suffix < suffix_end && strcmp (suffix->name, suf->name) == 0; - ++suffix) + if (ext_suffix_p && arc_operands[suf->type].fmt == *syn) { - if (arc_operands[suffix->type].fmt == *syn) - { - /* Insert the suffix's value into the insn. */ - if (operand->insert) - insn = (*operand->insert) (insn, operand, - mods, NULL, suffix->value, - NULL); - else - insn |= suffix->value << operand->shift; + /* Insert the suffix's value into the insn. */ + *t = c; + if (operand->insert) + insn = (*operand->insert) (insn, operand, + mods, NULL, suf->value, + NULL); + else + insn |= suf->value << operand->shift; - str = t; - found = 1; - break; + str = t; + found = 1; + } + else + { + *t = c; + suffix_end = arc_suffixes + arc_suffixes_count; + for (suffix = suf; + suffix < suffix_end && strcmp (suffix->name, suf->name) == 0; + ++suffix) + { + if (arc_operands[suffix->type].fmt == *syn) + { + /* Insert the suffix's value into the insn. */ + if (operand->insert) + insn = (*operand->insert) (insn, operand, + mods, NULL, suffix->value, + NULL); + else + insn |= suffix->value << operand->shift; + + str = t; + found = 1; + break; + } } } ++syn; if (!found) - ; /* Wrong type. Just go on to try next insn entry. */ + /* Wrong type. Just go on to try next insn entry. */ + ; else { if (num_suffixes == MAX_SUFFIXES) - as_bad (_("too many suffixes")); + as_bad ("too many suffixes"); else insn_suffixes[num_suffixes++] = suffix; } @@ -493,7 +615,6 @@ md_assemble (str) else /* This is either a register or an expression of some kind. */ { - char c; char *hold; const struct arc_operand_value *reg = NULL; long value = 0; @@ -507,20 +628,6 @@ md_assemble (str) any trailing fake arguments in the syntax string. */ if (*str == '\0') break; -#if 0 - /* Is this a syntax character? Eg: is there a '[' present when - there shouldn't be? */ - if (!isalnum (*str) - /* '.' as in ".LLC0" */ - && *str != '.' - /* '_' as in "_print" */ - && *str != '_' - /* '-' as in "[fp,-4]" */ - && *str != '-' - /* '%' as in "%ia(_func)" */ - && *str != '%') - break; -#endif /* Parse the operand. */ hold = input_line_pointer; @@ -530,37 +637,48 @@ md_assemble (str) input_line_pointer = hold; if (exp.X_op == O_illegal) - as_bad (_("illegal operand")); + as_bad ("illegal operand"); else if (exp.X_op == O_absent) - as_bad (_("missing operand")); + as_bad ("missing operand"); else if (exp.X_op == O_constant) { value = exp.X_add_number; } else if (exp.X_op == O_register) { - reg = arc_reg_names + exp.X_add_number; + reg = (struct arc_operand_value *) exp.X_add_number; } +#define IS_REG_DEST_OPERAND(o) ((o) == 'a') + else if (IS_REG_DEST_OPERAND (*syn)) + as_bad ("symbol as destination register"); else { + if (!strncmp (str, "@h30", 4)) + { + arc_code_symbol (&exp); + str += 4; + } /* We need to generate a fixup for this expression. */ if (fc >= MAX_FIXUPS) - as_fatal (_("too many fixups")); + as_fatal ("too many fixups"); fixups[fc].exp = exp; - + /* We don't support shimm relocs. break here to force + the assembler to output a limm. */ +#define IS_REG_SHIMM_OFFSET(o) ((o) == 'd') + if (IS_REG_SHIMM_OFFSET (*syn)) + break; /* If this is a register constant (IE: one whose register value gets stored as 61-63) then this - must be a limm. We don't support shimm relocs. */ + must be a limm. */ /* ??? This bit could use some cleaning up. Referencing the format chars like this goes against style. */ -#define IS_REG_OPERAND(o) ((o) == 'a' || (o) == 'b' || (o) == 'c') - if (IS_REG_OPERAND (*syn)) + if (IS_SYMBOL_OPERAND (*syn)) { const char *junk; - - fixups[fc].opindex = arc_operand_map['L']; limm_reloc_p = 1; + /* Save this, we don't yet know what reloc to use. */ + fix_up_at = fc; /* Tell insert_reg we need a limm. This is needed because the value at this point is zero, a shimm. */ @@ -569,7 +687,7 @@ md_assemble (str) (insn, operand, mods, reg, 0L, &junk); } else - fixups[fc].opindex = arc_operand_map[*syn]; + fixups[fc].opindex = arc_operand_map[(int) *syn]; ++fc; value = 0; } @@ -580,18 +698,18 @@ md_assemble (str) const char *errmsg = NULL; insn = (*operand->insert) (insn, operand, mods, reg, (long) value, &errmsg); -#if 0 if (errmsg != (const char *) NULL) - as_warn (errmsg); -#endif - /* FIXME: We want to try shimm insns for limm ones. But if - the constant won't fit, we must go on to try the next - possibility. Where do we issue warnings for constants - that are too big then? At present, we'll flag the insn - as unrecognizable! Maybe have the "bad instruction" - error message include our `errmsg'? */ - if (errmsg != (const char *) NULL) - break; + { + last_errmsg = errmsg; + if (operand->flags & ARC_OPERAND_ERROR) + { + as_bad (errmsg); + return; + } + else if (operand->flags & ARC_OPERAND_WARN) + as_warn (errmsg); + break; + } } else insn |= (value & ((1 << operand->bits) - 1)) << operand->shift; @@ -617,7 +735,7 @@ md_assemble (str) ++str; if (*str != '\0') - as_bad (_("junk at end of line: `%s'"), str); + as_bad ("junk at end of line: `%s'", str); /* Is there a limm value? */ limm_p = arc_opcode_limm_p (&limm); @@ -635,19 +753,18 @@ md_assemble (str) int cc_set_p = 0; /* 1 if conditional branch, including `b' "branch always" */ int cond_branch_p = opcode->flags & ARC_OPCODE_COND_BRANCH; - int need_cc_nop_p = 0; for (i = 0; i < num_suffixes; ++i) { switch (arc_operands[insn_suffixes[i]->type].fmt) { - case 'n' : + case 'n': delay_slot_type = insn_suffixes[i]->value; break; - case 'q' : + case 'q': conditional = insn_suffixes[i]->value; break; - case 'f' : + case 'f': cc_set_p = 1; break; } @@ -657,18 +774,22 @@ md_assemble (str) be legal, but let's warn the user anyway. Ditto for 8 byte jumps with delay slots. */ if (in_delay_slot_p && limm_p) - as_warn (_("8 byte instruction in delay slot")); - if (delay_slot_type != ARC_DELAY_NONE && limm_p) - as_warn (_("8 byte jump instruction with delay slot")); + as_warn ("8 byte instruction in delay slot"); + if (delay_slot_type != ARC_DELAY_NONE + && limm_p && arc_insn_not_jl (insn)) /* except for jl addr */ + as_warn ("8 byte jump instruction with delay slot"); in_delay_slot_p = (delay_slot_type != ARC_DELAY_NONE) && !limm_p; /* Warn when a conditional branch immediately follows a set of the condition codes. Note that this needn't be done if the insn that sets the condition codes uses a limm. */ if (cond_branch_p && conditional != 0 /* 0 = "always" */ - && prev_insn_needs_cc_nop_p) - as_warn (_("conditional branch follows set of flags")); - prev_insn_needs_cc_nop_p = cc_set_p && !limm_p; + && prev_insn_needs_cc_nop_p && arc_mach_type == bfd_mach_arc_5) + as_warn ("conditional branch follows set of flags"); + prev_insn_needs_cc_nop_p = + /* FIXME: ??? not required: + (delay_slot_type != ARC_DELAY_NONE) && */ + cc_set_p && !limm_p; } /* Write out the instruction. @@ -712,9 +833,14 @@ md_assemble (str) if (arc_operands[fixups[i].opindex].flags & ARC_OPERAND_LIMM) { + /* Modify the fixup addend as required by the cpu. */ + fixups[i].exp.X_add_number += arc_limm_fixup_adjust (insn); op_type = fixups[i].opindex; /* FIXME: can we add this data to the operand table? */ - if (op_type == arc_operand_map['L']) + if (op_type == arc_operand_map['L'] + || op_type == arc_operand_map['s'] + || op_type == arc_operand_map['o'] + || op_type == arc_operand_map['O']) reloc_type = BFD_RELOC_32; else if (op_type == arc_operand_map['J']) reloc_type = BFD_RELOC_ARC_B26; @@ -746,19 +872,502 @@ md_assemble (str) /* Try the next entry. */ } - as_bad (_("bad instruction `%s'"), start); + if (NULL == last_errmsg) + as_bad ("bad instruction `%s'", start); + else + as_bad (last_errmsg); } -/* ??? This was copied from tc-sparc.c, I think. Is it necessary? */ +static void +arc_extoper (opertype) + int opertype; +{ + char *name; + char *mode; + char c; + char *p; + int imode = 0; + int number; + struct arc_ext_operand_value *ext_oper; + symbolS *symbolP; + + segT old_sec; + int old_subsec; + + name = input_line_pointer; + c = get_symbol_end (); + name = xstrdup (name); + if (NULL == name) + { + ignore_rest_of_line (); + return; + } + + p = name; + while (*p) + { + if (isupper (*p)) + *p = tolower (*p); + p++; + } + + /* just after name is now '\0' */ + p = input_line_pointer; + *p = c; + SKIP_WHITESPACE (); + + if (*input_line_pointer != ',') + { + as_bad ("expected comma after operand name"); + ignore_rest_of_line (); + free (name); + return; + } + + input_line_pointer++; /* skip ',' */ + number = get_absolute_expression (); + + if (number < 0) + { + as_bad ("negative operand number %d", number); + ignore_rest_of_line (); + free (name); + return; + } + + if (opertype) + { + SKIP_WHITESPACE (); + + if (*input_line_pointer != ',') + { + as_bad ("expected comma after register-number"); + ignore_rest_of_line (); + free (name); + return; + } + + input_line_pointer++; /* skip ',' */ + mode = input_line_pointer; + + if (!strncmp (mode, "r|w", 3)) + { + imode = 0; + input_line_pointer += 3; + } + else + { + if (!strncmp (mode, "r", 1)) + { + imode = ARC_REGISTER_READONLY; + input_line_pointer += 1; + } + else + { + if (strncmp (mode, "w", 1)) + { + as_bad ("invalid mode"); + ignore_rest_of_line (); + free (name); + return; + } + else + { + imode = ARC_REGISTER_WRITEONLY; + input_line_pointer += 1; + } + } + } + SKIP_WHITESPACE (); + if (1 == opertype) + { + if (*input_line_pointer != ',') + { + as_bad ("expected comma after register-mode"); + ignore_rest_of_line (); + free (name); + return; + } + + input_line_pointer++; /* skip ',' */ + + if (!strncmp (input_line_pointer, "cannot_shortcut", 15)) + { + imode |= arc_get_noshortcut_flag (); + input_line_pointer += 15; + } + else + { + if (strncmp (input_line_pointer, "can_shortcut", 12)) + { + as_bad ("shortcut designator invalid"); + ignore_rest_of_line (); + free (name); + return; + } + else + { + input_line_pointer += 12; + } + } + } + } + + if ((opertype == 1) && number > 60) + { + as_bad ("core register value (%d) too large", number); + ignore_rest_of_line (); + free (name); + return; + } + + if ((opertype == 0) && number > 31) + { + as_bad ("condition code value (%d) too large", number); + ignore_rest_of_line (); + free (name); + return; + } + + ext_oper = (struct arc_ext_operand_value *) \ + xmalloc (sizeof (struct arc_ext_operand_value)); + + if (opertype) + { + /* If the symbol already exists, point it at the new definition. */ + if ((symbolP = symbol_find (name))) + { + if (S_GET_SEGMENT (symbolP) == reg_section) + S_SET_VALUE (symbolP, (int) &ext_oper->operand); + else + { + as_bad ("attempt to override symbol: %s", name); + ignore_rest_of_line (); + free (name); + free (ext_oper); + return; + } + } + else + { + /* If its not there, add it. */ + symbol_table_insert (symbol_create (name, reg_section, + (int) &ext_oper->operand, &zero_address_frag)); + } + } + + ext_oper->operand.name = name; + ext_oper->operand.value = number; + ext_oper->operand.type = arc_operand_type (opertype); + ext_oper->operand.flags = imode; + + ext_oper->next = arc_ext_operands; + arc_ext_operands = ext_oper; + + /* OK, now that we know what this operand is, put a description in + the arc extension section of the output file. */ + + old_sec = now_seg; + old_subsec = now_subseg; + + arc_set_ext_seg (); + + switch (opertype) + { + case 0: + p = frag_more (1); + *p = 3 + strlen (name) + 1; + p = frag_more (1); + *p = EXT_COND_CODE; + p = frag_more (1); + *p = number; + p = frag_more (strlen (name) + 1); + strcpy (p, name); + break; + case 1: + p = frag_more (1); + *p = 3 + strlen (name) + 1; + p = frag_more (1); + *p = EXT_CORE_REGISTER; + p = frag_more (1); + *p = number; + p = frag_more (strlen (name) + 1); + strcpy (p, name); + break; + case 2: + p = frag_more (1); + *p = 6 + strlen (name) + 1; + p = frag_more (1); + *p = EXT_AUX_REGISTER; + p = frag_more (1); + *p = number >> 24 & 0xff; + p = frag_more (1); + *p = number >> 16 & 0xff; + p = frag_more (1); + *p = number >> 8 & 0xff; + p = frag_more (1); + *p = number & 0xff; + p = frag_more (strlen (name) + 1); + strcpy (p, name); + break; + default: + as_bad ("invalid opertype"); + ignore_rest_of_line (); + free (name); + return; + break; + } + + subseg_set (old_sec, old_subsec); + + /* Enter all registers into the symbol table. */ + + demand_empty_rest_of_line (); +} static void -arc_common (ignore) - int ignore; +arc_extinst (ignore) + int ignore ATTRIBUTE_UNUSED; +{ + unsigned char syntax[129]; + char *name; + char *p; + char c; + int suffixcode = -1; + int opcode, subopcode; + int i; + int class = 0; + int name_len; + struct arc_opcode *ext_op; + + segT old_sec; + int old_subsec; + + name = input_line_pointer; + c = get_symbol_end (); + name = xstrdup (name); + if (NULL == name) + { + ignore_rest_of_line (); + return; + } + strcpy (syntax, name); + name_len = strlen (name); + + /* just after name is now '\0' */ + p = input_line_pointer; + *p = c; + + SKIP_WHITESPACE (); + + if (*input_line_pointer != ',') + { + as_bad ("expected comma after operand name"); + ignore_rest_of_line (); + return; + } + + input_line_pointer++; /* skip ',' */ + opcode = get_absolute_expression (); + + SKIP_WHITESPACE (); + + if (*input_line_pointer != ',') + { + as_bad ("expected comma after opcode"); + ignore_rest_of_line (); + return; + } + + input_line_pointer++; /* skip ',' */ + subopcode = get_absolute_expression (); + + if (subopcode < 0) + { + as_bad ("negative subopcode %d", subopcode); + ignore_rest_of_line (); + return; + } + + if (subopcode) + { + if (3 != opcode) + { + as_bad ("subcode value found when opcode not equal 0x03"); + ignore_rest_of_line (); + return; + } + else + { + if (subopcode < 0x09 || subopcode == 0x3f) + { + as_bad ("invalid subopcode %d", subopcode); + ignore_rest_of_line (); + return; + } + } + } + + SKIP_WHITESPACE (); + + if (*input_line_pointer != ',') + { + as_bad ("expected comma after subopcode"); + ignore_rest_of_line (); + return; + } + + input_line_pointer++; /* skip ',' */ + + for (i = 0; i < (int) MAXSUFFIXCLASS; i++) + { + if (!strncmp (suffixclass[i].name,input_line_pointer, suffixclass[i].len)) + { + suffixcode = i; + input_line_pointer += suffixclass[i].len; + break; + } + } + + if (-1 == suffixcode) + { + as_bad ("invalid suffix class"); + ignore_rest_of_line (); + return; + } + + SKIP_WHITESPACE (); + + if (*input_line_pointer != ',') + { + as_bad ("expected comma after suffix class"); + ignore_rest_of_line (); + return; + } + + input_line_pointer++; /* skip ',' */ + + for (i = 0; i < (int) MAXSYNTAXCLASS; i++) + { + if (!strncmp (syntaxclass[i].name,input_line_pointer, syntaxclass[i].len)) + { + class = syntaxclass[i].class; + input_line_pointer += syntaxclass[i].len; + break; + } + } + + if (0 == (SYNTAX_VALID & class)) + { + as_bad ("invalid syntax class"); + ignore_rest_of_line (); + return; + } + + if ((0x3 == opcode) & (class & SYNTAX_3OP)) + { + as_bad ("opcode 0x3 and SYNTAX_3OP invalid"); + ignore_rest_of_line (); + return; + } + + switch (suffixcode) + { + case 0: + strcat (syntax, "%.q%.f "); + break; + case 1: + strcat (syntax, "%.f "); + break; + case 2: + strcat (syntax, "%.q "); + break; + case 3: + strcat (syntax, " "); + break; + default: + as_bad ("unknown suffix class"); + ignore_rest_of_line (); + return; + break; + }; + + strcat (syntax, ((opcode == 0x3) ? "%a,%b" : ((class & SYNTAX_3OP) ? "%a,%b,%c" : "%b,%c"))); + if (suffixcode < 2) + strcat (syntax, "%F"); + strcat (syntax, "%S%L"); + + ext_op = (struct arc_opcode *) xmalloc (sizeof (struct arc_opcode)); + if (NULL == ext_op) + { + ignore_rest_of_line (); + return; + } + + ext_op->syntax = xstrdup (syntax); + if (NULL == ext_op->syntax) + { + ignore_rest_of_line (); + return; + } + + ext_op->mask = I (-1) | ((0x3 == opcode) ? C (-1) : 0); + ext_op->value = I (opcode) | ((0x3 == opcode) ? C (subopcode) : 0); + ext_op->flags = class; + ext_op->next_asm = arc_ext_opcodes; + ext_op->next_dis = arc_ext_opcodes; + arc_ext_opcodes = ext_op; + + /* OK, now that we know what this inst is, put a description in the + arc extension section of the output file. */ + + old_sec = now_seg; + old_subsec = now_subseg; + + arc_set_ext_seg (); + + p = frag_more (1); + *p = 5 + name_len + 1; + p = frag_more (1); + *p = EXT_INSTRUCTION; + p = frag_more (1); + *p = opcode; + p = frag_more (1); + *p = subopcode; + p = frag_more (1); + *p = (class & (OP1_MUST_BE_IMM | OP1_IMM_IMPLIED) ? IGNORE_FIRST_OPD : 0); + p = frag_more (name_len); + strncpy (p, syntax, name_len); + p = frag_more (1); + *p = '\0'; + + subseg_set (old_sec, old_subsec); + + demand_empty_rest_of_line (); +} + +int +arc_set_ext_seg () +{ + if (!arcext_section) + { + arcext_section = subseg_new (".arcextmap", 0); + bfd_set_section_flags (stdoutput, arcext_section, + SEC_READONLY | SEC_HAS_CONTENTS); + } + else + subseg_set (arcext_section, 0); + return 1; +} + +static void +arc_common (localScope) + int localScope; { char *name; char c; char *p; - int temp, size; + int align, size; symbolS *symbolP; name = input_line_pointer; @@ -767,218 +1376,157 @@ arc_common (ignore) p = input_line_pointer; *p = c; 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; } + input_line_pointer++; /* skip ',' */ - if ((temp = get_absolute_expression ()) < 0) + size = get_absolute_expression (); + + if (size < 0) { - as_bad (_(".COMMon length (%d.) <0! Ignored."), temp); + as_bad ("negative symbol length"); ignore_rest_of_line (); return; } - size = temp; + *p = 0; symbolP = symbol_find_or_make (name); *p = c; + if (S_IS_DEFINED (symbolP) && ! S_IS_COMMON (symbolP)) { - as_bad (_("ignoring attempt to re-define symbol")); + as_bad ("ignoring attempt to re-define symbol"); ignore_rest_of_line (); return; } - if (S_GET_VALUE (symbolP) != 0) + if (((int) S_GET_VALUE (symbolP) != 0) \ + && ((int) S_GET_VALUE (symbolP) != size)) { - if (S_GET_VALUE (symbolP) != size) - { - as_warn (_("Length of .comm \"%s\" is already %ld. Not changed to %d."), - S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), size); - } + as_warn ("length of symbol \"%s\" already %ld, ignoring %d", + S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), size); } - assert (symbol_get_frag (symbolP) == &zero_address_frag); - if (*input_line_pointer != ',') - { - as_bad (_("expected comma after common length")); - ignore_rest_of_line (); - return; - } - input_line_pointer++; - SKIP_WHITESPACE (); - if (*input_line_pointer != '"') - { - temp = get_absolute_expression (); - if (temp < 0) - { - temp = 0; - as_warn (_("Common alignment negative; 0 assumed")); - } - if (symbolP->local) - { - segT old_sec; - int old_subsec; - char *p; - int align; + assert (symbolP->sy_frag == &zero_address_frag); - allocate_bss: - old_sec = now_seg; - old_subsec = now_subseg; - align = temp; - record_alignment (bss_section, align); - subseg_set (bss_section, 0); - if (align) - frag_align (align, 0, 0); - if (S_GET_SEGMENT (symbolP) == bss_section) - symbol_get_frag (symbolP)->fr_symbol = 0; - symbol_set_frag (symbolP, frag_now); - p = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, - (offsetT) size, (char *) 0); - *p = 0; - S_SET_SEGMENT (symbolP, bss_section); - S_CLEAR_EXTERNAL (symbolP); - subseg_set (old_sec, old_subsec); - } - else + /* Now parse the alignment field. This field is optional for + local and global symbols. Default alignment is zero. */ + if (*input_line_pointer == ',') + { + input_line_pointer++; + align = get_absolute_expression (); + if (align < 0) { - allocate_common: - S_SET_VALUE (symbolP, (valueT) size); - S_SET_ALIGN (symbolP, temp); - S_SET_EXTERNAL (symbolP); - S_SET_SEGMENT (symbolP, bfd_com_section_ptr); + align = 0; + as_warn ("assuming symbol alignment of zero"); } } else + align = 0; + + if (localScope != 0) { - input_line_pointer++; - /* ??? Some say data, some say bss. */ - if (strncmp (input_line_pointer, ".bss\"", 5) - && strncmp (input_line_pointer, ".data\"", 6)) - { - input_line_pointer--; - goto bad_common_segment; - } - while (*input_line_pointer++ != '"') - ; - goto allocate_common; + segT old_sec; + int old_subsec; + char *pfrag; + + old_sec = now_seg; + old_subsec = now_subseg; + record_alignment (bss_section, align); + subseg_set (bss_section, 0); /* ??? subseg_set (bss_section, 1); ??? */ + + if (align) + /* Do alignment. */ + frag_align (align, 0, 0); + + /* Detach from old frag. */ + if (S_GET_SEGMENT (symbolP) == bss_section) + symbolP->sy_frag->fr_symbol = NULL; + + symbolP->sy_frag = frag_now; + pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, + (offsetT) size, (char *) 0); + *pfrag = 0; + + S_SET_SIZE (symbolP, size); + S_SET_SEGMENT (symbolP, bss_section); + S_CLEAR_EXTERNAL (symbolP); + symbolP->local = 1; + subseg_set (old_sec, old_subsec); } + else + { + S_SET_VALUE (symbolP, (valueT) size); + S_SET_ALIGN (symbolP, align); + S_SET_EXTERNAL (symbolP); + S_SET_SEGMENT (symbolP, bfd_com_section_ptr); + } + + symbolP->bsym->flags |= BSF_OBJECT; + demand_empty_rest_of_line (); return; - - { - bad_common_segment: - p = input_line_pointer; - while (*p && *p != '\n') - p++; - c = *p; - *p = '\0'; - as_bad (_("bad .common segment %s"), input_line_pointer + 1); - *p = c; - input_line_pointer = p; - ignore_rest_of_line (); - return; - } } - + /* Select the cpu we're assembling for. */ static void -arc_cpu (ignore) - int ignore; +arc_option (ignore) + int ignore ATTRIBUTE_UNUSED; { int mach; char c; char *cpu; - /* If an instruction has already been seen, it's too late. */ - if (cpu_tables_init_p) - { - as_bad (_(".cpu command must appear before any instructions")); - ignore_rest_of_line (); - return; - } - cpu = input_line_pointer; c = get_symbol_end (); mach = arc_get_mach (cpu); *input_line_pointer = c; + + /* If an instruction has already been seen, it's too late. */ + if (cpu_tables_init_p) + { + as_bad ("\".option\" directive must appear before any instructions"); + ignore_rest_of_line (); + return; + } + if (mach == -1) goto bad_cpu; - demand_empty_rest_of_line (); - - /* The cpu may have been selected on the command line. - The choices must match. */ - /* ??? This was a command line option early on. It's gone now, but - leave this in. */ if (mach_type_specified_p && mach != arc_mach_type) - as_bad (_(".cpu conflicts with previous value")); + { + as_bad ("\".option\" directive conflicts with initial definition"); + ignore_rest_of_line (); + return; + } else { + /* The cpu may have been selected on the command line. */ + if (mach != arc_mach_type) + as_warn ("\".option\" directive overrides command-line (default) value"); arc_mach_type = mach; - mach_type_specified_p = 1; if (!bfd_set_arch_mach (stdoutput, bfd_arch_arc, mach)) - as_warn (_("could not set architecture and machine")); + as_fatal ("could not set architecture and machine"); + mach_type_specified_p = 1; } + demand_empty_rest_of_line (); return; bad_cpu: - as_bad (_("bad .cpu op")); + as_bad ("invalid identifier for \".option\""); ignore_rest_of_line (); } - -#if 0 -/* The .rename pseudo-op. This is used by gcc to implement - -mmangle-cpu-libgcc. */ - -static void -arc_rename (ignore) - int ignore; -{ - char *name,*new; - char c; - symbolS *sym; - int len; - - name = input_line_pointer; - c = get_symbol_end (); - sym = symbol_find_or_make (name); - *input_line_pointer = c; - - if (*input_line_pointer != ',') - { - as_bad (_("missing rename string")); - ignore_rest_of_line (); - return; - } - ++input_line_pointer; - SKIP_WHITESPACE (); - - name = input_line_pointer; - c = get_symbol_end (); - if (*name == '\0') - { - *input_line_pointer = c; - as_bad (_("invalid symbol to rename to")); - ignore_rest_of_line (); - return; - } - new = (char *) xmalloc (strlen (name) + 1); - strcpy (new, name); - *input_line_pointer = c; - symbol_get_tc (sym)->real_name = new; - - demand_empty_rest_of_line (); -} -#endif -/* Turn a string in input_line_pointer into a floating point constant of type - type, and store the appropriate bytes in *litP. The number of LITTLENUMS - emitted is stored in *sizeP. - An error message is returned, or NULL on OK. */ +/* Turn a string in input_line_pointer into a floating point constant + of type TYPE, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. An error message is + returned, or NULL on OK. */ -/* Equal to MAX_PRECISION in atof-ieee.c */ +/* Equal to MAX_PRECISION in atof-ieee.c */ #define MAX_LITTLENUMS 6 char * @@ -1007,7 +1555,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); @@ -1038,7 +1586,7 @@ md_number_to_chars (buf, val, n) number_to_chars_littleendian (buf, val, n); } -/* Round up a section size to the appropriate boundary. */ +/* Round up a section size to the appropriate boundary. */ valueT md_section_align (segment, size) @@ -1054,21 +1602,58 @@ md_section_align (segment, size) int md_estimate_size_before_relax (fragp, seg) - fragS *fragp; - asection *seg; + fragS *fragp ATTRIBUTE_UNUSED; + asection *seg ATTRIBUTE_UNUSED; { - abort (); + as_fatal (_("md_estimate_size_before_relax\n")); + return 1; } /* Convert a machine dependent frag. We never generate these. */ void md_convert_frag (abfd, sec, fragp) - bfd *abfd; - asection *sec; - fragS *fragp; + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec ATTRIBUTE_UNUSED; + fragS *fragp ATTRIBUTE_UNUSED; { - abort (); + as_fatal (_("md_convert_frag\n")); +} + +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) + { + expressionS two; + expressionP->X_op = O_right_shift; + two.X_op = O_constant; + two.X_add_symbol = two.X_op_symbol = NULL; + two.X_add_number = 2; + expressionP->X_op_symbol = make_expr_symbol (&two); + } + /* Allow %st(sym1-sym2) */ + else if (expressionP->X_op == O_subtract + && expressionP->X_add_symbol != NULL + && expressionP->X_op_symbol != NULL + && expressionP->X_add_number == 0) + { + expressionS two; + expressionP->X_add_symbol = make_expr_symbol (expressionP); + expressionP->X_op = O_right_shift; + two.X_op = O_constant; + two.X_add_symbol = two.X_op_symbol = NULL; + two.X_add_number = 2; + expressionP->X_op_symbol = make_expr_symbol (&two); + } + else + { + as_bad ("expression too complex code symbol"); + return; + } } /* Parse an operand that is machine-specific. @@ -1079,59 +1664,57 @@ md_convert_frag (abfd, sec, fragp) ??? We can't create new expression types so we map the %-op's onto the existing syntax. This means that the user could use the chosen syntax - to achieve the same effect. Perhaps put a special cookie in X_add_number - to mark the expression as special. */ + to achieve the same effect. */ -void +void md_operand (expressionP) expressionS *expressionP; { char *p = input_line_pointer; - if (*p == '%' && strncmp (p, "%st(", 4) == 0) - { - input_line_pointer += 4; - expression (expressionP); - if (*input_line_pointer != ')') - { - as_bad (_("missing ')' in %-op")); - return; - } - ++input_line_pointer; - if (expressionP->X_op == O_symbol - && expressionP->X_add_number == 0 - /* I think this test is unnecessary but just as a sanity check... */ - && expressionP->X_op_symbol == NULL) - { - expressionS two; + if (*p == '%') + if (strncmp (p, "%st(", 4) == 0) + { + input_line_pointer += 4; + expression (expressionP); + if (*input_line_pointer != ')') + { + as_bad ("missing ')' in %%-op"); + return; + } + ++input_line_pointer; + arc_code_symbol (expressionP); + } + else + { /* It could be a register. */ + int i, l; + struct arc_ext_operand_value *ext_oper = arc_ext_operands; + p++; - expressionP->X_op = O_right_shift; - two.X_op = O_constant; - two.X_add_symbol = two.X_op_symbol = NULL; - two.X_add_number = 2; - expressionP->X_op_symbol = make_expr_symbol (&two); - } - /* allow %st(sym1-sym2) */ - else if (expressionP->X_op == O_subtract - && expressionP->X_add_symbol != NULL - && expressionP->X_op_symbol != NULL - && expressionP->X_add_number == 0) - { - expressionS two; - - expressionP->X_add_symbol = make_expr_symbol (expressionP); - expressionP->X_op = O_right_shift; - two.X_op = O_constant; - two.X_add_symbol = two.X_op_symbol = NULL; - two.X_add_number = 2; - expressionP->X_op_symbol = make_expr_symbol (&two); - } - else - { - as_bad (_("expression too complex for %%st")); - return; - } - } + while (ext_oper) + { + l = strlen (ext_oper->operand.name); + if (!strncmp (p, ext_oper->operand.name, l) && !isalnum(*(p + l))) + { + input_line_pointer += l + 1; + expressionP->X_op = O_register; + expressionP->X_add_number = (int) &ext_oper->operand; + return; + } + ext_oper = ext_oper->next; + } + 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))) + { + input_line_pointer += l + 1; + expressionP->X_op = O_register; + expressionP->X_add_number = (int) &arc_reg_names[i]; + break; + } + } + } } /* We have no need to default values of symbols. @@ -1140,7 +1723,7 @@ md_operand (expressionP) symbolS * md_undefined_symbol (name) - char *name; + char *name ATTRIBUTE_UNUSED; { return 0; } @@ -1155,9 +1738,23 @@ md_undefined_symbol (name) void arc_parse_cons_expression (exp, nbytes) expressionS *exp; - int nbytes; + unsigned int nbytes ATTRIBUTE_UNUSED; { + char *p = input_line_pointer; + int code_symbol_fix = 0; + + for (; ! is_end_of_line[(unsigned char) *p]; p++) + if (*p == '@' && !strncmp (p, "@h30", 4)) + { + code_symbol_fix = 1; + strcpy (p, "; "); + } expr (0, exp); + if (code_symbol_fix) + { + arc_code_symbol (exp); + input_line_pointer = p; + } } /* Record a fixup for a cons expression. */ @@ -1192,7 +1789,7 @@ arc_cons_fix_new (frag, where, nbytes, exp) /* The location from which a PC relative jump should be calculated, given a PC relative reloc. */ -long +long md_pcrel_from (fixP) fixS *fixP; { @@ -1242,13 +1839,13 @@ get_arc_exp_reloc_type (data_p, default_type, exp, expnew) if (exp->X_op == O_right_shift && exp->X_op_symbol != NULL - && symbol_constant_p (exp->X_op_symbol) - && S_GET_VALUE (exp->X_op_symbol) == 2 + && exp->X_op_symbol->sy_value.X_op == O_constant + && exp->X_op_symbol->sy_value.X_add_number == 2 && exp->X_add_number == 0) { if (exp->X_add_symbol != NULL - && (symbol_constant_p (exp->X_add_symbol) - || symbol_equated_p (exp->X_add_symbol))) + && (exp->X_add_symbol->sy_value.X_op == O_constant + || exp->X_add_symbol->sy_value.X_op == O_symbol)) { *expnew = *exp; expnew->X_op = O_symbol; @@ -1256,10 +1853,9 @@ get_arc_exp_reloc_type (data_p, default_type, exp, expnew) return data_p ? BFD_RELOC_ARC_B26 : arc_operand_map['J']; } else if (exp->X_add_symbol != NULL - && (symbol_get_value_expression (exp->X_add_symbol)->X_op - == O_subtract)) + && exp->X_add_symbol->sy_value.X_op == O_subtract) { - *expnew = *symbol_get_value_expression (exp->X_add_symbol); + *expnew = exp->X_add_symbol->sy_value; return data_p ? BFD_RELOC_ARC_B26 : arc_operand_map['J']; } } @@ -1282,7 +1878,9 @@ md_apply_fix3 (fixP, valueP, seg) valueT *valueP; segT seg; { - /*char *buf = fixP->fx_where + fixP->fx_frag->fr_literal;*/ +#if 0 + char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; +#endif valueT value; /* FIXME FIXME FIXME: The value we are passed in *valueP includes @@ -1323,7 +1921,7 @@ md_apply_fix3 (fixP, valueP, seg) { /* We can't actually support subtracting a symbol. */ as_bad_where (fixP->fx_file, fixP->fx_line, - _("expression too complex")); + "expression too complex"); } } } @@ -1372,14 +1970,14 @@ md_apply_fix3 (fixP, valueP, seg) && operand->shift == 7); fixP->fx_r_type = BFD_RELOC_ARC_B22_PCREL; } - else if (0 && operand->fmt == 'J') + else if (operand->fmt == 'J') { assert ((operand->flags & ARC_OPERAND_ABSOLUTE_BRANCH) != 0 && operand->bits == 24 && operand->shift == 32); fixP->fx_r_type = BFD_RELOC_ARC_B26; } - else if (0 && operand->fmt == 'L') + else if (operand->fmt == 'L') { assert ((operand->flags & ARC_OPERAND_LIMM) != 0 && operand->bits == 32 @@ -1389,7 +1987,7 @@ md_apply_fix3 (fixP, valueP, seg) else { as_bad_where (fixP->fx_file, fixP->fx_line, - _("unresolved expression that must be resolved")); + "unresolved expression that must be resolved"); fixP->fx_done = 1; return 1; } @@ -1440,45 +2038,32 @@ md_apply_fix3 (fixP, valueP, seg) arelent * tc_gen_reloc (section, fixP) - asection *section; + asection *section ATTRIBUTE_UNUSED; fixS *fixP; { arelent *reloc; reloc = (arelent *) xmalloc (sizeof (arelent)); - reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); - *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy); + reloc->sym_ptr_ptr = &fixP->fx_addsy->bsym; reloc->address = fixP->fx_frag->fr_address + fixP->fx_where; reloc->howto = bfd_reloc_type_lookup (stdoutput, fixP->fx_r_type); if (reloc->howto == (reloc_howto_type *) NULL) { as_bad_where (fixP->fx_file, fixP->fx_line, - _("internal error: can't export reloc type %d (`%s')"), - fixP->fx_r_type, bfd_get_reloc_code_name (fixP->fx_r_type)); + "internal error: can't export reloc type %d (`%s')", + fixP->fx_r_type, + bfd_get_reloc_code_name (fixP->fx_r_type)); return NULL; } assert (!fixP->fx_pcrel == !reloc->howto->pc_relative); - reloc->addend = fixP->fx_addnumber; + /* Set addend to account for PC being advanced one insn before the + target address is computed, drop fx_addnumber as it is handled + elsewhere mlm */ + + reloc->addend = (fixP->fx_pcrel ? -4 : 0); return reloc; } - -/* Frobbers. */ - -#if 0 -/* Set the real name if the .rename pseudo-op was used. - Return 1 if the symbol should not be included in the symbol table. */ - -int -arc_frob_symbol (sym) - symbolS *sym; -{ - if (symbol_get_tc (sym)->real_name != (char *) NULL) - S_SET_NAME (sym, symbol_get_tc (sym)->real_name); - - return 0; -} -#endif diff --git a/gnu/dist/toolchain/gas/config/tc-arc.h b/gnu/dist/toolchain/gas/config/tc-arc.h index 5066201e73bb..e81611b844e4 100644 --- a/gnu/dist/toolchain/gas/config/tc-arc.h +++ b/gnu/dist/toolchain/gas/config/tc-arc.h @@ -1,5 +1,5 @@ /* tc-arc.h - Macros and type defines for the ARC. - Copyright (C) 1994, 1995, 1997, 1999 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). This file is part of GAS, the GNU Assembler. @@ -17,7 +17,7 @@ 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. */ + 02111-1307, USA. */ #define TC_ARC 1 @@ -27,7 +27,19 @@ #define TARGET_ARCH bfd_arch_arc +#define DIFF_EXPR_OK +#define REGISTER_PREFIX '%' + +#ifdef LITTLE_ENDIAN +#undef LITTLE_ENDIAN +#endif + +#ifdef BIG_ENDIAN +#undef BIG_ENDIAN +#endif + #define LITTLE_ENDIAN 1234 + #define BIG_ENDIAN 4321 /* The endianness of the target format may change based on command @@ -54,18 +66,3 @@ arc_parse_cons_expression (EXP, NBYTES) extern void arc_cons_fix_new (); #define TC_CONS_FIX_NEW(FRAG, WHERE, NBYTES, EXP) \ arc_cons_fix_new (FRAG, WHERE, NBYTES, EXP) - -#if 0 -/* Extra stuff that we need to keep track of for each symbol. */ -struct arc_tc_sy -{ - /* The real name, if the symbol was renamed. */ - char *real_name; -}; - -#define TC_SYMFIELD_TYPE struct arc_tc_sy - -/* Finish up the symbol. */ -extern int arc_frob_symbol PARAMS ((symbolS *)); -#define tc_frob_symbol(sym, punt) punt = arc_frob_symbol (sym) -#endif diff --git a/gnu/dist/toolchain/gas/config/tc-avr.c b/gnu/dist/toolchain/gas/config/tc-avr.c index ea8008c2a420..ce27fcee2267 100644 --- a/gnu/dist/toolchain/gas/config/tc-avr.c +++ b/gnu/dist/toolchain/gas/config/tc-avr.c @@ -25,16 +25,28 @@ #include "as.h" #include "subsegs.h" +struct avr_opcodes_s +{ + char *name; + char *constraints; + int insn_size; /* In words. */ + int isa; + unsigned int bin_opcode; +}; + +#define AVR_INSN(NAME, CONSTR, OPCODE, SIZE, ISA, BIN) \ +{#NAME, CONSTR, SIZE, ISA, BIN}, + +struct avr_opcodes_s avr_opcodes[] = +{ + #include "opcode/avr.h" + {NULL, NULL, 0, 0, 0} +}; + const char comment_chars[] = ";"; const char line_comment_chars[] = "#"; const char line_separator_chars[] = "$"; -#define AVR_ISA_1200 1 -#define AVR_ISA_2xxx 3 -#define AVR_ISA_MEGA_x03 0x17 -#define AVR_ISA_MEGA 0x10 -#define AVR_ISA_MEGA_161 0x1b - const char *md_shortopts = "m:"; struct mcu_type_s { @@ -45,11 +57,17 @@ struct mcu_type_s static struct mcu_type_s mcu_types[] = { - {"avr1", AVR_ISA_1200, bfd_mach_avr1}, + {"avr1", AVR_ISA_TINY1, bfd_mach_avr1}, {"avr2", AVR_ISA_2xxx, bfd_mach_avr2}, - {"avr3", AVR_ISA_MEGA_x03, bfd_mach_avr3}, - {"avr4", AVR_ISA_MEGA_161, bfd_mach_avr4}, + {"avr3", AVR_ISA_M103, bfd_mach_avr3}, + {"avr4", AVR_ISA_M83, bfd_mach_avr4}, + {"avr5", AVR_ISA_ALL, bfd_mach_avr5}, {"at90s1200", AVR_ISA_1200, bfd_mach_avr1}, + {"attiny10", AVR_ISA_TINY1, bfd_mach_avr1}, + {"attiny11", AVR_ISA_TINY1, bfd_mach_avr1}, + {"attiny12", AVR_ISA_TINY1, bfd_mach_avr1}, + {"attiny15", AVR_ISA_TINY1, bfd_mach_avr1}, + {"attiny28", AVR_ISA_TINY1, bfd_mach_avr1}, {"at90s2313", AVR_ISA_2xxx, bfd_mach_avr2}, {"at90s2323", AVR_ISA_2xxx, bfd_mach_avr2}, {"at90s2333", AVR_ISA_2xxx, bfd_mach_avr2}, @@ -60,17 +78,32 @@ static struct mcu_type_s mcu_types[] = {"at90s4434", AVR_ISA_2xxx, bfd_mach_avr2}, {"at90s8515", AVR_ISA_2xxx, bfd_mach_avr2}, {"at90s8535", AVR_ISA_2xxx, bfd_mach_avr2}, - {"atmega603", AVR_ISA_MEGA_x03, bfd_mach_avr3}, - {"atmega103", AVR_ISA_MEGA_x03, bfd_mach_avr3}, - {"atmega161", AVR_ISA_MEGA_161, bfd_mach_avr4}, + {"at90c8534", AVR_ISA_2xxx, bfd_mach_avr2}, + {"atmega603", AVR_ISA_M603, bfd_mach_avr3}, + {"atmega103", AVR_ISA_M103, bfd_mach_avr3}, + {"atmega83", AVR_ISA_M83, bfd_mach_avr4}, + {"atmega85", AVR_ISA_M83, bfd_mach_avr4}, + {"atmega161", AVR_ISA_M161, bfd_mach_avr5}, + {"atmega163", AVR_ISA_M161, bfd_mach_avr5}, + {"atmega32", AVR_ISA_M161, bfd_mach_avr5}, + {"at94k", AVR_ISA_94K, bfd_mach_avr5}, {NULL, 0, 0} }; - /* Current MCU type. */ static struct mcu_type_s default_mcu = {"avr2", AVR_ISA_2xxx,bfd_mach_avr2}; static struct mcu_type_s *avr_mcu = &default_mcu; +/* AVR target-specific switches. */ +struct avr_opt_s +{ + int all_opcodes; /* -mall-opcodes: accept all known AVR opcodes */ + int no_skip_bug; /* -mno-skip-bug: no warnings for skipping 2-word insns */ + int no_wrap; /* -mno-wrap: reject rjmp/rcall with 8K wrap-around */ +}; + +static struct avr_opt_s avr_opt = { 0, 0, 0 }; + const char EXP_CHARS[] = "eE"; const char FLT_CHARS[] = "dD"; static void avr_set_arch (int dummy); @@ -83,172 +116,16 @@ const pseudo_typeS md_pseudo_table[] = }; #define LDI_IMMEDIATE(x) (((x) & 0xf) | (((x) << 4) & 0xf00)) -#define REGISTER_P(x) ((x) == 'r' || (x) == 'd' || (x) == 'w') - -struct avr_opcodes_s -{ - char *name; - char *constraints; - char *opcode; - int insn_size; /* in words */ - int isa; - unsigned int bin_opcode; -}; - -static char * skip_space (char * s); -static char * extract_word (char *from, char *to, int limit); -static unsigned int avr_operand (struct avr_opcodes_s *opcode, - int where, char *op, char **line); -static unsigned int avr_operands (struct avr_opcodes_s *opcode, char **line); -static unsigned int avr_get_constant (char * str, unsigned int max); -static char *parse_exp (char *s, expressionS * op); -static bfd_reloc_code_real_type avr_ldi_expression (expressionS *exp); -long md_pcrel_from_section PARAMS ((fixS *, segT)); - -/* constraint letters - r - any register - d - `ldi' register (r16-r31) - M - immediate value from 0 to 255 - n - immediate value from 0 to 255 ( n = ~M ). Relocation impossible - w - `adiw' register (r24,r26,r28,r30) - s - immediate value from 0 to 7 - P - Port address value from 0 to 64. (in, out) - p - Port address value from 0 to 32. (cbi, sbi, sbic, sbis) - K - immediate value from 0 to 64 (used in `adiw', `sbiw') - e - pointer regegisters (X,Y,Z) - b - base pointer register and displacement ([YZ]+disp) - i - immediate value - l - signed pc relative offset from -64 to 63 - L - signed pc relative offset from -2048 to 2047 - h - absolut code address (call, jmp) - S - immediate value from 0 to 7 (S = s << 4) -*/ -struct avr_opcodes_s avr_opcodes[] = -{ - {"adc", "r,r", "000111rdddddrrrr", 1, AVR_ISA_1200, 0x1c00}, - {"add", "r,r", "000011rdddddrrrr", 1, AVR_ISA_1200, 0x0c00}, - {"and", "r,r", "001000rdddddrrrr", 1, AVR_ISA_1200, 0x2000}, - {"cp", "r,r", "000101rdddddrrrr", 1, AVR_ISA_1200, 0x1400}, - {"cpc", "r,r", "000001rdddddrrrr", 1, AVR_ISA_1200, 0x0400}, - {"cpse", "r,r", "000100rdddddrrrr", 1, AVR_ISA_1200, 0x1000}, - {"eor", "r,r", "001001rdddddrrrr", 1, AVR_ISA_1200, 0x2400}, - {"mov", "r,r", "001011rdddddrrrr", 1, AVR_ISA_1200, 0x2c00}, - {"mul", "r,r", "100111rdddddrrrr", 1, AVR_ISA_MEGA_161, 0x9c00}, - {"or", "r,r", "001010rdddddrrrr", 1, AVR_ISA_1200, 0x2800}, - {"sbc", "r,r", "000010rdddddrrrr", 1, AVR_ISA_1200, 0x0800}, - {"sub", "r,r", "000110rdddddrrrr", 1, AVR_ISA_1200, 0x1800}, - - {"clr", "r=r", "001001rdddddrrrr", 1, AVR_ISA_1200, 0x2400}, - {"lsl", "r=r", "000011rdddddrrrr", 1, AVR_ISA_1200, 0x0c00}, - {"rol", "r=r", "000111rdddddrrrr", 1, AVR_ISA_1200, 0x1c00}, - {"tst", "r=r", "001000rdddddrrrr", 1, AVR_ISA_1200, 0x2000}, - - {"andi", "d,M", "0111KKKKddddKKKK", 1, AVR_ISA_1200, 0x7000}, - /*XXX special case*/ - {"cbr", "d,n", "0111KKKKddddKKKK", 1, AVR_ISA_1200, 0x7000}, - {"cpi", "d,M", "0011KKKKddddKKKK", 1, AVR_ISA_1200, 0x3000}, - {"ldi", "d,M", "1110KKKKddddKKKK", 1, AVR_ISA_1200, 0xe000}, - {"ori", "d,M", "0110KKKKddddKKKK", 1, AVR_ISA_1200, 0x6000}, - {"sbci", "d,M", "0100KKKKddddKKKK", 1, AVR_ISA_1200, 0x4000}, - {"sbr", "d,M", "0110KKKKddddKKKK", 1, AVR_ISA_1200, 0x6000}, - {"subi", "d,M", "0101KKKKddddKKKK", 1, AVR_ISA_1200, 0x5000}, - - {"sbrc", "r,s", "1111110rrrrr0sss", 1, AVR_ISA_1200, 0xfc00}, - {"sbrs", "r,s", "1111111rrrrr0sss", 1, AVR_ISA_1200, 0xfe00}, - {"bld", "r,s", "1111100ddddd0sss", 1, AVR_ISA_1200, 0xf800}, - {"bst", "r,s", "1111101ddddd0sss", 1, AVR_ISA_1200, 0xfa00}, - - {"in", "r,P", "10110PPdddddPPPP", 1, AVR_ISA_1200, 0xb000}, - {"out", "P,r", "10111PPrrrrrPPPP", 1, AVR_ISA_1200, 0xb800}, - - {"adiw", "w,K", "10010110KKddKKKK", 1, AVR_ISA_2xxx, 0x9600}, - {"sbiw", "w,K", "10010111KKddKKKK", 1, AVR_ISA_2xxx, 0x9700}, - - {"cbi", "p,s", "10011000pppppsss", 1, AVR_ISA_1200, 0x9800}, - {"sbi", "p,s", "10011010pppppsss", 1, AVR_ISA_1200, 0x9a00}, - {"sbic", "p,s", "10011001pppppsss", 1, AVR_ISA_1200, 0x9900}, - {"sbis", "p,s", "10011011pppppsss", 1, AVR_ISA_1200, 0x9b00}, - - /* ee = {X=11,Y=10,Z=00, 0} */ - {"ld", "r,e", "100!000dddddee-+", 1, AVR_ISA_2xxx, 0x8000}, - {"st", "e,r", "100!001rrrrree-+", 1, AVR_ISA_2xxx, 0x8200}, - {"ldd", "r,b", "10o0oo0dddddbooo", 1, AVR_ISA_2xxx, 0x8000}, - {"std", "b,r", "10o0oo1rrrrrbooo", 1, AVR_ISA_2xxx, 0x8200}, - {"sts", "i,r", "1001001ddddd0000", 2, AVR_ISA_2xxx, 0x9200}, - {"lds", "r,i", "1001000ddddd0000", 2, AVR_ISA_2xxx, 0x9000}, - - {"brbc", "s,l", "111101lllllllsss", 1, AVR_ISA_1200, 0xf400}, - {"brbs", "s,l", "111100lllllllsss", 1, AVR_ISA_1200, 0xf000}, - - {"brcc", "l", "111101lllllll000", 1, AVR_ISA_1200, 0xf400}, - {"brcs", "l", "111100lllllll000", 1, AVR_ISA_1200, 0xf000}, - {"breq", "l", "111100lllllll001", 1, AVR_ISA_1200, 0xf001}, - {"brge", "l", "111101lllllll100", 1, AVR_ISA_1200, 0xf404}, - {"brhc", "l", "111101lllllll101", 1, AVR_ISA_1200, 0xf405}, - {"brhs", "l", "111100lllllll101", 1, AVR_ISA_1200, 0xf005}, - {"brid", "l", "111101lllllll111", 1, AVR_ISA_1200, 0xf407}, - {"brie", "l", "111100lllllll111", 1, AVR_ISA_1200, 0xf007}, - {"brlo", "l", "111100lllllll000", 1, AVR_ISA_1200, 0xf000}, - {"brlt", "l", "111100lllllll100", 1, AVR_ISA_1200, 0xf004}, - {"brmi", "l", "111100lllllll010", 1, AVR_ISA_1200, 0xf002}, - {"brne", "l", "111101lllllll001", 1, AVR_ISA_1200, 0xf401}, - {"brpl", "l", "111101lllllll010", 1, AVR_ISA_1200, 0xf402}, - {"brsh", "l", "111101lllllll000", 1, AVR_ISA_1200, 0xf400}, - {"brtc", "l", "111101lllllll110", 1, AVR_ISA_1200, 0xf406}, - {"brts", "l", "111100lllllll110", 1, AVR_ISA_1200, 0xf006}, - {"brvc", "l", "111101lllllll011", 1, AVR_ISA_1200, 0xf403}, - {"brvs", "l", "111100lllllll011", 1, AVR_ISA_1200, 0xf003}, - - {"rcall", "L", "1101LLLLLLLLLLLL", 1, AVR_ISA_1200, 0xd000}, - {"rjmp", "L", "1100LLLLLLLLLLLL", 1, AVR_ISA_1200, 0xc000}, - - {"call", "h", "1001010hhhhh111h", 2, AVR_ISA_MEGA, 0x940e}, - {"jmp", "h", "1001010hhhhh110h", 2, AVR_ISA_MEGA, 0x940c}, - - {"asr", "r", "1001010rrrrr0101", 1, AVR_ISA_1200, 0x9405}, - {"com", "r", "1001010rrrrr0000", 1, AVR_ISA_1200, 0x9400}, - {"dec", "r", "1001010rrrrr1010", 1, AVR_ISA_1200, 0x940a}, - {"inc", "r", "1001010rrrrr0011", 1, AVR_ISA_1200, 0x9403}, - {"lsr", "r", "1001010rrrrr0110", 1, AVR_ISA_1200, 0x9406}, - {"neg", "r", "1001010rrrrr0001", 1, AVR_ISA_1200, 0x9401}, - {"pop", "r", "1001000rrrrr1111", 1, AVR_ISA_2xxx, 0x900f}, - {"push", "r", "1001001rrrrr1111", 1, AVR_ISA_2xxx, 0x920f}, - {"ror", "r", "1001010rrrrr0111", 1, AVR_ISA_1200, 0x9407}, - {"ser", "d", "11101111dddd1111", 1, AVR_ISA_1200, 0xef0f}, - {"swap", "r", "1001010rrrrr0010", 1, AVR_ISA_1200, 0x9402}, - - {"bclr", "S", "100101001SSS1000", 1, AVR_ISA_1200, 0x9488}, - {"bset", "S", "100101000SSS1000", 1, AVR_ISA_1200, 0x9408}, - - {"clc", "", "1001010010001000", 1, AVR_ISA_1200, 0x9488}, - {"clh", "", "1001010011011000", 1, AVR_ISA_1200, 0x94d8}, - {"cli", "", "1001010011111000", 1, AVR_ISA_1200, 0x94f8}, - {"cln", "", "1001010010101000", 1, AVR_ISA_1200, 0x94a8}, - {"cls", "", "1001010011001000", 1, AVR_ISA_1200, 0x94c8}, - {"clt", "", "1001010011101000", 1, AVR_ISA_1200, 0x94e8}, - {"clv", "", "1001010010111000", 1, AVR_ISA_1200, 0x94b8}, - {"clz", "", "1001010010011000", 1, AVR_ISA_1200, 0x9498}, - {"icall","", "1001010100001001", 1, AVR_ISA_2xxx, 0x9509}, - {"ijmp", "", "1001010000001001", 1, AVR_ISA_2xxx, 0x9409}, - {"lpm", "", "1001010111001000", 1, AVR_ISA_2xxx, 0x95c8}, - {"nop", "", "0000000000000000", 1, AVR_ISA_1200, 0x0000}, - {"ret", "", "1001010100001000", 1, AVR_ISA_1200, 0x9508}, - {"reti", "", "1001010100011000", 1, AVR_ISA_1200, 0x9518}, - {"sec", "", "1001010000001000", 1, AVR_ISA_1200, 0x9408}, - {"seh", "", "1001010001011000", 1, AVR_ISA_1200, 0x9458}, - {"sei", "", "1001010001111000", 1, AVR_ISA_1200, 0x9478}, - {"sen", "", "1001010000101000", 1, AVR_ISA_1200, 0x9428}, - {"ses", "", "1001010001001000", 1, AVR_ISA_1200, 0x9448}, - {"set", "", "1001010001101000", 1, AVR_ISA_1200, 0x9468}, - {"sev", "", "1001010000111000", 1, AVR_ISA_1200, 0x9438}, - {"sez", "", "1001010000011000", 1, AVR_ISA_1200, 0x9418}, - {"sleep","", "1001010110001000", 1, AVR_ISA_1200, 0x9588}, - {"wdr", "", "1001010110101000", 1, AVR_ISA_1200, 0x95a8}, - {"elpm", "", "1001010111011000", 1, AVR_ISA_MEGA_x03, 0x95d8}, - {NULL, NULL, NULL, 0, 0, 0} -}; - +static void show_mcu_list PARAMS ((FILE *)); +static char *skip_space PARAMS ((char *)); +static char *extract_word PARAMS ((char *, char *, int)); +static unsigned int avr_operand PARAMS ((struct avr_opcodes_s *, + int, char *, char **)); +static unsigned int avr_operands PARAMS ((struct avr_opcodes_s *, char **)); +static unsigned int avr_get_constant PARAMS ((char *, int)); +static char *parse_exp PARAMS ((char *, expressionS *)); +static bfd_reloc_code_real_type avr_ldi_expression PARAMS ((expressionS *)); #define EXP_MOD_NAME(i) exp_mod[i].name #define EXP_MOD_RELOC(i) exp_mod[i].reloc @@ -257,13 +134,14 @@ struct avr_opcodes_s avr_opcodes[] = struct exp_mod_s { - char * name; + char *name; bfd_reloc_code_real_type reloc; bfd_reloc_code_real_type neg_reloc; int have_pm; }; -static struct exp_mod_s exp_mod[] = { +static struct exp_mod_s exp_mod[] = +{ {"hh8", BFD_RELOC_AVR_HH8_LDI, BFD_RELOC_AVR_HH8_LDI_NEG, 1}, {"pm_hh8", BFD_RELOC_AVR_HH8_LDI_PM, BFD_RELOC_AVR_HH8_LDI_PM_NEG, 0}, {"hi8", BFD_RELOC_AVR_HI8_LDI, BFD_RELOC_AVR_HI8_LDI_NEG, 1}, @@ -280,17 +158,54 @@ static struct hash_control *avr_hash; /* Reloc modifiers hash control (hh8,hi8,lo8,pm_xx). */ static struct hash_control *avr_mod_hash; -#define OPTION_MMCU (OPTION_MD_BASE + 1) +#define OPTION_MMCU 'm' +#define OPTION_ALL_OPCODES (OPTION_MD_BASE + 1) +#define OPTION_NO_SKIP_BUG (OPTION_MD_BASE + 2) +#define OPTION_NO_WRAP (OPTION_MD_BASE + 3) -struct option md_longopts[] = { - {"mmcu", required_argument, NULL, 'm'}, - {NULL, no_argument, NULL, 0} +struct option md_longopts[] = +{ + { "mmcu", required_argument, NULL, OPTION_MMCU }, + { "mall-opcodes", no_argument, NULL, OPTION_ALL_OPCODES }, + { "mno-skip-bug", no_argument, NULL, OPTION_NO_SKIP_BUG }, + { "mno-wrap", no_argument, NULL, OPTION_NO_WRAP }, + { NULL, no_argument, NULL, 0 } }; -size_t md_longopts_size = sizeof(md_longopts); + +size_t md_longopts_size = sizeof (md_longopts); + +/* Display nicely formatted list of known MCU names. */ + +static void +show_mcu_list (stream) + FILE *stream; +{ + int i, x; + + fprintf (stream, _("Known MCU names:")); + x = 1000; + + for (i = 0; mcu_types[i].name; i++) + { + int len = strlen (mcu_types[i].name); + + x += len + 1; + + if (x < 75) + fprintf (stream, " %s", mcu_types[i].name); + else + { + fprintf (stream, "\n %s", mcu_types[i].name); + x = len + 2; + } + } + + fprintf (stream, "\n"); +} static inline char * skip_space (s) - char * s; + char *s; { while (*s == ' ' || *s == '\t') ++s; @@ -298,6 +213,7 @@ skip_space (s) } /* Extract one word from FROM and copy it to TO. */ + static char * extract_word (char *from, char *to, int limit) { @@ -308,21 +224,23 @@ extract_word (char *from, char *to, int limit) /* Drop leading whitespace. */ from = skip_space (from); *to = 0; + /* Find the op code end. */ - for (op_start = op_end = from; *op_end != 0 && is_part_of_name(*op_end); ) + for (op_start = op_end = from; *op_end != 0 && is_part_of_name (*op_end);) { to[size++] = *op_end++; if (size + 1 >= limit) break; } + to[size] = 0; return op_end; } int md_estimate_size_before_relax (fragp, seg) - fragS *fragp; - asection *seg; + fragS *fragp ATTRIBUTE_UNUSED; + asection *seg ATTRIBUTE_UNUSED; { abort (); return 0; @@ -330,28 +248,36 @@ md_estimate_size_before_relax (fragp, seg) void md_show_usage (stream) - FILE *stream; + FILE *stream; { - fprintf - (stream, - _ ("AVR options:\n" + fprintf (stream, + _("AVR options:\n" " -mmcu=[avr-name] select microcontroller variant\n" " [avr-name] can be:\n" - " avr1 - AT90S1200\n" - " avr2 - AT90S2xxx, AT90S4xxx, AT90S85xx, ATtiny22\n" - " avr3 - ATmega103 or ATmega603\n" - " avr4 - ATmega161\n" + " avr1 - AT90S1200, ATtiny1x, ATtiny28\n" + " avr2 - AT90S2xxx, AT90S4xxx, AT90S8xxx, ATtiny22\n" + " avr3 - ATmega103, ATmega603\n" + " avr4 - ATmega83, ATmega85\n" + " avr5 - ATmega161, ATmega163, ATmega32, AT94K\n" " or immediate microcontroller name.\n")); + fprintf (stream, + _(" -mall-opcodes accept all AVR opcodes, even if not supported by MCU\n" + " -mno-skip-bug disable warnings for skipping two-word instructions\n" + " (default for avr4, avr5)\n" + " -mno-wrap reject rjmp/rcall instructions with 8K wrap-around\n" + " (default for avr3, avr5)\n")); + show_mcu_list (stream); } static void avr_set_arch (dummy) - int dummy; + int dummy ATTRIBUTE_UNUSED; { - char * str; - str = (char *)alloca (20); + char *str; + + str = (char *) alloca (20); input_line_pointer = extract_word (input_line_pointer, str, 20); - md_parse_option ('m', str); + md_parse_option (OPTION_MMCU, str); bfd_set_arch_mach (stdoutput, TARGET_ARCH, avr_mcu->mach); } @@ -360,43 +286,68 @@ md_parse_option (c, arg) int c; char *arg; { - char *t = alloca (strlen (arg) + 1); - char *s = t; - char *arg1 = arg; - do - *t = tolower (*arg1++); - while (*t++); - - if (c == 'm') + switch (c) { - int i; + case OPTION_MMCU: + { + int i; + char *s = alloca (strlen (arg) + 1); - for (i = 0; mcu_types[i].name; ++i) - if (strcmp (mcu_types[i].name, s) == 0) - break; + { + char *t = s; + char *arg1 = arg; - if (!mcu_types[i].name) - as_fatal (_ ("unknown MCU: %s\n"), arg); - if (avr_mcu == &default_mcu) - avr_mcu = &mcu_types[i]; - else - as_fatal (_ ("redefinition of mcu type `%s'"), mcu_types[i].name); + do + *t = tolower (*arg1++); + while (*t++); + } + + for (i = 0; mcu_types[i].name; ++i) + if (strcmp (mcu_types[i].name, s) == 0) + break; + + if (!mcu_types[i].name) + { + show_mcu_list (stderr); + as_fatal (_("unknown MCU: %s\n"), arg); + } + + /* It is OK to redefine mcu type within the same avr[1-5] bfd machine + type - this for allows passing -mmcu=... via gcc ASM_SPEC as well + as .arch ... in the asm output at the same time. */ + if (avr_mcu == &default_mcu || avr_mcu->mach == mcu_types[i].mach) + avr_mcu = &mcu_types[i]; + else + as_fatal (_("redefinition of mcu type `%s' to `%s'"), + avr_mcu->name, mcu_types[i].name); + return 1; + } + case OPTION_ALL_OPCODES: + avr_opt.all_opcodes = 1; + return 1; + case OPTION_NO_SKIP_BUG: + avr_opt.no_skip_bug = 1; + return 1; + case OPTION_NO_WRAP: + avr_opt.no_wrap = 1; return 1; } + return 0; } symbolS * md_undefined_symbol (name) - char *name; + char *name ATTRIBUTE_UNUSED; { return 0; } -/* Convert a string pointed to by input_line_pointer into a floating point - constant of type `type', and store the appropriate bytes to `*litP'. - The number of LITTLENUMS emitted is stored in `*sizeP'. Returns NULL if - OK, or an error message otherwise. */ +/* Turn a string in input_line_pointer into a floating point constant + of type TYPE, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. An error message is + returned, or NULL on OK. */ + char * md_atof (type, litP, sizeP) int type; @@ -426,59 +377,71 @@ md_atof (type, litP, sizeP) input_line_pointer = t; *sizeP = prec * sizeof (LITTLENUM_TYPE); + /* This loop outputs the LITTLENUMs in REVERSE order. */ for (wordP = words + prec - 1; prec--;) { md_number_to_chars (litP, (valueT) (*wordP--), sizeof (LITTLENUM_TYPE)); litP += sizeof (LITTLENUM_TYPE); } + return NULL; } void md_convert_frag (abfd, sec, fragP) - bfd *abfd; - asection *sec; - fragS *fragP; + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec ATTRIBUTE_UNUSED; + fragS *fragP ATTRIBUTE_UNUSED; { abort (); } - void md_begin () { - int i; + unsigned int i; struct avr_opcodes_s *opcode; - avr_hash = hash_new(); + avr_hash = hash_new (); /* Insert unique names into hash table. This hash table then provides a quick index to the first opcode with a particular name in the opcode table. */ - for (opcode = avr_opcodes; opcode->name; opcode++) hash_insert (avr_hash, opcode->name, (char *) opcode); avr_mod_hash = hash_new (); for (i = 0; i < sizeof (exp_mod) / sizeof (exp_mod[0]); ++i) - hash_insert (avr_mod_hash, EXP_MOD_NAME(i), (void*)(i+10)); - - for (i = 0; i < 32; i++) - { - char buf[5]; - - sprintf (buf, "r%d", i); - symbol_table_insert (symbol_new (buf, reg_section, i, - &zero_address_frag)); - sprintf (buf, "R%d", i); - symbol_table_insert (symbol_new (buf, reg_section, i, - &zero_address_frag)); - } + hash_insert (avr_mod_hash, EXP_MOD_NAME (i), (void *) (i + 10)); bfd_set_arch_mach (stdoutput, TARGET_ARCH, avr_mcu->mach); } +/* Resolve STR as a constant expression and return the result. + If result greater than MAX then error. */ + +static unsigned int +avr_get_constant (str, max) + char *str; + int max; +{ + expressionS ex; + str = skip_space (str); + input_line_pointer = str; + expression (&ex); + + if (ex.X_op != O_constant) + as_bad (_("constant value required")); + + if (ex.X_add_number > max || ex.X_add_number < 0) + as_bad (_("number must be less than %d"), max + 1); + + return ex.X_add_number; +} + +/* Parse instruction operands. + Return binary opcode. */ static unsigned int avr_operands (opcode, line) @@ -490,6 +453,7 @@ avr_operands (opcode, line) char *frag = frag_more (opcode->insn_size * 2); char *str = *line; int where = frag - frag_now->fr_literal; + static unsigned int prev = 0; /* Previous opcode. */ /* Opcode have operands. */ if (*op) @@ -510,6 +474,7 @@ avr_operands (opcode, line) { if (*op == ',') ++op; + if (*op == '=') { reg2 = reg1; @@ -522,12 +487,13 @@ avr_operands (opcode, line) str = skip_space (str); if (*str++ != ',') - as_bad (_ ("`,' required")); + as_bad (_("`,' required")); str = skip_space (str); reg2 = avr_operand (opcode, where, op, &str); } + if (reg1_present && reg2_present) reg2 = (reg2 & 0xf) | ((reg2 << 5) & 0x200); else if (reg2_present) @@ -537,35 +503,32 @@ avr_operands (opcode, line) reg1 <<= 4; bin |= reg1 | reg2; } + + /* Detect undefined combinations (like ld r31,Z+). */ + if (!avr_opt.all_opcodes && AVR_UNDEF_P (bin)) + as_warn (_("undefined combination of operands")); + if (opcode->insn_size == 2) { - bfd_putl32 ((bfd_vma)bin, frag); + /* Warn if the previous opcode was cpse/sbic/sbis/sbrc/sbrs + (AVR core bug, fixed in the newer devices). */ + + if (!(avr_opt.no_skip_bug || (avr_mcu->isa & AVR_ISA_MUL)) + && AVR_SKIP_P (prev)) + as_warn (_("skipping two-word instruction")); + + bfd_putl32 ((bfd_vma) bin, frag); } else - { - bfd_putl16 ((bfd_vma)bin, frag); - } + bfd_putl16 ((bfd_vma) bin, frag); + + prev = bin; *line = str; return bin; } -static unsigned int -avr_get_constant (str, max) - char * str; - unsigned int max; -{ - expressionS ex; - str = skip_space (str); - input_line_pointer = str; - expression (&ex); - - if (ex.X_op != O_constant) - as_bad (_("constant value required")); - - if (ex.X_add_number > max) - as_bad (_("number must be less than %d"), max+1); - return ex.X_add_number; -} +/* Parse one instruction operand. + Return operand bitmask. Also fixups can be generated. */ static unsigned int avr_operand (opcode, where, op, line) @@ -574,52 +537,80 @@ avr_operand (opcode, where, op, line) char *op; char **line; { - unsigned int op_mask = 0; - char *str = *line; expressionS op_expr; + unsigned int op_mask = 0; + char *str = skip_space (*line); - str = skip_space (str); switch (*op) { /* Any register operand. */ case 'w': case 'd': case 'r': - { - char r_name[256]; - str = extract_word (str, r_name, sizeof (r_name)); - parse_exp (r_name, &op_expr); - if (op_expr.X_op == O_register) - { - op_mask = op_expr.X_add_number; - if (op_mask <= 31) - { - if (*op == 'd') - { - if (op_mask < 16) - as_bad (_ ("register number above 15 required")); - op_mask -= 16; - } - if (*op == 'w') - { - op_mask -= 24; - if (op_mask & 1 || op_mask > 6) - as_bad (_ ("register r24,r26,r28 or r30 required")); - op_mask >>= 1; - } - break; - } - } - as_bad (_ ("register required")); - } + case 'a': + case 'v': + if (*str == 'r' || *str == 'R') + { + char r_name[20]; + + str = extract_word (str, r_name, sizeof (r_name)); + op_mask = 0xff; + if (isdigit (r_name[1])) + { + if (r_name[2] == '\0') + op_mask = r_name[1] - '0'; + else if (r_name[1] != '0' + && isdigit (r_name[2]) + && r_name[3] == '\0') + op_mask = (r_name[1] - '0') * 10 + r_name[2] - '0'; + } + } + else + { + op_mask = avr_get_constant (str, 31); + str = input_line_pointer; + } + + if (op_mask <= 31) + { + switch (*op) + { + case 'a': + if (op_mask < 16 || op_mask > 23) + as_bad (_("register r16-r23 required")); + op_mask -= 16; + break; + + case 'd': + if (op_mask < 16) + as_bad (_("register number above 15 required")); + op_mask -= 16; + break; + + case 'v': + if (op_mask & 1) + as_bad (_("even register number required")); + op_mask >>= 1; + break; + + case 'w': + if ((op_mask & 1) || op_mask < 24) + as_bad (_("register r24, r26, r28 or r30 required")); + op_mask = (op_mask - 24) >> 1; + break; + } + break; + } + as_bad (_("register name or number from 0 to 31 required")); break; case 'e': { char c; + if (*str == '-') { - str = skip_space (str+1); + str = skip_space (str + 1); op_mask = 0x1002; } c = tolower (*str); @@ -628,26 +619,49 @@ avr_operand (opcode, where, op, line) else if (c == 'y') op_mask |= 0x8; else if (c != 'z') - as_bad (_ ("pointer register (X,Y or Z) required")); + as_bad (_("pointer register (X, Y or Z) required")); - str = skip_space (str+1); + str = skip_space (str + 1); if (*str == '+') { ++str; if (op_mask & 2) - as_bad (_ ("cannot both predecrement and postincrement")); + as_bad (_("cannot both predecrement and postincrement")); op_mask |= 0x1001; } + + /* avr1 can do "ld r,Z" and "st Z,r" but no other pointer + registers, no predecrement, no postincrement. */ + if (!avr_opt.all_opcodes && (op_mask & 0x100F) + && !(avr_mcu->isa & AVR_ISA_SRAM)) + as_bad (_("addressing mode not supported")); } break; + case 'z': + if (*str == '-') + as_bad (_("can't predecrement")); + + if (! (*str == 'z' || *str == 'Z')) + as_bad (_("pointer register Z required")); + + str = skip_space (str + 1); + + if (*str == '+') + { + ++str; + op_mask |= 1; + } + break; + case 'b': { char c = tolower (*str++); + if (c == 'y') op_mask |= 0x8; else if (c != 'z') - as_bad (_ ("pointer register (Y or Z) required")); + as_bad (_("pointer register (Y or Z) required")); str = skip_space (str); if (*str++ == '+') { @@ -660,47 +674,36 @@ avr_operand (opcode, where, op, line) break; case 'h': - { - str = parse_exp (str, &op_expr); - fix_new_exp (frag_now, where, opcode->insn_size * 2, - &op_expr, false, BFD_RELOC_AVR_CALL); - - } + str = parse_exp (str, &op_expr); + fix_new_exp (frag_now, where, opcode->insn_size * 2, + &op_expr, false, BFD_RELOC_AVR_CALL); break; case 'L': - { - str = parse_exp (str, &op_expr); - fix_new_exp (frag_now, where, opcode->insn_size * 2, - &op_expr, true, BFD_RELOC_AVR_13_PCREL); - - } + str = parse_exp (str, &op_expr); + fix_new_exp (frag_now, where, opcode->insn_size * 2, + &op_expr, true, BFD_RELOC_AVR_13_PCREL); break; case 'l': - { - str = parse_exp (str, &op_expr); - fix_new_exp (frag_now, where, opcode->insn_size * 2, - &op_expr, true, BFD_RELOC_AVR_7_PCREL); - - } + str = parse_exp (str, &op_expr); + fix_new_exp (frag_now, where, opcode->insn_size * 2, + &op_expr, true, BFD_RELOC_AVR_7_PCREL); break; case 'i': - { - str = parse_exp (str, &op_expr); - fix_new_exp (frag_now, where+2, opcode->insn_size * 2, - &op_expr, false, BFD_RELOC_16); - - } + str = parse_exp (str, &op_expr); + fix_new_exp (frag_now, where + 2, opcode->insn_size * 2, + &op_expr, false, BFD_RELOC_16); break; case 'M': { bfd_reloc_code_real_type r_type; - input_line_pointer = str; - r_type = avr_ldi_expression (&op_expr); - str = input_line_pointer; + + input_line_pointer = str; + r_type = avr_ldi_expression (&op_expr); + str = input_line_pointer; fix_new_exp (frag_now, where, 3, &op_expr, false, r_type); } @@ -709,6 +712,7 @@ avr_operand (opcode, where, op, line) case 'n': { unsigned int x; + x = ~avr_get_constant (str, 255); str = input_line_pointer; op_mask |= (x & 0xf) | ((x << 4) & 0xf00); @@ -718,6 +722,7 @@ avr_operand (opcode, where, op, line) case 'K': { unsigned int x; + x = avr_get_constant (str, 63); str = input_line_pointer; op_mask |= (x & 0xf) | ((x & 0x30) << 2); @@ -728,6 +733,7 @@ avr_operand (opcode, where, op, line) case 's': { unsigned int x; + x = avr_get_constant (str, 7); str = input_line_pointer; if (*op == 'S') @@ -739,6 +745,7 @@ avr_operand (opcode, where, op, line) case 'P': { unsigned int x; + x = avr_get_constant (str, 63); str = input_line_pointer; op_mask |= (x & 0xf) | ((x & 0x30) << 5); @@ -748,20 +755,27 @@ avr_operand (opcode, where, op, line) case 'p': { unsigned int x; + x = avr_get_constant (str, 31); str = input_line_pointer; op_mask |= x << 3; } break; + + case '?': + break; + default: - as_bad (_ ("unknown constraint `%c'"), *op); + as_bad (_("unknown constraint `%c'"), *op); } + *line = str; return op_mask; } /* GAS will call this function for each section at the end of the assembly, to permit the CPU backend to adjust the alignment of a section. */ + valueT md_section_align (seg, addr) asection *seg; @@ -776,20 +790,23 @@ md_section_align (seg, addr) 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. */ + long md_pcrel_from_section (fixp, sec) fixS *fixp; segT sec; { - if (fixp->fx_addsy != (symbolS *)NULL + if (fixp->fx_addsy != (symbolS *) NULL && (!S_IS_DEFINED (fixp->fx_addsy) || (S_GET_SEGMENT (fixp->fx_addsy) != sec))) return 0; + return fixp->fx_frag->fr_address + fixp->fx_where; } /* GAS will call this for each fixup. It should store the correct - value in the object file. */ + value in the object file. */ + int md_apply_fix3 (fixp, valuep, seg) fixS *fixp; @@ -808,6 +825,7 @@ md_apply_fix3 (fixp, valuep, seg) else if (fixp->fx_pcrel) { segT s = S_GET_SEGMENT (fixp->fx_addsy); + if (fixp->fx_addsy && (s == seg || s == absolute_section)) { value = S_GET_VALUE (fixp->fx_addsy) + *valuep; @@ -819,6 +837,7 @@ md_apply_fix3 (fixp, valuep, seg) else { value = fixp->fx_offset; + if (fixp->fx_subsy != (symbolS *) NULL) { if (S_GET_SEGMENT (fixp->fx_subsy) == absolute_section) @@ -829,11 +848,12 @@ md_apply_fix3 (fixp, valuep, seg) else { /* We don't actually support subtracting a symbol. */ - as_bad_where (fixp->fx_file, fixp->fx_line, - _ ("expression too complex")); + as_bad_where (fixp->fx_file, fixp->fx_line, + _("expression too complex")); } } } + switch (fixp->fx_r_type) { default: @@ -860,9 +880,11 @@ md_apply_fix3 (fixp, valuep, seg) if (value & 1) as_bad_where (fixp->fx_file, fixp->fx_line, _("odd address operand: %ld"), value); + /* Instruction addresses are always right-shifted by 1. */ value >>= 1; --value; /* Correct PC. */ + if (value < -64 || value > 63) as_bad_where (fixp->fx_file, fixp->fx_line, _("operand out of range: %ld"), value); @@ -874,21 +896,15 @@ md_apply_fix3 (fixp, valuep, seg) if (value & 1) as_bad_where (fixp->fx_file, fixp->fx_line, _("odd address operand: %ld"), value); + /* Instruction addresses are always right-shifted by 1. */ value >>= 1; --value; /* Correct PC. */ - /* XXX AT90S8515 must have WRAP here. */ if (value < -2048 || value > 2047) { - if (avr_mcu->mach == bfd_mach_avr2) - { - if (value > 2047) - value -= 4096; - else - value += 4096; - } - else + /* No wrap for devices with >8K of program memory. */ + if ((avr_mcu->isa & AVR_ISA_MEGA) || avr_opt.no_wrap) as_bad_where (fixp->fx_file, fixp->fx_line, _("operand out of range: %ld"), value); } @@ -906,7 +922,7 @@ md_apply_fix3 (fixp, valuep, seg) break; case BFD_RELOC_AVR_16_PM: - bfd_putl16 ((bfd_vma) (value>>1), where); + bfd_putl16 ((bfd_vma) (value >> 1), where); break; case BFD_RELOC_AVR_LO8_LDI: @@ -976,6 +992,7 @@ md_apply_fix3 (fixp, valuep, seg) case BFD_RELOC_AVR_CALL: { unsigned long x; + x = bfd_getl16 (where); if (value & 1) as_bad_where (fixp->fx_file, fixp->fx_line, @@ -983,13 +1000,13 @@ md_apply_fix3 (fixp, valuep, seg) value >>= 1; x |= ((value & 0x10000) | ((value << 3) & 0x1f00000)) >> 16; bfd_putl16 ((bfd_vma) x, where); - bfd_putl16 ((bfd_vma) (value & 0xffff), where+2); + bfd_putl16 ((bfd_vma) (value & 0xffff), where + 2); } break; default: - as_fatal ( _("line %d: unknown relocation type: 0x%x"), - fixp->fx_line, fixp->fx_r_type); + as_fatal (_("line %d: unknown relocation type: 0x%x"), + fixp->fx_line, fixp->fx_r_type); break; } } @@ -1013,20 +1030,19 @@ md_apply_fix3 (fixp, valuep, seg) return 0; } - /* A `BFD_ASSEMBLER' GAS will call this to generate a reloc. GAS will pass the resulting reloc to `bfd_install_relocation'. This currently works poorly, as `bfd_install_relocation' often does the wrong thing, and instances of `tc_gen_reloc' have been written to work around the problems, which in turns makes it difficult to fix - `bfd_install_relocation'. */ + `bfd_install_relocation'. */ /* If while processing a fixup, a reloc really needs to be created then it is done here. */ arelent * tc_gen_reloc (seg, fixp) - asection *seg; + asection *seg ATTRIBUTE_UNUSED; fixS *fixp; { arelent *reloc; @@ -1041,8 +1057,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; } @@ -1055,46 +1071,52 @@ tc_gen_reloc (seg, fixp) return reloc; } - void md_assemble (str) char *str; { - struct avr_opcodes_s * opcode; + struct avr_opcodes_s *opcode; char op[11]; - str = extract_word (str, op, sizeof(op)); + str = skip_space (extract_word (str, op, sizeof (op))); if (!op[0]) - as_bad (_ ("can't find opcode ")); + as_bad (_("can't find opcode ")); opcode = (struct avr_opcodes_s *) hash_find (avr_hash, op); if (opcode == NULL) { - as_bad (_ ("unknown opcode `%s'"), op); + as_bad (_("unknown opcode `%s'"), op); return; } - if ((opcode->isa & avr_mcu->isa) != opcode->isa) - as_bad (_ ("illegal opcode %s for mcu %s"), opcode->name, avr_mcu->name); + /* Special case for opcodes with optional operands (lpm, elpm) - + version with operands exists in avr_opcodes[] in the next entry. */ + + if (*str && *opcode->constraints == '?') + ++opcode; + + if (!avr_opt.all_opcodes && (opcode->isa & avr_mcu->isa) != opcode->isa) + as_bad (_("illegal opcode %s for mcu %s"), opcode->name, avr_mcu->name); /* We used to set input_line_pointer to the result of get_operands, but that is wrong. Our caller assumes we don't change it. */ { char *t = input_line_pointer; avr_operands (opcode, &str); - if (*str) - as_bad (_ ("garbage at end of line")); + if (*skip_space (str)) + as_bad (_("garbage at end of line")); input_line_pointer = t; } } /* Parse ordinary expression. */ + static char * parse_exp (s, op) char *s; - expressionS * op; + expressionS *op; { input_line_pointer = s; expression (op); @@ -1103,14 +1125,13 @@ parse_exp (s, op) return input_line_pointer; } - /* Parse special expressions (needed for LDI command): xx8 (address) xx8 (-address) pm_xx8 (address) pm_xx8 (-address) - where xx is: hh, hi, lo -*/ + where xx is: hh, hi, lo. */ + static bfd_reloc_code_real_type avr_ldi_expression (exp) expressionS *exp; @@ -1122,28 +1143,35 @@ avr_ldi_expression (exp) tmp = str; str = extract_word (str, op, sizeof (op)); + if (op[0]) { mod = (int) hash_find (avr_mod_hash, op); + if (mod) { int closes = 0; + mod -= 10; str = skip_space (str); + if (*str == '(') { int neg_p = 0; + ++str; + if (strncmp ("pm(", str, 3) == 0 || strncmp ("-(pm(", str, 5) == 0) { - if (HAVE_PM_P(mod)) + if (HAVE_PM_P (mod)) { ++mod; ++closes; } else - as_bad (_ ("illegal expression")); + as_bad (_("illegal expression")); + if (*str == '-') { neg_p = 1; @@ -1153,46 +1181,63 @@ avr_ldi_expression (exp) else str += 3; } + if (*str == '-' && *(str + 1) == '(') { neg_p ^= 1; ++closes; str += 2; } + input_line_pointer = str; expression (exp); + do { if (*input_line_pointer != ')') { - as_bad (_ ("`)' required")); + as_bad (_("`)' required")); break; } input_line_pointer++; } while (closes--); + return neg_p ? EXP_MOD_NEG_RELOC (mod) : EXP_MOD_RELOC (mod); } } } + input_line_pointer = tmp; expression (exp); + + /* Warn about expressions that fail to use lo8 (). */ + if (exp->X_op == O_constant) + { + int x = exp->X_add_number; + if (x < -255 || x > 255) + as_warn (_("constant out of 8-bit range: %d"), x); + } + else + as_warn (_("expression possibly out of 8-bit range")); + return BFD_RELOC_AVR_LO8_LDI; } /* Flag to pass `pm' mode between `avr_parse_cons_expression' and - `avr_cons_fix_new' */ + `avr_cons_fix_new'. */ static int exp_mod_pm = 0; /* Parse special CONS expression: pm (expression) which is used for addressing to a program memory. - Relocation: BFD_RELOC_AVR_16_PM */ + Relocation: BFD_RELOC_AVR_16_PM. */ + void avr_parse_cons_expression (exp, nbytes) expressionS *exp; int nbytes; { - char * tmp; + char *tmp; exp_mod_pm = 0; @@ -1200,33 +1245,39 @@ avr_parse_cons_expression (exp, nbytes) if (nbytes == 2) { - char * pm_name = "pm"; + char *pm_name = "pm"; int len = strlen (pm_name); + if (strncasecmp (input_line_pointer, pm_name, len) == 0) { input_line_pointer = skip_space (input_line_pointer + len); + if (*input_line_pointer == '(') { input_line_pointer = skip_space (input_line_pointer + 1); exp_mod_pm = 1; expression (exp); + if (*input_line_pointer == ')') ++input_line_pointer; else { - as_bad (_ ("`)' required")); + as_bad (_("`)' required")); exp_mod_pm = 0; } + return; } + input_line_pointer = tmp; } } + expression (exp); } void -avr_cons_fix_new(frag, where, nbytes, exp) +avr_cons_fix_new (frag, where, nbytes, exp) fragS *frag; int where; int nbytes; @@ -1239,14 +1290,14 @@ avr_cons_fix_new(frag, where, nbytes, exp) else if (nbytes == 4) fix_new_exp (frag, where, nbytes, exp, false, BFD_RELOC_32); else - as_bad (_ ("illegal %srelocation size: %d"), "", nbytes); + as_bad (_("illegal %srelocation size: %d"), "", nbytes); } else { if (nbytes == 2) fix_new_exp (frag, where, nbytes, exp, false, BFD_RELOC_AVR_16_PM); else - as_bad (_ ("illegal %srelocation size: %d"), "`pm' ", nbytes); + as_bad (_("illegal %srelocation size: %d"), "`pm' ", nbytes); exp_mod_pm = 0; } } diff --git a/gnu/dist/toolchain/gas/config/tc-avr.h b/gnu/dist/toolchain/gas/config/tc-avr.h index 2a8d3eea828d..3f02f1e3b744 100644 --- a/gnu/dist/toolchain/gas/config/tc-avr.h +++ b/gnu/dist/toolchain/gas/config/tc-avr.h @@ -24,36 +24,35 @@ #error AVR support requires BFD_ASSEMBLER #endif - #define TC_AVR /* By convention, you should define this macro in the `.h' file. For example, `tc-m68k.h' defines `TC_M68K'. You might have to use this if it is necessary to add CPU specific code to the object format - file. */ + file. */ #define TARGET_FORMAT "elf32-avr" /* This macro is the BFD target name to use when creating the output - file. This will normally depend upon the `OBJ_FMT' macro. */ + file. This will normally depend upon the `OBJ_FMT' macro. */ #define TARGET_ARCH bfd_arch_avr -/* This macro is the BFD architecture to pass to `bfd_set_arch_mach'. */ +/* This macro is the BFD architecture to pass to `bfd_set_arch_mach'. */ #define TARGET_MACH 0 /* This macro is the BFD machine number to pass to - `bfd_set_arch_mach'. If it is not defined, GAS will use 0. */ + `bfd_set_arch_mach'. If it is not defined, GAS will use 0. */ #define TARGET_BYTES_BIG_ENDIAN 0 /* You should define this macro to be non-zero if the target is big - endian, and zero if the target is little endian. */ + endian, and zero if the target is little endian. */ #define ONLY_STANDARD_ESCAPES /* If you define this macro, GAS will warn about the use of - nonstandard escape sequences in a string. */ + nonstandard escape sequences in a string. */ #define md_operand(x) /* GAS will call this function for any expression that can not be recognized. When the function is called, `input_line_pointer' - will point to the start of the expression. */ + will point to the start of the expression. */ void avr_parse_cons_expression (expressionS *exp, int nbytes); @@ -67,14 +66,14 @@ void avr_cons_fix_new(fragS *frag,int where, int nbytes, expressionS *exp); #define TC_CONS_FIX_NEW(FRAG,WHERE,N,EXP) avr_cons_fix_new(FRAG,WHERE,N,EXP) /* You may define this macro to generate a fixup for a data - allocation pseudo-op. */ + allocation pseudo-op. */ #define md_number_to_chars number_to_chars_littleendian /* This should just call either `number_to_chars_bigendian' or `number_to_chars_littleendian', whichever is appropriate. On targets like the MIPS which support options to change the endianness, which function to call is a runtime decision. On - other targets, `md_number_to_chars' can be a simple macro. */ + other targets, `md_number_to_chars' can be a simple macro. */ #define WORKING_DOT_WORD /* @@ -89,7 +88,7 @@ void avr_cons_fix_new(fragS *frag,int where, int nbytes, expressionS *exp); `md_long_jump_size' to the size of a long jump (a jump that can go anywhere in the function), You should define `md_create_short_jump' to create a short jump around a long jump, - and define `md_create_long_jump' to create a long jump. */ + and define `md_create_long_jump' to create a long jump. */ #define MD_APPLY_FIX3 @@ -99,20 +98,31 @@ void avr_cons_fix_new(fragS *frag,int where, int nbytes, expressionS *exp); /* If you define this macro, it means that `tc_gen_reloc' may return multiple relocation entries for a single fixup. In this case, the return value of `tc_gen_reloc' is a pointer to a null terminated - array. */ + array. */ -#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section(FIXP, SEC) +#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section(FIXP, SEC) /* 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. */ + macro would return the length of an instruction. */ + +extern long md_pcrel_from_section PARAMS ((struct fix *, segT)); #define LISTING_WORD_SIZE 2 /* The number of bytes to put into a word in a listing. This affects the way the bytes are clumped together in the listing. For example, a value of 2 might print `1234 5678' where a value of 1 - would print `12 34 56 78'. The default value is 4. */ + would print `12 34 56 78'. The default value is 4. */ #define LEX_DOLLAR 0 /* AVR port uses `$' as a logical line separator */ + +#define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR) (P2VAR) = 0 +/* An `.lcomm' directive with no explicit alignment parameter will + use this macro to set P2VAR to the alignment that a request for + SIZE bytes will have. The alignment is expressed as a power of + two. If no alignment should take place, the macro definition + should do nothing. Some targets define a `.bss' directive that is + also affected by this macro. The default definition will set + P2VAR to the truncated power of two of sizes up to eight bytes. */ diff --git a/gnu/dist/toolchain/gas/config/tc-cris.c b/gnu/dist/toolchain/gas/config/tc-cris.c new file mode 100644 index 000000000000..8557b400c955 --- /dev/null +++ b/gnu/dist/toolchain/gas/config/tc-cris.c @@ -0,0 +1,2904 @@ +/* tc-cris.c -- Assembler code for the CRIS CPU core. + Copyright (C) 2000 Free Software Foundation, Inc. + + Contributed by Axis Communications AB, Lund, Sweden. + Originally written for GAS 1.38.1 by Mikael Asker. + Updated, BFDized and GNUified by Hans-Peter Nilsson. + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GAS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA. */ + +#include +#include +#include "as.h" +#include "subsegs.h" +#include "opcode/cris.h" +#include "dwarf2dbg.h" + +/* Conventions used here: + Generally speaking, pointers to binutils types such as "fragS" and + "expressionS" get parameter and variable names ending in "P", such as + "fragP", to harmonize with the rest of the binutils code. Other + pointers get a "p" suffix, such as "bufp". Any function or type-name + that could clash with a current or future binutils or GAS function get + a "cris_" prefix. */ + +#define SYNTAX_RELAX_REG_PREFIX "no_register_prefix" +#define SYNTAX_ENFORCE_REG_PREFIX "register_prefix" +#define SYNTAX_USER_SYM_LEADING_UNDERSCORE "leading_underscore" +#define SYNTAX_USER_SYM_NO_LEADING_UNDERSCORE "no_leading_underscore" +#define REGISTER_PREFIX_CHAR '$' + +/* This might be CRIS_INSN_NONE if we're assembling a prefix-insn only. + Note that some prefix-insns might be assembled as CRIS_INSN_NORMAL. */ +enum cris_insn_kind +{ + CRIS_INSN_NORMAL, CRIS_INSN_NONE, CRIS_INSN_BRANCH +}; + +/* An instruction will have one of these prefixes. + Although the same bit-pattern, we handle BDAP with an immediate + expression (eventually quick or [pc+]) different from when we only have + register expressions. */ +enum prefix_kind +{ + PREFIX_NONE, PREFIX_BDAP_IMM, PREFIX_BDAP, PREFIX_BIAP, PREFIX_DIP, + PREFIX_PUSH +}; + +/* The prefix for an instruction. */ +struct cris_prefix +{ + enum prefix_kind kind; + int base_reg_number; + unsigned int opcode; + + /* There might be an expression to be evaluated, like I in [rN+I]. */ + expressionS expr; + + /* If there's an expression, we might need a relocation. Here's the + type of what relocation to start relaxaton with. + The relocation is assumed to start immediately after the prefix insn, + so we don't provide an offset. */ + enum bfd_reloc_code_real reloc; +}; + +/* The description of the instruction being assembled. */ +struct cris_instruction +{ + /* If CRIS_INSN_NONE, then this insn is of zero length. */ + enum cris_insn_kind insn_type; + + /* If a special register was mentioned, this is its description, else + it is NULL. */ + const struct cris_spec_reg *spec_reg; + + unsigned int opcode; + + /* An insn may have at most one expression; theoretically there could be + another in its prefix (but I don't see how that could happen). */ + expressionS expr; + + /* The expression might need a relocation. Here's one to start + relaxation with. */ + enum bfd_reloc_code_real reloc; + + /* The size in bytes of an immediate expression, or zero in + nonapplicable. */ + int imm_oprnd_size; +}; + +static void cris_process_instruction PARAMS ((char *, + struct cris_instruction *, + struct cris_prefix *)); +static int get_bwd_size_modifier PARAMS ((char **, int *)); +static int get_bw_size_modifier PARAMS ((char **, int *)); +static int get_gen_reg PARAMS ((char **, int *)); +static int get_spec_reg PARAMS ((char **, + const struct cris_spec_reg **)); +static int get_autoinc_prefix_or_indir_op PARAMS ((char **, + struct cris_prefix *, + int *, int *, int *, + expressionS *)); +static int get_3op_or_dip_prefix_op PARAMS ((char **, + struct cris_prefix *)); +static int cris_get_expression PARAMS ((char **, expressionS *)); +static int get_flags PARAMS ((char **, int *)); +static void gen_bdap PARAMS ((int, expressionS *)); +static int branch_disp PARAMS ((int)); +static void gen_cond_branch_32 PARAMS ((char *, char *, fragS *, + symbolS *, symbolS *, long int)); +static void cris_number_to_imm PARAMS ((char *, long, int, fixS *)); +static void cris_create_short_jump PARAMS ((char *, addressT, addressT, + fragS *, symbolS *)); +static void s_syntax PARAMS ((int)); +static void s_cris_file PARAMS ((int)); +static void s_cris_loc PARAMS ((int)); + +/* All the .syntax functions. */ +static void cris_force_reg_prefix PARAMS ((void)); +static void cris_relax_reg_prefix PARAMS ((void)); +static void cris_sym_leading_underscore PARAMS ((void)); +static void cris_sym_no_leading_underscore PARAMS ((void)); + +/* Handle to the opcode hash table. */ +static struct hash_control *op_hash = NULL; + +/* Whether we demand that registers have a `$' prefix. Default here. */ +static boolean demand_register_prefix = false; + +/* Whether global user symbols have a leading underscore. Default here. */ +static boolean symbols_have_leading_underscore = true; + +const pseudo_typeS md_pseudo_table[] = +{ + {"dword", cons, 4}, + {"syntax", s_syntax, 0}, + {"file", s_cris_file, 0}, + {"loc", s_cris_loc, 0}, + {NULL, 0, 0} +}; + +static int warn_for_branch_expansion = 0; + +const char cris_comment_chars[] = ";"; + +/* This array holds the chars that only start a comment at the beginning of + a line. If the line seems to have the form '# 123 filename' + .line and .file directives will appear in the pre-processed output. */ +/* Note that input_file.c hand-checks for '#' at the beginning of the + first line of the input file. This is because the compiler outputs + #NO_APP at the beginning of its output. */ +/* Also note that slash-star will always start a comment. */ +const char line_comment_chars[] = "#"; +const char line_separator_chars[] = "@"; + +/* Now all floating point support is shut off. See md_atof. */ +const char EXP_CHARS[] = ""; +const char FLT_CHARS[] = ""; + +/* For CRIS, we encode the relax_substateTs (in e.g. fr_substate) as: + 2 1 0 + ---/ /--+-----------------+-----------------+-----------------+ + | what state ? | how long ? | + ---/ /--+-----------------+-----------------+-----------------+ + + The "how long" bits are 00 = byte, 01 = word, 10 = dword (long). + This is a Un*x convention. + Not all lengths are legit for a given value of (what state). + + Groups for CRIS address relaxing: + + 1. Bcc + length: byte, word, 10-byte expansion + + 2. BDAP + length: byte, word, dword */ + +#define STATE_CONDITIONAL_BRANCH (1) +#define STATE_BASE_PLUS_DISP_PREFIX (2) + +#define STATE_LENGTH_MASK (3) +#define STATE_BYTE (0) +#define STATE_WORD (1) +#define STATE_DWORD (2) +/* Symbol undefined. */ +#define STATE_UNDF (3) +#define STATE_MAX_LENGTH (3) + +/* These displacements are relative to the adress following the opcode + word of the instruction. The first letter is Byte, Word. The 2nd + letter is Forward, Backward. */ + +#define BRANCH_BF ( 254) +#define BRANCH_BB (-256) +#define BRANCH_WF (2 + 32767) +#define BRANCH_WB (2 + -32768) + +#define BDAP_BF ( 127) +#define BDAP_BB (-128) +#define BDAP_WF ( 32767) +#define BDAP_WB (-32768) + +#define ENCODE_RELAX(what, length) (((what) << 2) + (length)) + +const relax_typeS md_cris_relax_table[] = +{ + /* Error sentinel (0, 0). */ + {1, 1, 0, 0}, + + /* Unused (0, 1). */ + {1, 1, 0, 0}, + + /* Unused (0, 2). */ + {1, 1, 0, 0}, + + /* Unused (0, 3). */ + {1, 1, 0, 0}, + + /* Bcc o (1, 0). */ + {BRANCH_BF, BRANCH_BB, 0, ENCODE_RELAX (1, 1)}, + + /* Bcc [PC+] (1, 1). */ + {BRANCH_WF, BRANCH_WB, 2, ENCODE_RELAX (1, 2)}, + + /* BEXT/BWF, BA, JUMP (external), JUMP (always), Bnot_cc, JUMP (default) + (1, 2). */ + {0, 0, 10, 0}, + + /* Unused (1, 3). */ + {1, 1, 0, 0}, + + /* BDAP o (2, 0). */ + {BDAP_BF, BDAP_BB, 0, ENCODE_RELAX (2, 1)}, + + /* BDAP.[bw] [PC+] (2, 1). */ + {BDAP_WF, BDAP_WB, 2, ENCODE_RELAX (2, 2)}, + + /* BDAP.d [PC+] (2, 2). */ + {0, 0, 4, 0} +}; + +#undef BRANCH_BF +#undef BRANCH_BB +#undef BRANCH_WF +#undef BRANCH_WB +#undef BDAP_BF +#undef BDAP_BB +#undef BDAP_WF +#undef BDAP_WB + +/* Target-specific multicharacter options, not const-declared at usage + in 2.9.1 and CVS of 2000-02-16. */ +struct option md_longopts[] = +{ +#define OPTION_NO_US (OPTION_MD_BASE + 0) + {"no-underscore", no_argument, NULL, OPTION_NO_US}, +#define OPTION_US (OPTION_MD_BASE + 1) + {"underscore", no_argument, NULL, OPTION_US}, + {NULL, no_argument, NULL, 0} +}; + +/* Not const-declared at usage in 2.9.1. */ +size_t md_longopts_size = sizeof (md_longopts); +const char *md_shortopts = "hHN"; + +/* At first glance, this may seems wrong and should be 4 (ba + nop); but + since a short_jump must skip a *number* of long jumps, it must also be + a long jump. Here, we hope to make it a "ba [16bit_offs]" and a "nop" + for the delay slot and hope that the jump table at most needs + 32767/4=8191 long-jumps. A branch is better than a jump, since it is + relative; we will not have a reloc to fix up somewhere. + + Note that we can't add relocs, because relaxation uses these fixed + numbers, and md_create_short_jump is called after relaxation. */ + +const int md_short_jump_size = 6; +const int md_long_jump_size = 6; + +/* Report output format. Small changes in output format (like elf + variants below) can happen until all options are parsed. */ + +const char * +cris_target_format () +{ + switch (OUTPUT_FLAVOR) + { + case bfd_target_aout_flavour: + return "a.out-cris"; + + case bfd_target_elf_flavour: + if (symbols_have_leading_underscore) + return "elf32-us-cris"; + return "elf32-cris"; + + default: + abort (); + return NULL; + } +} + +/* Prepare machine-dependent frags for relaxation. + + Called just before relaxation starts. Any symbol that is now undefined + will not become defined. + + Return the correct fr_subtype in the frag. + + Return the initial "guess for fr_var" to caller. The guess for fr_var + is *actually* the growth beyond fr_fix. Whatever we do to grow fr_fix + or fr_var contributes to our returned value. + + Although it may not be explicit in the frag, pretend + fr_var starts with a value. */ + +int +md_estimate_size_before_relax (fragP, segment_type) + fragS *fragP; + /* The segment is either N_DATA or N_TEXT. */ + segT segment_type; +{ + int old_fr_fix; + + old_fr_fix = fragP->fr_fix; + + switch (fragP->fr_subtype) + { + case ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_UNDF): + if (S_GET_SEGMENT (fragP->fr_symbol) == segment_type) + { + /* The symbol lies in the same segment - a relaxable case. */ + fragP->fr_subtype + = ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_BYTE); + } + else + { + /* Unknown or not the same segment, so not relaxable. */ + char *writep; + + /* A small branch-always (2 bytes) to the "real" branch + instruction, plus a delay-slot nop (2 bytes), plus a + jump (2 plus 4 bytes). See gen_cond_branch_32. */ + fragP->fr_fix += 2 + 2 + 2 + 4; + writep = fragP->fr_literal + old_fr_fix; + gen_cond_branch_32 (fragP->fr_opcode, writep, fragP, + fragP->fr_symbol, (symbolS *) NULL, + fragP->fr_offset); + frag_wane (fragP); + } + break; + + case ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_BYTE): + case ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_WORD): + /* We *might* give a better initial guess if we peek at offsets + now, but the caller will relax correctly and without this, so + don't bother. */ + break; + + case ENCODE_RELAX (STATE_BASE_PLUS_DISP_PREFIX, STATE_UNDF): + /* Note that we can not do anything sane with relaxing + [rX + a_known_symbol_in_text], it will have to be a 32-bit + value. + + We could play tricks with managing a constant pool and make + a_known_symbol_in_text a "bdap [pc + offset]" pointing there, but + that's pointless, it can only be longer and slower. + + Off-topic: If PIC becomes *really* important, and has to be done + in the assembler and linker only (which would be weird or + clueless), we can so something. Imagine: + move.x [r + 32_bit_symbol],r + move.x [32_bit_symbol],r + move.x 32_bit_symbol,r + can be shortened by a word (8-bit offset) if we are close to the + symbol or keep its length (16-bit offset) or be a word longer + (32-bit offset). Then change the 32_bit_symbol into a "bdap [pc + + offset]", and put the offset to the 32_bit_symbol in "offset". + Weird, to say the least, and we still have to add support for a + PC-relative relocation in the loader (shared libraries). But + it's an interesting thought. */ + + if (S_GET_SEGMENT (fragP->fr_symbol) != absolute_section) + { + /* Go for dword if not absolute or same segment. */ + fragP->fr_subtype + = ENCODE_RELAX (STATE_BASE_PLUS_DISP_PREFIX, STATE_DWORD); + fragP->fr_var += 4; + } + else + { + /* Absolute expression. */ + long int value; + value = S_GET_VALUE (fragP->fr_symbol) + fragP->fr_offset; + + if (value >= -128 && value <= 127) + { + /* Byte displacement. */ + (fragP->fr_opcode)[0] = value; + } + else + { + /* Word or dword displacement. */ + int pow2_of_size = 1; + char *writep; + + if (value < -32768 || value > 32767) + { + /* Outside word range, make it a dword. */ + pow2_of_size = 2; + } + + /* Modify the byte-offset BDAP into a word or dword offset + BDAP. Or really, a BDAP rX,8bit into a + BDAP.[wd] rX,[PC+] followed by a word or dword. */ + (fragP->fr_opcode)[0] = BDAP_PC_LOW + pow2_of_size * 16; + + /* Keep the register number in the highest four bits. */ + (fragP->fr_opcode)[1] &= 0xF0; + (fragP->fr_opcode)[1] |= BDAP_INCR_HIGH; + + /* It grew by two or four bytes. */ + fragP->fr_fix += 1 << pow2_of_size; + writep = fragP->fr_literal + old_fr_fix; + md_number_to_chars (writep, value, 1 << pow2_of_size); + } + frag_wane (fragP); + } + break; + + default: + BAD_CASE (fragP->fr_subtype); + } + + return fragP->fr_var + (fragP->fr_fix - old_fr_fix); +} + +/* Perform post-processing of machine-dependent frags after relaxation. + Called after relaxation is finished. + In: Address of frag. + fr_type == rs_machine_dependent. + fr_subtype is what the address relaxed to. + + Out: Any fixS:s and constants are set up. + + The caller will turn the frag into a ".space 0". */ + +void +md_convert_frag (abfd, sec, fragP) + bfd *abfd ATTRIBUTE_UNUSED; + segT sec ATTRIBUTE_UNUSED; + fragS *fragP; +{ + /* Pointer to first byte in variable-sized part of the frag. */ + char *var_partp; + + /* Pointer to first opcode byte in frag. */ + char *opcodep; + + /* Used to check integrity of the relaxation. + One of 2 = long, 1 = word, or 0 = byte. */ + int length_code; + + /* Size in bytes of variable-sized part of frag. */ + int var_part_size = 0; + + /* This is part of *fragP. It contains all information about addresses + and offsets to varying parts. */ + symbolS *symbolP; + unsigned long var_part_offset; + + /* Where, in file space, is _var of *fragP? */ + unsigned long address_of_var_part = 0; + + /* Where, in file space, does addr point? */ + unsigned long target_address; + + know (fragP->fr_type == rs_machine_dependent); + + length_code = fragP->fr_subtype & STATE_LENGTH_MASK; + know (length_code >= 0 && length_code < STATE_MAX_LENGTH); + + var_part_offset = fragP->fr_fix; + var_partp = fragP->fr_literal + var_part_offset; + opcodep = fragP->fr_opcode; + + symbolP = fragP->fr_symbol; + target_address + = (symbolP + ? S_GET_VALUE (symbolP) + symbol_get_frag(fragP->fr_symbol)->fr_address + : 0 ) + fragP->fr_offset; + address_of_var_part = fragP->fr_address + var_part_offset; + + switch (fragP->fr_subtype) + { + case ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_BYTE): + opcodep[0] = branch_disp ((target_address - address_of_var_part)); + var_part_size = 0; + break; + + case ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_WORD): + /* We had a quick immediate branch, now turn it into a word one i.e. a + PC autoincrement. */ + opcodep[0] = BRANCH_PC_LOW; + opcodep[1] &= 0xF0; + opcodep[1] |= BRANCH_INCR_HIGH; + md_number_to_chars (var_partp, + (long) (target_address - (address_of_var_part + 2)), + 2); + var_part_size = 2; + break; + + case ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_DWORD): + gen_cond_branch_32 (fragP->fr_opcode, var_partp, fragP, + fragP->fr_symbol, (symbolS *) NULL, + fragP->fr_offset); + /* Ten bytes added: a branch, nop and a jump. */ + var_part_size = 2 + 2 + 4 + 2; + break; + + case ENCODE_RELAX (STATE_BASE_PLUS_DISP_PREFIX, STATE_BYTE): + var_partp[0] = target_address - (address_of_var_part + 1); + var_part_size = 0; + break; + + case ENCODE_RELAX (STATE_BASE_PLUS_DISP_PREFIX, STATE_WORD): + /* We had a BDAP 8-bit "quick immediate", now turn it into a 16-bit + one that uses PC autoincrement. */ + opcodep[0] = BDAP_PC_LOW + (1 << 4); + opcodep[1] &= 0xF0; + opcodep[1] |= BDAP_INCR_HIGH; + md_number_to_chars (var_partp, (long) (target_address), 2); + var_part_size = 2; + break; + + case ENCODE_RELAX (STATE_BASE_PLUS_DISP_PREFIX, STATE_DWORD): + /* We had a BDAP 16-bit "word", change the offset to a dword. */ + opcodep[0] = BDAP_PC_LOW + (2 << 4); + opcodep[1] &= 0xF0; + opcodep[1] |= BDAP_INCR_HIGH; + if (fragP->fr_symbol == NULL) + md_number_to_chars (var_partp, fragP->fr_offset, 4); + else + fix_new (fragP, var_partp - fragP->fr_literal, 4, fragP->fr_symbol, + fragP->fr_offset, 0, BFD_RELOC_32); + var_part_size = 4; + break; + + default: + BAD_CASE (fragP->fr_subtype); + break; + } + + fragP->fr_fix += var_part_size; +} + +/* Generate a short jump around a secondary jump table. + Used by md_create_long_jump. + + This used to be md_create_short_jump, but is now called from + md_create_long_jump instead, when sufficient. + since the sizes of the jumps are the same. It used to be brittle, + making possibilities for creating bad code. */ + +static void +cris_create_short_jump (storep, from_addr, to_addr, fragP, to_symbol) + char *storep; + addressT from_addr; + addressT to_addr; + fragS *fragP ATTRIBUTE_UNUSED; + symbolS *to_symbol ATTRIBUTE_UNUSED; +{ + long int distance; + + distance = to_addr - from_addr; + + if (-254 <= distance && distance <= 256) + { + /* Create a "short" short jump: "BA distance - 2". */ + storep[0] = branch_disp (distance - 2); + storep[1] = BA_QUICK_HIGH; + + /* A nop for the delay slot. */ + md_number_to_chars (storep + 2, NOP_OPCODE, 2); + + /* The extra word should be filled with something sane too. Make it + a nop to keep disassembly sane. */ + md_number_to_chars (storep + 4, NOP_OPCODE, 2); + } + else + { + /* Make it a "long" short jump: "BA (PC+)". */ + md_number_to_chars (storep, BA_PC_INCR_OPCODE, 2); + + /* ".WORD distance - 4". */ + md_number_to_chars (storep + 2, (long) (distance - 4), 2); + + /* A nop for the delay slot. */ + md_number_to_chars (storep + 4, NOP_OPCODE, 2); + } +} + +/* Generate a long jump in a secondary jump table. + + storep Where to store the jump instruction. + from_addr Address of the jump instruction. + to_addr Destination address of the jump. + fragP Which frag the destination address operand + lies in. + to_symbol Destination symbol. */ + +void +md_create_long_jump (storep, from_addr, to_addr, fragP, to_symbol) + char *storep; + addressT from_addr; + addressT to_addr; + fragS *fragP; + symbolS *to_symbol; +{ + long int distance; + + distance = to_addr - from_addr; + + if (-32763 <= distance && distance <= 32772) + { + /* Then make it a "short" long jump. */ + cris_create_short_jump (storep, from_addr, to_addr, fragP, + to_symbol); + } + else + { + /* We have a "long" long jump: "JUMP (PC+)". */ + md_number_to_chars (storep, JUMP_PC_INCR_OPCODE, 2); + + /* Follow with a ".DWORD to_addr". */ + fix_new (fragP, storep + 2 - fragP->fr_literal, 4, to_symbol, + 0, 0, BFD_RELOC_32); + } +} + +/* Port-specific assembler initialization. */ + +void +md_begin () +{ + const char *hashret = NULL; + int i = 0; + + /* Set up a hash table for the instructions. */ + op_hash = hash_new (); + if (op_hash == NULL) + as_fatal (_("Virtual memory exhausted")); + + while (cris_opcodes[i].name != NULL) + { + const char *name = cris_opcodes[i].name; + hashret = hash_insert (op_hash, name, (PTR) &cris_opcodes[i]); + + if (hashret != NULL && *hashret != '\0') + as_fatal (_("Can't hash `%s': %s\n"), cris_opcodes[i].name, + *hashret == 0 ? _("(unknown reason)") : hashret); + do + { + if (cris_opcodes[i].match & cris_opcodes[i].lose) + as_fatal (_("Buggy opcode: `%s' \"%s\"\n"), cris_opcodes[i].name, + cris_opcodes[i].args); + + ++i; + } + while (cris_opcodes[i].name != NULL + && strcmp (cris_opcodes[i].name, name) == 0); + } +} + +/* Assemble a source line. */ + +void +md_assemble (str) + char *str; +{ + struct cris_instruction output_instruction; + struct cris_prefix prefix; + char *opcodep; + char *p; + int insn_size = 0; + + know (str); + + /* Do the low-level grunt - assemble to bits and split up into a prefix + and ordinary insn. */ + cris_process_instruction (str, &output_instruction, &prefix); + + /* Handle any prefixes to the instruction. */ + switch (prefix.kind) + { + case PREFIX_NONE: + break; + + /* When the expression is unknown for a BDAP, it can need 0, 2 or 4 + extra bytes, so we handle it separately. */ + case PREFIX_BDAP_IMM: + gen_bdap (prefix.base_reg_number, &prefix.expr); + break; + + case PREFIX_BDAP: + case PREFIX_BIAP: + case PREFIX_DIP: + insn_size += 2; + opcodep = frag_more (2); + + /* Output the prefix opcode. */ + md_number_to_chars (opcodep, (long) prefix.opcode, 2); + + /* This only happens for DIP, but is ok for the others as they have + no reloc. */ + if (prefix.reloc != BFD_RELOC_NONE) + { + /* Output an absolute mode address. */ + insn_size += 4; + p = frag_more (4); + fix_new_exp (frag_now, (p - frag_now->fr_literal), 4, + &prefix.expr, 0, prefix.reloc); + } + break; + + case PREFIX_PUSH: + insn_size += 2; + opcodep = frag_more (2); + + /* Output the prefix opcode. Being a "push", we add the negative + size of the register to "sp". */ + if (output_instruction.spec_reg != NULL) + { + /* Special register. */ + opcodep[0] = -output_instruction.spec_reg->reg_size; + } + else + { + /* General register. */ + opcodep[0] = -4; + } + opcodep[1] = (REG_SP << 4) + (BDAP_QUICK_OPCODE >> 8); + break; + + default: + BAD_CASE (prefix.kind); + } + + /* If we only had a prefix insn, we're done. */ + if (output_instruction.insn_type == CRIS_INSN_NONE) + return; + + /* Done with the prefix. Continue with the main instruction. */ + insn_size += 2; + opcodep = frag_more (2); + + /* Output the instruction opcode. */ + md_number_to_chars (opcodep, (long) (output_instruction.opcode), 2); + + /* Output the symbol-dependent instruction stuff. */ + if (output_instruction.insn_type == CRIS_INSN_BRANCH) + { + segT to_seg = absolute_section; + int is_undefined = 0; + int length_code; + + if (output_instruction.expr.X_op != O_constant) + { + to_seg = S_GET_SEGMENT (output_instruction.expr.X_add_symbol); + + if (to_seg == undefined_section) + is_undefined = 1; + } + + if (output_instruction.expr.X_op == O_constant + || to_seg == now_seg || is_undefined) + { + /* If is_undefined, then the expression may BECOME now_seg. */ + length_code = is_undefined ? STATE_UNDF : STATE_BYTE; + + /* Make room for max ten bytes of variable length. */ + frag_var (rs_machine_dependent, 10, 0, + ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, length_code), + output_instruction.expr.X_add_symbol, + output_instruction.expr.X_add_number, + opcodep); + } + else + { + /* We have: to_seg != now_seg && to_seg != undefined_section. + This means it is a branch to a known symbol in another + section. Code in data? Weird but valid. Emit a 32-bit + branch. */ + insn_size += 10; + gen_cond_branch_32 (opcodep, frag_more (10), frag_now, + output_instruction.expr.X_add_symbol, + (symbolS *) NULL, + output_instruction.expr.X_add_number); + } + } + else + { + if (output_instruction.imm_oprnd_size > 0) + { + /* The intruction has an immediate operand. */ + enum bfd_reloc_code_real reloc = 0; + + switch (output_instruction.imm_oprnd_size) + { + /* Any byte-size immediate constants are treated as + word-size. FIXME: Thus overflow check does not work + correctly. */ + + case 2: + reloc = BFD_RELOC_16; + break; + + case 4: + reloc = BFD_RELOC_32; + break; + + default: + BAD_CASE (output_instruction.imm_oprnd_size); + } + + insn_size += output_instruction.imm_oprnd_size; + p = frag_more (output_instruction.imm_oprnd_size); + fix_new_exp (frag_now, (p - frag_now->fr_literal), + output_instruction.imm_oprnd_size, + &output_instruction.expr, 0, reloc); + } + else if (output_instruction.reloc != BFD_RELOC_NONE) + { + /* An immediate operand that has a relocation and needs to be + processed further. */ + + /* It is important to use fix_new_exp here and everywhere else + (and not fix_new), as fix_new_exp can handle "difference + expressions" - where the expression contains a difference of + two symbols in the same segment. */ + fix_new_exp (frag_now, (opcodep - frag_now->fr_literal), 2, + &output_instruction.expr, 0, + output_instruction.reloc); + } + } + + if (OUTPUT_FLAVOR == bfd_target_elf_flavour) + dwarf2_emit_insn (insn_size); +} + +/* Low level text-to-bits assembly. */ + +static void +cris_process_instruction (insn_text, out_insnp, prefixp) + char *insn_text; + struct cris_instruction *out_insnp; + struct cris_prefix *prefixp; +{ + char *s; + char modified_char = 0; + const char *args; + struct cris_opcode *instruction; + char *operands; + int match = 0; + int mode; + int regno; + int size_bits; + + /* Reset these fields to a harmless state in case we need to return in + error. */ + prefixp->kind = PREFIX_NONE; + prefixp->reloc = BFD_RELOC_NONE; + out_insnp->insn_type = CRIS_INSN_NORMAL; + out_insnp->imm_oprnd_size = 0; + + /* Find the end of the opcode mnemonic. We assume (true in 2.9.1) + that the caller has translated the opcode to lower-case, up to the + first non-letter. */ + for (operands = insn_text; islower (*operands); ++operands) + ; + + /* Terminate the opcode after letters, but save the character there if + it was of significance. */ + switch (*operands) + { + case '\0': + break; + + case '.': + /* Put back the modified character later. */ + modified_char = *operands; + /* Fall through. */ + + case ' ': + /* Consume the character after the mnemonic + and replace it with '\0'. */ + *operands++ = '\0'; + break; + + default: + as_bad (_("Unknown opcode: `%s'"), insn_text); + return; + } + + /* Find the instruction. */ + instruction = (struct cris_opcode *) hash_find (op_hash, insn_text); + if (instruction == NULL) + { + as_bad (_("Unknown opcode: `%s'"), insn_text); + return; + } + + /* Put back the modified character. */ + switch (modified_char) + { + case 0: + break; + + default: + *--operands = modified_char; + } + + /* Try to match an opcode table slot. */ + for (s = operands;;) + { + int imm_expr_found; + + /* Initialize *prefixp, perhaps after being modified for a + "near match". */ + prefixp->kind = PREFIX_NONE; + prefixp->reloc = BFD_RELOC_NONE; + + /* Initialize *out_insnp. */ + memset (out_insnp, 0, sizeof (*out_insnp)); + out_insnp->opcode = instruction->match; + out_insnp->reloc = BFD_RELOC_NONE; + out_insnp->insn_type = CRIS_INSN_NORMAL; + out_insnp->imm_oprnd_size = 0; + + imm_expr_found = 0; + + /* Build the opcode, checking as we go to make sure that the + operands match. */ + for (args = instruction->args;; ++args) + { + switch (*args) + { + case '\0': + /* If we've come to the end of arguments, we're done. */ + if (*s == '\0') + match = 1; + break; + + case '!': + /* Non-matcher character for disassembly. + Ignore it here. */ + continue; + + case ',': + case ' ': + /* These must match exactly. */ + if (*s++ == *args) + continue; + break; + + case 'B': + /* This is not really an operand, but causes a "BDAP + -size,SP" prefix to be output, for PUSH instructions. */ + prefixp->kind = PREFIX_PUSH; + continue; + + case 'b': + /* This letter marks an operand that should not be matched + in the assembler. It is a branch with 16-bit + displacement. The assembler will create them from the + 8-bit flavor when necessary. The assembler does not + support the [rN+] operand, as the [r15+] that is + generated for 16-bit displacements. */ + break; + + case 'c': + /* A 5-bit unsigned immediate in bits <4:0>. */ + if (! cris_get_expression (&s, &out_insnp->expr)) + break; + else + { + if (out_insnp->expr.X_op == O_constant + && (out_insnp->expr.X_add_number < 0 + || out_insnp->expr.X_add_number > 31)) + as_bad (_("Immediate value not in 5 bit unsigned range: %ld"), + out_insnp->expr.X_add_number); + + out_insnp->reloc = BFD_RELOC_CRIS_UNSIGNED_5; + continue; + } + + case 'C': + /* A 4-bit unsigned immediate in bits <3:0>. */ + if (! cris_get_expression (&s, &out_insnp->expr)) + break; + else + { + if (out_insnp->expr.X_op == O_constant + && (out_insnp->expr.X_add_number < 0 + || out_insnp->expr.X_add_number > 15)) + as_bad (_("Immediate value not in 4 bit unsigned range: %ld"), + out_insnp->expr.X_add_number); + + out_insnp->reloc = BFD_RELOC_CRIS_UNSIGNED_4; + continue; + } + + case 'D': + /* General register in bits <15:12> and <3:0>. */ + if (! get_gen_reg (&s, ®no)) + break; + else + { + out_insnp->opcode |= regno /* << 0 */; + out_insnp->opcode |= regno << 12; + continue; + } + + case 'f': + /* Flags from the condition code register. */ + { + int flags = 0; + + if (! get_flags (&s, &flags)) + break; + + out_insnp->opcode |= ((flags & 0xf0) << 8) | (flags & 0xf); + continue; + } + + case 'i': + /* A 6-bit signed immediate in bits <5:0>. */ + if (! cris_get_expression (&s, &out_insnp->expr)) + break; + else + { + if (out_insnp->expr.X_op == O_constant + && (out_insnp->expr.X_add_number < -32 + || out_insnp->expr.X_add_number > 31)) + as_bad (_("Immediate value not in 6 bit range: %ld"), + out_insnp->expr.X_add_number); + out_insnp->reloc = BFD_RELOC_CRIS_SIGNED_6; + continue; + } + + case 'I': + /* A 6-bit unsigned immediate in bits <5:0>. */ + if (! cris_get_expression (&s, &out_insnp->expr)) + break; + else + { + if (out_insnp->expr.X_op == O_constant + && (out_insnp->expr.X_add_number < 0 + || out_insnp->expr.X_add_number > 63)) + as_bad (_("Immediate value not in 6 bit unsigned range: %ld"), + out_insnp->expr.X_add_number); + out_insnp->reloc = BFD_RELOC_CRIS_UNSIGNED_6; + continue; + } + + case 'M': + /* A size modifier, B, W or D, to be put in a bit position + suitable for CLEAR instructions (i.e. reflecting a zero + register). */ + if (! get_bwd_size_modifier (&s, &size_bits)) + break; + else + { + switch (size_bits) + { + case 0: + out_insnp->opcode |= 0 << 12; + break; + + case 1: + out_insnp->opcode |= 4 << 12; + break; + + case 2: + out_insnp->opcode |= 8 << 12; + break; + } + continue; + } + + case 'm': + /* A size modifier, B, W or D, to be put in bits <5:4>. */ + if (! get_bwd_size_modifier (&s, &size_bits)) + break; + else + { + out_insnp->opcode |= size_bits << 4; + continue; + } + + case 'o': + /* A branch expression. */ + if (! cris_get_expression (&s, &out_insnp->expr)) + break; + else + { + out_insnp->insn_type = CRIS_INSN_BRANCH; + continue; + } + + case 'O': + /* A BDAP expression for any size, "expr,r". */ + if (! cris_get_expression (&s, &prefixp->expr)) + break; + else + { + if (*s != ',') + break; + + s++; + + if (!get_gen_reg (&s, &prefixp->base_reg_number)) + break; + + /* Since 'O' is used with an explicit bdap, we have no + "real" instruction. */ + prefixp->kind = PREFIX_BDAP_IMM; + out_insnp->insn_type = CRIS_INSN_NONE; + continue; + } + + case 'P': + /* Special register in bits <15:12>. */ + if (! get_spec_reg (&s, &out_insnp->spec_reg)) + break; + else + { + /* Use of some special register names come with a + specific warning. Note that we have no ".cpu type" + pseudo yet, so some of this is just unused + framework. */ + if (out_insnp->spec_reg->warning) + as_warn (out_insnp->spec_reg->warning); + else if (out_insnp->spec_reg->applicable_version + == cris_ver_warning) + /* Others have a generic warning. */ + as_warn (_("Unimplemented register `%s' specified"), + out_insnp->spec_reg->name); + + out_insnp->opcode + |= out_insnp->spec_reg->number << 12; + continue; + } + + case 'p': + /* This character is used in the disassembler to + recognize a prefix instruction to fold into the + addressing mode for the next instruction. It is + ignored here. */ + continue; + + case 'R': + /* General register in bits <15:12>. */ + if (! get_gen_reg (&s, ®no)) + break; + else + { + out_insnp->opcode |= regno << 12; + continue; + } + + case 'r': + /* General register in bits <3:0>. */ + if (! get_gen_reg (&s, ®no)) + break; + else + { + out_insnp->opcode |= regno /* << 0 */; + continue; + } + + case 'S': + /* Source operand in bit <10> and a prefix; a 3-operand + prefix. */ + if (! get_3op_or_dip_prefix_op (&s, prefixp)) + break; + else + continue; + + case 's': + /* Source operand in bits <10>, <3:0> and optionally a + prefix; i.e. an indirect operand or an side-effect + prefix. */ + if (! get_autoinc_prefix_or_indir_op (&s, prefixp, &mode, + ®no, + &imm_expr_found, + &out_insnp->expr)) + break; + else + { + if (prefixp->kind != PREFIX_NONE) + { + /* A prefix, so it has the autoincrement bit + set. */ + out_insnp->opcode |= (AUTOINCR_BIT << 8); + } + else + /* No prefix. The "mode" variable contains bits like + whether or not this is autoincrement mode. */ + out_insnp->opcode |= (mode << 10); + + out_insnp->opcode |= regno /* << 0 */ ; + continue; + } + + case 'x': + /* Rs.m in bits <15:12> and <5:4>. */ + if (! get_gen_reg (&s, ®no) + || ! get_bwd_size_modifier (&s, &size_bits)) + break; + else + { + out_insnp->opcode |= (regno << 12) | (size_bits << 4); + continue; + } + + case 'y': + /* Source operand in bits <10>, <3:0> and optionally a + prefix; i.e. an indirect operand or an side-effect + prefix. + + The difference to 's' is that this does not allow an + "immediate" expression. */ + if (! get_autoinc_prefix_or_indir_op (&s, prefixp, + &mode, ®no, + &imm_expr_found, + &out_insnp->expr) + || imm_expr_found) + break; + else + { + if (prefixp->kind != PREFIX_NONE) + { + /* A prefix, and those matched here always have + side-effects (see 's' case). */ + out_insnp->opcode |= (AUTOINCR_BIT << 8); + } + else + { + /* No prefix. The "mode" variable contains bits + like whether or not this is autoincrement + mode. */ + out_insnp->opcode |= (mode << 10); + } + + out_insnp->opcode |= regno /* << 0 */; + continue; + } + + case 'z': + /* Size modifier (B or W) in bit <4>. */ + if (! get_bw_size_modifier (&s, &size_bits)) + break; + else + { + out_insnp->opcode |= size_bits << 4; + continue; + } + + default: + BAD_CASE (*args); + } + + /* We get here when we fail a match above or we found a + complete match. Break out of this loop. */ + break; + } + + /* Was it a match or a miss? */ + if (match == 0) + { + /* If it's just that the args don't match, maybe the next + item in the table is the same opcode but with + matching operands. */ + if (instruction[1].name != NULL + && ! strcmp (instruction->name, instruction[1].name)) + { + /* Yep. Restart and try that one instead. */ + ++instruction; + s = operands; + continue; + } + else + { + /* We've come to the end of instructions with this + opcode, so it must be an error. */ + as_bad (_("Illegal operands")); + return; + } + } + else + { + /* We have a match. Check if there's anything more to do. */ + if (imm_expr_found) + { + /* There was an immediate mode operand, so we must check + that it has an appropriate size. */ + + switch (instruction->imm_oprnd_size) + { + default: + case SIZE_NONE: + /* Shouldn't happen; this one does not have immediate + operands with different sizes. */ + BAD_CASE (instruction->imm_oprnd_size); + break; + + case SIZE_FIX_32: + out_insnp->imm_oprnd_size = 4; + break; + + case SIZE_SPEC_REG: + switch (out_insnp->spec_reg->reg_size) + { + case 1: + if (out_insnp->expr.X_op == O_constant + && (out_insnp->expr.X_add_number < -128 + || out_insnp->expr.X_add_number > 255)) + as_bad (_("Immediate value not in 8 bit range: %ld"), + out_insnp->expr.X_add_number); + /* Fall through. */ + case 2: + /* FIXME: We need an indicator in the instruction + table to pass on, to indicate if we need to check + overflow for a signed or unsigned number. */ + if (out_insnp->expr.X_op == O_constant + && (out_insnp->expr.X_add_number < -32768 + || out_insnp->expr.X_add_number > 65535)) + as_bad (_("Immediate value not in 16 bit range: %ld"), + out_insnp->expr.X_add_number); + out_insnp->imm_oprnd_size = 2; + break; + + case 4: + out_insnp->imm_oprnd_size = 4; + break; + + default: + BAD_CASE (out_insnp->spec_reg->reg_size); + } + break; + + case SIZE_FIELD: + switch (size_bits) + { + case 0: + if (out_insnp->expr.X_op == O_constant + && (out_insnp->expr.X_add_number < -128 + || out_insnp->expr.X_add_number > 255)) + as_bad (_("Immediate value not in 8 bit range: %ld"), + out_insnp->expr.X_add_number); + /* Fall through. */ + case 1: + if (out_insnp->expr.X_op == O_constant + && (out_insnp->expr.X_add_number < -32768 + || out_insnp->expr.X_add_number > 65535)) + as_bad (_("Immediate value not in 16 bit range: %ld"), + out_insnp->expr.X_add_number); + out_insnp->imm_oprnd_size = 2; + break; + + case 2: + out_insnp->imm_oprnd_size = 4; + break; + + default: + BAD_CASE (out_insnp->spec_reg->reg_size); + } + } + } + } + break; + } +} + +/* Get a B, W, or D size modifier from the string pointed out by *cPP, + which must point to a '.' in front of the modifier. On successful + return, *cPP is advanced to the character following the size + modifier, and is undefined otherwise. + + cPP Pointer to pointer to string starting + with the size modifier. + + size_bitsp Pointer to variable to contain the size bits on + successful return. + + Return 1 iff a correct size modifier is found, else 0. */ + +static int +get_bwd_size_modifier (cPP, size_bitsp) + char **cPP; + int *size_bitsp; +{ + if (**cPP != '.') + return 0; + else + { + /* Consume the '.'. */ + (*cPP)++; + + switch (**cPP) + { + case 'B': + case 'b': + *size_bitsp = 0; + break; + + case 'W': + case 'w': + *size_bitsp = 1; + break; + + case 'D': + case 'd': + *size_bitsp = 2; + break; + + default: + return 0; + } + + /* Consume the size letter. */ + (*cPP)++; + return 1; + } +} + +/* Get a B or W size modifier from the string pointed out by *cPP, + which must point to a '.' in front of the modifier. On successful + return, *cPP is advanced to the character following the size + modifier, and is undefined otherwise. + + cPP Pointer to pointer to string starting + with the size modifier. + + size_bitsp Pointer to variable to contain the size bits on + successful return. + + Return 1 iff a correct size modifier is found, else 0. */ + +static int +get_bw_size_modifier (cPP, size_bitsp) + char **cPP; + int *size_bitsp; +{ + if (**cPP != '.') + return 0; + else + { + /* Consume the '.'. */ + (*cPP)++; + + switch (**cPP) + { + case 'B': + case 'b': + *size_bitsp = 0; + break; + + case 'W': + case 'w': + *size_bitsp = 1; + break; + + default: + return 0; + } + + /* Consume the size letter. */ + (*cPP)++; + return 1; + } +} + +/* Get a general register from the string pointed out by *cPP. The + variable *cPP is advanced to the character following the general + register name on a successful return, and has its initial position + otherwise. + + cPP Pointer to pointer to string, beginning with a general + register name. + + regnop Pointer to int containing the register number. + + Return 1 iff a correct general register designator is found, + else 0. */ + +static int +get_gen_reg (cPP, regnop) + char **cPP; + int *regnop; +{ + char *oldp; + oldp = *cPP; + + /* Handle a sometimes-mandatory dollar sign as register prefix. */ + if (**cPP == REGISTER_PREFIX_CHAR) + (*cPP)++; + else if (demand_register_prefix) + return 0; + + switch (**cPP) + { + case 'P': + case 'p': + /* "P" as in "PC"? Consume the "P". */ + (*cPP)++; + + if ((**cPP == 'C' || **cPP == 'c') + && ! isalnum ((*cPP)[1])) + { + /* It's "PC": consume the "c" and we're done. */ + (*cPP)++; + *regnop = REG_PC; + return 1; + } + break; + + case 'R': + case 'r': + /* Hopefully r[0-9] or r1[0-5]. Consume 'R' or 'r'. */ + (*cPP)++; + + if (isdigit (**cPP)) + { + /* It's r[0-9]. Consume and check the next digit. */ + *regnop = **cPP - '0'; + (*cPP)++; + + if (! isalnum (**cPP)) + { + /* No more digits, we're done. */ + return 1; + } + else + { + /* One more digit. Consume and add. */ + *regnop = *regnop * 10 + (**cPP - '0'); + + /* We need to check for a valid register number; Rn, + 0 <= n <= MAX_REG. */ + if (*regnop <= MAX_REG) + { + /* Consume second digit. */ + (*cPP)++; + return 1; + } + } + } + break; + + case 'S': + case 's': + /* "S" as in "SP"? Consume the "S". */ + (*cPP)++; + if (**cPP == 'P' || **cPP == 'p') + { + /* It's "SP": consume the "p" and we're done. */ + (*cPP)++; + *regnop = REG_SP; + return 1; + } + break; + + default: + /* Just here to silence compilation warnings. */ + ; + } + + /* We get here if we fail. Restore the pointer. */ + *cPP = oldp; + return 0; +} + +/* Get a special register from the string pointed out by *cPP. The + variable *cPP is advanced to the character following the special + register name if one is found, and retains its original position + otherwise. + + cPP Pointer to pointer to string starting with a special register + name. + + sregpp Pointer to Pointer to struct spec_reg, where a pointer to the + register description will be stored. + + Return 1 iff a correct special register name is found. */ + +static int +get_spec_reg (cPP, sregpp) + char **cPP; + const struct cris_spec_reg **sregpp; +{ + char *s1; + const char *s2; + char *name_begin = *cPP; + + const struct cris_spec_reg *sregp; + + /* Handle a sometimes-mandatory dollar sign as register prefix. */ + if (*name_begin == REGISTER_PREFIX_CHAR) + name_begin++; + else if (demand_register_prefix) + return 0; + + /* Loop over all special registers. */ + for (sregp = cris_spec_regs; sregp->name != NULL; sregp++) + { + /* Start over from beginning of the supposed name. */ + s1 = name_begin; + s2 = sregp->name; + + while (*s2 != '\0' + && (isupper (*s1) ? tolower (*s1) == *s2 : *s1 == *s2)) + { + s1++; + s2++; + } + + /* For a match, we must have consumed the name in the table, and we + must be outside what could be part of a name. Assume here that a + test for alphanumerics is sufficient for a name test. */ + if (*s2 == 0 && ! isalnum (*s1)) + { + /* We have a match. Update the pointer and be done. */ + *cPP = s1; + *sregpp = sregp; + return 1; + } + } + + /* If we got here, we did not find any name. */ + return 0; +} + +/* Get an unprefixed or side-effect-prefix operand from the string pointed + out by *cPP. The pointer *cPP is advanced to the character following + the indirect operand if we have success, else it contains an undefined + value. + + cPP Pointer to pointer to string beginning with the first + character of the supposed operand. + + prefixp Pointer to structure containing an optional instruction + prefix. + + is_autoincp Pointer to int indicating the indirect or autoincrement + bits. + + src_regnop Pointer to int containing the source register number in + the instruction. + + imm_foundp Pointer to an int indicating if an immediate expression + is found. + + imm_exprP Pointer to a structure containing an immediate + expression, if success and if *imm_foundp is nonzero. + + Return 1 iff a correct indirect operand is found. */ + +static int +get_autoinc_prefix_or_indir_op (cPP, prefixp, is_autoincp, src_regnop, + imm_foundp, imm_exprP) + char **cPP; + struct cris_prefix *prefixp; + int *is_autoincp; + int *src_regnop; + int *imm_foundp; + expressionS *imm_exprP; +{ + /* Assume there was no immediate mode expression. */ + *imm_foundp = 0; + + if (**cPP == '[') + { + /* So this operand is one of: + Indirect: [rN] + Autoincrement: [rN+] + Indexed with assign: [rN=rM+rO.S] + Offset with assign: [rN=rM+I], [rN=rM+[rO].s], [rN=rM+[rO+].s] + + Either way, consume the '['. */ + (*cPP)++; + + /* Get the rN register. */ + if (! get_gen_reg (cPP, src_regnop)) + /* If there was no register, then this cannot match. */ + return 0; + else + { + /* We got the register, now check the next character. */ + switch (**cPP) + { + case ']': + /* Indirect mode. We're done here. */ + prefixp->kind = PREFIX_NONE; + *is_autoincp = 0; + break; + + case '+': + /* This must be an auto-increment mode, if there's a + match. */ + prefixp->kind = PREFIX_NONE; + *is_autoincp = 1; + + /* We consume this character and break out to check the + closing ']'. */ + (*cPP)++; + break; + + case '=': + /* This must be indexed with assign, or offset with assign + to match. */ + (*cPP)++; + + /* Either way, the next thing must be a register. */ + if (! get_gen_reg (cPP, &prefixp->base_reg_number)) + /* No register, no match. */ + return 0; + else + { + /* We've consumed "[rN=rM", so we must be looking at + "+rO.s]" or "+I]", or "-I]", or "+[rO].s]" or + "+[rO+].s]". */ + if (**cPP == '+') + { + int index_reg_number; + (*cPP)++; + + if (**cPP == '[') + { + int size_bits; + /* This must be [rx=ry+[rz].s] or + [rx=ry+[rz+].s] or no match. We must be + looking at rz after consuming the '['. */ + (*cPP)++; + + if (!get_gen_reg (cPP, &index_reg_number)) + return 0; + + prefixp->kind = PREFIX_BDAP; + prefixp->opcode + = (BDAP_INDIR_OPCODE + + (prefixp->base_reg_number << 12) + + index_reg_number); + + if (**cPP == '+') + { + /* We've seen "[rx=ry+[rz+" here, so now we + know that there must be "].s]" left to + check. */ + (*cPP)++; + prefixp->opcode |= AUTOINCR_BIT << 8; + } + + /* If it wasn't autoincrement, we don't need to + add anything. */ + + /* Check the next-to-last ']'. */ + if (**cPP != ']') + return 0; + + (*cPP)++; + + /* Check the ".s" modifier. */ + if (! get_bwd_size_modifier (cPP, &size_bits)) + return 0; + + prefixp->opcode |= size_bits << 4; + + /* Now we got [rx=ry+[rz+].s or [rx=ry+[rz].s. + We break out to check the final ']'. */ + break; + } + /* It wasn't an indirection. Check if it's a + register. */ + else if (get_gen_reg (cPP, &index_reg_number)) + { + int size_bits; + + /* Indexed with assign mode: "[rN+rM.S]". */ + prefixp->kind = PREFIX_BIAP; + prefixp->opcode + = (BIAP_OPCODE + (index_reg_number << 12) + + prefixp->base_reg_number /* << 0 */); + + if (! get_bwd_size_modifier (cPP, &size_bits)) + /* Size missing, this isn't a match. */ + return 0; + else + { + /* Size found, break out to check the + final ']'. */ + prefixp->opcode |= size_bits << 4; + break; + } + } + /* Not a register. Then this must be "[rN+I]". */ + else if (cris_get_expression (cPP, &prefixp->expr)) + { + /* We've got offset with assign mode. Fill + in the blanks and break out to match the + final ']'. */ + prefixp->kind = PREFIX_BDAP_IMM; + break; + } + else + /* Neither register nor expression found, so + this can't be a match. */ + return 0; + } + /* Not "[rN+" but perhaps "[rN-"? */ + else if (**cPP == '-') + { + /* We must have an offset with assign mode. */ + if (! cris_get_expression (cPP, &prefixp->expr)) + /* No expression, no match. */ + return 0; + else + { + /* We've got offset with assign mode. Fill + in the blanks and break out to match the + final ']'. */ + prefixp->kind = PREFIX_BDAP_IMM; + break; + } + } + else + /* Neither '+' nor '-' after "[rN=rM". Lose. */ + return 0; + } + default: + /* Neither ']' nor '+' nor '=' after "[rN". Lose. */ + return 0; + } + } + + /* When we get here, we have a match and will just check the closing + ']'. We can still fail though. */ + if (**cPP != ']') + return 0; + else + { + /* Don't forget to consume the final ']'. + Then return in glory. */ + (*cPP)++; + return 1; + } + } + /* No indirection. Perhaps a constant? */ + else if (cris_get_expression (cPP, imm_exprP)) + { + /* Expression found, this is immediate mode. */ + prefixp->kind = PREFIX_NONE; + *is_autoincp = 1; + *src_regnop = REG_PC; + *imm_foundp = 1; + return 1; + } + + /* No luck today. */ + return 0; +} + +/* This function gets an indirect operand in a three-address operand + combination from the string pointed out by *cPP. The pointer *cPP is + advanced to the character following the indirect operand on success, or + has an unspecified value on failure. + + cPP Pointer to pointer to string begining + with the operand + + prefixp Pointer to structure containing an + instruction prefix + + Returns 1 iff a correct indirect operand is found. */ + +static int +get_3op_or_dip_prefix_op (cPP, prefixp) + char **cPP; + struct cris_prefix *prefixp; +{ + int reg_number; + + if (**cPP != '[') + /* We must have a '[' or it's a clean failure. */ + return 0; + + /* Eat the first '['. */ + (*cPP)++; + + if (**cPP == '[') + { + /* A second '[', so this must be double-indirect mode. */ + (*cPP)++; + prefixp->kind = PREFIX_DIP; + prefixp->opcode = DIP_OPCODE; + + /* Get the register or fail entirely. */ + if (! get_gen_reg (cPP, ®_number)) + return 0; + else + { + prefixp->opcode |= reg_number /* << 0 */ ; + if (**cPP == '+') + { + /* Since we found a '+', this must be double-indirect + autoincrement mode. */ + (*cPP)++; + prefixp->opcode |= AUTOINCR_BIT << 8; + } + + /* There's nothing particular to do, if this was a + double-indirect *without* autoincrement. */ + } + + /* Check the first ']'. The second one is checked at the end. */ + if (**cPP != ']') + return 0; + + /* Eat the first ']', so we'll be looking at a second ']'. */ + (*cPP)++; + } + /* No second '['. Then we should have a register here, making + it "[rN". */ + else if (get_gen_reg (cPP, &prefixp->base_reg_number)) + { + /* This must be indexed or offset mode: "[rN+I]" or + "[rN+rM.S]" or "[rN+[rM].S]" or "[rN+[rM+].S]". */ + if (**cPP == '+') + { + /* Not the first alternative, must be one of the last + three. */ + int index_reg_number; + + (*cPP)++; + + if (**cPP == '[') + { + /* This is "[rx+["... Expect a register next. */ + int size_bits; + (*cPP)++; + + if (!get_gen_reg (cPP, &index_reg_number)) + return 0; + + prefixp->kind = PREFIX_BDAP; + prefixp->opcode + = (BDAP_INDIR_OPCODE + + (prefixp->base_reg_number << 12) + + index_reg_number); + + /* We've seen "[rx+[ry", so check if this is + autoincrement. */ + if (**cPP == '+') + { + /* Yep, now at "[rx+[ry+". */ + (*cPP)++; + prefixp->opcode |= AUTOINCR_BIT << 8; + } + /* If it wasn't autoincrement, we don't need to + add anything. */ + + /* Check a first closing ']': "[rx+[ry]" or + "[rx+[ry+]". */ + if (**cPP != ']') + return 0; + (*cPP)++; + + /* Now expect a size modifier ".S". */ + if (! get_bwd_size_modifier (cPP, &size_bits)) + return 0; + + prefixp->opcode |= size_bits << 4; + + /* Ok, all interesting stuff has been seen: + "[rx+[ry+].S" or "[rx+[ry].S". We only need to + expect a final ']', which we'll do in a common + closing session. */ + } + /* Seen "[rN+", but not a '[', so check if we have a + register. */ + else if (get_gen_reg (cPP, &index_reg_number)) + { + /* This is indexed mode: "[rN+rM.S]" or + "[rN+rM.S+]". */ + int size_bits; + prefixp->kind = PREFIX_BIAP; + prefixp->opcode + = (BIAP_OPCODE + | prefixp->base_reg_number /* << 0 */ + | (index_reg_number << 12)); + + /* Consume the ".S". */ + if (! get_bwd_size_modifier (cPP, &size_bits)) + /* Missing size, so fail. */ + return 0; + else + /* Size found. Add that piece and drop down to + the common checking of the closing ']'. */ + prefixp->opcode |= size_bits << 4; + } + /* Seen "[rN+", but not a '[' or a register, so then + it must be a constant "I". */ + else if (cris_get_expression (cPP, &prefixp->expr)) + { + /* Expression found, so fill in the bits of offset + mode and drop down to check the closing ']'. */ + prefixp->kind = PREFIX_BDAP_IMM; + } + else + /* Nothing valid here: lose. */ + return 0; + } + /* Seen "[rN" but no '+', so check if it's a '-'. */ + else if (**cPP == '-') + { + /* Yep, we must have offset mode. */ + if (! cris_get_expression (cPP, &prefixp->expr)) + /* No expression, so we lose. */ + return 0; + else + { + /* Expression found to make this offset mode, so + fill those bits and drop down to check the + closing ']'. */ + prefixp->kind = PREFIX_BDAP_IMM; + } + } + else + { + /* We've seen "[rN", but not '+' or '-'; rather a ']'. + Hmm. Normally this is a simple indirect mode that we + shouldn't match, but if we expect ']', then we have a + zero offset, so it can be a three-address-operand, + like "[rN],rO,rP", thus offset mode. + + Don't eat the ']', that will be done in the closing + ceremony. */ + prefixp->expr.X_op = O_constant; + prefixp->expr.X_add_number = 0; + prefixp->expr.X_add_symbol = NULL; + prefixp->expr.X_op_symbol = NULL; + prefixp->kind = PREFIX_BDAP_IMM; + } + } + /* A '[', but no second '[', and no register. Check if we + have an expression, making this "[I]" for a double-indirect + prefix. */ + else if (cris_get_expression (cPP, &prefixp->expr)) + { + /* Expression found, the so called absolute mode for a + double-indirect prefix on PC. */ + prefixp->kind = PREFIX_DIP; + prefixp->opcode = DIP_OPCODE | (AUTOINCR_BIT << 8) | REG_PC; + prefixp->reloc = BFD_RELOC_32; + } + else + /* Neither '[' nor register nor expression. We lose. */ + return 0; + + /* We get here as a closing ceremony to a successful match. We just + need to check the closing ']'. */ + if (**cPP != ']') + /* Oops. Close but no air-polluter. */ + return 0; + + /* Don't forget to consume that ']', before returning in glory. */ + (*cPP)++; + return 1; +} + +/* Get an expression from the string pointed out by *cPP. + The pointer *cPP is advanced to the character following the expression + on a success, or retains its original value otherwise. + + cPP Pointer to pointer to string beginning with the expression. + + exprP Pointer to structure containing the expression. + + Return 1 iff a correct expression is found. */ + +static int +cris_get_expression (cPP, exprP) + char **cPP; + expressionS *exprP; +{ + char *saved_input_line_pointer; + segT exp; + + /* The "expression" function expects to find an expression at the + global variable input_line_pointer, so we have to save it to give + the impression that we don't fiddle with global variables. */ + saved_input_line_pointer = input_line_pointer; + input_line_pointer = *cPP; + + exp = expression (exprP); + if (exprP->X_op == O_illegal || exprP->X_op == O_absent) + { + input_line_pointer = saved_input_line_pointer; + return 0; + } + + /* Everything seems to be fine, just restore the global + input_line_pointer and say we're successful. */ + *cPP = input_line_pointer; + input_line_pointer = saved_input_line_pointer; + return 1; +} + +/* Get a sequence of flag characters from *spp. The pointer *cPP is + advanced to the character following the expression. The flag + characters are consecutive, no commas or spaces. + + cPP Pointer to pointer to string beginning with the expression. + + flagp Pointer to int to return the flags expression. + + Return 1 iff a correct flags expression is found. */ + +static int +get_flags (cPP, flagsp) + char **cPP; + int *flagsp; +{ + for (;;) + { + switch (**cPP) + { + case 'd': + case 'D': + case 'm': + case 'M': + *flagsp |= 0x80; + break; + + case 'e': + case 'E': + case 'b': + case 'B': + *flagsp |= 0x40; + break; + + case 'i': + case 'I': + *flagsp |= 0x20; + break; + + case 'x': + case 'X': + *flagsp |= 0x10; + break; + + case 'n': + case 'N': + *flagsp |= 0x8; + break; + + case 'z': + case 'Z': + *flagsp |= 0x4; + break; + + case 'v': + case 'V': + *flagsp |= 0x2; + break; + + case 'c': + case 'C': + *flagsp |= 1; + break; + + default: + /* We consider this successful if we stop at a comma or + whitespace. Anything else, and we consider it a failure. */ + if (**cPP != ',' + && **cPP != 0 + && ! isspace (**cPP)) + return 0; + else + return 1; + } + + /* Don't forget to consume each flag character. */ + (*cPP)++; + } +} + +/* Generate code and fixes for a BDAP prefix. + + base_regno Int containing the base register number. + + exprP Pointer to structure containing the offset expression. */ + +static void +gen_bdap (base_regno, exprP) + int base_regno; + expressionS *exprP; +{ + unsigned int opcode; + char *opcodep; + + /* Put out the prefix opcode; assume quick immediate mode at first. */ + opcode = BDAP_QUICK_OPCODE | (base_regno << 12); + opcodep = frag_more (2); + md_number_to_chars (opcodep, opcode, 2); + + if (exprP->X_op == O_constant) + { + /* We have an absolute expression that we know the size of right + now. */ + long int value; + int size; + + value = exprP->X_add_number; + if (value < -32768 || value > 32767) + /* Outside range for a "word", make it a dword. */ + size = 2; + else + /* Assume "word" size. */ + size = 1; + + /* If this is a signed-byte value, we can fit it into the prefix + insn itself. */ + if (value >= -128 && value <= 127) + opcodep[0] = value; + else + { + /* This is a word or dword displacement, which will be put in a + word or dword after the prefix. */ + char *p; + + opcodep[0] = BDAP_PC_LOW + (size << 4); + opcodep[1] &= 0xF0; + opcodep[1] |= BDAP_INCR_HIGH; + p = frag_more (1 << size); + md_number_to_chars (p, value, 1 << size); + } + } + else + /* The expression is not defined yet but may become absolute. We make + it a relocation to be relaxed. */ + frag_var (rs_machine_dependent, 4, 0, + ENCODE_RELAX (STATE_BASE_PLUS_DISP_PREFIX, STATE_UNDF), + exprP->X_add_symbol, exprP->X_add_number, opcodep); +} + +/* Encode a branch displacement in the range -256..254 into the form used + by CRIS conditional branch instructions. + + offset The displacement value in bytes. */ + +static int +branch_disp (offset) + int offset; +{ + int disp; + + disp = offset & 0xFE; + + if (offset < 0) + disp |= 1; + + return disp; +} + +/* Generate code and fixes for a 32-bit conditional branch instruction + created by "extending" an existing 8-bit branch instruction. + + opcodep Pointer to the word containing the original 8-bit branch + instruction. + + writep Pointer to "extension area" following the first instruction + word. + + fragP Pointer to the frag containing the instruction. + + add_symP, Parts of the destination address expression. + sub_symP, + add_num. */ + +static void +gen_cond_branch_32 (opcodep, writep, fragP, add_symP, sub_symP, add_num) + char *opcodep; + char *writep; + fragS *fragP; + symbolS *add_symP; + symbolS *sub_symP; + long int add_num; +{ + if (warn_for_branch_expansion) + { + /* FIXME: Find out and change to as_warn_where. Add testcase. */ + as_warn (_("32-bit conditional branch generated")); + } + + /* Here, writep points to what will be opcodep + 2. First, we change + the actual branch in opcodep[0] and opcodep[1], so that in the + final insn, it will look like: + opcodep+10: Bcc .-6 + + This means we don't have to worry about changing the opcode or + messing with te delay-slot instruction. So, we move it to last in + the "extended" branch, and just change the displacement. Admittedly, + it's not the optimal extended construct, but we should get this + rarely enough that it shouldn't matter. */ + + writep[8] = branch_disp (-2 - 6); + writep[9] = opcodep[1]; + + /* Then, we change the branch to an unconditional branch over the + extended part, to the new location of the Bcc: + opcodep: BA .+10 + opcodep+2: NOP + + Note that these two writes are to currently different locations, + merged later. */ + + md_number_to_chars (opcodep, BA_QUICK_OPCODE + 8, 2); + md_number_to_chars (writep, NOP_OPCODE, 2); + + /* Then the extended thing, the 32-bit jump insn. + opcodep+4: JUMP [PC+] */ + + md_number_to_chars (writep + 2, JUMP_PC_INCR_OPCODE, 2); + + /* We have to fill in the actual value too. + opcodep+6: .DWORD + This is most probably an expression, but we can cope with an absolute + value too. FIXME: Testcase needed. */ + + if (add_symP == NULL && sub_symP == NULL) + /* An absolute address. */ + md_number_to_chars (writep + 4, add_num, 4); + else + { + /* Not absolute, we have to make it a frag for later evaluation. */ + know (sub_symP == 0); + + fix_new (fragP, writep + 4 - fragP->fr_literal, 4, add_symP, + add_num, 0, BFD_RELOC_32); + } +} + +/* This *could* be: + + Turn a string in input_line_pointer into a floating point constant + of type TYPE, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. + + type A character from FLTCHARS that describes what kind of + floating-point number is wanted. + + litp A pointer to an array that the result should be stored in. + + sizep A pointer to an integer where the size of the result is stored. + + But we don't support floating point constants in assembly code *at all*, + since it's suboptimal and just opens up bug opportunities. GCC emits + the bit patterns as hex. All we could do here is to emit what GCC + would have done in the first place. *Nobody* writes floating-point + code as assembly code, but if they do, they should be able enough to + find out the correct bit patterns and use them. */ + +char * +md_atof (type, litp, sizep) + char type ATTRIBUTE_UNUSED; + char *litp ATTRIBUTE_UNUSED; + int *sizep ATTRIBUTE_UNUSED; +{ + /* FIXME: Is this function mentioned in the internals.texi manual? If + not, add it. */ + return _("Bad call to md_atof () - floating point formats are not supported"); +} + +/* Turn a number as a fixS * into a series of bytes that represents the + number on the target machine. The purpose of this procedure is the + same as that of md_number_to_chars but this procedure is supposed to + handle general bit field fixes and machine-dependent fixups. + + bufp Pointer to an array where the result should be stored. + + val The value to store. + + n The number of bytes in "val" that should be stored. + + fixP The fix to be applied to the bit field starting at bufp. */ + +static void +cris_number_to_imm (bufp, val, n, fixP) + char *bufp; + long val; + int n; + fixS *fixP; +{ + segT sym_seg; + + know (n <= 4); + know (fixP); + + /* We put the relative "vma" for the other segment for inter-segment + relocations in the object data to stay binary "compatible" (with an + uninteresting old version) for the relocation. + Maybe delete some day. */ + if (fixP->fx_addsy + && (sym_seg = S_GET_SEGMENT (fixP->fx_addsy)) != now_seg) + val += sym_seg->vma; + + switch (fixP->fx_r_type) + { + /* Ditto here, we put the addend into the object code as + well as the reloc addend. Keep it that way for now, to simplify + regression tests on the object file contents. FIXME: Seems + uninteresting now that we have a test suite. */ + + case BFD_RELOC_32: + /* No use having warnings here, since most hosts have a 32-bit type + for "long" (which will probably change soon, now that I wrote + this). */ + bufp[3] = (val >> 24) & 0xFF; + bufp[2] = (val >> 16) & 0xFF; + bufp[1] = (val >> 8) & 0xFF; + bufp[0] = val & 0xFF; + break; + + /* FIXME: The 16 and 8-bit cases should have a way to check + whether a signed or unsigned (or any signedness) number is + accepted. + FIXME: Does the as_bad calls find the line number by themselves, + or should we change them into as_bad_where? */ + + case BFD_RELOC_16: + if (val > 0xffff || val < -32768) + as_bad (_("Value not in 16 bit range: %ld"), val); + if (! fixP->fx_addsy) + { + bufp[1] = (val >> 8) & 0xFF; + bufp[0] = val & 0xFF; + } + break; + + case BFD_RELOC_8: + if (val > 255 || val < -128) + as_bad (_("Value not in 8 bit range: %ld"), val); + if (! fixP->fx_addsy) + bufp[0] = val & 0xFF; + break; + + case BFD_RELOC_CRIS_UNSIGNED_4: + if (val > 15 || val < 0) + as_bad (_("Value not in 4 bit unsigned range: %ld"), val); + if (! fixP->fx_addsy) + bufp[0] |= val & 0x0F; + break; + + case BFD_RELOC_CRIS_UNSIGNED_5: + if (val > 31 || val < 0) + as_bad (_("Value not in 5 bit unsigned range: %ld"), val); + if (! fixP->fx_addsy) + bufp[0] |= val & 0x1F; + break; + + case BFD_RELOC_CRIS_SIGNED_6: + if (val > 31 || val < -32) + as_bad (_("Value not in 6 bit range: %ld"), val); + if (! fixP->fx_addsy) + bufp[0] |= val & 0x3F; + break; + + case BFD_RELOC_CRIS_UNSIGNED_6: + if (val > 63 || val < 0) + as_bad (_("Value not in 6 bit unsigned range: %ld"), val); + if (! fixP->fx_addsy) + bufp[0] |= val & 0x3F; + break; + + case BFD_RELOC_CRIS_BDISP8: + if (! fixP->fx_addsy) + bufp[0] = branch_disp (val); + break; + + case BFD_RELOC_NONE: + /* May actually happen automatically. For example at broken + words, if the word turns out not to be broken. + FIXME: When? Which testcase? */ + if (! fixP->fx_addsy) + md_number_to_chars (bufp, val, n); + break; + + case BFD_RELOC_VTABLE_INHERIT: + /* This borrowed from tc-ppc.c on a whim. */ + if (fixP->fx_addsy + && !S_IS_DEFINED (fixP->fx_addsy) + && !S_IS_WEAK (fixP->fx_addsy)) + S_SET_WEAK (fixP->fx_addsy); + /* Fall through. */ + + case BFD_RELOC_VTABLE_ENTRY: + fixP->fx_done = 0; + break; + + default: + BAD_CASE (fixP->fx_r_type); + } +} + +/* Processes machine-dependent command line options. Called once for + each option on the command line that the machine-independent part of + GAS does not understand. */ + +int +md_parse_option (arg, argp) + int arg; + char *argp ATTRIBUTE_UNUSED; +{ + switch (arg) + { + case 'H': + case 'h': + printf (_("Please use --help to see usage and options for this assembler.\n")); + md_show_usage (stdout); + exit (EXIT_SUCCESS); + + case 'N': + warn_for_branch_expansion = 1; + return 1; + + case OPTION_NO_US: + demand_register_prefix = true; + + if (OUTPUT_FLAVOR == bfd_target_aout_flavour) + as_bad (_("--no-underscore is invalid with a.out format"), arg); + else + symbols_have_leading_underscore = false; + return 1; + + case OPTION_US: + demand_register_prefix = false; + symbols_have_leading_underscore = true; + return 1; + + default: + return 0; + } +} + +/* Round up a section size to the appropriate boundary. */ +valueT +md_section_align (segment, size) + segT segment; + valueT size; +{ + /* Round all sects to multiple of 4, except the bss section, which + we'll round to word-size. + + FIXME: Check if this really matters. All sections should be + rounded up, and all sections should (optionally) be assumed to be + dword-aligned, it's just that there is actual usage of linking to a + multiple of two. */ + if (OUTPUT_FLAVOR == bfd_target_aout_flavour) + { + if (segment == bss_section) + return (size + 1) & ~1; + return (size + 3) & ~3; + } + else + { + /* FIXME: Is this wanted? It matches the testsuite, but that's not + really a valid reason. */ + if (segment == text_section) + return (size + 3) & ~3; + } + + return size; +} + +/* Generate a machine-dependent relocation. */ +arelent * +tc_gen_reloc (section, fixP) + asection *section ATTRIBUTE_UNUSED; + fixS *fixP; +{ + arelent *relP; + bfd_reloc_code_real_type code; + + switch (fixP->fx_r_type) + { + case BFD_RELOC_32: + case BFD_RELOC_16: + case BFD_RELOC_8: + case BFD_RELOC_VTABLE_INHERIT: + case BFD_RELOC_VTABLE_ENTRY: + code = fixP->fx_r_type; + break; + default: + as_bad_where (fixP->fx_file, fixP->fx_line, + _("Semantics error. This type of operand can not be relocated, it must be an assembly-time constant")); + return 0; + } + + relP = (arelent *) xmalloc (sizeof (arelent)); + assert (relP != 0); + relP->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *relP->sym_ptr_ptr = symbol_get_bfdsym (fixP->fx_addsy); + relP->address = fixP->fx_frag->fr_address + fixP->fx_where; + + if (fixP->fx_pcrel) + /* FIXME: Is this correct? */ + relP->addend = fixP->fx_addnumber; + else + /* At least *this one* is correct. */ + relP->addend = fixP->fx_offset; + + /* This is the standard place for KLUDGEs to work around bugs in + bfd_install_relocation (first such note in the documentation + appears with binutils-2.8). + + That function bfd_install_relocation does the wrong thing with + putting stuff into the addend of a reloc (it should stay out) for a + weak symbol. The really bad thing is that it adds the + "segment-relative offset" of the symbol into the reloc. In this + case, the reloc should instead be relative to the symbol with no + other offset than the assembly code shows; and since the symbol is + weak, any local definition should be ignored until link time (or + thereafter). + To wit: weaksym+42 should be weaksym+42 in the reloc, + not weaksym+(offset_from_segment_of_local_weaksym_definition) + + To "work around" this, we subtract the segment-relative offset of + "known" weak symbols. This evens out the extra offset. + + That happens for a.out but not for ELF, since for ELF, + bfd_install_relocation uses the "special function" field of the + howto, and does not execute the code that needs to be undone. */ + + if (OUTPUT_FLAVOR == bfd_target_aout_flavour + && fixP->fx_addsy && S_IS_WEAK (fixP->fx_addsy) + && ! bfd_is_und_section (S_GET_SEGMENT (fixP->fx_addsy))) + { + relP->addend -= S_GET_VALUE (fixP->fx_addsy); + } + + relP->howto = bfd_reloc_type_lookup (stdoutput, code); + if (! relP->howto) + { + const char *name; + + name = S_GET_NAME (fixP->fx_addsy); + if (name == NULL) + name = _(""); + as_fatal (_("Cannot generate relocation type for symbol %s, code %s"), + name, bfd_get_reloc_code_name (code)); + } + + return relP; +} + +/* Machine-dependent usage-output. */ + +void +md_show_usage (stream) + FILE *stream; +{ + fprintf (stream, _("CRIS-specific options:\n")); + fprintf (stream, "%s", + _(" -h, -H Don't execute, print this help text. Deprecated.\n")); + fprintf (stream, "%s", + _(" -N Warn when branches are expanded to jumps.\n")); + fprintf (stream, "%s", + _(" --underscore User symbols are normally prepended with underscore.\n")); + fprintf (stream, "%s", + _(" Registers will not need any prefix.\n")); + fprintf (stream, "%s", + _(" --no-underscore User symbols do not have any prefix.\n")); + fprintf (stream, "%s", + _(" Registers will require a `$'-prefix.\n")); +} + +/* Apply a fixS (fixup of an instruction or data that we didn't have + enough info to complete immediately) to the data in a frag. */ + +int +md_apply_fix (fixP, valP) + fixS *fixP; + valueT *valP; +{ + long val = *valP; + + char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; + + if (fixP->fx_addsy == 0 && !fixP->fx_pcrel) + fixP->fx_done = 1; + + if (fixP->fx_bit_fixP || fixP->fx_im_disp != 0) + { + as_bad_where (fixP->fx_file, fixP->fx_line, _("Invalid relocation")); + fixP->fx_done = 1; + } + else + { + /* I took this from tc-arc.c, since we used to not support + fx_subsy != NULL. I'm not totally sure it's TRT. */ + if (fixP->fx_subsy != (symbolS *) NULL) + { + if (S_GET_SEGMENT (fixP->fx_subsy) == absolute_section) + val -= S_GET_VALUE (fixP->fx_subsy); + else + { + /* We can't actually support subtracting a symbol. */ + as_bad_where (fixP->fx_file, fixP->fx_line, + _("expression too complex")); + } + } + + cris_number_to_imm (buf, val, fixP->fx_size, fixP); + } + + return 1; +} + +/* All relocations are relative to the location just after the fixup; + the address of the fixup plus its size. */ + +long +md_pcrel_from (fixP) + fixS *fixP; +{ + valueT addr = fixP->fx_where + fixP->fx_frag->fr_address; + + /* FIXME: We get here only at the end of assembly, when X in ".-X" is + still unknown. Since we don't have pc-relative relocations, this + is invalid. What to do if anything for a.out, is to add + pc-relative relocations everywhere including the elinux program + loader. */ + as_bad_where (fixP->fx_file, fixP->fx_line, + _("Invalid pc-relative relocation")); + return fixP->fx_size + addr; +} + +/* We have no need to give defaults for symbol-values. */ +symbolS * +md_undefined_symbol (name) + char *name ATTRIBUTE_UNUSED; +{ + return 0; +} + +/* Definition of TC_FORCE_RELOCATION. + FIXME: Unsure of this. Can we omit it? Just copied from tc-i386.c + when doing multi-object format with ELF, since it's the only other + multi-object-format target with a.out and ELF. */ +int +md_cris_force_relocation (fixp) + struct fix *fixp; +{ + if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT + || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY) + return 1; + return 0; +} + +/* Check and emit error if broken-word handling has failed to fix up a + case-table. This is called from write.c, after doing everything it + knows about how to handle broken words. */ + +void +tc_cris_check_adjusted_broken_word (new_offset, brokwP) + offsetT new_offset; + struct broken_word *brokwP; +{ + if (new_offset > 32767 || new_offset < -32768) + /* We really want a genuine error, not a warning, so make it one. */ + as_bad_where (brokwP->frag->fr_file, brokwP->frag->fr_line, + _("Adjusted signed .word (%ld) overflows: `switch'-statement too large."), + (long) new_offset); +} + +/* Make a leading REGISTER_PREFIX_CHAR mandatory for all registers. */ + +static void cris_force_reg_prefix () +{ + demand_register_prefix = true; +} + +/* Do not demand a leading REGISTER_PREFIX_CHAR for all registers. */ + +static void cris_relax_reg_prefix () +{ + demand_register_prefix = false; +} + +/* Adjust for having a leading '_' on all user symbols. */ + +static void cris_sym_leading_underscore () +{ + /* We can't really do anything more than assert that what the program + thinks symbol starts with agrees with the command-line options, since + the bfd is already created. */ + + if (symbols_have_leading_underscore == false) + as_bad (".syntax %s requires command-line option `--underscore'", + SYNTAX_USER_SYM_LEADING_UNDERSCORE); +} + +/* Adjust for not having any particular prefix on user symbols. */ + +static void cris_sym_no_leading_underscore () +{ + if (symbols_have_leading_underscore == true) + as_bad (".syntax %s requires command-line option `--no-underscore'", + SYNTAX_USER_SYM_NO_LEADING_UNDERSCORE); +} + +/* Handle the .syntax pseudo, which takes an argument that decides what + syntax the assembly code has. */ + +static void +s_syntax (ignore) + int ignore ATTRIBUTE_UNUSED; +{ + static const struct syntaxes + { + const char *operand; + void (*fn) PARAMS ((void)); + } syntax_table[] = + {{SYNTAX_ENFORCE_REG_PREFIX, cris_force_reg_prefix}, + {SYNTAX_RELAX_REG_PREFIX, cris_relax_reg_prefix}, + {SYNTAX_USER_SYM_LEADING_UNDERSCORE, cris_sym_leading_underscore}, + {SYNTAX_USER_SYM_NO_LEADING_UNDERSCORE, cris_sym_no_leading_underscore}}; + + const struct syntaxes *sp; + + for (sp = syntax_table; + sp < syntax_table + sizeof (syntax_table) / sizeof (syntax_table[0]); + sp++) + { + if (strncmp (input_line_pointer, sp->operand, + strlen (sp->operand)) == 0) + { + (sp->fn) (); + + input_line_pointer += strlen (sp->operand); + demand_empty_rest_of_line (); + return; + } + } + + as_bad (_("Unknown .syntax operand")); +} + +/* Wrapper for dwarf2_directive_file to emit error if this is seen when + not emitting ELF. */ + +static void +s_cris_file (dummy) + int dummy; +{ + if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + as_bad ("Pseudodirective .file is only valid when generating ELF"); + else + dwarf2_directive_file (dummy); +} + +/* Wrapper for dwarf2_directive_loc to emit error if this is seen when not + emitting ELF. */ + +static void +s_cris_loc (dummy) + int dummy; +{ + if (OUTPUT_FLAVOR != bfd_target_elf_flavour) + as_bad ("Pseudodirective .loc is only valid when generating ELF"); + else + dwarf2_directive_loc (dummy); +} + +/* + * Local variables: + * eval: (c-set-style "gnu") + * indent-tabs-mode: t + * End: + */ diff --git a/gnu/dist/toolchain/gas/config/tc-cris.h b/gnu/dist/toolchain/gas/config/tc-cris.h new file mode 100644 index 000000000000..4fdf309be40f --- /dev/null +++ b/gnu/dist/toolchain/gas/config/tc-cris.h @@ -0,0 +1,139 @@ +/* tc-cris.h -- Header file for tc-cris.c, the CRIS GAS port. + Copyright (C) 2000 Free Software Foundation, Inc. + + Contributed by Axis Communications AB, Lund, Sweden. + Originally written for GAS 1.38.1 by Mikael Asker. + Updated, BFDized and GNUified by Hans-Peter Nilsson. + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GAS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA. */ + +/* See the GAS "internal" document for general documentation on this. + It is called internals.texi (internals.info when makeinfo:d), but is + not installed or makeinfo:d by "make info". */ + +/* Functions and variables that aren't declared in tc.h are declared here, + with the type/prototype that is used in the local extern-declaration of + their usage. */ + +#ifndef TC_CRIS +#define TC_CRIS + +/* Multi-target support is always on. */ +extern const char *cris_target_format PARAMS ((void)); +#define TARGET_FORMAT cris_target_format () + +#define TARGET_ARCH bfd_arch_cris + +#define TARGET_BYTES_BIG_ENDIAN 0 + +extern const char *md_shortopts; +extern struct option md_longopts[]; +extern size_t md_longopts_size; + +extern const pseudo_typeS md_pseudo_table[]; + +#define tc_comment_chars cris_comment_chars +extern const char cris_comment_chars[]; +extern const char line_comment_chars[]; +extern const char line_separator_chars[]; +extern const char EXP_CHARS[]; +extern const char FLT_CHARS[]; + +/* This should be optional, since it is ignored as an escape (assumed to + be itself) if it is not recognized. */ +#define ONLY_STANDARD_ESCAPES + +/* Note that we do not define TC_EQUAL_IN_INSN, since its current use is + in the instruction rather than the operand, and thus does not come to + use for side-effect assignments such as "and.d [r0 = r1 + 42], r3". */ +#define md_operand(x) + +#define md_number_to_chars number_to_chars_littleendian + +extern const int md_short_jump_size; +extern const int md_long_jump_size; + +/* There's no use having different functions for this; the sizes are the + same. Note that we can't #define md_short_jump_size here. */ +#define md_create_short_jump md_create_long_jump + +extern const struct relax_type md_cris_relax_table[]; +#define TC_GENERIC_RELAX_TABLE md_cris_relax_table + +#define TC_HANDLES_FX_DONE + +#define TC_FORCE_RELOCATION(fixp) md_cris_force_relocation (fixp) +extern int md_cris_force_relocation PARAMS ((struct fix *)); + +/* This is really a workaround for a bug in write.c that resolves relocs + for weak symbols - it should be postponed to the link stage or later. + */ +#define tc_fix_adjustable(X) \ + ((! (X)->fx_addsy || ! S_IS_WEAK((X)->fx_addsy)) \ + && (X)->fx_r_type != BFD_RELOC_VTABLE_INHERIT \ + && (X)->fx_r_type != BFD_RELOC_VTABLE_ENTRY) + +/* When we have fixups against constant expressions, we get a GAS-specific + section symbol at no extra charge for obscure reasons in + adjust_reloc_syms. Since ELF outputs section symbols, it gladly + outputs this "*ABS*" symbol in every object. Avoid that. */ +#define tc_frob_symbol(symp, punt) \ + do { \ + if (OUTPUT_FLAVOR == bfd_target_elf_flavour \ + && (symp) == section_symbol (absolute_section)) \ + (punt) = 1; \ + } while (0) + +#define LISTING_HEADER "GAS for CRIS" + +#if 0 +/* The testsuite does not let me define these, although they IMHO should + be preferred over the default. */ +#define LISTING_WORD_SIZE 2 +#define LISTING_LHS_WIDTH 4 +#define LISTING_LHS_WIDTH_SECOND 4 +#endif + +/* END of declaration and definitions described in the "internals" + document. */ + +/* Do this, or we will never know what hit us when the + broken-word-fixes break. Do _not_ use WARN_SIGNED_OVERFLOW_WORD, + it is only for use with WORKING_DOT_WORD and warns about most stuff. + (still in 2.9.1). */ +struct broken_word; +extern void tc_cris_check_adjusted_broken_word PARAMS ((offsetT, + struct + broken_word *)); +#define TC_CHECK_ADJUSTED_BROKEN_DOT_WORD(new_offset, brokw) \ + tc_cris_check_adjusted_broken_word ((offsetT) (new_offset), brokw) + +/* We don't want any implicit alignment, so we do nothing. */ +#define TC_IMPLICIT_LCOMM_ALIGNMENT(SIZE, P2VAR) + +/* CRIS instructions, with operands and prefixes included, are a multiple + of two bytes long. */ +#define DWARF2_LINE_MIN_INSN_LENGTH 2 + +#endif /* TC_CRIS */ +/* + * Local variables: + * eval: (c-set-style "gnu") + * indent-tabs-mode: t + * End: + */ diff --git a/gnu/dist/toolchain/gas/config/tc-d10v.c b/gnu/dist/toolchain/gas/config/tc-d10v.c index d20ae10475fe..85cfe875960a 100644 --- a/gnu/dist/toolchain/gas/config/tc-d10v.c +++ b/gnu/dist/toolchain/gas/config/tc-d10v.c @@ -1,5 +1,5 @@ /* tc-d10v.c -- Assembler code for the Mitsubishi D10V - Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation. + Copyright (C) 1996, 97, 98, 99, 2000 Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -21,9 +21,10 @@ #include #include #include "as.h" -#include "subsegs.h" +#include "subsegs.h" #include "opcode/d10v.h" #include "elf/ppc.h" +//#include "read.h" const char comment_chars[] = ";"; const char line_comment_chars[] = "#"; @@ -40,8 +41,7 @@ int Optimizing = 0; && S_GET_VALUE ((X)->X_op_symbol) == AT_WORD_RIGHT_SHIFT) #define AT_WORD_RIGHT_SHIFT 2 - -/* fixups */ +/* Fixups. */ #define MAX_INSN_FIXUPS (5) struct d10v_fixup { @@ -64,10 +64,22 @@ static Fixups *fixups; static int do_not_ignore_hash = 0; -/* True if instruction swapping warnings should be inhibited. */ -static unsigned char flag_warn_suppress_instructionswap; /* --nowarnswap */ +typedef int packing_type; +#define PACK_UNSPEC (0) /* Packing order not specified. */ +#define PACK_PARALLEL (1) /* "||" */ +#define PACK_LEFT_RIGHT (2) /* "->" */ +#define PACK_RIGHT_LEFT (3) /* "<-" */ +static packing_type etype = PACK_UNSPEC; /* Used by d10v_cleanup. */ -/* local functions */ +/* True if instruction swapping warnings should be inhibited. + --nowarnswap. */ +static boolean flag_warn_suppress_instructionswap; + +/* True if instruction packing should be performed when --gstabs is specified. + --gstabs-packing, --no-gstabs-packing. */ +static boolean flag_allow_gstabs_packing = 1; + +/* Local functions. */ static int reg_name_search PARAMS ((char *name)); static int register_name PARAMS ((expressionS *expressionP)); static int check_range PARAMS ((unsigned long num, int bits, int flags)); @@ -76,25 +88,32 @@ static bfd_reloc_code_real_type get_reloc PARAMS ((struct d10v_operand *op)); static int get_operands PARAMS ((expressionS exp[])); static struct d10v_opcode *find_opcode PARAMS ((struct d10v_opcode *opcode, expressionS ops[])); static unsigned long build_insn PARAMS ((struct d10v_opcode *opcode, expressionS *opers, unsigned long insn)); -static void write_long PARAMS ((struct d10v_opcode *opcode, unsigned long insn, Fixups *fx)); +static void write_long PARAMS ((unsigned long insn, Fixups *fx)); static void write_1_short PARAMS ((struct d10v_opcode *opcode, unsigned long insn, Fixups *fx)); -static int write_2_short PARAMS ((struct d10v_opcode *opcode1, unsigned long insn1, - struct d10v_opcode *opcode2, unsigned long insn2, int exec_type, Fixups *fx)); +static int write_2_short PARAMS ((struct d10v_opcode *opcode1, unsigned long insn1, + struct d10v_opcode *opcode2, unsigned long insn2, packing_type exec_type, Fixups *fx)); static unsigned long do_assemble PARAMS ((char *str, struct d10v_opcode **opcode)); static unsigned long d10v_insert_operand PARAMS (( unsigned long insn, int op_type, offsetT value, int left, fixS *fix)); -static int parallel_ok PARAMS ((struct d10v_opcode *opcode1, unsigned long insn1, +static int parallel_ok PARAMS ((struct d10v_opcode *opcode1, unsigned long insn1, struct d10v_opcode *opcode2, unsigned long insn2, - int exec_type)); + packing_type exec_type)); static symbolS * find_symbol_matching_register PARAMS ((expressionS *)); struct option md_longopts[] = { #define OPTION_NOWARNSWAP (OPTION_MD_BASE) {"nowarnswap", no_argument, NULL, OPTION_NOWARNSWAP}, +#define OPTION_GSTABSPACKING (OPTION_MD_BASE + 1) + {"gstabspacking", no_argument, NULL, OPTION_GSTABSPACKING}, + {"gstabs-packing", no_argument, NULL, OPTION_GSTABSPACKING}, +#define OPTION_NOGSTABSPACKING (OPTION_MD_BASE + 2) + {"nogstabspacking", no_argument, NULL, OPTION_NOGSTABSPACKING}, + {"no-gstabs-packing", no_argument, NULL, OPTION_NOGSTABSPACKING}, {NULL, no_argument, NULL, 0} }; -size_t md_longopts_size = sizeof(md_longopts); + +size_t md_longopts_size = sizeof (md_longopts); static void d10v_dot_word PARAMS ((int)); @@ -108,9 +127,9 @@ const pseudo_typeS md_pseudo_table[] = /* Opcode hash table. */ static struct hash_control *d10v_hash; -/* reg_name_search does a binary search of the d10v_predefined_registers - array to see if "name" is a valid regiter name. Returns the register - number from the array on success, or -1 on failure. */ +/* Do a binary search of the d10v_predefined_registers array to see if + NAME is a valid regiter name. Return the register number from the + array on success, or -1 on failure. */ static int reg_name_search (name) @@ -120,7 +139,7 @@ reg_name_search (name) int cmp; low = 0; - high = d10v_reg_name_cnt() - 1; + high = d10v_reg_name_cnt () - 1; do { @@ -130,15 +149,15 @@ reg_name_search (name) high = middle - 1; else if (cmp > 0) low = middle + 1; - else - return d10v_predefined_registers[middle].value; + else + return d10v_predefined_registers[middle].value; } while (low <= high); return -1; } -/* register_name() checks the string at input_line_pointer - to see if it is a valid register name */ +/* Check the string at input_line_pointer + to see if it is a valid register name. */ static int register_name (expressionP) @@ -146,49 +165,49 @@ register_name (expressionP) { int reg_number; char c, *p = input_line_pointer; - - while (*p && *p!='\n' && *p!='\r' && *p !=',' && *p!=' ' && *p!=')') + + while (*p + && *p != '\n' && *p != '\r' && *p != ',' && *p != ' ' && *p != ')') p++; c = *p; if (c) *p++ = 0; - /* look to see if it's in the register table */ + /* Look to see if it's in the register table. */ reg_number = reg_name_search (input_line_pointer); - if (reg_number >= 0) + if (reg_number >= 0) { expressionP->X_op = O_register; - /* temporarily store a pointer to the string here */ - expressionP->X_op_symbol = (symbolS *)input_line_pointer; + /* Temporarily store a pointer to the string here. */ + expressionP->X_op_symbol = (symbolS *) input_line_pointer; expressionP->X_add_number = reg_number; input_line_pointer = p; return 1; } if (c) - *(p-1) = c; + *(p - 1) = c; return 0; } - static int check_range (num, bits, flags) unsigned long num; int bits; int flags; { - long min, max, bit1; - int retval=0; + long min, max; + int retval = 0; - /* don't bother checking 16-bit values */ + /* Don't bother checking 16-bit values. */ if (bits == 16) return 0; if (flags & OPERAND_SHIFT) { - /* all special shift operands are unsigned */ - /* and <= 16. We allow 0 for now. */ - if (num>16) + /* All special shift operands are unsigned and <= 16. + We allow 0 for now. */ + if (num > 16) return 1; else return 0; @@ -196,7 +215,7 @@ check_range (num, bits, flags) if (flags & OPERAND_SIGNED) { - /* Signed 3-bit integers are restricted to the (-2, 3) range */ + /* Signed 3-bit integers are restricted to the (-2, 3) range. */ if (flags & RESTRICTED_NUM3) { if ((long) num < -2 || (long) num > 3) @@ -204,8 +223,8 @@ check_range (num, bits, flags) } else { - max = (1 << (bits - 1)) - 1; - min = - (1 << (bits - 1)); + max = (1 << (bits - 1)) - 1; + min = - (1 << (bits - 1)); if (((long) num > max) || ((long) num < min)) retval = 1; } @@ -214,35 +233,44 @@ check_range (num, bits, flags) { max = (1 << bits) - 1; min = 0; - if ((num > max) || (num < min)) + if (((long) num > max) || ((long) num < min)) retval = 1; } return retval; } - void md_show_usage (stream) - FILE *stream; + FILE *stream; { - fprintf(stream, _("D10V options:\n\ --O optimize. Will do some operations in parallel.\n")); -} + fprintf (stream, _("D10V options:\n\ +-O Optimize. Will do some operations in parallel.\n\ +--gstabs-packing Pack adjacent short instructions together even\n\ + when --gstabs is specified. On by default.\n\ +--no-gstabs-packing If --gstabs is specified, do not pack adjacent\n\ + instructions together.\n")); +} int md_parse_option (c, arg) int c; - char *arg; + char *arg ATTRIBUTE_UNUSED; { switch (c) { case 'O': - /* Optimize. Will attempt to parallelize operations */ + /* Optimize. Will attempt to parallelize operations. */ Optimizing = 1; break; case OPTION_NOWARNSWAP: flag_warn_suppress_instructionswap = 1; break; + case OPTION_GSTABSPACKING: + flag_allow_gstabs_packing = 1; + break; + case OPTION_NOGSTABSPACKING: + flag_allow_gstabs_packing = 0; + break; default: return 0; } @@ -251,15 +279,16 @@ md_parse_option (c, arg) symbolS * md_undefined_symbol (name) - char *name; + char *name ATTRIBUTE_UNUSED; { return 0; } -/* Turn a string in input_line_pointer into a floating point constant of type - type, and store the appropriate bytes in *litP. The number of LITTLENUMS - emitted is stored in *sizeP . An error message is returned, or NULL on OK. - */ +/* Turn a string in input_line_pointer into a floating point constant + of type TYPE, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. An error message is + returned, or NULL on OK. */ + char * md_atof (type, litP, sizeP) int type; @@ -270,7 +299,7 @@ md_atof (type, litP, sizeP) LITTLENUM_TYPE words[4]; char *t; int i; - + switch (type) { case 'f': @@ -287,22 +316,22 @@ md_atof (type, litP, sizeP) t = atof_ieee (input_line_pointer, type, words); if (t) input_line_pointer = t; - + *sizeP = prec * 2; - + for (i = 0; i < prec; i++) { md_number_to_chars (litP, (valueT) words[i], 2); - litP += 2; + litP += 2; } return NULL; } void md_convert_frag (abfd, sec, fragP) - bfd *abfd; - asection *sec; - fragS *fragP; + bfd *abfd ATTRIBUTE_UNUSED; + asection *sec ATTRIBUTE_UNUSED; + fragS *fragP ATTRIBUTE_UNUSED; { abort (); } @@ -316,24 +345,23 @@ md_section_align (seg, addr) return ((addr + (1 << align) - 1) & (-1 << align)); } - void md_begin () { char *prev_name = ""; struct d10v_opcode *opcode; - d10v_hash = hash_new(); + d10v_hash = hash_new (); /* Insert unique names into hash table. The D10v instruction set has many identical opcode names that have different opcodes based on the operands. This hash table then provides a quick index to the first opcode with a particular name in the opcode table. */ - for (opcode = (struct d10v_opcode *)d10v_opcodes; opcode->name; opcode++) + for (opcode = (struct d10v_opcode *) d10v_opcodes; opcode->name; opcode++) { if (strcmp (prev_name, opcode->name)) { - prev_name = (char *)opcode->name; + prev_name = (char *) opcode->name; hash_insert (d10v_hash, opcode->name, (char *) opcode); } } @@ -343,26 +371,26 @@ md_begin () FixUps[1].next = &FixUps[0]; } +/* Remove the postincrement or postdecrement operator ( '+' or '-' ) + from an expression. */ -/* this function removes the postincrement or postdecrement - operator ( '+' or '-' ) from an expression */ - -static int postfix (p) +static int +postfix (p) char *p; { - while (*p != '-' && *p != '+') + while (*p != '-' && *p != '+') { - if (*p==0 || *p=='\n' || *p=='\r') + if (*p == 0 || *p == '\n' || *p == '\r') break; p++; } - if (*p == '-') + if (*p == '-') { *p = ' '; return (-1); } - if (*p == '+') + if (*p == '+') { *p = ' '; return (1); @@ -371,17 +399,16 @@ static int postfix (p) return (0); } - -static bfd_reloc_code_real_type -get_reloc (op) +static bfd_reloc_code_real_type +get_reloc (op) struct d10v_operand *op; { int bits = op->bits; - if (bits <= 4) + if (bits <= 4) return (0); - - if (op->flags & OPERAND_ADDR) + + if (op->flags & OPERAND_ADDR) { if (bits == 8) return (BFD_RELOC_D10V_10_PCREL_R); @@ -392,38 +419,36 @@ get_reloc (op) return (BFD_RELOC_16); } - -/* get_operands parses a string of operands and returns - an array of expressions */ +/* Parse a string of operands. Return an array of expressions. */ static int -get_operands (exp) +get_operands (exp) expressionS exp[]; { char *p = input_line_pointer; int numops = 0; int post = 0; int uses_at = 0; - - while (*p) + + while (*p) { - while (*p == ' ' || *p == '\t' || *p == ',') + while (*p == ' ' || *p == '\t' || *p == ',') p++; - if (*p==0 || *p=='\n' || *p=='\r') + if (*p == 0 || *p == '\n' || *p == '\r') break; - - if (*p == '@') + + if (*p == '@') { uses_at = 1; - + p++; exp[numops].X_op = O_absent; - if (*p == '(') + if (*p == '(') { p++; exp[numops].X_add_number = OPERAND_ATPAR; } - else if (*p == '-') + else if (*p == '-') { p++; exp[numops].X_add_number = OPERAND_ATMINUS; @@ -437,19 +462,19 @@ get_operands (exp) continue; } - if (*p == ')') + if (*p == ')') { - /* just skip the trailing paren */ + /* Just skip the trailing paren. */ p++; continue; } input_line_pointer = p; - /* check to see if it might be a register name */ + /* Check to see if it might be a register name. */ if (!register_name (&exp[numops])) { - /* parse as an expression */ + /* Parse as an expression. */ if (uses_at) { /* Any expression that involves the indirect addressing @@ -457,9 +482,9 @@ get_operands (exp) the use of the hash character is illegal. */ int save = do_not_ignore_hash; do_not_ignore_hash = 1; - + expression (&exp[numops]); - + do_not_ignore_hash = save; } else @@ -471,23 +496,23 @@ get_operands (exp) input_line_pointer += 5; if (exp[numops].X_op == O_register) { - /* if it looked like a register name but was followed by + /* If it looked like a register name but was followed by "@word" then it was really a symbol, so change it to - one */ + one. */ exp[numops].X_op = O_symbol; - exp[numops].X_add_symbol = symbol_find_or_make ((char *)exp[numops].X_op_symbol); + exp[numops].X_add_symbol = + symbol_find_or_make ((char *) exp[numops].X_op_symbol); } - /* check for identifier@word+constant */ + /* Check for identifier@word+constant. */ if (*input_line_pointer == '-' || *input_line_pointer == '+') - { - char *orig_line = input_line_pointer; - expressionS new_exp; - expression (&new_exp); - exp[numops].X_add_number = new_exp.X_add_number; - } + { + expressionS new_exp; + expression (&new_exp); + exp[numops].X_add_number = new_exp.X_add_number; + } - /* convert expr into a right shift by AT_WORD_RIGHT_SHIFT */ + /* Convert expr into a right shift by AT_WORD_RIGHT_SHIFT. */ { expressionS new_exp; memset (&new_exp, 0, sizeof new_exp); @@ -500,23 +525,23 @@ get_operands (exp) know (AT_WORD_P (&exp[numops])); } - - if (exp[numops].X_op == O_illegal) + + if (exp[numops].X_op == O_illegal) as_bad (_("illegal operand")); - else if (exp[numops].X_op == O_absent) + else if (exp[numops].X_op == O_absent) as_bad (_("missing operand")); numops++; p = input_line_pointer; } - switch (post) + switch (post) { - case -1: /* postdecrement mode */ + case -1: /* Postdecrement mode. */ exp[numops].X_op = O_absent; exp[numops++].X_add_number = OPERAND_MINUS; break; - case 1: /* postincrement mode */ + case 1: /* Postincrement mode. */ exp[numops].X_op = O_absent; exp[numops++].X_add_number = OPERAND_PLUS; break; @@ -527,7 +552,7 @@ get_operands (exp) } static unsigned long -d10v_insert_operand (insn, op_type, value, left, fix) +d10v_insert_operand (insn, op_type, value, left, fix) unsigned long insn; int op_type; offsetT value; @@ -542,9 +567,10 @@ d10v_insert_operand (insn, op_type, value, left, fix) bits = d10v_operands[op_type].bits; - /* truncate to the proper number of bits */ + /* Truncate to the proper number of bits. */ if (check_range (value, bits, d10v_operands[op_type].flags)) - as_bad_where (fix->fx_file, fix->fx_line, _("operand out of range: %d"), value); + as_bad_where (fix->fx_file, fix->fx_line, + _("operand out of range: %d"), value); value &= 0x7FFFFFFF >> (31 - bits); insn |= (value << shift); @@ -552,20 +578,19 @@ d10v_insert_operand (insn, op_type, value, left, fix) return insn; } - -/* build_insn takes a pointer to the opcode entry in the opcode table - and the array of operand expressions and returns the instruction */ +/* Take a pointer to the opcode entry in the opcode table and the + array of operand expressions. Return the instruction. */ static unsigned long -build_insn (opcode, opers, insn) +build_insn (opcode, opers, insn) struct d10v_opcode *opcode; expressionS *opers; unsigned long insn; { int i, bits, shift, flags, format; unsigned long number; - - /* the insn argument is only used for the DIVS kludge */ + + /* The insn argument is only used for the DIVS kludge. */ if (insn) format = LONG_R; else @@ -573,96 +598,97 @@ build_insn (opcode, opers, insn) insn = opcode->opcode; format = opcode->format; } - - for (i=0;opcode->operands[i];i++) + + for (i = 0; opcode->operands[i]; i++) { flags = d10v_operands[opcode->operands[i]].flags; bits = d10v_operands[opcode->operands[i]].bits; shift = d10v_operands[opcode->operands[i]].shift; number = opers[i].X_add_number; - if (flags & OPERAND_REG) + if (flags & OPERAND_REG) { number &= REGISTER_MASK; if (format == LONG_L) shift += 15; } - if (opers[i].X_op != O_register && opers[i].X_op != O_constant) + if (opers[i].X_op != O_register && opers[i].X_op != O_constant) { - /* now create a fixup */ + /* Now create a fixup. */ if (fixups->fc >= MAX_INSN_FIXUPS) as_fatal (_("too many fixups")); if (AT_WORD_P (&opers[i])) { - /* Reconize XXX>>1+N aka XXX@word+N as special (AT_WORD) */ + /* Reconize XXX>>1+N aka XXX@word+N as special (AT_WORD). */ fixups->fix[fixups->fc].reloc = BFD_RELOC_D10V_18; opers[i].X_op = O_symbol; - opers[i].X_op_symbol = NULL; /* Should free it */ + opers[i].X_op_symbol = NULL; /* Should free it. */ /* number is left shifted by AT_WORD_RIGHT_SHIFT so that, it is aligned with the symbol's value. Later, BFD_RELOC_D10V_18 will right shift (symbol_value + - X_add_number). */ + X_add_number). */ number <<= AT_WORD_RIGHT_SHIFT; opers[i].X_add_number = number; } else - fixups->fix[fixups->fc].reloc = - get_reloc((struct d10v_operand *)&d10v_operands[opcode->operands[i]]); + fixups->fix[fixups->fc].reloc = + get_reloc ((struct d10v_operand *) &d10v_operands[opcode->operands[i]]); - if (fixups->fix[fixups->fc].reloc == BFD_RELOC_16 || + if (fixups->fix[fixups->fc].reloc == BFD_RELOC_16 || fixups->fix[fixups->fc].reloc == BFD_RELOC_D10V_18) - fixups->fix[fixups->fc].size = 2; + fixups->fix[fixups->fc].size = 2; else fixups->fix[fixups->fc].size = 4; - + fixups->fix[fixups->fc].exp = opers[i]; fixups->fix[fixups->fc].operand = opcode->operands[i]; - fixups->fix[fixups->fc].pcrel = (flags & OPERAND_ADDR) ? true : false; + fixups->fix[fixups->fc].pcrel = + (flags & OPERAND_ADDR) ? true : false; (fixups->fc)++; } - /* truncate to the proper number of bits */ + /* Truncate to the proper number of bits. */ if ((opers[i].X_op == O_constant) && check_range (number, bits, flags)) - as_bad (_("operand out of range: %d"),number); + as_bad (_("operand out of range: %d"), number); number &= 0x7FFFFFFF >> (31 - bits); insn = insn | (number << shift); } - /* kludge: for DIVS, we need to put the operands in twice */ - /* on the second pass, format is changed to LONG_R to force */ - /* the second set of operands to not be shifted over 15 */ - if ((opcode->opcode == OPCODE_DIVS) && (format==LONG_L)) + /* kludge: for DIVS, we need to put the operands in twice */ + /* on the second pass, format is changed to LONG_R to force + the second set of operands to not be shifted over 15. */ + if ((opcode->opcode == OPCODE_DIVS) && (format == LONG_L)) insn = build_insn (opcode, opers, insn); - + return insn; } -/* write out a long form instruction */ +/* Write out a long form instruction. */ + static void -write_long (opcode, insn, fx) - struct d10v_opcode *opcode; +write_long (insn, fx) unsigned long insn; Fixups *fx; { int i, where; - char *f = frag_more(4); + char *f = frag_more (4); insn |= FM11; number_to_chars_bigendian (f, insn, 4); - for (i=0; i < fx->fc; i++) + for (i = 0; i < fx->fc; i++) { if (fx->fix[i].reloc) - { - where = f - frag_now->fr_literal; + { + where = f - frag_now->fr_literal; if (fx->fix[i].size == 2) where += 2; if (fx->fix[i].reloc == BFD_RELOC_D10V_18) - fx->fix[i].operand |= 4096; + fx->fix[i].operand |= 4096; fix_new_exp (frag_now, where, @@ -675,46 +701,47 @@ write_long (opcode, insn, fx) fx->fc = 0; } +/* Write out a short form instruction by itself. */ -/* write out a short form instruction by itself */ static void -write_1_short (opcode, insn, fx) +write_1_short (opcode, insn, fx) struct d10v_opcode *opcode; unsigned long insn; Fixups *fx; { - char *f = frag_more(4); + char *f = frag_more (4); int i, where; if (opcode->exec_type & PARONLY) as_fatal (_("Instruction must be executed in parallel with another instruction.")); - /* the other container needs to be NOP */ - /* according to 4.3.1: for FM=00, sub-instructions performed only - by IU cannot be encoded in L-container. */ + /* The other container needs to be NOP. */ + /* According to 4.3.1: for FM=00, sub-instructions performed only + by IU cannot be encoded in L-container. */ if (opcode->unit == IU) - insn |= FM00 | (NOP << 15); /* right container */ + insn |= FM00 | (NOP << 15); /* Right container. */ else - insn = FM00 | (insn << 15) | NOP; /* left container */ + insn = FM00 | (insn << 15) | NOP; /* Left container. */ number_to_chars_bigendian (f, insn, 4); - for (i=0; i < fx->fc; i++) + for (i = 0; i < fx->fc; i++) { if (fx->fix[i].reloc) - { - where = f - frag_now->fr_literal; + { + where = f - frag_now->fr_literal; if (fx->fix[i].size == 2) where += 2; if (fx->fix[i].reloc == BFD_RELOC_D10V_18) - fx->fix[i].operand |= 4096; + fx->fix[i].operand |= 4096; - /* if it's an R reloc, we may have to switch it to L */ - if ( (fx->fix[i].reloc == BFD_RELOC_D10V_10_PCREL_R) && (opcode->unit != IU) ) + /* If it's an R reloc, we may have to switch it to L. */ + if ((fx->fix[i].reloc == BFD_RELOC_D10V_10_PCREL_R) + && (opcode->unit != IU)) fx->fix[i].operand |= 1024; fix_new_exp (frag_now, - where, + where, fx->fix[i].size, &(fx->fix[i].exp), fx->fix[i].pcrel, @@ -724,139 +751,161 @@ write_1_short (opcode, insn, fx) fx->fc = 0; } -/* write out a short form instruction if possible */ -/* return number of instructions not written out */ +/* Expects two short instructions. + If possible, writes out both as a single packed instruction. + Otherwise, writes out the first one, packed with a NOP. + Returns number of instructions not written out. */ + static int -write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx) +write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx) struct d10v_opcode *opcode1, *opcode2; unsigned long insn1, insn2; - int exec_type; + packing_type exec_type; Fixups *fx; { unsigned long insn; char *f; - int i,j, where; + int i, j, where; - if ( (exec_type != 1) && ((opcode1->exec_type & PARONLY) - || (opcode2->exec_type & PARONLY))) + if ((exec_type != PACK_PARALLEL) + && ((opcode1->exec_type & PARONLY) || (opcode2->exec_type & PARONLY))) as_fatal (_("Instruction must be executed in parallel")); - - if ( (opcode1->format & LONG_OPCODE) || (opcode2->format & LONG_OPCODE)) + + if ((opcode1->format & LONG_OPCODE) || (opcode2->format & LONG_OPCODE)) as_fatal (_("Long instructions may not be combined.")); - if(opcode1->exec_type & BRANCH_LINK && exec_type == 0) + switch (exec_type) { - /* Instructions paired with a subroutine call are executed before the - subroutine, so don't do these pairings unless explicitly requested. */ - write_1_short (opcode1, insn1, fx->next); - return (1); - } - - switch (exec_type) - { - case 0: /* order not specified */ - if ( Optimizing && parallel_ok (opcode1, insn1, opcode2, insn2, exec_type)) + case PACK_UNSPEC: /* Order not specified. */ + if (opcode1->exec_type & ALONE) { - /* parallel */ + /* Case of a short branch on a separate GAS line. + Pack with NOP. */ + write_1_short (opcode1, insn1, fx->next); + return 1; + } + if (Optimizing + && parallel_ok (opcode1, insn1, opcode2, insn2, exec_type)) + { + /* Parallel. */ if (opcode1->unit == IU) insn = FM00 | (insn2 << 15) | insn1; else if (opcode2->unit == MU) insn = FM00 | (insn2 << 15) | insn1; else { - insn = FM00 | (insn1 << 15) | insn2; + insn = FM00 | (insn1 << 15) | insn2; + /* Advance over dummy fixup since packed insn1 in L. */ fx = fx->next; } } - else if (opcode1->unit == IU) - { - /* reverse sequential */ - insn = FM10 | (insn2 << 15) | insn1; - } + else if (opcode1->unit == IU) + /* Reverse sequential with IU opcode1 on right and done first. */ + insn = FM10 | (insn2 << 15) | insn1; else { - /* sequential */ + /* Sequential with non-IU opcode1 on left and done first. */ insn = FM01 | (insn1 << 15) | insn2; - fx = fx->next; + /* Advance over dummy fixup since packed insn1 in L. */ + fx = fx->next; } break; - case 1: /* parallel */ - if (opcode1->exec_type & SEQ || opcode2->exec_type & SEQ) - as_fatal (_("One of these instructions may not be executed in parallel.")); + case PACK_PARALLEL: + if (opcode1->exec_type & SEQ || opcode2->exec_type & SEQ) + as_fatal + (_("One of these instructions may not be executed in parallel.")); if (opcode1->unit == IU) { if (opcode2->unit == IU) as_fatal (_("Two IU instructions may not be executed in parallel")); - if (!flag_warn_suppress_instructionswap) + if (!flag_warn_suppress_instructionswap) as_warn (_("Swapping instruction order")); - insn = FM00 | (insn2 << 15) | insn1; + insn = FM00 | (insn2 << 15) | insn1; } else if (opcode2->unit == MU) { if (opcode1->unit == MU) as_fatal (_("Two MU instructions may not be executed in parallel")); - if (!flag_warn_suppress_instructionswap) + if (!flag_warn_suppress_instructionswap) as_warn (_("Swapping instruction order")); insn = FM00 | (insn2 << 15) | insn1; } else { - insn = FM00 | (insn1 << 15) | insn2; + insn = FM00 | (insn1 << 15) | insn2; + /* Advance over dummy fixup since packed insn1 in L. */ fx = fx->next; } break; - case 2: /* sequential */ + + case PACK_LEFT_RIGHT: if (opcode1->unit != IU) - insn = FM01 | (insn1 << 15) | insn2; + insn = FM01 | (insn1 << 15) | insn2; else if (opcode2->unit == MU || opcode2->unit == EITHER) { - if (!flag_warn_suppress_instructionswap) + if (!flag_warn_suppress_instructionswap) as_warn (_("Swapping instruction order")); - insn = FM10 | (insn2 << 15) | insn1; + insn = FM10 | (insn2 << 15) | insn1; } else as_fatal (_("IU instruction may not be in the left container")); + if (opcode1->exec_type & ALONE) + as_warn (_("Instruction in R container is squashed by flow control instruction in L container.")); + /* Advance over dummy fixup. */ fx = fx->next; break; - case 3: /* reverse sequential */ + + case PACK_RIGHT_LEFT: if (opcode2->unit != MU) insn = FM10 | (insn1 << 15) | insn2; else if (opcode1->unit == IU || opcode1->unit == EITHER) { - if (!flag_warn_suppress_instructionswap) + if (!flag_warn_suppress_instructionswap) as_warn (_("Swapping instruction order")); - insn = FM01 | (insn2 << 15) | insn1; + insn = FM01 | (insn2 << 15) | insn1; } else as_fatal (_("MU instruction may not be in the right container")); + if (opcode2->exec_type & ALONE) + as_warn (_("Instruction in R container is squashed by flow control instruction in L container.")); + /* Advance over dummy fixup. */ fx = fx->next; break; + default: as_fatal (_("unknown execution type passed to write_2_short()")); } - f = frag_more(4); + f = frag_more (4); number_to_chars_bigendian (f, insn, 4); - for (j=0; j<2; j++) + /* Process fixup chains. + Note that the packing code above advanced fx conditionally. + dlindsay@cygnus.com: There's something subtle going on here involving + _dummy_first_bfd_reloc_code_real. This is related to the + difference between BFD_RELOC_D10V_10_PCREL_R and _L, ie whether + a fixup is done in the L or R container. A bug in this code + can pass Plum Hall fine, yet still affect hand-written assembler. */ + + for (j = 0; j < 2; j++) { - for (i=0; i < fx->fc; i++) + for (i = 0; i < fx->fc; i++) { if (fx->fix[i].reloc) { - where = f - frag_now->fr_literal; + where = f - frag_now->fr_literal; if (fx->fix[i].size == 2) where += 2; - - if ( (fx->fix[i].reloc == BFD_RELOC_D10V_10_PCREL_R) && (j == 0) ) + + if ((fx->fix[i].reloc == BFD_RELOC_D10V_10_PCREL_R) && (j == 0)) fx->fix[i].operand |= 1024; - + if (fx->fix[i].reloc == BFD_RELOC_D10V_18) - fx->fix[i].operand |= 4096; + fx->fix[i].operand |= 4096; fix_new_exp (frag_now, - where, + where, fx->fix[i].size, &(fx->fix[i].exp), fx->fix[i].pcrel, @@ -869,14 +918,14 @@ write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx) return (0); } +/* Check 2 instructions and determine if they can be safely + executed in parallel. Return 1 if they can be. */ -/* Check 2 instructions and determine if they can be safely */ -/* executed in parallel. Returns 1 if they can be. */ static int parallel_ok (op1, insn1, op2, insn2, exec_type) struct d10v_opcode *op1, *op2; unsigned long insn1, insn2; - int exec_type; + packing_type exec_type; { int i, j, flags, mask, shift, regno; unsigned long ins, mod[2], used[2]; @@ -889,9 +938,10 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) || (op1->unit == MU && op2->unit == MU)) return 0; - /* If the first instruction is a branch and this is auto parallazation, - don't combine with any second instruction. */ - if (exec_type == 0 && (op1->exec_type & BRANCH) != 0) + /* If this is auto parallization, and either instruction is a branch, + don't parallel. */ + if (exec_type == PACK_UNSPEC + && (op1->exec_type & ALONE || op2->exec_type & ALONE)) return 0; /* The idea here is to create two sets of bitmasks (mod and used) @@ -907,16 +957,16 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) memory and the second reads, then they cannot be done in parallel. Likewise, if the first instruction mucks with the psw and the second reads the PSW (which includes C, F0, and F1), then - they cannot operate safely in parallel. */ + they cannot operate safely in parallel. */ - /* the bitmasks (mod and used) look like this (bit 31 = MSB) */ - /* r0-r15 0-15 */ - /* a0-a1 16-17 */ - /* cr (not psw) 18 */ - /* psw 19 */ - /* mem 20 */ + /* The bitmasks (mod and used) look like this (bit 31 = MSB). */ + /* r0-r15 0-15 */ + /* a0-a1 16-17 */ + /* cr (not psw) 18 */ + /* psw 19 */ + /* mem 20 */ - for (j=0;j<2;j++) + for (j = 0; j < 2; j++) { if (j == 0) { @@ -940,19 +990,19 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) if (flags & OPERAND_REG) { regno = (ins >> shift) & mask; - if (flags & (OPERAND_ACC0|OPERAND_ACC1)) + if (flags & (OPERAND_ACC0 | OPERAND_ACC1)) regno += 16; - else if (flags & OPERAND_CONTROL) /* mvtc or mvfc */ - { + else if (flags & OPERAND_CONTROL) /* mvtc or mvfc. */ + { if (regno == 0) regno = 19; else - regno = 18; + regno = 18; } - else if (flags & (OPERAND_FFLAG|OPERAND_CFLAG)) + else if (flags & (OPERAND_FFLAG | OPERAND_CFLAG)) regno = 19; - - if ( flags & OPERAND_DEST ) + + if (flags & OPERAND_DEST) { mod[j] |= 1 << regno; if (flags & OPERAND_EVEN) @@ -960,20 +1010,20 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) } else { - used[j] |= 1 << regno ; + used[j] |= 1 << regno; if (flags & OPERAND_EVEN) used[j] |= 1 << (regno + 1); /* Auto inc/dec also modifies the register. */ - if (op->operands[i+1] != 0 - && (d10v_operands[op->operands[i+1]].flags + if (op->operands[i + 1] != 0 + && (d10v_operands[op->operands[i + 1]].flags & (OPERAND_PLUS | OPERAND_MINUS)) != 0) mod[j] |= 1 << regno; } } else if (flags & OPERAND_ATMINUS) { - /* SP implicitly used/modified */ + /* SP implicitly used/modified. */ mod[j] |= 1 << 15; used[j] |= 1 << 15; } @@ -994,58 +1044,61 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) return 0; } - -/* This is the main entry point for the machine-dependent assembler. str points to a - machine-dependent instruction. This function is supposed to emit the frags/bytes - it assembles to. For the D10V, it mostly handles the special VLIW parsing and packing - and leaves the difficult stuff to do_assemble(). - */ +/* This is the main entry point for the machine-dependent assembler. + STR points to a machine-dependent instruction. This function is + supposed to emit the frags/bytes it assembles to. For the D10V, it + mostly handles the special VLIW parsing and packing and leaves the + difficult stuff to do_assemble(). */ static unsigned long prev_insn; static struct d10v_opcode *prev_opcode = 0; static subsegT prev_subseg; static segT prev_seg = 0;; -static int etype = 0; /* saved extype. used for multiline instructions */ void md_assemble (str) char *str; { - struct d10v_opcode * opcode; - unsigned long insn; - int extype = 0; /* execution type; parallel, etc */ - char * str2; + /* etype is saved extype. For multi-line instructions. */ - if (etype == 0) + packing_type extype = PACK_UNSPEC; /* Parallel, etc. */ + + struct d10v_opcode *opcode; + unsigned long insn; + char *str2; + + if (etype == PACK_UNSPEC) { - /* look for the special multiple instruction separators */ + /* Look for the special multiple instruction separators. */ str2 = strstr (str, "||"); - if (str2) - extype = 1; + if (str2) + extype = PACK_PARALLEL; else { str2 = strstr (str, "->"); - if (str2) - extype = 2; + if (str2) + extype = PACK_LEFT_RIGHT; else { str2 = strstr (str, "<-"); - if (str2) - extype = 3; + if (str2) + extype = PACK_RIGHT_LEFT; } } - /* str2 points to the separator, if one */ - if (str2) + /* STR2 points to the separator, if there is one. */ + if (str2) { *str2 = 0; - - /* if two instructions are present and we already have one saved - then first write it out */ + + /* If two instructions are present and we already have one saved, + then first write out the saved one. */ d10v_cleanup (); - - /* assemble first instruction and save it */ + + /* Assemble first instruction and save it. */ prev_insn = do_assemble (str, &prev_opcode); - if (prev_insn == -1) + prev_seg = now_seg; + prev_subseg = now_subseg; + if (prev_insn == (unsigned long) -1) as_fatal (_("can't find opcode ")); fixups = fixups->next; str = str2 + 2; @@ -1053,9 +1106,9 @@ md_assemble (str) } insn = do_assemble (str, &opcode); - if (insn == -1) + if (insn == (unsigned long) -1) { - if (extype) + if (extype != PACK_UNSPEC) { etype = extype; return; @@ -1063,36 +1116,40 @@ md_assemble (str) as_fatal (_("can't find opcode ")); } - if (etype) + if (etype != PACK_UNSPEC) { extype = etype; - etype = 0; + etype = PACK_UNSPEC; } - /* if this is a long instruction, write it and any previous short instruction */ - if (opcode->format & LONG_OPCODE) + /* If this is a long instruction, write it and any previous short + instruction. */ + if (opcode->format & LONG_OPCODE) { - if (extype) + if (extype != PACK_UNSPEC) as_fatal (_("Unable to mix instructions as specified")); d10v_cleanup (); - write_long (opcode, insn, fixups); + write_long (insn, fixups); prev_opcode = NULL; return; } - - if (prev_opcode && prev_seg && ((prev_seg != now_seg) || (prev_subseg != now_subseg))) - d10v_cleanup(); - - if (prev_opcode && (write_2_short (prev_opcode, prev_insn, opcode, insn, extype, fixups) == 0)) + + if (prev_opcode + && prev_seg + && ((prev_seg != now_seg) || (prev_subseg != now_subseg))) + d10v_cleanup (); + + if (prev_opcode + && (write_2_short (prev_opcode, prev_insn, opcode, insn, extype, fixups) == 0)) { - /* no instructions saved */ + /* No instructions saved. */ prev_opcode = NULL; } else { - if (extype) + if (extype != PACK_UNSPEC) as_fatal (_("Unable to mix instructions as specified")); - /* save off last instruction so it may be packed on next pass */ + /* Save last instruction so it may be packed on next pass. */ prev_opcode = opcode; prev_insn = insn; prev_seg = now_seg; @@ -1101,12 +1158,11 @@ md_assemble (str) } } - -/* do_assemble assembles a single instruction and returns an opcode */ -/* it returns -1 (an invalid opcode) on error */ +/* Assemble a single instruction. + Return an opcode, or -1 (an invalid opcode) on error. */ static unsigned long -do_assemble (str, opcode) +do_assemble (str, opcode) char *str; struct d10v_opcode **opcode; { @@ -1135,11 +1191,11 @@ do_assemble (str, opcode) if (nlen == 0) return -1; - + /* Find the first opcode with the proper name. */ - *opcode = (struct d10v_opcode *)hash_find (d10v_hash, name); + *opcode = (struct d10v_opcode *) hash_find (d10v_hash, name); if (*opcode == NULL) - as_fatal (_("unknown opcode: %s"),name); + as_fatal (_("unknown opcode: %s"), name); save = input_line_pointer; input_line_pointer = op_end; @@ -1148,64 +1204,65 @@ do_assemble (str, opcode) return -1; input_line_pointer = save; - insn = build_insn ((*opcode), myops, 0); + insn = build_insn ((*opcode), myops, 0); return (insn); } -/* Find the symbol which has the same name as the register in the given expression. */ +/* Find the symbol which has the same name as the register in EXP. */ + static symbolS * find_symbol_matching_register (exp) - expressionS * exp; + expressionS *exp; { int i; - + if (exp->X_op != O_register) return NULL; - + /* Find the name of the register. */ for (i = d10v_reg_name_cnt (); i--;) - if (d10v_predefined_registers [i].value == exp->X_add_number) + if (d10v_predefined_registers[i].value == exp->X_add_number) break; if (i < 0) abort (); /* Now see if a symbol has been defined with the same name. */ - return symbol_find (d10v_predefined_registers [i].name); + return symbol_find (d10v_predefined_registers[i].name); } - -/* find_opcode() gets a pointer to an entry in the opcode table. */ -/* It must look at all opcodes with the same name and use the operands */ -/* to choose the correct opcode. */ +/* Get a pointer to an entry in the opcode table. + The function must look at all opcodes with the same name and use + the operands to choose the correct opcode. */ static struct d10v_opcode * find_opcode (opcode, myops) struct d10v_opcode *opcode; expressionS myops[]; { - int i, match, done; + int i, match; struct d10v_opcode *next_opcode; - /* get all the operands and save them as expressions */ + /* Get all the operands and save them as expressions. */ get_operands (myops); - /* now see if the operand is a fake. If so, find the correct size */ - /* instruction, if possible */ + /* Now see if the operand is a fake. If so, find the correct size + instruction, if possible. */ if (opcode->format == OPCODE_FAKE) { int opnum = opcode->operands[0]; int flags; - + if (myops[opnum].X_op == O_register) { myops[opnum].X_op = O_symbol; - myops[opnum].X_add_symbol = symbol_find_or_make ((char *)myops[opnum].X_op_symbol); + myops[opnum].X_add_symbol = + symbol_find_or_make ((char *) myops[opnum].X_op_symbol); myops[opnum].X_add_number = 0; myops[opnum].X_op_symbol = NULL; } - next_opcode=opcode+1; + next_opcode = opcode + 1; /* If the first operand is supposed to be a register, make sure we got a valid one. */ @@ -1225,16 +1282,18 @@ find_opcode (opcode, myops) } } - if (myops[opnum].X_op == O_constant || (myops[opnum].X_op == O_symbol && - S_IS_DEFINED(myops[opnum].X_add_symbol) && - (S_GET_SEGMENT(myops[opnum].X_add_symbol) == now_seg))) + if (myops[opnum].X_op == O_constant + || (myops[opnum].X_op == O_symbol + && S_IS_DEFINED (myops[opnum].X_add_symbol) + && (S_GET_SEGMENT (myops[opnum].X_add_symbol) == now_seg))) { - for (i=0; opcode->operands[i+1]; i++) + for (i = 0; opcode->operands[i + 1]; i++) { int bits = d10v_operands[next_opcode->operands[opnum]].bits; int flags = d10v_operands[next_opcode->operands[opnum]].flags; if (flags & OPERAND_ADDR) bits += 2; + if (myops[opnum].X_op == O_constant) { if (!check_range (myops[opnum].X_add_number, bits, flags)) @@ -1242,18 +1301,40 @@ find_opcode (opcode, myops) } else { + fragS *sym_frag; fragS *f; - long value; - /* calculate the current address by running through the previous frags */ - /* and adding our current offset */ - for (value = 0, f = frchain_now->frch_root; f; f = f->fr_next) - value += f->fr_fix + f->fr_offset; + unsigned long current_position; + unsigned long symbol_position; + unsigned long value; + boolean found_symbol; + + /* Calculate the address of the current instruction + and the address of the symbol. Do this by summing + the offsets of previous frags until we reach the + frag containing the symbol, and the current frag. */ + sym_frag = symbol_get_frag (myops[opnum].X_add_symbol); + found_symbol = false; + + current_position = + obstack_next_free (&frchain_now->frch_obstack) + - frag_now->fr_literal; + symbol_position = S_GET_VALUE (myops[opnum].X_add_symbol); + + for (f = frchain_now->frch_root; f; f = f->fr_next) + { + current_position += f->fr_fix + f->fr_offset; + + if (f == sym_frag) + found_symbol = true; + + if (! found_symbol) + symbol_position += f->fr_fix + f->fr_offset; + } + + value = symbol_position; if (flags & OPERAND_ADDR) - value = S_GET_VALUE(myops[opnum].X_add_symbol) - value - - (obstack_next_free(&frchain_now->frch_obstack) - frag_now->fr_literal); - else - value += S_GET_VALUE(myops[opnum].X_add_symbol); + value -= current_position; if (AT_WORD_P (&myops[opnum])) { @@ -1273,19 +1354,19 @@ find_opcode (opcode, myops) } else { - /* not a constant, so use a long instruction */ - return opcode+2; + /* Not a constant, so use a long instruction. */ + return opcode + 2; } } else { match = 0; - /* now search the opcode table table for one with operands */ - /* that matches what we've got */ + /* Now search the opcode table table for one with operands + that matches what we've got. */ while (!match) { match = 1; - for (i = 0; opcode->operands[i]; i++) + for (i = 0; opcode->operands[i]; i++) { int flags = d10v_operands[opcode->operands[i]].flags; int X_op = myops[i].X_op; @@ -1296,7 +1377,7 @@ find_opcode (opcode, myops) match = 0; break; } - + if (flags & OPERAND_REG) { if ((X_op != O_register) @@ -1309,7 +1390,7 @@ find_opcode (opcode, myops) break; } } - + if (((flags & OPERAND_MINUS) && ((X_op != O_absent) || (num != OPERAND_MINUS))) || ((flags & OPERAND_PLUS) && ((X_op != O_absent) || (num != OPERAND_PLUS))) || ((flags & OPERAND_ATMINUS) && ((X_op != O_absent) || (num != OPERAND_ATMINUS))) || @@ -1319,71 +1400,73 @@ find_opcode (opcode, myops) match = 0; break; } - - /* Unfortunatly, for the indirect operand in instructions such as - ``ldb r1, @(c,r14)'' this function can be passed X_op == O_register - (because 'c' is a valid register name). However we cannot just - ignore the case when X_op == O_register but flags & OPERAND_REG is - null, so we check to see if a symbol of the same name as the register - exists. If the symbol does exist, then the parser was unable to - distinguish the two cases and we fix things here. (Ref: PR14826) */ - + + /* Unfortunatly, for the indirect operand in + instructions such as ``ldb r1, @(c,r14)'' this + function can be passed X_op == O_register (because + 'c' is a valid register name). However we cannot + just ignore the case when X_op == O_register but + flags & OPERAND_REG is null, so we check to see if a + symbol of the same name as the register exists. If + the symbol does exist, then the parser was unable to + distinguish the two cases and we fix things here. + (Ref: PR14826) */ + if (!(flags & OPERAND_REG) && (X_op == O_register)) { - symbolS * sym; - - sym = find_symbol_matching_register (& myops[i]); - + symbolS *sym = find_symbol_matching_register (&myops[i]); + if (sym != NULL) { - myops [i].X_op == X_op == O_symbol; - myops [i].X_add_symbol = sym; + myops[i].X_op = X_op = O_symbol; + myops[i].X_add_symbol = sym; } else as_bad (_("illegal operand - register name found where none expected")); } } - + /* We're only done if the operands matched so far AND there are no more to check. */ - if (match && myops[i].X_op == 0) + if (match && myops[i].X_op == 0) break; else match = 0; next_opcode = opcode + 1; - - if (next_opcode->opcode == 0) + + if (next_opcode->opcode == 0) break; - + if (strcmp (next_opcode->name, opcode->name)) break; - + opcode = next_opcode; } } - if (!match) + if (!match) { as_bad (_("bad opcode or operands")); return (0); } - /* Check that all registers that are required to be even are. */ - /* Also, if any operands were marked as registers, but were really symbols */ - /* fix that here. */ - for (i=0; opcode->operands[i]; i++) + /* Check that all registers that are required to be even are. + Also, if any operands were marked as registers, but were really symbols, + fix that here. */ + for (i = 0; opcode->operands[i]; i++) { if ((d10v_operands[opcode->operands[i]].flags & OPERAND_EVEN) && - (myops[i].X_add_number & 1)) + (myops[i].X_add_number & 1)) as_fatal (_("Register number must be EVEN")); if (myops[i].X_op == O_register) { - if (!(d10v_operands[opcode->operands[i]].flags & OPERAND_REG)) + if (!(d10v_operands[opcode->operands[i]].flags & OPERAND_REG)) { myops[i].X_op = O_symbol; - myops[i].X_add_symbol = symbol_find_or_make ((char *)myops[i].X_op_symbol); + myops[i].X_add_symbol = + symbol_find_or_make ((char *) myops[i].X_op_symbol); myops[i].X_add_number = 0; myops[i].X_op_symbol = NULL; } @@ -1392,12 +1475,12 @@ find_opcode (opcode, myops) return opcode; } -/* if while processing a fixup, a reloc really needs to be created */ -/* then it is done here */ - +/* If while processing a fixup, a reloc really needs to be created. + Then it is done here. */ + arelent * tc_gen_reloc (seg, fixp) - asection *seg; + asection *seg ATTRIBUTE_UNUSED; fixS *fixp; { arelent *reloc; @@ -1409,7 +1492,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; } @@ -1424,20 +1508,21 @@ tc_gen_reloc (seg, fixp) int md_estimate_size_before_relax (fragp, seg) - fragS *fragp; - asection *seg; + fragS *fragp ATTRIBUTE_UNUSED; + asection *seg ATTRIBUTE_UNUSED; { abort (); return 0; -} +} long md_pcrel_from_section (fixp, sec) fixS *fixp; segT sec; { - if (fixp->fx_addsy != (symbolS *)NULL && (!S_IS_DEFINED (fixp->fx_addsy) || - (S_GET_SEGMENT (fixp->fx_addsy) != sec))) + if (fixp->fx_addsy != (symbolS *) NULL + && (!S_IS_DEFINED (fixp->fx_addsy) + || (S_GET_SEGMENT (fixp->fx_addsy) != sec))) return 0; return fixp->fx_frag->fr_address + fixp->fx_where; } @@ -1446,13 +1531,13 @@ int md_apply_fix3 (fixp, valuep, seg) fixS *fixp; valueT *valuep; - segT seg; + segT seg ATTRIBUTE_UNUSED; { char *where; unsigned long insn; long value; int op_type; - int left=0; + int left = 0; if (fixp->fx_addsy == (symbolS *) NULL) { @@ -1471,7 +1556,7 @@ md_apply_fix3 (fixp, valuep, seg) else { /* We don'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")); } } @@ -1493,7 +1578,8 @@ md_apply_fix3 (fixp, valuep, seg) fixp->fx_r_type = BFD_RELOC_D10V_18; } else - fixp->fx_r_type = get_reloc((struct d10v_operand *)&d10v_operands[op_type]); + fixp->fx_r_type = + get_reloc ((struct d10v_operand *) &d10v_operands[op_type]); } /* Fetch the instruction, insert the fully resolved operand @@ -1507,7 +1593,7 @@ md_apply_fix3 (fixp, valuep, seg) case BFD_RELOC_D10V_10_PCREL_R: case BFD_RELOC_D10V_18_PCREL: case BFD_RELOC_D10V_18: - /* instruction addresses are always right-shifted by 2 */ + /* Instruction addresses are always right-shifted by 2. */ value >>= AT_WORD_RIGHT_SHIFT; if (fixp->fx_size == 2) bfd_putb16 ((bfd_vma) value, (unsigned char *) where); @@ -1518,14 +1604,15 @@ md_apply_fix3 (fixp, valuep, seg) rep = (struct d10v_opcode *) hash_find (d10v_hash, "rep"); repi = (struct d10v_opcode *) hash_find (d10v_hash, "repi"); if ((insn & FM11) == FM11 - && (repi != NULL && (insn & repi->mask) == repi->opcode - || rep != NULL && (insn & rep->mask) == rep->opcode) + && ( (repi != NULL && (insn & repi->mask) == (unsigned) repi->opcode) + || (rep != NULL && (insn & rep->mask) == (unsigned) rep->opcode)) && value < 4) as_fatal (_("line %d: rep or repi must include at least 4 instructions"), fixp->fx_line); - insn = d10v_insert_operand (insn, op_type, (offsetT)value, left, fixp); - bfd_putb32 ((bfd_vma) insn, (unsigned char *) where); + insn = + d10v_insert_operand (insn, op_type, (offsetT) value, left, fixp); + bfd_putb32 ((bfd_vma) insn, (unsigned char *) where); } break; case BFD_RELOC_32: @@ -1541,44 +1628,61 @@ md_apply_fix3 (fixp, valuep, seg) return 1; default: - as_fatal (_("line %d: unknown relocation type: 0x%x"),fixp->fx_line,fixp->fx_r_type); + as_fatal (_("line %d: unknown relocation type: 0x%x"), + fixp->fx_line, fixp->fx_r_type); } return 0; } -/* d10v_cleanup() is called after the assembler has finished parsing the input - file or after a label is defined. Because the D10V assembler sometimes saves short - instructions to see if it can package them with the next instruction, there may - be a short instruction that still needs written. */ +/* d10v_cleanup() is called after the assembler has finished parsing + the input file, when a label is read from the input file, or when a + stab directive is output. Because the D10V assembler sometimes + saves short instructions to see if it can package them with the + next instruction, there may be a short instruction that still needs + to be written. + + NOTE: accesses a global, etype. + NOTE: invoked by various macros such as md_cleanup: see. */ + int d10v_cleanup () { segT seg; subsegT subseg; - if (prev_opcode && etype == 0) + /* If cleanup was invoked because the assembler encountered, e.g., a + user label, we write out the pending instruction, if any. If it + was invoked because the assembler is outputting a piece of line + debugging information, though, we write out the pending + instruction only if the --no-gstabs-packing command line switch + has been specified. */ + if (prev_opcode + && etype == PACK_UNSPEC + && (! outputting_stabs_line_debug || ! flag_allow_gstabs_packing)) { seg = now_seg; subseg = now_subseg; + if (prev_seg) subseg_set (prev_seg, prev_subseg); + write_1_short (prev_opcode, prev_insn, fixups->next); + subseg_set (seg, subseg); prev_opcode = NULL; } return 1; } -/* Like normal .word, except support @word */ -/* clobbers input_line_pointer, checks end-of-line. */ +/* Like normal .word, except support @word. */ +/* Clobbers input_line_pointer, checks end-of-line. */ + static void -d10v_dot_word (nbytes) - register int nbytes; /* 1=.byte, 2=.word, 4=.long */ +d10v_dot_word (dummy) + int dummy ATTRIBUTE_UNUSED; { expressionS exp; - bfd_reloc_code_real_type reloc; char *p; - int offset; if (is_it_end_of_statement ()) { @@ -1593,9 +1697,9 @@ d10v_dot_word (nbytes) { exp.X_add_number = 0; input_line_pointer += 5; - + p = frag_more (2); - fix_new_exp (frag_now, p - frag_now->fr_literal, 2, + fix_new_exp (frag_now, p - frag_now->fr_literal, 2, &exp, 0, BFD_RELOC_D10V_18); } else @@ -1603,22 +1707,21 @@ d10v_dot_word (nbytes) } while (*input_line_pointer++ == ','); - input_line_pointer--; /* Put terminator back into stream. */ + input_line_pointer--; /* Put terminator back into stream. */ demand_empty_rest_of_line (); } +/* Mitsubishi asked that we support some old syntax that apparently + had immediate operands starting with '#'. This is in some of their + sample code but is not documented (although it appears in some + examples in their assembler manual). For now, we'll solve this + compatibility problem by simply ignoring any '#' at the beginning + of an operand. */ -/* Mitsubishi asked that we support some old syntax that apparently */ -/* had immediate operands starting with '#'. This is in some of their */ -/* sample code but is not documented (although it appears in some */ -/* examples in their assembler manual). For now, we'll solve this */ -/* compatibility problem by simply ignoring any '#' at the beginning */ -/* of an operand. */ +/* Operands that begin with '#' should fall through to here. */ +/* From expr.c. */ -/* operands that begin with '#' should fall through to here */ -/* from expr.c */ - -void +void md_operand (expressionP) expressionS *expressionP; { @@ -1631,19 +1734,18 @@ md_operand (expressionP) boolean d10v_fix_adjustable (fixP) - fixS *fixP; + fixS *fixP; { - if (fixP->fx_addsy == NULL) return 1; - - /* Prevent all adjustments to global symbols. */ + + /* Prevent all adjustments to global symbols. */ if (S_IS_EXTERN (fixP->fx_addsy)) return 0; if (S_IS_WEAK (fixP->fx_addsy)) return 0; - /* We need the symbol name for the VTABLE entries */ + /* We need the symbol name for the VTABLE entries. */ if (fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) return 0; @@ -1653,7 +1755,7 @@ d10v_fix_adjustable (fixP) int d10v_force_relocation (fixp) - struct fix *fixp; + fixS *fixp; { if (fixp->fx_r_type == BFD_RELOC_VTABLE_INHERIT || fixp->fx_r_type == BFD_RELOC_VTABLE_ENTRY) diff --git a/gnu/dist/toolchain/gas/config/tc-d10v.h b/gnu/dist/toolchain/gas/config/tc-d10v.h index 18e6e30b7113..6c2eecd5d6f8 100644 --- a/gnu/dist/toolchain/gas/config/tc-d10v.h +++ b/gnu/dist/toolchain/gas/config/tc-d10v.h @@ -1,5 +1,5 @@ /* tc-d10v.h -- Header file for tc-d10v.c. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc. Written by Martin Hunt, Cygnus Support. This file is part of GAS, the GNU Assembler. @@ -17,7 +17,9 @@ 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. */ + 02111-1307, USA. */ + +#include "write.h" /* For the definition of fixS. */ #define TC_D10V @@ -35,7 +37,8 @@ #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) +#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section(FIXP, SEC) +long md_pcrel_from_section PARAMS ((fixS *, segT)); /* Permit temporary numeric labels. */ #define LOCAL_LABELS_FB 1 @@ -57,7 +60,8 @@ int d10v_cleanup PARAMS ((void)); } while (0) #define obj_fix_adjustable(fixP) d10v_fix_adjustable(fixP) +boolean d10v_fix_adjustable PARAMS ((fixS *)); #define TC_FORCE_RELOCATION(fixp) d10v_force_relocation(fixp) -extern int d10v_force_relocation PARAMS ((struct fix *)); +extern int d10v_force_relocation PARAMS ((fixS *)); #define md_flush_pending_output d10v_cleanup diff --git a/gnu/dist/toolchain/gas/config/tc-d30v.c b/gnu/dist/toolchain/gas/config/tc-d30v.c index f1dc0ea72e24..01f3ac0dff40 100644 --- a/gnu/dist/toolchain/gas/config/tc-d30v.c +++ b/gnu/dist/toolchain/gas/config/tc-d30v.c @@ -21,7 +21,7 @@ #include #include #include "as.h" -#include "subsegs.h" +#include "subsegs.h" #include "opcode/d30v.h" const char comment_chars[] = ";"; @@ -57,7 +57,7 @@ typedef enum _exec_type EXEC_REVSEQ /* reverse sequential (FM=10) */ } exec_type_enum; -/* fixups */ +/* Fixups. */ #define MAX_INSN_FIXUPS (5) struct d30v_fixup { @@ -84,11 +84,11 @@ static int prev_mul32_p = 0; /* The flag_explicitly_parallel is true iff the instruction being assembled has been explicitly written as a parallel short-instruction pair by the - human programmer. It is used in parallel_ok() to distinguish between + human programmer. It is used in parallel_ok () to distinguish between those dangerous parallelizations attempted by the human, which are to be allowed, and those attempted by the assembler, which are not. It is set - from md_assemble(). */ -static int flag_explicitly_parallel = 0; + from md_assemble (). */ +static int flag_explicitly_parallel = 0; static int flag_xp_state = 0; /* Whether current and previous left sub-instruction disables @@ -104,29 +104,29 @@ static segT d30v_current_align_seg; labels preceeding instructions. */ static symbolS *d30v_last_label; -/* Two nops */ +/* Two nops. */ #define NOP_LEFT ((long long) NOP << 32) #define NOP_RIGHT ((long long) NOP) #define NOP2 (FM00 | NOP_LEFT | NOP_RIGHT) -/* local functions */ +/* Local functions. */ static int reg_name_search PARAMS ((char *name)); static int register_name PARAMS ((expressionS *expressionP)); static int check_range PARAMS ((unsigned long num, int bits, int flags)); static int postfix PARAMS ((char *p)); static bfd_reloc_code_real_type get_reloc PARAMS ((struct d30v_operand *op, int rel_flag)); static int get_operands PARAMS ((expressionS exp[], int cmp_hack)); -static struct d30v_format *find_format PARAMS ((struct d30v_opcode *opcode, +static struct d30v_format *find_format PARAMS ((struct d30v_opcode *opcode, expressionS ops[],int fsize, int cmp_hack)); static long long build_insn PARAMS ((struct d30v_insn *opcode, expressionS *opers)); static void write_long PARAMS ((struct d30v_insn *opcode, long long insn, Fixups *fx)); static void write_1_short PARAMS ((struct d30v_insn *opcode, long long insn, Fixups *fx, int use_sequential)); -static int write_2_short PARAMS ((struct d30v_insn *opcode1, long long insn1, +static int write_2_short PARAMS ((struct d30v_insn *opcode1, long long insn1, struct d30v_insn *opcode2, long long insn2, exec_type_enum exec_type, Fixups *fx)); static long long do_assemble PARAMS ((char *str, struct d30v_insn *opcode, int shortp, int is_parallel)); -static int parallel_ok PARAMS ((struct d30v_insn *opcode1, unsigned long insn1, +static int parallel_ok PARAMS ((struct d30v_insn *opcode1, unsigned long insn1, struct d30v_insn *opcode2, unsigned long insn2, exec_type_enum exec_type)); static void d30v_number_to_chars PARAMS ((char *buf, long long value, int nbytes)); @@ -137,11 +137,12 @@ static void s_d30v_text PARAMS ((int)); static void s_d30v_data PARAMS ((int)); static void s_d30v_section PARAMS ((int)); -struct option md_longopts[] = { +struct option md_longopts[] = +{ {NULL, no_argument, NULL, 0} }; -size_t md_longopts_size = sizeof(md_longopts); +size_t md_longopts_size = sizeof (md_longopts); /* The target specific pseudo-ops which we support. */ const pseudo_typeS md_pseudo_table[] = @@ -161,9 +162,9 @@ const pseudo_typeS md_pseudo_table[] = /* Opcode hash table. */ static struct hash_control *d30v_hash; -/* reg_name_search does a binary search of the pre_defined_registers - array to see if "name" is a valid regiter name. Returns the register - number from the array on success, or -1 on failure. */ +/* Do a binary search of the pre_defined_registers array to see if + NAME is a valid regiter name. Return the register number from the + array on success, or -1 on failure. */ static int reg_name_search (name) @@ -191,17 +192,17 @@ reg_name_search (name) as_warn (_("Register name %s conflicts with symbol of the same name"), name); } - + return pre_defined_registers[middle].value; } } while (low <= high); - + return -1; } -/* register_name() checks the string at input_line_pointer - to see if it is a valid register name. */ +/* Check the string at input_line_pointer to see if it is a valid + register name. */ static int register_name (expressionP) @@ -209,31 +210,30 @@ register_name (expressionP) { int reg_number; char c, *p = input_line_pointer; - - while (*p && *p!='\n' && *p!='\r' && *p !=',' && *p!=' ' && *p!=')') + + while (*p && *p != '\n' && *p != '\r' && *p != ',' && *p != ' ' && *p != ')') p++; c = *p; if (c) *p++ = 0; - /* look to see if it's in the register table */ + /* Look to see if it's in the register table. */ reg_number = reg_name_search (input_line_pointer); - if (reg_number >= 0) + if (reg_number >= 0) { expressionP->X_op = O_register; - /* temporarily store a pointer to the string here */ - expressionP->X_op_symbol = (symbolS *)input_line_pointer; + /* Temporarily store a pointer to the string here. */ + expressionP->X_op_symbol = (symbolS *) input_line_pointer; expressionP->X_add_number = reg_number; input_line_pointer = p; return 1; } if (c) - *(p-1) = c; + *(p - 1) = c; return 0; } - static int check_range (num, bits, flags) unsigned long num; @@ -245,46 +245,45 @@ check_range (num, bits, flags) /* Don't bother checking 32-bit values. */ if (bits == 32) { - if (sizeof(unsigned long) * CHAR_BIT == 32) + if (sizeof (unsigned long) * CHAR_BIT == 32) return 0; /* We don't record signed or unsigned for 32-bit quantities. Allow either. */ - min = -((unsigned long)1 << (bits - 1)); - max = ((unsigned long)1 << bits) - 1; + min = -((unsigned long) 1 << (bits - 1)); + max = ((unsigned long) 1 << bits) - 1; return (long)num < min || (long)num > max; } if (flags & OPERAND_SHIFT) { - /* We know that all shifts are right by three bits.... */ - + /* We know that all shifts are right by three bits. */ + if (flags & OPERAND_SIGNED) - num = (unsigned long) ( (long) num >= 0) - ? ( ((long) num) >> 3 ) - : ( (num >> 3) | ~(~(unsigned long)0 >> 3) ); + num = (unsigned long) ((long) num >= 0) + ? (((long) num) >> 3) + : ((num >> 3) | ~(~(unsigned long) 0 >> 3)); else num >>= 3; } if (flags & OPERAND_SIGNED) { - max = ((unsigned long)1 << (bits - 1)) - 1; - min = - ((unsigned long)1 << (bits - 1)); + max = ((unsigned long) 1 << (bits - 1)) - 1; + min = - ((unsigned long) 1 << (bits - 1)); return (long)num > max || (long)num < min; } else { - max = ((unsigned long)1 << bits) - 1; + max = ((unsigned long) 1 << bits) - 1; min = 0; return num > max || num < min; } } - void md_show_usage (stream) - FILE *stream; + FILE *stream; { fprintf (stream, _("\nD30V options:\n\ -O Make adjacent short instructions parallel if possible.\n\ @@ -301,7 +300,7 @@ md_parse_option (c, arg) { switch (c) { - /* Optimize. Will attempt to parallelize operations */ + /* Optimize. Will attempt to parallelize operations. */ case 'O': Optimizing = 1; break; @@ -324,7 +323,7 @@ md_parse_option (c, arg) case 'C': warn_register_name_conflicts = 0; break; - + default: return 0; } @@ -333,15 +332,16 @@ md_parse_option (c, arg) symbolS * md_undefined_symbol (name) - char *name; + char *name; { return 0; } -/* Turn a string in input_line_pointer into a floating point constant of type - type, and store the appropriate bytes in *litP. The number of LITTLENUMS - emitted is stored in *sizeP . An error message is returned, or NULL on OK. - */ +/* Turn a string in input_line_pointer into a floating point constant + of type TYPE, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. An error message is + returned, or NULL on OK. */ + char * md_atof (type, litP, sizeP) int type; @@ -352,7 +352,7 @@ md_atof (type, litP, sizeP) LITTLENUM_TYPE words[4]; char *t; int i; - + switch (type) { case 'f': @@ -369,22 +369,22 @@ md_atof (type, litP, sizeP) t = atof_ieee (input_line_pointer, type, words); if (t) input_line_pointer = t; - + *sizeP = prec * 2; - + for (i = 0; i < prec; i++) { md_number_to_chars (litP, (valueT) words[i], 2); - litP += 2; + litP += 2; } return NULL; } void md_convert_frag (abfd, sec, fragP) - bfd *abfd; - asection *sec; - fragS *fragP; + bfd *abfd; + asection *sec; + fragS *fragP; { abort (); } @@ -398,15 +398,14 @@ md_section_align (seg, addr) return ((addr + (1 << align) - 1) & (-1 << align)); } - void md_begin () { - struct d30v_opcode * opcode; + struct d30v_opcode *opcode; d30v_hash = hash_new (); - /* Insert opcode names into a hash table. */ - for (opcode = (struct d30v_opcode *)d30v_opcode_table; opcode->name; opcode++) + /* Insert opcode names into a hash table. */ + for (opcode = (struct d30v_opcode *) d30v_opcode_table; opcode->name; opcode++) hash_insert (d30v_hash, opcode->name, (char *) opcode); fixups = &FixUps[0]; @@ -416,37 +415,37 @@ md_begin () d30v_current_align_seg = now_seg; } +/* Remove the postincrement or postdecrement operator ( '+' or '-' ) + from an expression. */ -/* this function removes the postincrement or postdecrement - operator ( '+' or '-' ) from an expression */ - -static int postfix (p) +static int +postfix (p) char *p; { - while (*p != '-' && *p != '+') + while (*p != '-' && *p != '+') { - if (*p==0 || *p=='\n' || *p=='\r' || *p==' ' || *p==',') + if (*p == 0 || *p == '\n' || *p == '\r' || *p == ' ' || *p == ',') break; p++; } - if (*p == '-') + if (*p == '-') { *p = ' '; - return (-1); - } - if (*p == '+') - { - *p = ' '; - return (1); + return -1; } - return (0); + if (*p == '+') + { + *p = ' '; + return 1; + } + + return 0; } - -static bfd_reloc_code_real_type -get_reloc (op, rel_flag) +static bfd_reloc_code_real_type +get_reloc (op, rel_flag) struct d30v_operand *op; int rel_flag; { @@ -482,11 +481,10 @@ get_reloc (op, rel_flag) } } -/* get_operands parses a string of operands and returns - an array of expressions */ +/* Parse a string of operands and return an array of expressions. */ static int -get_operands (exp, cmp_hack) +get_operands (exp, cmp_hack) expressionS exp[]; int cmp_hack; { @@ -500,24 +498,25 @@ get_operands (exp, cmp_hack) exp[numops++].X_add_number = cmp_hack - 1; } - while (*p) + while (*p) { - while (*p == ' ' || *p == '\t' || *p == ',') + while (*p == ' ' || *p == '\t' || *p == ',') p++; - if (*p==0 || *p=='\n' || *p=='\r') + + if (*p == 0 || *p == '\n' || *p == '\r') break; - - if (*p == '@') + + if (*p == '@') { p++; exp[numops].X_op = O_absent; - if (*p == '(') + if (*p == '(') { p++; exp[numops].X_add_number = OPERAND_ATPAR; post = postfix (p); } - else if (*p == '-') + else if (*p == '-') { p++; exp[numops].X_add_number = OPERAND_ATMINUS; @@ -531,37 +530,39 @@ get_operands (exp, cmp_hack) continue; } - if (*p == ')') + if (*p == ')') { - /* just skip the trailing paren */ + /* Just skip the trailing paren. */ p++; continue; } input_line_pointer = p; - /* check to see if it might be a register name */ + /* Check to see if it might be a register name. */ if (!register_name (&exp[numops])) { - /* parse as an expression */ + /* Parse as an expression. */ expression (&exp[numops]); } - if (exp[numops].X_op == O_illegal) + if (exp[numops].X_op == O_illegal) as_bad (_("illegal operand")); - else if (exp[numops].X_op == O_absent) + else if (exp[numops].X_op == O_absent) as_bad (_("missing operand")); numops++; p = input_line_pointer; - switch (post) + switch (post) { - case -1: /* postdecrement mode */ + case -1: + /* Postdecrement mode. */ exp[numops].X_op = O_absent; exp[numops++].X_add_number = OPERAND_MINUS; break; - case 1: /* postincrement mode */ + case 1: + /* Postincrement mode. */ exp[numops].X_op = O_absent; exp[numops++].X_add_number = OPERAND_PLUS; break; @@ -570,32 +571,34 @@ get_operands (exp, cmp_hack) } exp[numops].X_op = 0; - return (numops); + + return numops; } -/* build_insn generates the instruction. It does everything */ -/* but write the FM bits. */ +/* Generate the instruction. + It does everything but write the FM bits. */ static long long -build_insn (opcode, opers) +build_insn (opcode, opers) struct d30v_insn *opcode; expressionS *opers; { int i, length, bits, shift, flags; - unsigned long number, id=0; + unsigned long number, id = 0; long long insn; struct d30v_opcode *op = opcode->op; struct d30v_format *form = opcode->form; - insn = opcode->ecc << 28 | op->op1 << 25 | op->op2 << 20 | form->modifier << 18; + insn = + opcode->ecc << 28 | op->op1 << 25 | op->op2 << 20 | form->modifier << 18; - for (i=0; form->operands[i]; i++) - { + for (i = 0; form->operands[i]; i++) + { flags = d30v_operand_table[form->operands[i]].flags; - /* must be a register or number */ - if (!(flags & OPERAND_REG) && !(flags & OPERAND_NUM) && - !(flags & OPERAND_NAME) && !(flags & OPERAND_SPECIAL)) + /* Must be a register or number. */ + if (!(flags & OPERAND_REG) && !(flags & OPERAND_NUM) + && !(flags & OPERAND_NAME) && !(flags & OPERAND_SPECIAL)) continue; bits = d30v_operand_table[form->operands[i]].bits; @@ -610,16 +613,17 @@ build_insn (opcode, opers) number = 0; if (flags & OPERAND_REG) { - /* check for mvfsys or mvtsys control registers */ + /* Check for mvfsys or mvtsys control registers. */ if (flags & OPERAND_CONTROL && (number & 0x7f) > MAX_CONTROL_REG) { - /* PSWL or PSWH */ + /* PSWL or PSWH. */ id = (number & 0x7f) - MAX_CONTROL_REG; number = 0; } else if (number & OPERAND_FLAG) { - id = 3; /* number is a flag register */ + /* NUMBER is a flag register. */ + id = 3; } number &= 0x7F; } @@ -628,15 +632,15 @@ build_insn (opcode, opers) number = id; } - if (opers[i].X_op != O_register && opers[i].X_op != O_constant && !(flags & OPERAND_NAME)) + if (opers[i].X_op != O_register && opers[i].X_op != O_constant + && !(flags & OPERAND_NAME)) { - /* now create a fixup */ - + /* Now create a fixup. */ if (fixups->fc >= MAX_INSN_FIXUPS) as_fatal (_("too many fixups")); - fixups->fix[fixups->fc].reloc = - get_reloc ((struct d30v_operand *)&d30v_operand_table[form->operands[i]], op->reloc_flag); + fixups->fix[fixups->fc].reloc = + get_reloc ((struct d30v_operand *) &d30v_operand_table[form->operands[i]], op->reloc_flag); fixups->fix[fixups->fc].size = 4; fixups->fix[fixups->fc].exp = opers[i]; fixups->fix[fixups->fc].operand = form->operands[i]; @@ -647,31 +651,32 @@ build_insn (opcode, opers) (fixups->fc)++; } - /* truncate to the proper number of bits */ + /* Truncate to the proper number of bits. */ if ((opers[i].X_op == O_constant) && check_range (number, bits, flags)) - as_bad (_("operand out of range: %d"),number); + as_bad (_("operand out of range: %d"), number); if (bits < 31) number &= 0x7FFFFFFF >> (31 - bits); if (flags & OPERAND_SHIFT) number >>= 3; if (bits == 32) { - /* it's a LONG instruction */ + /* It's a LONG instruction. */ insn |= ((number & 0xffffffff) >> 26); /* top 6 bits */ insn <<= 32; /* shift the first word over */ - insn |= ((number & 0x03FC0000) << 2); /* next 8 bits */ + insn |= ((number & 0x03FC0000) << 2); /* next 8 bits */ insn |= number & 0x0003FFFF; /* bottom 18 bits */ } else insn |= number << shift; } + return insn; } +/* Write out a long form instruction. */ -/* write out a long form instruction */ static void -write_long (opcode, insn, fx) +write_long (opcode, insn, fx) struct d30v_insn *opcode; long long insn; Fixups *fx; @@ -682,11 +687,11 @@ write_long (opcode, insn, fx) insn |= FM11; d30v_number_to_chars (f, insn, 8); - for (i=0; i < fx->fc; i++) + for (i = 0; i < fx->fc; i++) { if (fx->fix[i].reloc) - { - where = f - frag_now->fr_literal; + { + where = f - frag_now->fr_literal; fix_new_exp (frag_now, where, fx->fix[i].size, @@ -695,13 +700,14 @@ write_long (opcode, insn, fx) fx->fix[i].reloc); } } + fx->fc = 0; } - /* Write out a short form instruction by itself. */ + static void -write_1_short (opcode, insn, fx, use_sequential) +write_1_short (opcode, insn, fx, use_sequential) struct d30v_insn *opcode; long long insn; Fixups *fx; @@ -714,54 +720,60 @@ write_1_short (opcode, insn, fx, use_sequential) as_warn (_("%s NOP inserted"), use_sequential ? _("sequential") : _("parallel")); - /* The other container needs to be NOP. */ + /* The other container needs to be NOP. */ if (use_sequential) { /* Use a sequential NOP rather than a parallel one, as the current instruction is a FLAG_MUL32 type one and the next instruction is a load. */ - + /* According to 4.3.1: for FM=01, sub-instructions performed - only by IU cannot be encoded in L-container. */ - + only by IU cannot be encoded in L-container. */ + if (opcode->op->unit == IU) - insn |= FM10 | NOP_LEFT; /* right then left */ + /* Right then left. */ + insn |= FM10 | NOP_LEFT; else - insn = FM01 | (insn << 32) | NOP_RIGHT; /* left then right */ + /* Left then right. */ + insn = FM01 | (insn << 32) | NOP_RIGHT; } else { /* According to 4.3.1: for FM=00, sub-instructions performed - only by IU cannot be encoded in L-container. */ - + only by IU cannot be encoded in L-container. */ + if (opcode->op->unit == IU) - insn |= FM00 | NOP_LEFT; /* right container */ + /* Right container. */ + insn |= FM00 | NOP_LEFT; else - insn = FM00 | (insn << 32) | NOP_RIGHT; /* left container */ + /* Left container. */ + insn = FM00 | (insn << 32) | NOP_RIGHT; } d30v_number_to_chars (f, insn, 8); - for (i=0; i < fx->fc; i++) + for (i = 0; i < fx->fc; i++) { if (fx->fix[i].reloc) - { - where = f - frag_now->fr_literal; + { + where = f - frag_now->fr_literal; fix_new_exp (frag_now, - where, + where, fx->fix[i].size, &(fx->fix[i].exp), fx->fix[i].pcrel, fx->fix[i].reloc); } } + fx->fc = 0; } /* Write out a short form instruction if possible. Return number of instructions not written out. */ + static int -write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx) +write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx) struct d30v_insn *opcode1, *opcode2; long long insn1, insn2; exec_type_enum exec_type; @@ -769,7 +781,7 @@ write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx) { long long insn = NOP2; char *f; - int i,j, where; + int i, j, where; if (exec_type == EXEC_SEQ && (opcode1->op->flags_used & (FLAG_JMP | FLAG_JSR)) @@ -784,14 +796,13 @@ write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx) write_1_short (opcode1, insn1, fx->next, false); return 1; } - + /* Note: we do not have to worry about subroutine calls occuring in the right hand container. The return address is always aligned to the next 64 bit boundary, be that 64 or 32 bit away. */ - - switch (exec_type) + switch (exec_type) { - case EXEC_UNKNOWN: /* Order not specified. */ + case EXEC_UNKNOWN: /* Order not specified. */ if (Optimizing && parallel_ok (opcode1, insn1, opcode2, insn2, exec_type) && ! ( (opcode1->op->unit == EITHER_BUT_PREFER_MU @@ -800,22 +811,21 @@ write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx) ( opcode2->op->unit == EITHER_BUT_PREFER_MU || opcode2->op->unit == MU))) { - /* parallel */ + /* Parallel. */ exec_type = EXEC_PARALLEL; - + if (opcode1->op->unit == IU || opcode2->op->unit == MU || opcode2->op->unit == EITHER_BUT_PREFER_MU) insn = FM00 | (insn2 << 32) | insn1; else { - insn = FM00 | (insn1 << 32) | insn2; + insn = FM00 | (insn1 << 32) | insn2; fx = fx->next; } } else if ((opcode1->op->flags_used & (FLAG_JMP | FLAG_JSR) - && ((opcode1->op->flags_used & FLAG_DELAY) == 0) - && ((opcode1->ecc == ECC_AL) || ! Optimizing)) + && ((opcode1->op->flags_used & FLAG_DELAY) == 0)) || opcode1->op->flags_used & FLAG_RP) { /* We must emit (non-delayed) branch type instructions @@ -833,24 +843,31 @@ write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx) write_1_short (opcode1, insn1, fx->next, false); return 1; } - else if (opcode1->op->unit == IU - || (opcode1->op->unit == EITHER - && opcode2->op->unit == EITHER_BUT_PREFER_MU)) + else if (opcode1->op->unit == IU) { - /* reverse sequential */ + if (opcode2->op->unit == EITHER_BUT_PREFER_MU) + { + /* Case 103810 is a request from Mitsubishi that opcodes + with EITHER_BUT_PREFER_MU should not be executed in + reverse sequential order. */ + write_1_short (opcode1, insn1, fx->next, false); + return 1; + } + + /* Reverse sequential. */ insn = FM10 | (insn2 << 32) | insn1; exec_type = EXEC_REVSEQ; } else { - /* sequential */ + /* Sequential. */ insn = FM01 | (insn1 << 32) | insn2; fx = fx->next; exec_type = EXEC_SEQ; } break; - case EXEC_PARALLEL: /* parallel */ + case EXEC_PARALLEL: /* Parallel. */ flag_explicitly_parallel = flag_xp_state; if (! parallel_ok (opcode1, insn1, opcode2, insn2, exec_type)) as_bad (_("Instructions may not be executed in parallel")); @@ -859,7 +876,7 @@ write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx) if (opcode2->op->unit == IU) as_bad (_("Two IU instructions may not be executed in parallel")); as_warn (_("Swapping instruction order")); - insn = FM00 | (insn2 << 32) | insn1; + insn = FM00 | (insn2 << 32) | insn1; } else if (opcode2->op->unit == MU) { @@ -873,33 +890,36 @@ write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx) else { if (opcode2->op->unit == EITHER_BUT_PREFER_MU) - as_warn (_("Executing %s in IU may not work"), opcode2->op->name); - - insn = FM00 | (insn1 << 32) | insn2; + as_warn (_("Executing %s in IU may not work in parallel execution"), + opcode2->op->name); + + insn = FM00 | (insn1 << 32) | insn2; fx = fx->next; } flag_explicitly_parallel = 0; break; - case EXEC_SEQ: /* sequential */ + case EXEC_SEQ: /* Sequential. */ if (opcode1->op->unit == IU) as_bad (_("IU instruction may not be in the left container")); if (prev_left_kills_right_p) as_bad (_("special left instruction `%s' kills instruction " - "`%s' in right container"), - opcode1->op->name, opcode2->op->name); - if (opcode2->op->unit == EITHER_BUT_PREFER_MU) - as_warn (_("Executing %s in IU may not work"), opcode2->op->name); - insn = FM01 | (insn1 << 32) | insn2; + "`%s' in right container"), + opcode1->op->name, opcode2->op->name); + insn = FM01 | (insn1 << 32) | insn2; fx = fx->next; break; - case EXEC_REVSEQ: /* reverse sequential */ + case EXEC_REVSEQ: /* Reverse sequential. */ if (opcode2->op->unit == MU) as_bad (_("MU instruction may not be in the right container")); - if (opcode2->op->unit == EITHER_BUT_PREFER_MU) - as_warn (_("Executing %s in IU may not work"), opcode2->op->name); - insn = FM10 | (insn1 << 32) | insn2; + if (opcode1->op->unit == EITHER_BUT_PREFER_MU) + as_warn (_("Executing %s in reverse serial with %s may not work"), + opcode1->op->name, opcode2->op->name); + else if (opcode2->op->unit == EITHER_BUT_PREFER_MU) + as_warn (_("Executing %s in IU in reverse serial may not work"), + opcode2->op->name); + insn = FM10 | (insn1 << 32) | insn2; fx = fx->next; break; @@ -907,7 +927,9 @@ write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx) as_fatal (_("unknown execution type passed to write_2_short()")); } - /* printf ("writing out %llx\n",insn); */ +#if 0 + printf ("writing out %llx\n", insn); +#endif f = frag_more (8); d30v_number_to_chars (f, insn, 8); @@ -917,33 +939,33 @@ write_2_short (opcode1, insn1, opcode2, insn2, exec_type, fx) if (prev_mul32_p && exec_type == EXEC_PARALLEL) cur_mul32_p = 1; - for (j=0; j<2; j++) + for (j = 0; j < 2; j++) { - for (i=0; i < fx->fc; i++) + for (i = 0; i < fx->fc; i++) { if (fx->fix[i].reloc) { - where = (f - frag_now->fr_literal) + 4*j; + where = (f - frag_now->fr_literal) + 4 * j; fix_new_exp (frag_now, - where, + where, fx->fix[i].size, &(fx->fix[i].exp), fx->fix[i].pcrel, fx->fix[i].reloc); } } - + fx->fc = 0; fx = fx->next; } - + return 0; } +/* Check 2 instructions and determine if they can be safely + executed in parallel. Return 1 if they can be. */ -/* Check 2 instructions and determine if they can be safely */ -/* executed in parallel. Returns 1 if they can be. */ static int parallel_ok (op1, insn1, op2, insn2, exec_type) struct d30v_insn *op1, *op2; @@ -956,12 +978,12 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) struct d30v_format *f; struct d30v_opcode *op; - /* section 4.3: both instructions must not be IU or MU only */ + /* Section 4.3: Both instructions must not be IU or MU only. */ if ((op1->op->unit == IU && op2->op->unit == IU) || (op1->op->unit == MU && op2->op->unit == MU)) return 0; - /* first instruction must not be a jump to safely optimize, unless this + /* First instruction must not be a jump to safely optimize, unless this is an explicit parallel operation. */ if (exec_type != EXEC_PARALLEL && (op1->op->flags_used & (FLAG_JMP | FLAG_JSR))) @@ -974,12 +996,11 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) || (op1->ecc == ECC_FX && op2->ecc == ECC_TX) || (op1->ecc == ECC_XT && op2->ecc == ECC_XF) || (op1->ecc == ECC_XF && op2->ecc == ECC_XT)) - return 1; + return 1; /* [0] r0-r31 [1] r32-r63 - [2] a0, a1, flag registers */ - + [2] a0, a1, flag registers. */ for (j = 0; j < 2; j++) { if (j == 0) @@ -996,6 +1017,7 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) ecc = op2->ecc; ins = insn2; } + flag_reg[j] = 0; mod_reg[j][0] = mod_reg[j][1] = 0; used_reg[j][0] = used_reg[j][1] = 0; @@ -1010,7 +1032,6 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) eg "cmpne f0,r1,0x10 || cmpeq f0, r5, 0x2", so further on we test for the use of a flag register and set a bit in the mod or used array appropriately. */ - mod_reg[j][2] = 0; used_reg[j][2] = 0; } @@ -1019,12 +1040,12 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) mod_reg[j][2] = (op->flags_set & FLAG_ALL); used_reg[j][2] = (op->flags_used & FLAG_ALL); } - - /* BSR/JSR always sets R62 */ - if (op->flags_used & FLAG_JSR) - mod_reg[j][1] = (1L << (62-32)); - /* conditional execution affects the flags_used */ + /* BSR/JSR always sets R62. */ + if (op->flags_used & FLAG_JSR) + mod_reg[j][1] = (1L << (62 - 32)); + + /* Conditional execution affects the flags_used. */ switch (ecc) { case ECC_TX: @@ -1055,10 +1076,9 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) if ((flags & OPERAND_PLUS) || (flags & OPERAND_MINUS)) { - /* this is a post-increment or post-decrement */ - /* the previous register needs to be marked as modified */ - - shift = 12 - d30v_operand_table[f->operands[i-1]].position; + /* This is a post-increment or post-decrement. + The previous register needs to be marked as modified. */ + shift = 12 - d30v_operand_table[f->operands[i - 1]].position; regno = (ins >> shift) & 0x3f; if (regno >= 32) mod_reg[j][1] |= 1L << (regno - 32); @@ -1068,10 +1088,11 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) else if (flags & OPERAND_REG) { regno = (ins >> shift) & mask; - /* the memory write functions don't have a destination register */ + /* The memory write functions don't have a destination + register. */ if ((flags & OPERAND_DEST) && !(op->flags_set & FLAG_MEM)) { - /* MODIFIED registers and flags */ + /* MODIFIED registers and flags. */ if (flags & OPERAND_ACC) { if (regno == 0) @@ -1087,15 +1108,15 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) { int r, z; - /* need to check if there are two destination */ - /* registers, for example ld2w */ + /* Need to check if there are two destination + registers, for example ld2w. */ if (flags & OPERAND_2REG) z = 1; else z = 0; for (r = regno; r <= regno + z; r++) - { + { if (r >= 32) mod_reg[j][1] |= 1L << (r - 32); else @@ -1105,7 +1126,7 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) } else { - /* USED, but not modified registers and flags */ + /* USED, but not modified registers and flags. */ if (flags & OPERAND_ACC) { if (regno == 0) @@ -1121,15 +1142,15 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) { int r, z; - /* need to check if there are two source */ - /* registers, for example st2w */ + /* Need to check if there are two source + registers, for example st2w. */ if (flags & OPERAND_2REG) z = 1; else z = 0; for (r = regno; r <= regno + z; r++) - { + { if (r >= 32) used_reg[j][1] |= 1L << (r - 32); else @@ -1140,7 +1161,7 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) } } } - + flags_set1 = op1->op->flags_set; flags_set2 = op2->op->flags_set; flags_used1 = op1->op->flags_used; @@ -1163,7 +1184,6 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) the right container, and it writes its results last. However, don't paralellize add followed by addc or sub followed by subb. */ - if (mod_reg[0][2] == FLAG_CVVA && mod_reg[1][2] == FLAG_CVVA && (used_reg[0][2] & ~flag_reg[0]) == 0 && (used_reg[1][2] & ~flag_reg[1]) == 0 @@ -1177,12 +1197,12 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) /* If the second instruction depends on the first, we obviously cannot parallelize. Note, the mod flag implies use, so check that as well. */ - /* If flag_explicitly_parallel is set, then the case of the + /* If flag_explicitly_parallel is set, then the case of the second instruction using a register the first instruction modifies is assumed to be okay; we trust the human. We don't trust the human if both instructions modify the same register but we do trust the human if they modify the same - flags. */ + flags. */ /* We have now been requested not to trust the human if the instructions modify the same flag registers either. */ if (flag_explicitly_parallel) @@ -1198,11 +1218,11 @@ parallel_ok (op1, insn1, op2, insn2, exec_type) return 1; } - -/* This is the main entry point for the machine-dependent assembler. str points to a - machine-dependent instruction. This function is supposed to emit the frags/bytes - it assembles to. For the D30V, it mostly handles the special VLIW parsing and packing - and leaves the difficult stuff to do_assemble(). */ +/* This is the main entry point for the machine-dependent assembler. + STR points to a machine-dependent instruction. This function is + supposed to emit the frags/bytes it assembles to. For the D30V, it + mostly handles the special VLIW parsing and packing and leaves the + difficult stuff to do_assemble (). */ static long long prev_insn = -1; static struct d30v_insn prev_opcode; @@ -1215,12 +1235,14 @@ md_assemble (str) { struct d30v_insn opcode; long long insn; - exec_type_enum extype = EXEC_UNKNOWN; /* execution type; parallel, etc */ - static exec_type_enum etype = EXEC_UNKNOWN; /* saved extype. used for multiline instructions */ + /* Execution type; parallel, etc. */ + exec_type_enum extype = EXEC_UNKNOWN; + /* Saved extype. Used for multiline instructions. */ + static exec_type_enum etype = EXEC_UNKNOWN; char *str2; if ((prev_insn != -1) && prev_seg - && ((prev_seg != now_seg) || (prev_subseg != now_subseg))) + && ((prev_seg != now_seg) || (prev_subseg != now_subseg))) d30v_cleanup (false); if (d30v_current_align < 3) @@ -1233,9 +1255,9 @@ md_assemble (str) flag_xp_state = 0; if (etype == EXEC_UNKNOWN) { - /* look for the special multiple instruction separators */ + /* Look for the special multiple instruction separators. */ str2 = strstr (str, "||"); - if (str2) + if (str2) { extype = EXEC_PARALLEL; flag_xp_state = 1; @@ -1243,30 +1265,31 @@ md_assemble (str) else { str2 = strstr (str, "->"); - if (str2) + if (str2) extype = EXEC_SEQ; else { str2 = strstr (str, "<-"); - if (str2) + if (str2) extype = EXEC_REVSEQ; } } - /* str2 points to the separator, if one */ - if (str2) + + /* STR2 points to the separator, if one. */ + if (str2) { *str2 = 0; - - /* if two instructions are present and we already have one saved - then first write it out */ + + /* If two instructions are present and we already have one saved, + then first write it out. */ d30v_cleanup (false); - + /* Assemble first instruction and save it. */ prev_insn = do_assemble (str, &prev_opcode, 1, 0); if (prev_insn == -1) as_bad (_("Cannot assemble instruction")); if (prev_opcode.form != NULL && prev_opcode.form->form >= LONG) - as_bad (_("First opcode is long. Unable to mix instructions as specified.")); + as_bad (_("First opcode is long. Unable to mix instructions as specified.")); fixups = fixups->next; str = str2 + 2; prev_seg = now_seg; @@ -1303,34 +1326,35 @@ md_assemble (str) && (opcode.op->flags_used & FLAG_MEM) && opcode.form->form < LONG && (extype == EXEC_PARALLEL || (Optimizing && extype == EXEC_UNKNOWN)) - && parallel_ok (&prev_opcode, (long)prev_insn, - &opcode, (long)insn, extype) - && write_2_short (&prev_opcode, (long)prev_insn, - &opcode, (long)insn, extype, fixups) == 0) + && parallel_ok (&prev_opcode, (long) prev_insn, + &opcode, (long) insn, extype) + && write_2_short (&prev_opcode, (long) prev_insn, + &opcode, (long) insn, extype, fixups) == 0) { - /* no instructions saved */ + /* No instructions saved. */ prev_insn = -1; return; } else { - /* Can't parallelize, flush previous instruction and emit a word of NOPS, - unless the previous instruction is a NOP, in which case just flush it, - as this will generate a word of NOPs for us. */ + /* Can't parallelize, flush previous instruction and emit a + word of NOPS, unless the previous instruction is a NOP, + in which case just flush it, as this will generate a word + of NOPs for us. */ if (prev_insn != -1 && (strcmp (prev_opcode.op->name, "nop") == 0)) d30v_cleanup (false); else { - char * f; - + char *f; + if (prev_insn != -1) d30v_cleanup (true); else { f = frag_more (8); d30v_number_to_chars (f, NOP2, 8); - + if (warn_nops == NOP_ALL || warn_nops == NOP_MULTIPLY) { if (opcode.op->flags_used & FLAG_MEM) @@ -1340,7 +1364,7 @@ md_assemble (str) } } } - + extype = EXEC_UNKNOWN; } } @@ -1348,9 +1372,10 @@ md_assemble (str) && cur_mul32_p && (prev_opcode.op->flags_used & (FLAG_MEM | FLAG_MUL16))) { - /* Can't parallelize, flush current instruction and add a sequential NOP. */ - write_1_short (& opcode, (long) insn, fixups->next->next, true); - + /* Can't parallelize, flush current instruction and add a + sequential NOP. */ + write_1_short (&opcode, (long) insn, fixups->next->next, true); + /* Make the previous instruction the current one. */ extype = EXEC_UNKNOWN; insn = prev_insn; @@ -1362,28 +1387,29 @@ md_assemble (str) memcpy (&opcode, &prev_opcode, sizeof (prev_opcode)); } - /* If this is a long instruction, write it and any previous short instruction. */ - if (opcode.form->form >= LONG) + /* If this is a long instruction, write it and any previous short + instruction. */ + if (opcode.form->form >= LONG) { - if (extype != EXEC_UNKNOWN) + if (extype != EXEC_UNKNOWN) as_bad (_("Instruction uses long version, so it cannot be mixed as specified")); d30v_cleanup (false); - write_long (& opcode, insn, fixups); + write_long (&opcode, insn, fixups); prev_insn = -1; } else if ((prev_insn != -1) && (write_2_short - (& prev_opcode, (long) prev_insn, & opcode, - (long) insn, extype, fixups) == 0)) + (&prev_opcode, (long) prev_insn, &opcode, + (long) insn, extype, fixups) == 0)) { /* No instructions saved. */ prev_insn = -1; } else { - if (extype != EXEC_UNKNOWN) + if (extype != EXEC_UNKNOWN) as_bad (_("Unable to mix instructions as specified")); - + /* Save off last instruction so it may be packed on next pass. */ memcpy (&prev_opcode, &opcode, sizeof (prev_opcode)); prev_insn = insn; @@ -1394,38 +1420,37 @@ md_assemble (str) } } - -/* do_assemble assembles a single instruction and returns an opcode */ -/* it returns -1 (an invalid opcode) on error */ +/* Assemble a single instruction and return an opcode. + Return -1 (an invalid opcode) on error. */ #define NAME_BUF_LEN 20 static long long -do_assemble (str, opcode, shortp, is_parallel) +do_assemble (str, opcode, shortp, is_parallel) char *str; struct d30v_insn *opcode; int shortp; int is_parallel; { - unsigned char * op_start; - unsigned char * save; - unsigned char * op_end; - char name [NAME_BUF_LEN]; - int cmp_hack; - int nlen = 0; - int fsize = (shortp ? FORCE_SHORT : 0); - expressionS myops [6]; - long long insn; + unsigned char *op_start; + unsigned char *save; + unsigned char *op_end; + char name[NAME_BUF_LEN]; + int cmp_hack; + int nlen = 0; + int fsize = (shortp ? FORCE_SHORT : 0); + expressionS myops[6]; + long long insn; - /* Drop leading whitespace */ - while (* str == ' ') - str ++; + /* Drop leading whitespace. */ + while (*str == ' ') + str++; - /* find the opcode end */ + /* Find the opcode end. */ for (op_start = op_end = (unsigned char *) (str); - * op_end + *op_end && nlen < (NAME_BUF_LEN - 1) - && * op_end != '/' + && *op_end != '/' && !is_end_of_line[*op_end] && *op_end != ' '; op_end++) { @@ -1438,70 +1463,73 @@ do_assemble (str, opcode, shortp, is_parallel) name[nlen] = 0; - /* if there is an execution condition code, handle it */ + /* If there is an execution condition code, handle it. */ if (*op_end == '/') { int i = 0; - while ( (i < ECC_MAX) && strncasecmp (d30v_ecc_names[i], op_end + 1, 2)) + while ((i < ECC_MAX) && strncasecmp (d30v_ecc_names[i], op_end + 1, 2)) i++; - + if (i == ECC_MAX) { char tmp[4]; strncpy (tmp, op_end + 1, 2); tmp[2] = 0; - as_bad (_("unknown condition code: %s"),tmp); + as_bad (_("unknown condition code: %s"), tmp); return -1; } - /* printf ("condition code=%d\n",i); */ +#if 0 + printf ("condition code=%d\n", i); +#endif opcode->ecc = i; op_end += 3; } else opcode->ecc = ECC_AL; - - /* CMP and CMPU change their name based on condition codes */ + /* CMP and CMPU change their name based on condition codes. */ if (!strncmp (name, "cmp", 3)) { - int p,i; - char **str = (char **)d30v_cc_names; + int p, i; + char **str = (char **) d30v_cc_names; if (name[3] == 'u') p = 4; else p = 3; - for (i=1; *str && strncmp (*str, & name[p], 2); i++, str++) + for (i = 1; *str && strncmp (*str, &name[p], 2); i++, str++) ; - /* cmpu only supports some condition codes */ + /* cmpu only supports some condition codes. */ if (p == 4) { if (i < 3 || i > 6) { - name[p+2]=0; - as_bad (_("cmpu doesn't support condition code %s"),&name[p]); + name[p + 2] = 0; + as_bad (_("cmpu doesn't support condition code %s"), &name[p]); } } if (!*str) { - name[p+2]=0; - as_bad (_("unknown condition code: %s"),&name[p]); + name[p + 2] = 0; + as_bad (_("unknown condition code: %s"), &name[p]); } - + cmp_hack = i; name[p] = 0; } else cmp_hack = 0; - - /* printf("cmp_hack=%d\n",cmp_hack); */ - /* need to look for .s or .l */ - if (name[nlen-2] == '.') +#if 0 + printf ("cmp_hack=%d\n", cmp_hack); +#endif + + /* Need to look for .s or .l. */ + if (name[nlen - 2] == '.') { - switch (name[nlen-1]) + switch (name[nlen - 1]) { case 's': fsize = FORCE_SHORT; @@ -1510,14 +1538,14 @@ do_assemble (str, opcode, shortp, is_parallel) fsize = FORCE_LONG; break; } - name[nlen-2] = 0; + name[nlen - 2] = 0; } - /* find the first opcode with the proper name */ - opcode->op = (struct d30v_opcode *)hash_find (d30v_hash, name); + /* Find the first opcode with the proper name. */ + opcode->op = (struct d30v_opcode *) hash_find (d30v_hash, name); if (opcode->op == NULL) { - as_bad (_("unknown opcode: %s"),name); + as_bad (_("unknown opcode: %s"), name); return -1; } @@ -1528,15 +1556,16 @@ do_assemble (str, opcode, shortp, is_parallel) opcode->op++; if (opcode->op->name == NULL || strcmp (opcode->op->name, name)) { - as_bad (_("operands for opcode `%s' do not match any valid format"), name); + as_bad (_("operands for opcode `%s' do not match any valid format"), + name); return -1; } } input_line_pointer = save; - insn = build_insn (opcode, myops); + insn = build_insn (opcode, myops); - /* Propigate multiply status */ + /* Propigate multiply status. */ if (insn != -1) { if (is_parallel && prev_mul32_p) @@ -1548,7 +1577,7 @@ do_assemble (str, opcode, shortp, is_parallel) } } - /* Propagate left_kills_right status */ + /* Propagate left_kills_right status. */ if (insn != -1) { prev_left_kills_right_p = cur_left_kills_right_p; @@ -1556,10 +1585,11 @@ do_assemble (str, opcode, shortp, is_parallel) if (opcode->op->flags_set & FLAG_LKR) { cur_left_kills_right_p = 1; - + if (strcmp (opcode->op->name, "mvtsys") == 0) { - /* Left kills right for only mvtsys only for PSW/PSWH/PSWL/flags target. */ + /* Left kills right for only mvtsys only for + PSW/PSWH/PSWL/flags target. */ if ((myops[0].X_op == O_register) && ((myops[0].X_add_number == OPERAND_CONTROL) || /* psw */ (myops[0].X_add_number == OPERAND_CONTROL+MAX_CONTROL_REG+2) || /* pswh */ @@ -1577,7 +1607,8 @@ do_assemble (str, opcode, shortp, is_parallel) } else { - /* Other mvtsys target registers don't kill right instruction. */ + /* Other mvtsys target registers don't kill right + instruction. */ cur_left_kills_right_p = 0; } } /* mvtsys */ @@ -1589,10 +1620,9 @@ do_assemble (str, opcode, shortp, is_parallel) return insn; } - -/* find_format() gets a pointer to an entry in the format table. +/* Get a pointer to an entry in the format table. It must look at all formats for an opcode and use the operands - to choose the correct one. Returns NULL on error. */ + to choose the correct one. Return NULL on error. */ static struct d30v_format * find_format (opcode, myops, fsize, cmp_hack) @@ -1601,12 +1631,12 @@ find_format (opcode, myops, fsize, cmp_hack) int fsize; int cmp_hack; { - int numops, match, index, i=0, j, k; + int numops, match, index, i = 0, j, k; struct d30v_format *fm; if (opcode == NULL) return NULL; - + /* Get all the operands and save them as expressions. */ numops = get_operands (myops, cmp_hack); @@ -1618,7 +1648,7 @@ find_format (opcode, myops, fsize, cmp_hack) if (fsize == FORCE_LONG && index < LONG) continue; - fm = (struct d30v_format *)&d30v_format_table[index]; + fm = (struct d30v_format *) &d30v_format_table[index]; k = index; while (fm->form == index) { @@ -1630,7 +1660,7 @@ find_format (opcode, myops, fsize, cmp_hack) int bits = d30v_operand_table[fm->operands[j]].bits; int X_op = myops[j].X_op; int num = myops[j].X_add_number; - + if (flags & OPERAND_SPECIAL) break; else if (X_op == O_illegal) @@ -1649,7 +1679,7 @@ find_format (opcode, myops, fsize, cmp_hack) } } else if (((flags & OPERAND_MINUS) - && (X_op != O_absent || num != OPERAND_MINUS)) + && (X_op != O_absent || num != OPERAND_MINUS)) || ((flags & OPERAND_PLUS) && (X_op != O_absent || num != OPERAND_PLUS)) || ((flags & OPERAND_ATMINUS) @@ -1659,21 +1689,22 @@ find_format (opcode, myops, fsize, cmp_hack) || ((flags & OPERAND_ATSIGN) && (X_op != O_absent || num != OPERAND_ATSIGN))) { - match=0; + match = 0; } else if (flags & OPERAND_NUM) { /* A number can be a constant or symbol expression. */ - /* If we have found a register name, but that name also - matches a symbol, then re-parse the name as an expression. */ + /* If we have found a register name, but that name + also matches a symbol, then re-parse the name as + an expression. */ if (X_op == O_register && symbol_find ((char *) myops[j].X_op_symbol)) { input_line_pointer = (char *) myops[j].X_op_symbol; - expression (& myops[j]); + expression (&myops[j]); } - + /* Turn an expression into a symbol for later resolution. */ if (X_op != O_absent && X_op != O_constant && X_op != O_symbol && X_op != O_register @@ -1687,7 +1718,7 @@ find_format (opcode, myops, fsize, cmp_hack) if (fm->form >= LONG) { - /* If we're testing for a LONG format, either fits. */ + /* If we're testing for a LONG format, either fits. */ if (X_op != O_constant && X_op != O_symbol) match = 0; } @@ -1695,8 +1726,9 @@ find_format (opcode, myops, fsize, cmp_hack) && ((fsize == FORCE_SHORT && X_op == O_symbol) || (fm->form == SHORT_D2 && j == 0))) match = 1; + /* This is the tricky part. Will the constant or symbol - fit into the space in the current format? */ + fit into the space in the current format? */ else if (X_op == O_constant) { if (check_range (num, bits, flags)) @@ -1708,7 +1740,7 @@ find_format (opcode, myops, fsize, cmp_hack) && opcode->reloc_flag == RELOC_PCREL) { /* If the symbol is defined, see if the value will fit - into the form we're considering. */ + into the form we're considering. */ fragS *f; long value; @@ -1720,14 +1752,16 @@ find_format (opcode, myops, fsize, cmp_hack) value = (S_GET_VALUE (myops[j].X_add_symbol) - value - (obstack_next_free (&frchain_now->frch_obstack) - frag_now->fr_literal)); - if (check_range (value, bits, flags)) + if (check_range (value, bits, flags)) match = 0; } else match = 0; } } - /* printf("through the loop: match=%d\n",match); */ +#if 0 + printf ("through the loop: match=%d\n", match); +#endif /* We're only done if the operands matched so far AND there are no more to check. */ if (match && myops[j].X_op == 0) @@ -1740,21 +1774,22 @@ find_format (opcode, myops, fsize, cmp_hack) if (myops[j].X_op == O_register && (myops[j].X_add_number & 1) && (d30v_operand_table[fm->operands[j]].flags & OPERAND_2REG)) - as_warn (\ -_("Odd numbered register used as target of multi-register instruction")); - + as_warn (_("Odd numbered register used as target of multi-register instruction")); + return fm; } - fm = (struct d30v_format *)&d30v_format_table[++k]; + fm = (struct d30v_format *) &d30v_format_table[++k]; } - /* printf("trying another format: i=%d\n",i); */ +#if 0 + printf ("trying another format: i=%d\n", i); +#endif } return NULL; } -/* if while processing a fixup, a reloc really needs to be created */ -/* then it is done here */ - +/* If while processing a fixup, a reloc really needs to be created, + then it is done here. */ + arelent * tc_gen_reloc (seg, fixp) asection *seg; @@ -1769,7 +1804,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; @@ -1783,43 +1819,44 @@ md_estimate_size_before_relax (fragp, seg) { abort (); return 0; -} +} long md_pcrel_from_section (fixp, sec) fixS *fixp; segT sec; { - if (fixp->fx_addsy != (symbolS *)NULL && (!S_IS_DEFINED (fixp->fx_addsy) || - (S_GET_SEGMENT (fixp->fx_addsy) != sec))) + if (fixp->fx_addsy != (symbolS *) NULL + && (!S_IS_DEFINED (fixp->fx_addsy) + || (S_GET_SEGMENT (fixp->fx_addsy) != sec))) return 0; return fixp->fx_frag->fr_address + fixp->fx_where; } int md_apply_fix3 (fixp, valuep, seg) - fixS * fixp; - valueT * valuep; + fixS *fixp; + valueT *valuep; segT seg; { - char * where; + char *where; unsigned long insn, insn2; long value; - + if (fixp->fx_addsy == (symbolS *) NULL) { - value = * valuep; + value = *valuep; fixp->fx_done = 1; } else if (fixp->fx_pcrel) - value = * valuep; + value = *valuep; else { value = fixp->fx_offset; - + if (fixp->fx_subsy != (symbolS *) NULL) { - if (S_GET_SEGMENT (fixp->fx_subsy) == absolute_section) + if (S_GET_SEGMENT (fixp->fx_subsy) == absolute_section) value -= S_GET_VALUE (fixp->fx_subsy); else { @@ -1829,12 +1866,12 @@ md_apply_fix3 (fixp, valuep, seg) } } } - + /* Fetch the instruction, insert the fully resolved operand value, and stuff the instruction back again. */ where = fixp->fx_frag->fr_literal + fixp->fx_where; insn = bfd_getb32 ((unsigned char *) where); - + switch (fixp->fx_r_type) { case BFD_RELOC_8: /* Check for a bad .byte directive. */ @@ -1842,23 +1879,23 @@ md_apply_fix3 (fixp, valuep, seg) as_bad (_("line %d: unable to place address of symbol '%s' into a byte"), fixp->fx_line, S_GET_NAME (fixp->fx_addsy)); else if (((unsigned)value) > 0xff) - as_bad (_("line %d: unable to place value %x into a byte"), - fixp->fx_line, value); + as_bad (_("line %d: unable to place value %x into a byte"), + fixp->fx_line, value); else - * (unsigned char *) where = value; + *(unsigned char *) where = value; break; - + case BFD_RELOC_16: /* Check for a bad .short directive. */ if (fixp->fx_addsy != NULL) as_bad (_("line %d: unable to place address of symbol '%s' into a short"), fixp->fx_line, S_GET_NAME (fixp->fx_addsy)); else if (((unsigned)value) > 0xffff) - as_bad (_("line %d: unable to place value %x into a short"), - fixp->fx_line, value); + as_bad (_("line %d: unable to place value %x into a short"), + fixp->fx_line, value); else bfd_putb16 ((bfd_vma) value, (unsigned char *) where); break; - + case BFD_RELOC_64: /* Check for a bad .quad directive. */ if (fixp->fx_addsy != NULL) as_bad (_("line %d: unable to place address of symbol '%s' into a quad"), @@ -1869,7 +1906,7 @@ md_apply_fix3 (fixp, valuep, seg) bfd_putb32 (0, ((unsigned char *) where) + 4); } break; - + case BFD_RELOC_D30V_6: check_size (value, 6, fixp->fx_file, fixp->fx_line); insn |= value & 0x3F; @@ -1929,18 +1966,18 @@ md_apply_fix3 (fixp, valuep, seg) case BFD_RELOC_D30V_32: insn2 = bfd_getb32 ((unsigned char *) where + 4); - insn |= (value >> 26) & 0x3F; /* top 6 bits */ - insn2 |= ((value & 0x03FC0000) << 2); /* next 8 bits */ - insn2 |= value & 0x0003FFFF; /* bottom 18 bits */ + insn |= (value >> 26) & 0x3F; /* Top 6 bits. */ + insn2 |= ((value & 0x03FC0000) << 2); /* Next 8 bits. */ + insn2 |= value & 0x0003FFFF; /* Bottom 18 bits. */ bfd_putb32 ((bfd_vma) insn, (unsigned char *) where); bfd_putb32 ((bfd_vma) insn2, (unsigned char *) where + 4); break; case BFD_RELOC_D30V_32_PCREL: insn2 = bfd_getb32 ((unsigned char *) where + 4); - insn |= (value >> 26) & 0x3F; /* top 6 bits */ - insn2 |= ((value & 0x03FC0000) << 2); /* next 8 bits */ - insn2 |= value & 0x0003FFFF; /* bottom 18 bits */ + insn |= (value >> 26) & 0x3F; /* Top 6 bits. */ + insn2 |= ((value & 0x03FC0000) << 2); /* Next 8 bits. */ + insn2 |= value & 0x0003FFFF; /* Bottom 18 bits. */ bfd_putb32 ((bfd_vma) insn, (unsigned char *) where); bfd_putb32 ((bfd_vma) insn2, (unsigned char *) where + 4); break; @@ -1951,17 +1988,18 @@ md_apply_fix3 (fixp, valuep, seg) default: as_bad (_("line %d: unknown relocation type: 0x%x"), - fixp->fx_line,fixp->fx_r_type); + fixp->fx_line, fixp->fx_r_type); } - + return 0; } +/* Called after the assembler has finished parsing the input file or + after a label is defined. Because the D30V assembler sometimes + saves short instructions to see if it can package them with the + next instruction, there may be a short instruction that still needs + written. */ -/* d30v_cleanup() is called after the assembler has finished parsing the input - file or after a label is defined. Because the D30V assembler sometimes saves short - instructions to see if it can package them with the next instruction, there may - be a short instruction that still needs written. */ int d30v_cleanup (use_sequential) int use_sequential; @@ -1974,20 +2012,22 @@ d30v_cleanup (use_sequential) seg = now_seg; subseg = now_subseg; subseg_set (prev_seg, prev_subseg); - write_1_short (&prev_opcode, (long)prev_insn, fixups->next, use_sequential); + write_1_short (&prev_opcode, (long) prev_insn, fixups->next, + use_sequential); subseg_set (seg, subseg); prev_insn = -1; if (use_sequential) prev_mul32_p = false; } + return 1; } -static void +static void d30v_number_to_chars (buf, value, n) - char *buf; /* Return 'nbytes' of chars here. */ - long long value; /* The value of the bits. */ - int n; /* Number of bytes in the output. */ + char *buf; /* Return 'nbytes' of chars here. */ + long long value; /* The value of the bits. */ + int n; /* Number of bytes in the output. */ { while (n--) { @@ -1996,13 +2036,11 @@ d30v_number_to_chars (buf, value, n) } } +/* This function is called at the start of every line. It checks to + see if the first character is a '.', which indicates the start of a + pseudo-op. If it is, then write out any unwritten instructions. */ -/* This function is called at the start of every line. */ -/* it checks to see if the first character is a '.' */ -/* which indicates the start of a pseudo-op. If it is, */ -/* then write out any unwritten instructions */ - -void +void d30v_start_line () { char *c = input_line_pointer; @@ -2014,7 +2052,7 @@ d30v_start_line () d30v_cleanup (false); } -static void +static void check_size (value, bits, file, line) long value; int bits; @@ -2027,7 +2065,7 @@ check_size (value, bits, file, line) tmp = ~value; else tmp = value; - + max = (1 << (bits - 1)) - 1; if (tmp > max) @@ -2093,7 +2131,6 @@ d30v_align (n, pfill, label) this alignement request. The alignment of the current frag can be changed under our feet, for example by a .ascii directive in the source code. cf testsuite/gas/d30v/reloc.s */ - d30v_cleanup (false); if (pfill == NULL) @@ -2120,18 +2157,18 @@ d30v_align (n, pfill, label) if (label != NULL) { - symbolS * sym; - int label_seen = false; - struct frag * old_frag; - valueT old_value; - valueT new_value; - + symbolS *sym; + int label_seen = false; + struct frag *old_frag; + valueT old_value; + valueT new_value; + assert (S_GET_SEGMENT (label) == now_seg); old_frag = symbol_get_frag (label); old_value = S_GET_VALUE (label); new_value = (valueT) frag_now_fix (); - + /* It is possible to have more than one label at a particular address, especially if debugging is enabled, so we must take care to adjust all the labels at this address in this diff --git a/gnu/dist/toolchain/gas/config/tc-d30v.h b/gnu/dist/toolchain/gas/config/tc-d30v.h index dfebbb926e13..077275269a17 100644 --- a/gnu/dist/toolchain/gas/config/tc-d30v.h +++ b/gnu/dist/toolchain/gas/config/tc-d30v.h @@ -1,5 +1,5 @@ /* tc-310v.h -- Header file for tc-d30v.c. - Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. Written by Martin Hunt, Cygnus Support. This file is part of GAS, the GNU Assembler. @@ -17,7 +17,9 @@ 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. */ + 02111-1307, USA. */ + +#include "write.h" /* For the definition of fixS. */ #define TC_D30V @@ -35,7 +37,9 @@ #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 ((fixS *fixp, segT sec)); +#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section(FIXP, SEC) /* Permit temporary numeric labels. */ #define LOCAL_LABELS_FB 1 @@ -51,7 +55,8 @@ int d30v_cleanup PARAMS ((int)); #define md_after_pass_hook() d30v_cleanup (false) #define md_cleanup() d30v_cleanup (false) #define TC_START_LABEL(ch, ptr) (ch == ':' && d30v_cleanup (false)) -#define md_start_line_hook() d30v_start_line (false) +void d30v_start_line PARAMS ((void)); +#define md_start_line_hook() d30v_start_line () void d30v_frob_label PARAMS ((symbolS *)); #define tc_frob_label(sym) d30v_frob_label(sym) diff --git a/gnu/dist/toolchain/gas/config/tc-fr30.c b/gnu/dist/toolchain/gas/config/tc-fr30.c index aca5880bb7d0..c61a8affedd5 100644 --- a/gnu/dist/toolchain/gas/config/tc-fr30.c +++ b/gnu/dist/toolchain/gas/config/tc-fr30.c @@ -1,5 +1,5 @@ /* tc-fr30.c -- Assembler for the Fujitsu FR30. - Copyright (C) 1998, 1999 Free Software Foundation. + Copyright (C) 1998, 1999, 2000 Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -21,7 +21,7 @@ #include #include #include "as.h" -#include "subsegs.h" +#include "subsegs.h" #include "symcat.h" #include "opcodes/fr30-desc.h" #include "opcodes/fr30-opc.h" @@ -82,7 +82,7 @@ md_show_usage (stream) FILE * stream; { fprintf (stream, _(" FR30 specific command line options:\n")); -} +} /* The target specific pseudo-ops which we support. */ const pseudo_typeS md_pseudo_table[] = @@ -100,7 +100,7 @@ md_begin () subsegT subseg; /* Initialize the `cgen' interface. */ - + /* Set the machine number and endian. */ gas_cgen_cpu_desc = fr30_cgen_cpu_open (CGEN_CPU_OPEN_MACHS, 0, CGEN_CPU_OPEN_ENDIAN, @@ -126,7 +126,7 @@ md_assemble (str) insn.insn = fr30_cgen_assemble_insn (gas_cgen_cpu_desc, str, & insn.fields, insn.buffer, & errmsg); - + if (!insn.insn) { as_bad (errmsg); @@ -150,7 +150,7 @@ md_assemble (str) /* The syntax in the manual says constants begin with '#'. We just ignore it. */ -void +void md_operand (expressionP) expressionS * expressionP; { @@ -279,7 +279,7 @@ md_estimate_size_before_relax (fragP, segment) all further handling to md_convert_frag. */ fragP->fr_subtype = 2; -#if 0 /* Can't use this, but leave in for illustration. */ +#if 0 /* Can't use this, but leave in for illustration. */ /* Change 16 bit insn to 32 bit insn. */ fragP->fr_opcode[0] |= 0x80; @@ -323,7 +323,7 @@ md_estimate_size_before_relax (fragP, segment) } return (fragP->fr_var + fragP->fr_fix - old_fr_fix); -} +} /* *fragP has been relaxed to its final size, and now needs to have the bytes inside it modified to conform to the new size. @@ -549,7 +549,7 @@ md_atof (type, litP, sizeP) sizeof (LITTLENUM_TYPE)); litP += sizeof (LITTLENUM_TYPE); } - + return 0; } @@ -559,14 +559,14 @@ restore_colon (advance_i_l_p_by) int advance_i_l_p_by; { char c; - + /* Restore the colon, and advance input_line_pointer to the end of the new symbol. */ * input_line_pointer = ':'; input_line_pointer += advance_i_l_p_by; c = * input_line_pointer; * input_line_pointer = 0; - + return c; } @@ -610,11 +610,11 @@ fr30_is_colon_insn (start) if (start [len] != 0) continue; - + while (len --) if (tolower (start [len]) != insn [len]) break; - + if (len == -1) return restore_colon (1); } @@ -645,16 +645,16 @@ fr30_fix_adjustable (fixP) { if (fixP->fx_addsy == NULL) return 1; - -#if 0 - /* Prevent all adjustments to global symbols. */ + +#if 0 + /* Prevent all adjustments to global symbols. */ if (S_IS_EXTERN (fixP->fx_addsy)) return 0; - + if (S_IS_WEAK (fixP->fx_addsy)) return 0; #endif - + /* We need the symbol name for the VTABLE entries */ if ( fixP->fx_r_type == BFD_RELOC_VTABLE_INHERIT || fixP->fx_r_type == BFD_RELOC_VTABLE_ENTRY) diff --git a/gnu/dist/toolchain/gas/config/tc-fr30.h b/gnu/dist/toolchain/gas/config/tc-fr30.h index a672d8bab11b..c3ecff49a0d4 100644 --- a/gnu/dist/toolchain/gas/config/tc-fr30.h +++ b/gnu/dist/toolchain/gas/config/tc-fr30.h @@ -1,5 +1,5 @@ /* tc-fr30.h -- Header file for tc-fr30.c. - Copyright (C) 1998 Free Software Foundation, Inc. + Copyright (C) 1998, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -16,7 +16,7 @@ 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. */ + Boston, MA 02111-1307, USA. */ #define TC_FR30 diff --git a/gnu/dist/toolchain/gas/config/tc-h8300.c b/gnu/dist/toolchain/gas/config/tc-h8300.c index 736d6b91294d..161337ce2531 100644 --- a/gnu/dist/toolchain/gas/config/tc-h8300.c +++ b/gnu/dist/toolchain/gas/config/tc-h8300.c @@ -1,5 +1,6 @@ /* tc-h8300.c -- Assemble code for the Hitachi H8/300 - Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 1998 Free Software Foundation. + Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 2000 + Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -18,11 +19,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* - Written By Steve Chamberlain - sac@cygnus.com - */ +/* Written By Steve Chamberlain . */ #include #include "as.h" @@ -33,11 +30,9 @@ #include "opcode/h8300.h" #include -const char comment_chars[] = -{';', 0}; -const char line_separator_chars[] = -{0}; +const char comment_chars[] = ";"; const char line_comment_chars[] = "#"; +const char line_separator_chars[] = ""; /* This table describes all the machine specific pseudo-ops the assembler has to support. The fields are: @@ -55,7 +50,6 @@ int Smode; #define DSYMMODE (Hmode ? L_24 : L_16) int bsize = L_8; /* default branch displacement */ - void h8300hmode () { @@ -69,6 +63,7 @@ h8300smode () Smode = 1; Hmode = 1; } + void sbranch (size) int size; @@ -76,14 +71,14 @@ sbranch (size) bsize = size; } -static void pint () +static void +pint () { cons (Hmode ? 4 : 2); } const pseudo_typeS md_pseudo_table[] = { - {"h8300h", h8300hmode, 0}, {"h8300s", h8300smode, 0}, {"sbranch", sbranch, L_8}, @@ -112,12 +107,9 @@ const char FLT_CHARS[] = "rRsSfFdDxXpP"; static struct hash_control *opcode_hash_control; /* Opcode mnemonics */ -/* - This function is called once, at assembler startup time. This should - set up all the tables, etc that the MD part of the assembler needs - */ - - +/* This function is called once, at assembler startup time. This + should set up all the tables, etc. that the MD part of the assembler + needs. */ void md_begin () { @@ -131,8 +123,7 @@ md_begin () for (opcode = h8_opcodes; opcode->name; opcode++) { /* Strip off any . part when inserting the opcode and only enter - unique codes into the hash table - */ + unique codes into the hash table. */ char *src = opcode->name; unsigned int len = strlen (src); char *dst = malloc (len + 1); @@ -158,12 +149,12 @@ md_begin () } opcode->idx = idx; - - /* Find the number of operands */ + /* Find the number of operands. */ opcode->noperands = 0; while (opcode->args.nib[opcode->noperands] != E) opcode->noperands++; - /* Find the length of the opcode in bytes */ + + /* Find the length of the opcode in bytes. */ opcode->length = 0; while (opcode->data.nib[opcode->length * 2] != E) opcode->length++; @@ -172,17 +163,16 @@ md_begin () linkrelax = 1; } - struct h8_exp { char *e_beg; char *e_end; expressionS e_exp; }; + int dispreg; int opsize; /* Set when a register size is seen */ - struct h8_op { op_type mode; @@ -201,8 +191,9 @@ struct h8_op ccr */ -/* try and parse a reg name, returns number of chars consumed */ -int +/* Try to parse a reg name. Return the number of chars consumed. */ + +static int parse_reg (src, mode, reg, direction) char *src; op_type *mode; @@ -213,10 +204,10 @@ parse_reg (src, mode, reg, direction) char *end; int len; - /* Cribbed from get_symbol_end(). */ + /* Cribbed from get_symbol_end. */ if (!is_name_beginner (*src) || *src == '\001') return 0; - end = src+1; + end = src + 1; while (is_part_of_name (*end) || *end == '\001') end++; len = end - src; @@ -291,10 +282,10 @@ parse_reg (src, mode, reg, direction) return 0; } -char * +static char * parse_exp (s, op) char *s; - expressionS * op; + expressionS *op; { char *save = input_line_pointer; char *new; @@ -322,7 +313,7 @@ skip_colonthing (ptr, exp, mode) { ptr++; /* ff fill any 8 bit quantity */ - /* exp->X_add_number -= 0x100;*/ + /* exp->X_add_number -= 0x100; */ *mode |= L_8; } else @@ -353,12 +344,12 @@ skip_colonthing (ptr, exp, mode) @(exp[:16], Rn) Register indirect with displacement @Rn+ @-Rn - @aa:8 absolute 8 bit - @aa:16 absolute 16 bit + @aa:8 absolute 8 bit + @aa:16 absolute 16 bit @aa absolute 16 bit #xx[:size] immediate data - @(exp:[8], pc) pc rel + @(exp:[8], pc) pc rel @@aa[:8] memory indirect */ @@ -374,7 +365,7 @@ colonmod24 (op, src) if (!mode) { - /* Choose a default mode */ + /* Choose a default mode. */ if (op->exp.X_add_number < -32768 || op->exp.X_add_number > 32767) { @@ -394,7 +385,6 @@ colonmod24 (op, src) } - static void get_operand (ptr, op, dst, direction) char **ptr; @@ -411,8 +401,8 @@ get_operand (ptr, op, dst, direction) /* Gross. Gross. ldm and stm have a format not easily handled by get_operand. We deal with it explicitly here. */ - if (src[0] == 'e' && src[1] == 'r' && isdigit(src[2]) - && src[3] == '-' && src[4] == 'e' && src[5] == 'r' && isdigit(src[6])) + if (src[0] == 'e' && src[1] == 'r' && isdigit (src[2]) + && src[3] == '-' && src[4] == 'e' && src[5] == 'r' && isdigit (src[6])) { int low, high; @@ -463,29 +453,24 @@ get_operand (ptr, op, dst, direction) op->mode = MEMIND; return; - } - if (*src == '-') { src++; len = parse_reg (src, &mode, &num, direction); if (len == 0) { - /* Oops, not a reg after all, must be ordinary exp */ + /* Oops, not a reg after all, must be ordinary exp. */ src--; - /* must be a symbol */ + /* Must be a symbol. */ op->mode = ABS | PSIZE | direction; *ptr = skip_colonthing (parse_exp (src, &op->exp), &op->exp, &op->mode); return; - - } - if ((mode & SIZE) != PSIZE) as_bad (_("Wrong size pointer register for architecture.")); op->mode = RDDEC; @@ -495,11 +480,10 @@ get_operand (ptr, op, dst, direction) } if (*src == '(') { - /* Disp */ + /* Disp. */ src++; - /* Start off assuming a 16 bit offset */ - + /* Start off assuming a 16 bit offset. */ src = parse_exp (src, &op->exp); @@ -578,7 +562,6 @@ get_operand (ptr, op, dst, direction) } } - if (*src == '#') { src++; @@ -625,9 +608,7 @@ get_operand (ptr, op, dst, direction) } } - -static -char * +static char * get_operands (noperands, op_end, operand) unsigned int noperands; char *op_end; @@ -654,8 +635,8 @@ get_operands (noperands, op_end, operand) { operand[1].mode = 0; } - break; + case 2: ptr++; get_operand (&ptr, operand + 0, 0, SRC); @@ -668,16 +649,13 @@ get_operands (noperands, op_end, operand) abort (); } - return ptr; } /* Passed a pointer to a list of opcodes which use different addressing modes, return the opcode which matches the opcodes - provided - */ -static -struct h8_opcode * + provided. */ +static struct h8_opcode * get_specific (opcode, operands, size) struct h8_opcode *opcode; struct h8_op *operands; @@ -733,7 +711,7 @@ get_specific (opcode, operands, size) opsize = op & SIZE; - /* The size of the reg is v important */ + /* The size of the reg is v important. */ if ((op & SIZE) != (x & SIZE)) found = 0; } @@ -741,7 +719,7 @@ get_specific (opcode, operands, size) { operands[i].mode &= ~ABS; operands[i].mode |= ABSJMP; - /* But it may not be 24 bits long */ + /* But it may not be 24 bits long. */ if (!Hmode) { operands[i].mode &= ~SIZE; @@ -750,11 +728,11 @@ get_specific (opcode, operands, size) } else if ((op & (KBIT | DBIT)) && (x & IMM)) { - /* This is ok if the immediate value is sensible */ + /* This is ok if the immediate value is sensible. */ } else if (op & PCREL) { - /* The size of the displacement is important */ + /* The size of the displacement is important. */ if ((op & SIZE) != (x & SIZE)) found = 0; } @@ -768,10 +746,10 @@ get_specific (opcode, operands, size) x |= L_32; } /* Promote an L8 to L_16 if it makes us match. */ - if (op & ABS && op & L_8 && op & DISP) + if (op & ABS && op & L_8 && op & DISP) { if (x & L_16) - found= 1; + found = 1; } else if ((x & SIZE) != 0 && ((op & SIZE) != (x & SIZE))) @@ -784,7 +762,7 @@ get_specific (opcode, operands, size) else if ((op & MODE) != (x & MODE)) { found = 0; - } + } } } } @@ -803,29 +781,28 @@ check_operand (operand, width, string) if (operand->exp.X_add_symbol == 0 && operand->exp.X_op_symbol == 0) { + /* No symbol involved, let's look at offset, it's dangerous if + any of the high bits are not 0 or ff's, find out by oring or + anding with the width and seeing if the answer is 0 or all + fs. */ - /* No symbol involved, let's look at offset, it's dangerous if any of - the high bits are not 0 or ff's, find out by oring or anding with - the width and seeing if the answer is 0 or all fs*/ - if ((operand->exp.X_add_number & ~width) != 0 && (operand->exp.X_add_number | width) != (~0)) { - if (width == 255 + if (width == 255 && (operand->exp.X_add_number & 0xff00) == 0xff00) { /* Just ignore this one - which happens when trying to fit a 16 bit address truncated into an 8 bit address of something like bset. */ } - else + else { as_warn (_("operand %s0x%lx out of range."), string, (unsigned long) operand->exp.X_add_number); } } } - } /* RELAXMODE has one of 3 values: @@ -848,7 +825,6 @@ do_a_fix_imm (offset, operand, relaxmode) int size; int where; - char *t = operand->mode & IMM ? "#" : "@"; if (operand->exp.X_add_symbol == 0) @@ -881,20 +857,23 @@ do_a_fix_imm (offset, operand, relaxmode) break; case L_32: - /* This should be done with bfd */ + /* This should be done with bfd. */ bytes[0] = operand->exp.X_add_number >> 24; bytes[1] = operand->exp.X_add_number >> 16; bytes[2] = operand->exp.X_add_number >> 8; bytes[3] = operand->exp.X_add_number >> 0; + if (relaxmode != 0) + { + idx = (relaxmode == 2) ? R_MOV24B1 : R_MOVL1; + fix_new_exp (frag_now, offset, 4, &operand->exp, 0, idx); + } break; } - } else { switch (operand->mode & SIZE) { - case L_24: case L_32: size = 4; @@ -907,7 +886,7 @@ do_a_fix_imm (offset, operand, relaxmode) idx = R_RELLONG; break; default: - as_bad(_("Can't work out size of operand.\n")); + as_bad (_("Can't work out size of operand.\n")); case L_16: size = 2; where = 0; @@ -915,19 +894,15 @@ do_a_fix_imm (offset, operand, relaxmode) idx = R_MOV16B1; else idx = R_RELWORD; - operand->exp.X_add_number = (short)operand->exp.X_add_number; + operand->exp.X_add_number = + ((operand->exp.X_add_number & 0xffff) ^ 0x8000) - 0x8000; break; case L_8: size = 1; where = 0; idx = R_RELBYTE; - /* This used to use a cast to char, but that fails if char is an - unsigned type. We can't use `signed char', as that isn't valid - K&R C. */ - if (operand->exp.X_add_number & 0x80) - operand->exp.X_add_number |= ((offsetT) -1 << 8); - else - operand->exp.X_add_number &= 0xff; + operand->exp.X_add_number = + ((operand->exp.X_add_number & 0xff) ^ 0x80) - 0x80; } fix_new_exp (frag_now, @@ -937,11 +912,9 @@ do_a_fix_imm (offset, operand, relaxmode) 0, idx); } - } -/* Now we know what sort of opcodes it is, lets build the bytes - - */ +/* Now we know what sort of opcodes it is, let's build the bytes. */ static void build_bytes (this_try, operand) struct h8_opcode *this_try; @@ -977,7 +950,6 @@ build_bytes (this_try, operand) } else { - if (c & (REG | IND | INC | DEC)) { nib = operand[d].reg; @@ -986,7 +958,7 @@ build_bytes (this_try, operand) { nib = dispreg; } - else if (c & ABS ) + else if (c & ABS) { operand[d].mode = c; absat = nibble_count / 2; @@ -1036,7 +1008,7 @@ build_bytes (this_try, operand) as_bad (_("Need #1 or #2 here")); break; } - /* stop it making a fix */ + /* Stop it making a fix. */ operand[0].mode = 0; } @@ -1052,7 +1024,12 @@ build_bytes (this_try, operand) if (c & MACREG) { - nib = 2 + operand[d].reg; + if (operand[0].mode == MACREG) + /* stmac has mac[hl] as the first operand. */ + nib = 2 + operand[0].reg; + else + /* ldmac has mac[hl] as the second operand. */ + nib = 2 + operand[1].reg; } } nibble_count++; @@ -1083,7 +1060,7 @@ build_bytes (this_try, operand) if (strcmp (this_try->name, "mov.b") == 0) movb = 1; - /* output any fixes */ + /* Output any fixes. */ for (i = 0; i < 2; i++) { int x = operand[i].mode; @@ -1114,13 +1091,8 @@ build_bytes (this_try, operand) } operand[i].exp.X_add_number -= 1; - /* This used to use a cast to char, but that fails if char is an - unsigned type. We can't use `signed char', as that isn't valid - K&R C. */ - if (operand[i].exp.X_add_number & 0x80) - operand[i].exp.X_add_number |= ((offsetT) -1 << 8); - else - operand[i].exp.X_add_number &= 0xff; + operand[i].exp.X_add_number = + ((operand[i].exp.X_add_number & 0xff) ^ 0x80) - 0x80; fix_new_exp (frag_now, output - frag_now->fr_literal + where, @@ -1131,7 +1103,6 @@ build_bytes (this_try, operand) } else if (x & MEMIND) { - check_operand (operand + i, 0xff, "@@"); fix_new_exp (frag_now, output - frag_now->fr_literal + 1, @@ -1142,7 +1113,7 @@ build_bytes (this_try, operand) } else if (x & ABSJMP) { - /* This jmp may be a jump or a branch */ + /* This jmp may be a jump or a branch. */ check_operand (operand + i, Hmode ? 0xffffff : 0xffff, "@"); if (operand[i].exp.X_add_number & 1) @@ -1151,7 +1122,8 @@ build_bytes (this_try, operand) (unsigned long) operand->exp.X_add_number); } if (!Hmode) - operand[i].exp.X_add_number = (short) operand[i].exp.X_add_number; + operand[i].exp.X_add_number = + ((operand[i].exp.X_add_number & 0xffff) ^ 0x8000) - 0x8000; fix_new_exp (frag_now, output - frag_now->fr_literal, 4, @@ -1160,27 +1132,23 @@ build_bytes (this_try, operand) R_JMPL1); } } - } -/* - try and give an intelligent error message for common and simple to - detect errors - */ - +/* Try to give an intelligent error message for common and simple to + detect errors. */ static void clever_message (opcode, operand) struct h8_opcode *opcode; struct h8_op *operand; { - /* Find out if there was more than one possible opccode */ + /* Find out if there was more than one possible opcode. */ if ((opcode + 1)->idx != opcode->idx) { unsigned int argn; - /* Only one opcode of this flavour, try and guess which operand - didn't match */ + /* Only one opcode of this flavour, try to guess which operand + didn't match. */ for (argn = 0; argn < opcode->noperands; argn++) { switch (opcode->args.nib[argn]) @@ -1195,7 +1163,6 @@ clever_message (opcode, operand) break; case RS8: - if (operand[argn].mode != RS8) { as_bad (_("source operand must be 8 bit register")); @@ -1218,7 +1185,6 @@ clever_message (opcode, operand) } break; - case ABS16SRC: if (operand[argn].mode != ABS16SRC) { @@ -1233,13 +1199,9 @@ clever_message (opcode, operand) as_bad (_("invalid operands")); } -/* This is the guts of the machine-dependent assembler. STR points to a - machine dependent instruction. This funciton is supposed to emit - the frags/bytes it assembles to. - */ - - - +/* This is the guts of the machine-dependent assembler. STR points to + a machine dependent instruction. This function is supposed to emit + the frags/bytes it assembles. */ void md_assemble (str) char *str; @@ -1254,11 +1216,11 @@ md_assemble (str) char c; int size; - /* Drop leading whitespace */ + /* Drop leading whitespace. */ while (*str == ' ') str++; - /* find the op code end */ + /* Find the op code end. */ for (op_start = op_end = str; *op_end != 0 && *op_end != ' '; op_end++) @@ -1272,8 +1234,6 @@ md_assemble (str) } } - ; - if (op_end == op_start) { as_bad (_("can't find opcode ")); @@ -1291,7 +1251,7 @@ md_assemble (str) return; } - /* We use to set input_line_pointer to the result of get_operands, + /* We used to set input_line_pointer to the result of get_operands, but that is wrong. Our caller assumes we don't change it. */ (void) get_operands (opcode->noperands, op_end, operand); @@ -1320,7 +1280,7 @@ md_assemble (str) if (opcode == 0) { - /* Couldn't find an opcode which matched the operands */ + /* Couldn't find an opcode which matched the operands. */ char *where = frag_more (2); where[0] = 0x0; @@ -1338,12 +1298,11 @@ md_assemble (str) } build_bytes (opcode, operand); - } void tc_crawl_symbol_chain (headers) - object_headers * headers ATTRIBUTE_UNUSED; + object_headers *headers ATTRIBUTE_UNUSED; { printf (_("call to tc_crawl_symbol_chain \n")); } @@ -1357,7 +1316,7 @@ md_undefined_symbol (name) void tc_headers_hook (headers) - object_headers * headers ATTRIBUTE_UNUSED; + object_headers *headers ATTRIBUTE_UNUSED; { printf (_("call to tc_headers_hook \n")); } @@ -1366,10 +1325,11 @@ tc_headers_hook (headers) /* Equal to MAX_PRECISION in atof-ieee.c */ #define MAX_LITTLENUMS 6 -/* Turn a string in input_line_pointer into a floating point constant of type - type, and store the appropriate bytes in *litP. The number of LITTLENUMS - emitted is stored in *sizeP . An error message is returned, or NULL on OK. - */ +/* Turn a string in input_line_pointer into a floating point constant + of type TYPE, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. An error message is + returned, or NULL on OK. */ + char * md_atof (type, litP, sizeP) char type; @@ -1429,7 +1389,8 @@ CONST char *md_shortopts = ""; struct option md_longopts[] = { {NULL, no_argument, NULL, 0} }; -size_t md_longopts_size = sizeof(md_longopts); + +size_t md_longopts_size = sizeof (md_longopts); int md_parse_option (c, arg) @@ -1462,13 +1423,13 @@ md_convert_frag (headers, seg, fragP) abort (); } -valueT +valueT md_section_align (seg, size) segT seg; valueT size; { - return ((size + (1 << section_alignment[(int) seg]) - 1) & (-1 << section_alignment[(int) seg])); - + return ((size + (1 << section_alignment[(int) seg]) - 1) + & (-1 << section_alignment[(int) seg])); } void @@ -1507,8 +1468,7 @@ md_estimate_size_before_relax (fragP, segment_type) abort (); } -/* Put number into target byte order */ - +/* Put number into target byte order. */ void md_number_to_chars (ptr, use, nbytes) char *ptr; @@ -1517,6 +1477,7 @@ md_number_to_chars (ptr, use, nbytes) { number_to_chars_bigendian (ptr, use, nbytes); } + long md_pcrel_from (fixP) fixS *fixP ATTRIBUTE_UNUSED; @@ -1524,7 +1485,6 @@ md_pcrel_from (fixP) abort (); } - void tc_reloc_mangle (fix_ptr, intr, base) fixS *fix_ptr; @@ -1537,7 +1497,7 @@ tc_reloc_mangle (fix_ptr, intr, base) symbol_ptr = fix_ptr->fx_addsy; /* If this relocation is attached to a symbol then it's ok - to output it */ + to output it. */ if (fix_ptr->fx_r_type == TC_CONS_RELOC) { /* cons likes to create reloc32's whatever the size of the reloc.. @@ -1555,9 +1515,7 @@ tc_reloc_mangle (fix_ptr, intr, base) break; default: abort (); - } - } else { @@ -1588,8 +1546,4 @@ tc_reloc_mangle (fix_ptr, intr, base) } else intr->r_symndx = -1; - - } - -/* end of tc-h8300.c */ diff --git a/gnu/dist/toolchain/gas/config/tc-h8300.h b/gnu/dist/toolchain/gas/config/tc-h8300.h index 2a2a7040f3c8..2a521c60247f 100644 --- a/gnu/dist/toolchain/gas/config/tc-h8300.h +++ b/gnu/dist/toolchain/gas/config/tc-h8300.h @@ -1,5 +1,5 @@ /* This file is tc-h8300.h - Copyright (C) 1987-1992, 93, 94, 95, 96, 97, 1998 + Copyright (C) 1987-1992, 93, 94, 95, 96, 97, 98, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,7 +19,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #define TC_H8300 #define TARGET_BYTES_BIG_ENDIAN 1 @@ -31,7 +30,7 @@ struct internal_reloc; #define WORKING_DOT_WORD /* This macro translates between an internal fix and an coff reloc type */ -#define TC_COFF_FIX2RTYPE(fixP) abort(); +#define TC_COFF_FIX2RTYPE(fixP) abort (); #define BFD_ARCH bfd_arch_h8300 #define COFF_MAGIC ( Smode ? 0x8302 : Hmode ? 0x8301 : 0x8300) @@ -54,5 +53,3 @@ extern int Hmode; extern int Smode; #define md_operand(x) - -/* end of tc-h8300.h */ diff --git a/gnu/dist/toolchain/gas/config/tc-h8500.c b/gnu/dist/toolchain/gas/config/tc-h8500.c index 9dec3e2e6a21..7367a2e952f4 100644 --- a/gnu/dist/toolchain/gas/config/tc-h8500.c +++ b/gnu/dist/toolchain/gas/config/tc-h8500.c @@ -1,5 +1,5 @@ /* tc-h8500.c -- Assemble code for the Hitachi H8/500 - Copyright (C) 1993, 94, 95, 1998 Free Software Foundation. + Copyright (C) 1993, 94, 95, 98, 2000 Free Software Foundation. This file is part of GAS, the GNU Assembler. @@ -18,10 +18,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* - Written By Steve Chamberlain - sac@cygnus.com - */ +/* Written By Steve Chamberlain . */ #include #include "as.h" @@ -94,7 +91,7 @@ static struct hash_control *opcode_hash_control; /* Opcode mnemonics */ /* This function is called once, at assembler startup time. This should - set up all the tables, etc that the MD part of the assembler needs + set up all the tables, etc. that the MD part of the assembler needs */ void @@ -180,7 +177,8 @@ typedef struct h8500_operand_info; -/* try and parse a reg name, returns number of chars consumed */ +/* Try to parse a reg name. Return the number of chars consumed. */ + static int parse_reg (src, mode, reg) char *src; @@ -193,7 +191,7 @@ parse_reg (src, mode, reg) /* Cribbed from get_symbol_end(). */ if (!is_name_beginner (*src) || *src == '\001') return 0; - end = src+1; + end = src + 1; while (is_part_of_name (*end) || *end == '\001') end++; len = end - src; @@ -258,8 +256,7 @@ parse_reg (src, mode, reg) return 0; } -static -char * +static char * parse_exp (s, op, page) char *s; expressionS *op; @@ -305,7 +302,6 @@ typedef enum exp_signed, exp_unsigned, exp_sandu } sign_type; - static char * skip_colonthing (sign, ptr, exp, def, size8, size16, size24) sign_type sign; @@ -498,7 +494,7 @@ get_operand (ptr, op, ispage) /* Disp */ src++; - src = skip_colonthing (exp_signed, src, + src = skip_colonthing (exp_signed, src, op, RNIND_D16, RNIND_D8, RNIND_D16, 0); if (*src != ',') @@ -573,8 +569,7 @@ get_operand (ptr, op, ispage) } } -static -char * +static char * get_operands (info, args, operand) h8500_opcode_info *info; char *args; @@ -613,13 +608,11 @@ get_operands (info, args, operand) /* Passed a pointer to a list of opcodes which use different addressing modes, return the opcode which matches the opcodes - provided - */ + provided. */ int pcrel8; /* Set when we've seen a pcrel operand */ -static -h8500_opcode_info * +static h8500_opcode_info * get_specific (opcode, operands) h8500_opcode_info *opcode; h8500_operand_info *operands; @@ -875,8 +868,7 @@ check (operand, low, high) return operand->X_add_number; } -static -void +static void insert (output, index, exp, reloc, pcrel) char *output; int index; @@ -898,8 +890,8 @@ build_relaxable_instruction (opcode, operand) h8500_operand_info *operand; { /* All relaxable instructions start life as two bytes but can become - three bytes long if a lonely branch and up to 9 bytes if long scb - */ + three bytes long if a lonely branch and up to 9 bytes if long + scb. */ char *p; int len; int type; @@ -933,8 +925,8 @@ build_relaxable_instruction (opcode, operand) } } -/* Now we know what sort of opcodes it is, lets build the bytes - - */ +/* Now we know what sort of opcodes it is, let's build the bytes. */ + static void build_bytes (opcode, operand) h8500_opcode_info *opcode; @@ -969,7 +961,6 @@ build_bytes (opcode, operand) break; case RD: case RDIND: - output[index] |= rd; break; case RS: @@ -983,37 +974,32 @@ build_bytes (opcode, operand) case FPIND_D8: insert (output, index, &displacement, R_H8500_IMM8, 0); break; - case IMM16: { int p; - switch (immediate_inpage) { - case 'p': - p = R_H8500_HIGH16; - break; - case 'h': - p = R_H8500_HIGH16; - break; - default: - p = R_H8500_IMM16; - break; - } - - insert (output, index, &immediate,p, 0); + + switch (immediate_inpage) + { + case 'p': + p = R_H8500_HIGH16; + break; + case 'h': + p = R_H8500_HIGH16; + break; + default: + p = R_H8500_IMM16; + break; + } + insert (output, index, &immediate, p, 0); } - index++; break; case RLIST: case IMM8: if (immediate_inpage) - { - insert (output, index, &immediate, R_H8500_HIGH8, 0); - } + insert (output, index, &immediate, R_H8500_HIGH8, 0); else - { - insert (output, index, &immediate, R_H8500_IMM8, 0); - } + insert (output, index, &immediate, R_H8500_IMM8, 0); break; case PCREL16: insert (output, index, &displacement, R_H8500_PCREL16, 1); @@ -1026,19 +1012,12 @@ build_bytes (opcode, operand) output[index] |= check (&immediate, 0, 15); break; case CR: - output[index] |= cr; if (cr == 0) - { - output[0] |= 0x8; - } + output[0] |= 0x8; else - { - output[0] &= ~0x8; - } - + output[0] &= ~0x8; break; - case CRB: output[index] |= crb; output[0] &= ~0x8; @@ -1080,14 +1059,13 @@ build_bytes (opcode, operand) } } -/* This is the guts of the machine-dependent assembler. STR points to a - machine dependent instruction. This funciton is supposed to emit - the frags/bytes it assembles to. - */ +/* This is the guts of the machine-dependent assembler. STR points to + a machine dependent instruction. This function is supposed to emit + the frags/bytes it assembles to. */ void -DEFUN (md_assemble, (str), - char *str) +md_assemble (str) + char *str; { char *op_start; char *op_end; @@ -1098,14 +1076,13 @@ DEFUN (md_assemble, (str), int nlen = 0; - /* Drop leading whitespace */ + /* Drop leading whitespace. */ while (*str == ' ') str++; - /* find the op code end */ + /* Find the op code end. */ for (op_start = op_end = str; - *op_end && - !is_end_of_line[*op_end] && *op_end != ' '; + !is_end_of_line[(unsigned char) *op_end] && *op_end != ' '; op_end++) { if ( /**op_end != '.' @@ -1118,9 +1095,7 @@ DEFUN (md_assemble, (str), name[nlen] = 0; if (op_end == op_start) - { - as_bad (_("can't find opcode ")); - } + as_bad (_("can't find opcode ")); opcode = (h8500_opcode_info *) hash_find (opcode_hash_control, name); @@ -1147,38 +1122,38 @@ DEFUN (md_assemble, (str), } build_bytes (opcode, operand); - } void -DEFUN (tc_crawl_symbol_chain, (headers), - object_headers * headers) +tc_crawl_symbol_chain (headers) + object_headers *headers; { printf (_("call to tc_crawl_symbol_chain \n")); } symbolS * -DEFUN (md_undefined_symbol, (name), - char *name) +md_undefined_symbol (name) + char *name; { return 0; } void -DEFUN (tc_headers_hook, (headers), - object_headers * headers) +tc_headers_hook (headers) + object_headers *headers; { printf (_("call to tc_headers_hook \n")); } -/* Various routines to kill one day */ -/* Equal to MAX_PRECISION in atof-ieee.c */ +/* Various routines to kill one day. */ +/* Equal to MAX_PRECISION in atof-ieee.c. */ #define MAX_LITTLENUMS 6 -/* Turn a string in input_line_pointer into a floating point constant of type - type, and store the appropriate bytes in *litP. The number of LITTLENUMS - emitted is stored in *sizeP . An error message is returned, or NULL on OK. - */ +/* Turn a string in input_line_pointer into a floating point constant + of type type, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. An error message is + returned, or NULL on OK. */ + char * md_atof (type, litP, sizeP) char type; @@ -1238,7 +1213,7 @@ CONST char *md_shortopts = ""; struct option md_longopts[] = { {NULL, no_argument, NULL, 0} }; -size_t md_longopts_size = sizeof(md_longopts); +size_t md_longopts_size = sizeof (md_longopts); int md_parse_option (c, arg) @@ -1261,8 +1236,7 @@ tc_aout_fix_to_chars () abort (); } -static -void +static void wordify_scb (buffer, disp_size, inst_size) char *buffer; int *disp_size; @@ -1322,14 +1296,14 @@ wordify_scb (buffer, disp_size, inst_size) *buffer++ = 0x04; /* cmp #0xff:8, rn */ *buffer++ = 0xff; *buffer++ = 0x70 | rn; - *buffer++ = 0x36; /* bne ... */ + *buffer++ = 0x36; /* bne ... */ *buffer++ = 0; *buffer++ = 0; } -/* -called after relaxing, change the frags so they know how big they are -*/ +/* Called after relaxing, change the frags so they know how big they + are. */ + void md_convert_frag (headers, seg, fragP) object_headers *headers; @@ -1353,9 +1327,9 @@ md_convert_frag (headers, seg, fragP) inst_size = 2; break; - /* Branches to a known 16 bit displacement */ + /* Branches to a known 16 bit displacement. */ - /* Turn on the 16bit bit */ + /* Turn on the 16bit bit. */ case C (BRANCH, WORD_DISP): case C (SCB_F, WORD_DISP): case C (SCB_TST, WORD_DISP): @@ -1365,8 +1339,8 @@ md_convert_frag (headers, seg, fragP) case C (BRANCH, UNDEF_WORD_DISP): case C (SCB_F, UNDEF_WORD_DISP): case C (SCB_TST, UNDEF_WORD_DISP): - /* This tried to be relaxed, but didn't manage it, it now needs a - fix */ + /* This tried to be relaxed, but didn't manage it, it now needs + a fix. */ wordify_scb (buffer, &disp_size, &inst_size); /* Make a reloc */ @@ -1404,7 +1378,7 @@ md_section_align (seg, size) segT seg ; valueT size; { - return ((size + (1 << section_alignment[(int) seg]) - 1) + return ((size + (1 << section_alignment[(int) seg]) - 1) & (-1 << section_alignment[(int) seg])); } @@ -1480,13 +1454,14 @@ md_estimate_size_before_relax (fragP, segment_type) if (S_GET_SEGMENT (fragP->fr_symbol) == segment_type) { /* Got a symbol and it's defined in this segment, become byte - sized - maybe it will fix up */ + sized - maybe it will fix up. */ fragP->fr_subtype = C (what, BYTE_DISP); fragP->fr_var = md_relax_table[C (what, BYTE_DISP)].rlx_length; } else { - /* Its got a segment, but its not ours, so it will always be long */ + /* Its got a segment, but its not ours, so it will always be + long. */ fragP->fr_subtype = C (what, UNDEF_WORD_DISP); fragP->fr_var = md_relax_table[C (what, WORD_DISP)].rlx_length; return md_relax_table[C (what, WORD_DISP)].rlx_length; @@ -1495,7 +1470,7 @@ md_estimate_size_before_relax (fragP, segment_type) return fragP->fr_var; } -/* Put number into target byte order */ +/* Put number into target byte order. */ void md_number_to_chars (ptr, use, nbytes) @@ -1513,7 +1488,6 @@ md_pcrel_from (fixP) return fixP->fx_size + fixP->fx_where + fixP->fx_frag->fr_address; } -/*ARGSUSED*/ void tc_coff_symbol_emit_hook (ignore) symbolS *ignore; @@ -1588,8 +1562,10 @@ tc_reloc_mangle (fix_ptr, intr, base) dot = segment_info[S_GET_SEGMENT (symbol_ptr)].dot; if (dot) { - /* intr->r_offset -= - segment_info[S_GET_SEGMENT(symbol_ptr)].scnhdr.s_paddr;*/ +#if 0 + intr->r_offset -= + segment_info[S_GET_SEGMENT (symbol_ptr)].scnhdr.s_paddr; +#endif intr->r_offset += S_GET_VALUE (symbol_ptr); intr->r_symndx = dot->sy_number; } @@ -1606,8 +1582,6 @@ tc_reloc_mangle (fix_ptr, intr, base) } - - int start_label (ptr) char *ptr; @@ -1621,13 +1595,9 @@ start_label (ptr) return 1; } - int tc_coff_sizemachdep (frag) fragS *frag; { return md_relax_table[frag->fr_subtype].rlx_length; } - -/* end of tc-h8500.c */ - diff --git a/gnu/dist/toolchain/gas/config/tc-h8500.h b/gnu/dist/toolchain/gas/config/tc-h8500.h index 2a53ec35ce2b..b0e368dc14ed 100644 --- a/gnu/dist/toolchain/gas/config/tc-h8500.h +++ b/gnu/dist/toolchain/gas/config/tc-h8500.h @@ -1,5 +1,5 @@ /* This file is tc-h8500.h - Copyright (C) 1993, 95, 97, 1998 Free Software Foundation, Inc. + Copyright (C) 1993, 95, 97, 98, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -18,7 +18,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - #define TC_H8500 #define TARGET_BYTES_BIG_ENDIAN 1 @@ -53,5 +52,3 @@ extern void tc_reloc_mangle extern struct relax_type md_relax_table[]; #define TC_GENERIC_RELAX_TABLE md_relax_table - -/* end of tc-h8500.h */ diff --git a/gnu/dist/toolchain/gas/config/tc-hppa.c b/gnu/dist/toolchain/gas/config/tc-hppa.c index 7e95a4ad6d0a..fe877cbd6505 100644 --- a/gnu/dist/toolchain/gas/config/tc-hppa.c +++ b/gnu/dist/toolchain/gas/config/tc-hppa.c @@ -1,5 +1,5 @@ /* tc-hppa.c -- Assemble for the PA - Copyright (C) 1989, 93, 94, 95, 96, 97, 98, 1999 + Copyright 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,7 +19,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - /* HP PA-RISC support was contributed by the Center for Software Science at the University of Utah. */ @@ -30,7 +29,6 @@ #include "subsegs.h" #include "bfd/libhppa.h" -#include "bfd/libbfd.h" /* Be careful, this file includes data *declarations*. */ #include "opcode/hppa.h" @@ -44,19 +42,19 @@ error only one of OBJ_ELF and OBJ_SOM can be defined then we want to use the assembler support for compact line numbers. */ #ifdef OBJ_ELF #include "dwarf2dbg.h" -struct dwarf2_line_info debug_line; -#endif /* A "convient" place to put object file dependencies which do not need to be seen outside of tc-hppa.c. */ -#ifdef OBJ_ELF + /* Object file formats specify relocation types. */ -typedef elf_hppa_reloc_type reloc_type; +typedef enum elf_hppa_reloc_type reloc_type; /* Object file formats specify BFD symbol types. */ typedef elf_symbol_type obj_symbol_type; +#define symbol_arg_reloc_info(sym)\ + (((obj_symbol_type *) symbol_get_bfdsym (sym))->tc_data.hppa_arg_reloc) -#ifdef BFD64 +#if TARGET_ARCH_SIZE == 64 /* How to generate a relocation. */ #define hppa_gen_reloc_type _bfd_elf64_hppa_gen_reloc_type #else @@ -69,7 +67,7 @@ typedef elf_symbol_type obj_symbol_type; #define obj_copyright obj_elf_version #define UNWIND_SECTION_NAME ".PARISC.unwind" -#endif +#endif /* OBJ_ELF */ #ifdef OBJ_SOM /* Names of various debugging spaces/subspaces. */ @@ -90,12 +88,13 @@ typedef int reloc_type; /* Object file formats specify BFD symbol types. */ typedef som_symbol_type obj_symbol_type; +#define symbol_arg_reloc_info(sym)\ + (((obj_symbol_type *) symbol_get_bfdsym (sym))->tc_data.ap.hppa_arg_reloc) /* This apparently isn't in older versions of hpux reloc.h. */ #ifndef R_DLT_REL #define R_DLT_REL 0x78 #endif -#endif #ifndef R_N0SEL #define R_N0SEL 0xd8 @@ -104,6 +103,13 @@ typedef som_symbol_type obj_symbol_type; #ifndef R_N1SEL #define R_N1SEL 0xd9 #endif +#endif /* OBJ_SOM */ + +#if TARGET_ARCH_SIZE == 64 +#define DEFAULT_LEVEL 25 +#else +#define DEFAULT_LEVEL 10 +#endif /* Various structures and types used internally in tc-hppa.c. */ @@ -133,6 +139,31 @@ struct unwind_desc unsigned int frame_size:27; }; +/* We can't rely on compilers placing bitfields in any particular + place, so use these macros when dumping unwind descriptors to + object files. */ +#define UNWIND_LOW32(U) \ + (((U)->cannot_unwind << 31) \ + | ((U)->millicode << 30) \ + | ((U)->millicode_save_rest << 29) \ + | ((U)->region_desc << 27) \ + | ((U)->save_sr << 25) \ + | ((U)->entry_fr << 21) \ + | ((U)->entry_gr << 16) \ + | ((U)->args_stored << 15) \ + | ((U)->call_fr << 10) \ + | ((U)->call_gr << 5) \ + | ((U)->save_sp << 4) \ + | ((U)->save_rp << 3) \ + | ((U)->save_rp_in_frame << 2) \ + | ((U)->extn_ptr_defined << 1) \ + | ((U)->cleanup_defined << 0)) + +#define UNWIND_HIGH32(U) \ + (((U)->hpe_interrupt_marker << 31) \ + | ((U)->hpux_interrupt_marker << 30) \ + | ((U)->frame_size << 0)) + struct unwind_table { /* Starting and ending offsets of the region described by @@ -219,7 +250,7 @@ struct pa_it /* Holds any argument relocation bits associated with this instruction. (instruction should be some sort of call). */ - long arg_reloc; + unsigned int arg_reloc; /* The format specification for this instruction. */ int format; @@ -230,7 +261,6 @@ struct pa_it /* PA-89 floating point registers are arranged like this: - +--------------+--------------+ | 0 or 16L | 16 or 16R | +--------------+--------------+ @@ -247,23 +277,7 @@ struct pa_it | 14 or 30L | 30 or 30R | +--------------+--------------+ | 15 or 31L | 31 or 31R | - +--------------+--------------+ - - - The following is a version of pa_parse_number that - handles the L/R notation and returns the correct - value to put into the instruction register field. - The correct value to put into the instruction is - encoded in the structure 'pa_11_fp_reg_struct'. */ - -struct pa_11_fp_reg_struct - { - /* The register number. */ - char number_part; - - /* L/R selector. */ - char l_r_select; - }; + +--------------+--------------+ */ /* Additional information needed to build argument relocation stubs. */ struct call_desc @@ -438,7 +452,7 @@ struct hppa_fix_struct int fx_r_format; /* Argument relocation bits. */ - long fx_arg_reloc; + unsigned int fx_arg_reloc; /* The segment this fixup appears in. */ segT segment; @@ -474,15 +488,18 @@ struct selector_entry static void pa_check_current_space_and_subspace PARAMS ((void)); #endif +#if !(defined (OBJ_ELF) && defined (TE_LINUX)) +static void pa_text PARAMS ((int)); +static void pa_data PARAMS ((int)); +static void pa_comm PARAMS ((int)); +#endif static fp_operand_format pa_parse_fp_format PARAMS ((char **s)); static void pa_cons PARAMS ((int)); -static void pa_data PARAMS ((int)); static void pa_float_cons PARAMS ((int)); static void pa_fill PARAMS ((int)); static void pa_lcomm PARAMS ((int)); static void pa_lsym PARAMS ((int)); static void pa_stringer PARAMS ((int)); -static void pa_text PARAMS ((int)); static void pa_version PARAMS ((int)); static int pa_parse_fp_cmp_cond PARAMS ((char **)); static int get_expression PARAMS ((char *)); @@ -504,8 +521,6 @@ static void pa_try PARAMS ((int)); static void pa_call PARAMS ((int)); static void pa_call_args PARAMS ((struct call_desc *)); static void pa_callinfo PARAMS ((int)); -static void pa_code PARAMS ((int)); -static void pa_comm PARAMS ((int)); static void pa_copyright PARAMS ((int)); static void pa_end PARAMS ((int)); static void pa_enter PARAMS ((int)); @@ -523,11 +538,11 @@ static void pa_proc PARAMS ((int)); static void pa_procend PARAMS ((int)); static void pa_param PARAMS ((int)); static void pa_undefine_label PARAMS ((void)); -static int need_pa11_opcode PARAMS ((struct pa_it *, - struct pa_11_fp_reg_struct *)); -static int pa_parse_number PARAMS ((char **, struct pa_11_fp_reg_struct *)); +static int need_pa11_opcode PARAMS ((void)); +static int pa_parse_number PARAMS ((char **, int)); static label_symbol_struct *pa_get_label PARAMS ((void)); #ifdef OBJ_SOM +static int log2 PARAMS ((int)); static void pa_compiler PARAMS ((int)); static void pa_align PARAMS ((int)); static void pa_space PARAMS ((int)); @@ -559,16 +574,15 @@ static void pa_spaces_begin PARAMS ((void)); #endif static void pa_ip PARAMS ((char *)); static void fix_new_hppa PARAMS ((fragS *, int, int, symbolS *, - long, expressionS *, int, + offsetT, expressionS *, int, bfd_reloc_code_real_type, enum hppa_reloc_field_selector_type_alt, - int, long, int *)); + int, unsigned int, int)); static int is_end_of_statement PARAMS ((void)); static int reg_name_search PARAMS ((char *)); static int pa_chk_field_selector PARAMS ((char **)); static int is_same_frag PARAMS ((fragS *, fragS *)); static void process_exit PARAMS ((void)); -static int log2 PARAMS ((int)); static unsigned int pa_stringer_aux PARAMS ((char *)); static fp_operand_format pa_parse_fp_cnv_format PARAMS ((char **s)); static int pa_parse_ftest_gfx_completer PARAMS ((char **)); @@ -576,6 +590,8 @@ static int pa_parse_ftest_gfx_completer PARAMS ((char **)); #ifdef OBJ_ELF static void hppa_elf_mark_end_of_function PARAMS ((void)); static void pa_build_unwind_subspace PARAMS ((struct call_info *)); +static void pa_vtable_entry PARAMS ((int)); +static void pa_vtable_inherit PARAMS ((int)); #endif /* File and gloally scoped variable declarations. */ @@ -604,10 +620,6 @@ static struct call_desc last_call_desc; /* handle of the OPCODE hash table */ static struct hash_control *op_hash = NULL; -/* 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[] = ";"; - /* Table of pseudo ops for the PA. FIXME -- how many of these are now redundant with the overall GAS and the object file dependent tables? */ @@ -628,25 +640,33 @@ const pseudo_typeS md_pseudo_table[] = {"byte", pa_cons, 1}, {"call", pa_call, 0}, {"callinfo", pa_callinfo, 0}, - {"code", pa_code, 0}, +#if defined (OBJ_ELF) && defined (TE_LINUX) + {"code", obj_elf_text, 0}, +#else + {"code", pa_text, 0}, {"comm", pa_comm, 0}, +#endif #ifdef OBJ_SOM {"compiler", pa_compiler, 0}, #endif {"copyright", pa_copyright, 0}, +#if !(defined (OBJ_ELF) && defined (TE_LINUX)) {"data", pa_data, 0}, +#endif {"double", pa_float_cons, 'd'}, {"dword", pa_cons, 8}, {"end", pa_end, 0}, {"end_brtab", pa_brtab, 0}, +#if !(defined (OBJ_ELF) && defined (TE_LINUX)) {"end_try", pa_try, 0}, +#endif {"enter", pa_enter, 0}, {"entry", pa_entry, 0}, {"equ", pa_equ, 0}, {"exit", pa_exit, 0}, {"export", pa_export, 0}, #ifdef OBJ_ELF - { "file", dwarf2_directive_file }, + {"file", dwarf2_directive_file, 0 }, #endif {"fill", pa_fill, 0}, {"float", pa_float_cons, 'f'}, @@ -658,7 +678,7 @@ const pseudo_typeS md_pseudo_table[] = {"leave", pa_leave, 0}, {"level", pa_level, 0}, #ifdef OBJ_ELF - { "loc", dwarf2_directive_loc }, + {"loc", dwarf2_directive_loc, 0 }, #endif {"long", pa_cons, 4}, {"lsym", pa_lsym, 0}, @@ -684,8 +704,14 @@ const pseudo_typeS md_pseudo_table[] = #ifdef OBJ_SOM {"subspa", pa_subspace, 0}, #endif +#if !(defined (OBJ_ELF) && defined (TE_LINUX)) {"text", pa_text, 0}, +#endif {"version", pa_version, 0}, +#ifdef OBJ_ELF + {"vtable_entry", pa_vtable_entry, 0}, + {"vtable_inherit", pa_vtable_inherit, 0}, +#endif {"word", pa_cons, 4}, {NULL, 0, 0} }; @@ -698,9 +724,13 @@ const pseudo_typeS md_pseudo_table[] = first line of the input file. This is because the compiler outputs #NO_APP at the beginning of its output. - Also note that C style comments will always work. */ + Also note that C style comments will always work. */ const char line_comment_chars[] = "#"; +/* This array holds the chars that always start a comment. If the + pre-processor is disabled, these aren't very useful. */ +const char comment_chars[] = ";"; + /* This array holds the characters which act as line separators. */ const char line_separator_chars[] = "!"; @@ -731,7 +761,7 @@ static int within_entry_exit; /* Nonzero if the assembler is currently within a procedure definition. */ static int within_procedure; -/* Handle on strucutre which keep track of the last symbol +/* Handle on structure which keep track of the last symbol seen in each subspace. */ static label_symbol_struct *label_symbols_rootp = NULL; @@ -744,6 +774,15 @@ static int hppa_field_selector; strict syntax checking should be enabled for that instruction. */ static int strict = 0; +/* pa_parse_number returns values in `pa_number'. Mostly + pa_parse_number is used to return a register number, with floating + point registers being numbered from FP_REG_BASE upwards. + The bit specified with FP_REG_RSEL is set if the floating point + register has a `r' suffix. */ +#define FP_REG_BASE 64 +#define FP_REG_RSEL 128 +static int pa_number; + #ifdef OBJ_SOM /* A dummy bfd symbol so that all relocations have symbols of some kind. */ static symbolS *dummy_symbol; @@ -776,206 +815,206 @@ static int print_errors = 1; Almost every control register has a synonym; they are not listed here for brevity. - The table is sorted. Suitable for searching by a binary search. */ + The table is sorted. Suitable for searching by a binary search. */ static const struct pd_reg pre_defined_registers[] = { - {"%arg0", 26}, - {"%arg1", 25}, - {"%arg2", 24}, - {"%arg3", 23}, - {"%cr0", 0}, - {"%cr10", 10}, - {"%cr11", 11}, - {"%cr12", 12}, - {"%cr13", 13}, - {"%cr14", 14}, - {"%cr15", 15}, - {"%cr16", 16}, - {"%cr17", 17}, - {"%cr18", 18}, - {"%cr19", 19}, - {"%cr20", 20}, - {"%cr21", 21}, - {"%cr22", 22}, - {"%cr23", 23}, - {"%cr24", 24}, - {"%cr25", 25}, - {"%cr26", 26}, - {"%cr27", 27}, - {"%cr28", 28}, - {"%cr29", 29}, - {"%cr30", 30}, - {"%cr31", 31}, - {"%cr8", 8}, - {"%cr9", 9}, - {"%dp", 27}, - {"%eiem", 15}, - {"%eirr", 23}, - {"%fr0", 0}, - {"%fr0l", 0}, - {"%fr0r", 0}, - {"%fr1", 1}, - {"%fr10", 10}, - {"%fr10l", 10}, - {"%fr10r", 10}, - {"%fr11", 11}, - {"%fr11l", 11}, - {"%fr11r", 11}, - {"%fr12", 12}, - {"%fr12l", 12}, - {"%fr12r", 12}, - {"%fr13", 13}, - {"%fr13l", 13}, - {"%fr13r", 13}, - {"%fr14", 14}, - {"%fr14l", 14}, - {"%fr14r", 14}, - {"%fr15", 15}, - {"%fr15l", 15}, - {"%fr15r", 15}, - {"%fr16", 16}, - {"%fr16l", 16}, - {"%fr16r", 16}, - {"%fr17", 17}, - {"%fr17l", 17}, - {"%fr17r", 17}, - {"%fr18", 18}, - {"%fr18l", 18}, - {"%fr18r", 18}, - {"%fr19", 19}, - {"%fr19l", 19}, - {"%fr19r", 19}, - {"%fr1l", 1}, - {"%fr1r", 1}, - {"%fr2", 2}, - {"%fr20", 20}, - {"%fr20l", 20}, - {"%fr20r", 20}, - {"%fr21", 21}, - {"%fr21l", 21}, - {"%fr21r", 21}, - {"%fr22", 22}, - {"%fr22l", 22}, - {"%fr22r", 22}, - {"%fr23", 23}, - {"%fr23l", 23}, - {"%fr23r", 23}, - {"%fr24", 24}, - {"%fr24l", 24}, - {"%fr24r", 24}, - {"%fr25", 25}, - {"%fr25l", 25}, - {"%fr25r", 25}, - {"%fr26", 26}, - {"%fr26l", 26}, - {"%fr26r", 26}, - {"%fr27", 27}, - {"%fr27l", 27}, - {"%fr27r", 27}, - {"%fr28", 28}, - {"%fr28l", 28}, - {"%fr28r", 28}, - {"%fr29", 29}, - {"%fr29l", 29}, - {"%fr29r", 29}, - {"%fr2l", 2}, - {"%fr2r", 2}, - {"%fr3", 3}, - {"%fr30", 30}, - {"%fr30l", 30}, - {"%fr30r", 30}, - {"%fr31", 31}, - {"%fr31l", 31}, - {"%fr31r", 31}, - {"%fr3l", 3}, - {"%fr3r", 3}, - {"%fr4", 4}, - {"%fr4l", 4}, - {"%fr4r", 4}, - {"%fr5", 5}, - {"%fr5l", 5}, - {"%fr5r", 5}, - {"%fr6", 6}, - {"%fr6l", 6}, - {"%fr6r", 6}, - {"%fr7", 7}, - {"%fr7l", 7}, - {"%fr7r", 7}, - {"%fr8", 8}, - {"%fr8l", 8}, - {"%fr8r", 8}, - {"%fr9", 9}, - {"%fr9l", 9}, - {"%fr9r", 9}, - {"%hta", 25}, - {"%iir", 19}, - {"%ior", 21}, - {"%ipsw", 22}, - {"%isr", 20}, - {"%itmr", 16}, - {"%iva", 14}, - {"%pcoq", 18}, - {"%pcsq", 17}, - {"%pidr1", 8}, - {"%pidr2", 9}, + {"%arg0", 26}, + {"%arg1", 25}, + {"%arg2", 24}, + {"%arg3", 23}, + {"%cr0", 0}, + {"%cr10", 10}, + {"%cr11", 11}, + {"%cr12", 12}, + {"%cr13", 13}, + {"%cr14", 14}, + {"%cr15", 15}, + {"%cr16", 16}, + {"%cr17", 17}, + {"%cr18", 18}, + {"%cr19", 19}, + {"%cr20", 20}, + {"%cr21", 21}, + {"%cr22", 22}, + {"%cr23", 23}, + {"%cr24", 24}, + {"%cr25", 25}, + {"%cr26", 26}, + {"%cr27", 27}, + {"%cr28", 28}, + {"%cr29", 29}, + {"%cr30", 30}, + {"%cr31", 31}, + {"%cr8", 8}, + {"%cr9", 9}, + {"%dp", 27}, + {"%eiem", 15}, + {"%eirr", 23}, + {"%fr0", 0 + FP_REG_BASE}, + {"%fr0l", 0 + FP_REG_BASE}, + {"%fr0r", 0 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr1", 1 + FP_REG_BASE}, + {"%fr10", 10 + FP_REG_BASE}, + {"%fr10l", 10 + FP_REG_BASE}, + {"%fr10r", 10 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr11", 11 + FP_REG_BASE}, + {"%fr11l", 11 + FP_REG_BASE}, + {"%fr11r", 11 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr12", 12 + FP_REG_BASE}, + {"%fr12l", 12 + FP_REG_BASE}, + {"%fr12r", 12 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr13", 13 + FP_REG_BASE}, + {"%fr13l", 13 + FP_REG_BASE}, + {"%fr13r", 13 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr14", 14 + FP_REG_BASE}, + {"%fr14l", 14 + FP_REG_BASE}, + {"%fr14r", 14 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr15", 15 + FP_REG_BASE}, + {"%fr15l", 15 + FP_REG_BASE}, + {"%fr15r", 15 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr16", 16 + FP_REG_BASE}, + {"%fr16l", 16 + FP_REG_BASE}, + {"%fr16r", 16 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr17", 17 + FP_REG_BASE}, + {"%fr17l", 17 + FP_REG_BASE}, + {"%fr17r", 17 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr18", 18 + FP_REG_BASE}, + {"%fr18l", 18 + FP_REG_BASE}, + {"%fr18r", 18 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr19", 19 + FP_REG_BASE}, + {"%fr19l", 19 + FP_REG_BASE}, + {"%fr19r", 19 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr1l", 1 + FP_REG_BASE}, + {"%fr1r", 1 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr2", 2 + FP_REG_BASE}, + {"%fr20", 20 + FP_REG_BASE}, + {"%fr20l", 20 + FP_REG_BASE}, + {"%fr20r", 20 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr21", 21 + FP_REG_BASE}, + {"%fr21l", 21 + FP_REG_BASE}, + {"%fr21r", 21 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr22", 22 + FP_REG_BASE}, + {"%fr22l", 22 + FP_REG_BASE}, + {"%fr22r", 22 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr23", 23 + FP_REG_BASE}, + {"%fr23l", 23 + FP_REG_BASE}, + {"%fr23r", 23 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr24", 24 + FP_REG_BASE}, + {"%fr24l", 24 + FP_REG_BASE}, + {"%fr24r", 24 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr25", 25 + FP_REG_BASE}, + {"%fr25l", 25 + FP_REG_BASE}, + {"%fr25r", 25 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr26", 26 + FP_REG_BASE}, + {"%fr26l", 26 + FP_REG_BASE}, + {"%fr26r", 26 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr27", 27 + FP_REG_BASE}, + {"%fr27l", 27 + FP_REG_BASE}, + {"%fr27r", 27 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr28", 28 + FP_REG_BASE}, + {"%fr28l", 28 + FP_REG_BASE}, + {"%fr28r", 28 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr29", 29 + FP_REG_BASE}, + {"%fr29l", 29 + FP_REG_BASE}, + {"%fr29r", 29 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr2l", 2 + FP_REG_BASE}, + {"%fr2r", 2 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr3", 3 + FP_REG_BASE}, + {"%fr30", 30 + FP_REG_BASE}, + {"%fr30l", 30 + FP_REG_BASE}, + {"%fr30r", 30 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr31", 31 + FP_REG_BASE}, + {"%fr31l", 31 + FP_REG_BASE}, + {"%fr31r", 31 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr3l", 3 + FP_REG_BASE}, + {"%fr3r", 3 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr4", 4 + FP_REG_BASE}, + {"%fr4l", 4 + FP_REG_BASE}, + {"%fr4r", 4 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr5", 5 + FP_REG_BASE}, + {"%fr5l", 5 + FP_REG_BASE}, + {"%fr5r", 5 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr6", 6 + FP_REG_BASE}, + {"%fr6l", 6 + FP_REG_BASE}, + {"%fr6r", 6 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr7", 7 + FP_REG_BASE}, + {"%fr7l", 7 + FP_REG_BASE}, + {"%fr7r", 7 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr8", 8 + FP_REG_BASE}, + {"%fr8l", 8 + FP_REG_BASE}, + {"%fr8r", 8 + FP_REG_BASE + FP_REG_RSEL}, + {"%fr9", 9 + FP_REG_BASE}, + {"%fr9l", 9 + FP_REG_BASE}, + {"%fr9r", 9 + FP_REG_BASE + FP_REG_RSEL}, + {"%hta", 25}, + {"%iir", 19}, + {"%ior", 21}, + {"%ipsw", 22}, + {"%isr", 20}, + {"%itmr", 16}, + {"%iva", 14}, + {"%pcoq", 18}, + {"%pcsq", 17}, + {"%pidr1", 8}, + {"%pidr2", 9}, {"%pidr3", 12}, {"%pidr4", 13}, - {"%ppda", 24}, - {"%r0", 0}, - {"%r1", 1}, - {"%r10", 10}, - {"%r11", 11}, - {"%r12", 12}, - {"%r13", 13}, - {"%r14", 14}, - {"%r15", 15}, - {"%r16", 16}, - {"%r17", 17}, - {"%r18", 18}, - {"%r19", 19}, - {"%r2", 2}, - {"%r20", 20}, - {"%r21", 21}, - {"%r22", 22}, - {"%r23", 23}, - {"%r24", 24}, - {"%r25", 25}, - {"%r26", 26}, - {"%r27", 27}, - {"%r28", 28}, - {"%r29", 29}, - {"%r3", 3}, - {"%r30", 30}, - {"%r31", 31}, - {"%r4", 4}, - {"%r5", 5}, - {"%r6", 6}, - {"%r7", 7}, - {"%r8", 8}, - {"%r9", 9}, - {"%rctr", 0}, - {"%ret0", 28}, - {"%ret1", 29}, - {"%rp", 2}, - {"%sar", 11}, - {"%sp", 30}, - {"%sr0", 0}, - {"%sr1", 1}, - {"%sr2", 2}, - {"%sr3", 3}, - {"%sr4", 4}, - {"%sr5", 5}, - {"%sr6", 6}, - {"%sr7", 7}, - {"%tr0", 24}, - {"%tr1", 25}, - {"%tr2", 26}, - {"%tr3", 27}, - {"%tr4", 28}, - {"%tr5", 29}, - {"%tr6", 30}, - {"%tr7", 31} + {"%ppda", 24}, + {"%r0", 0}, + {"%r1", 1}, + {"%r10", 10}, + {"%r11", 11}, + {"%r12", 12}, + {"%r13", 13}, + {"%r14", 14}, + {"%r15", 15}, + {"%r16", 16}, + {"%r17", 17}, + {"%r18", 18}, + {"%r19", 19}, + {"%r2", 2}, + {"%r20", 20}, + {"%r21", 21}, + {"%r22", 22}, + {"%r23", 23}, + {"%r24", 24}, + {"%r25", 25}, + {"%r26", 26}, + {"%r27", 27}, + {"%r28", 28}, + {"%r29", 29}, + {"%r3", 3}, + {"%r30", 30}, + {"%r31", 31}, + {"%r4", 4}, + {"%r5", 5}, + {"%r6", 6}, + {"%r7", 7}, + {"%r8", 8}, + {"%r9", 9}, + {"%rctr", 0}, + {"%ret0", 28}, + {"%ret1", 29}, + {"%rp", 2}, + {"%sar", 11}, + {"%sp", 30}, + {"%sr0", 0}, + {"%sr1", 1}, + {"%sr2", 2}, + {"%sr3", 3}, + {"%sr4", 4}, + {"%sr5", 5}, + {"%sr6", 6}, + {"%sr7", 7}, + {"%tr0", 24}, + {"%tr1", 25}, + {"%tr2", 26}, + {"%tr3", 27}, + {"%tr4", 28}, + {"%tr5", 29}, + {"%tr6", 30}, + {"%tr7", 31} }; /* This table is sorted by order of the length of the string. This is @@ -1114,6 +1153,20 @@ static struct default_space_dict pa_def_spaces[] = } \ } +/* Simple alignment checking for FIELD againt ALIGN (a power of two). + IGNORE is used to suppress the error message. */ + +#define CHECK_ALIGN(FIELD, ALIGN, IGNORE) \ + { \ + if ((FIELD) & ((ALIGN) - 1)) \ + { \ + if (! IGNORE) \ + as_bad (_("Field not properly aligned [%d] (%d)."), (ALIGN), \ + (int) (FIELD));\ + break; \ + } \ + } + #define is_DP_relative(exp) \ ((exp).X_op == O_subtract \ && strcmp (S_GET_NAME ((exp).X_op_symbol), "$global$") == 0) @@ -1235,7 +1288,6 @@ pa_undefine_label () } } - /* An HPPA-specific version of fix_new. This is required because the HPPA code needs to keep track of some extra stuff. Each call to fix_new_hppa results in the creation of an instance of an hppa_fix_struct. An @@ -1250,14 +1302,14 @@ fix_new_hppa (frag, where, size, add_symbol, offset, exp, pcrel, int where; int size; symbolS *add_symbol; - long offset; + offsetT offset; expressionS *exp; int pcrel; bfd_reloc_code_real_type r_type; enum hppa_reloc_field_selector_type_alt r_field; int r_format; - long arg_reloc; - int* unwind_bits; + unsigned int arg_reloc; + int unwind_bits ATTRIBUTE_UNUSED; { fixS *new_fix; @@ -1276,14 +1328,15 @@ fix_new_hppa (frag, where, size, add_symbol, offset, exp, pcrel, hppa_fix->segment = now_seg; #ifdef OBJ_SOM if (r_type == R_ENTRY || r_type == R_EXIT) - new_fix->fx_offset = *unwind_bits; + new_fix->fx_offset = unwind_bits; #endif /* foo-$global$ is used to access non-automatic storage. $global$ is really just a marker and has served its purpose, so eliminate - it now so as not to confuse write.c. */ + it now so as not to confuse write.c. Ditto for $PIC_pcrel$0. */ if (new_fix->fx_subsy - && !strcmp (S_GET_NAME (new_fix->fx_subsy), "$global$")) + && (strcmp (S_GET_NAME (new_fix->fx_subsy), "$global$") == 0 + || strcmp (S_GET_NAME (new_fix->fx_subsy), "$PIC_pcrel$0") == 0)) new_fix->fx_subsy = NULL; } @@ -1319,11 +1372,14 @@ cons_fix_new_hppa (frag, where, size, exp) rel_type = R_HPPA; if (hppa_field_selector != e_psel && hppa_field_selector != e_fsel) - as_warn (_("Invalid field selector. Assuming F%%.")); + { + as_warn (_("Invalid field selector. Assuming F%%.")); + hppa_field_selector = e_fsel; + } fix_new_hppa (frag, where, size, (symbolS *) NULL, (offsetT) 0, exp, 0, rel_type, - hppa_field_selector, size * 8, 0, NULL); + hppa_field_selector, size * 8, 0, 0); /* Reset field selector to its default state. */ hppa_field_selector = 0; @@ -1343,7 +1399,7 @@ md_begin () call_info_root = NULL; /* Set the default machine type. */ - if (!bfd_set_arch_mach (stdoutput, bfd_arch_hppa, 10)) + if (!bfd_set_arch_mach (stdoutput, bfd_arch_hppa, DEFAULT_LEVEL)) as_warn (_("could not set architecture and machine")); /* Folding of text and data segments fails miserably on the PA. @@ -1395,7 +1451,7 @@ md_begin () #ifdef OBJ_SOM dummy_symbol = symbol_find_or_make ("L$dummy"); S_SET_SEGMENT (dummy_symbol, text_section); - /* Force the symbol to be converted to a real symbol. */ + /* Force the symbol to be converted to a real symbol. */ (void) symbol_get_bfdsym (dummy_symbol); #endif } @@ -1433,12 +1489,14 @@ md_assemble (str) information when the label appears after the proc/procend. */ if (within_entry_exit) { - char *where = frag_more (0); + char *where; + unsigned int u; + where = frag_more (0); + u = UNWIND_LOW32 (&last_call_info->ci_unwind.descriptor); fix_new_hppa (frag_now, where - frag_now->fr_literal, 0, NULL, (offsetT) 0, NULL, - 0, R_HPPA_ENTRY, e_fsel, 0, 0, - (int *)&last_call_info->ci_unwind.descriptor); + 0, R_HPPA_ENTRY, e_fsel, 0, 0, u); } #endif } @@ -1455,7 +1513,7 @@ md_assemble (str) /* Get somewhere to put the assembled instrution. */ to = frag_more (4); - /* Output the opcode. */ + /* Output the opcode. */ md_number_to_chars (to, the_insn.opcode, 4); /* If necessary output more stuff. */ @@ -1463,23 +1521,10 @@ md_assemble (str) fix_new_hppa (frag_now, (to - frag_now->fr_literal), 4, NULL, (offsetT) 0, &the_insn.exp, the_insn.pcrel, the_insn.reloc, the_insn.field_selector, - the_insn.format, the_insn.arg_reloc, NULL); + the_insn.format, the_insn.arg_reloc, 0); #ifdef OBJ_ELF - if (debug_type == DEBUG_DWARF2) - { - bfd_vma addr; - - /* First update the notion of the current source line. */ - dwarf2_where (&debug_line); - - /* We want the offset of the start of this instruction within the - the current frag. */ - addr = frag_now->fr_address + frag_now_fix () - 4; - - /* And record the information. */ - dwarf2_gen_line_info (addr, &debug_line); - } + dwarf2_emit_insn (4); #endif } @@ -1614,10 +1659,9 @@ pa_ip (str) /* Handle a 5 bit register or control register field at 10. */ case 'b': case '^': - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 0)) break; - num = pa_parse_number (&s, 0); + num = pa_number; CHECK_FIELD (num, 31, 0, 0); INSERT_FIELD_AND_CONTINUE (opcode, num, 21); @@ -1642,28 +1686,25 @@ pa_ip (str) /* Handle a 5 bit register field at 15. */ case 'x': - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 0)) break; - num = pa_parse_number (&s, 0); + num = pa_number; CHECK_FIELD (num, 31, 0, 0); INSERT_FIELD_AND_CONTINUE (opcode, num, 16); /* Handle a 5 bit register field at 31. */ case 't': - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 0)) break; - num = pa_parse_number (&s, 0); + num = pa_number; CHECK_FIELD (num, 31, 0, 0); INSERT_FIELD_AND_CONTINUE (opcode, num, 0); /* Handle a 5 bit register field at 10 and 15. */ case 'a': - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 0)) break; - num = pa_parse_number (&s, 0); + num = pa_number; CHECK_FIELD (num, 31, 0, 0); opcode |= num << 16; INSERT_FIELD_AND_CONTINUE (opcode, num, 21); @@ -1686,7 +1727,7 @@ pa_ip (str) /* When in strict mode, we want to just reject this match instead of giving an out of range error. */ CHECK_FIELD (num, 15, -16, strict); - low_sign_unext (num, 5, &num); + num = low_sign_unext (num, 5); INSERT_FIELD_AND_CONTINUE (opcode, num, 16); /* Handle a 5 bit immediate at 31. */ @@ -1697,8 +1738,8 @@ pa_ip (str) s = expr_end; /* When in strict mode, we want to just reject this match instead of giving an out of range error. */ - CHECK_FIELD (num, 15, -16, strict) - low_sign_unext (num, 5, &num); + CHECK_FIELD (num, 15, -16, strict); + num = low_sign_unext (num, 5); INSERT_FIELD_AND_CONTINUE (opcode, num, 0); /* Handle an unsigned 5 bit immediate at 31. */ @@ -1707,8 +1748,8 @@ pa_ip (str) if (strict && the_insn.exp.X_op != O_constant) break; s = expr_end; - CHECK_FIELD (num, 31, 0, 0); - INSERT_FIELD_AND_CONTINUE (opcode, num, strict); + CHECK_FIELD (num, 31, 0, strict); + INSERT_FIELD_AND_CONTINUE (opcode, num, 0); /* Handle an unsigned 5 bit immediate at 15. */ case 'R': @@ -1730,22 +1771,20 @@ pa_ip (str) /* Handle a 2 bit space identifier at 17. */ case 's': - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 0)) break; - num = pa_parse_number (&s, 0); + num = pa_number; CHECK_FIELD (num, 3, 0, 1); INSERT_FIELD_AND_CONTINUE (opcode, num, 14); /* Handle a 3 bit space identifier at 18. */ case 'S': - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 0)) break; - num = pa_parse_number (&s, 0); + num = pa_number; CHECK_FIELD (num, 7, 0, 1); - dis_assemble_3 (num, &num); - INSERT_FIELD_AND_CONTINUE (opcode, num, 13); + opcode |= re_assemble_3 (num); + continue; /* Handle all completers. */ case 'c': @@ -1849,10 +1888,10 @@ pa_ip (str) } else if (*args == 'e') { - /* Gross! Hide these values in the immediate field - of the instruction, then pull them out later. */ - opcode |= m << 8; - opcode |= a << 9; + /* Stash the ma/mb flag temporarily in the + instruction. We will use (and remove it) + later when handling 'J', 'K', '<' & '>'. */ + opcode |= a; continue; } } @@ -1925,7 +1964,7 @@ pa_ip (str) } INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 10); - /* Handle load ordering completer. */ + /* Handle load ordering completer. */ case 'o': if (strncmp(s, ",o", 2) != 0) break; @@ -2385,7 +2424,7 @@ pa_ip (str) } else { - /* Negated condition requires an opcode change. */ + /* Negated condition requires an opcode change. */ opcode |= (cmpltr & 8) << 24; } INSERT_FIELD_AND_CONTINUE (opcode, cmpltr & 7, 13); @@ -2406,7 +2445,7 @@ pa_ip (str) } else { - /* Negated condition requires an opcode change. */ + /* Negated condition requires an opcode change. */ opcode |= 1 << 27; } } @@ -2559,7 +2598,7 @@ pa_ip (str) } else { - /* Negated condition requires an opcode change. */ + /* Negated condition requires an opcode change. */ opcode |= 1 << 27; } } @@ -2571,11 +2610,11 @@ pa_ip (str) cmpltr = pa_parse_cmpb_64_cmpltr (&s); if (cmpltr >= 0) { - /* Negated condition requires an opcode change. */ + /* Negated condition requires an opcode change. */ opcode |= (cmpltr & 8) << 26; } else - /* Not a 64 bit cond. Give 32 bit a chance. */ + /* Not a 64 bit cond. Give 32 bit a chance. */ break; INSERT_FIELD_AND_CONTINUE (opcode, cmpltr & 7, 13); @@ -2584,7 +2623,7 @@ pa_ip (str) case 'Q': cmpltr = pa_parse_cmpib_64_cmpltr (&s); if (cmpltr < 0) - /* Not a 64 bit cond. Give 32 bit a chance. */ + /* Not a 64 bit cond. Give 32 bit a chance. */ break; INSERT_FIELD_AND_CONTINUE (opcode, cmpltr, 13); @@ -2608,7 +2647,6 @@ pa_ip (str) } else if (*s == '*') break; - name = s; name = s; while (*s != ',' && *s != ' ' && *s != '\t') @@ -2616,7 +2654,6 @@ pa_ip (str) c = *s; *s = 0x00; - if (strcmp (name, "=") == 0) cmpltr = 1; else if (strcmp (name, "<") == 0) @@ -2677,7 +2714,6 @@ pa_ip (str) } else if (*s == '*') break; - name = s; name = s; while (*s != ',' && *s != ' ' && *s != '\t') @@ -2897,7 +2933,7 @@ pa_ip (str) { num = evaluate_absolute (&the_insn); CHECK_FIELD (num, 1023, -1024, 0); - low_sign_unext (num, 11, &num); + num = low_sign_unext (num, 11); INSERT_FIELD_AND_CONTINUE (opcode, num, 0); } else @@ -2919,26 +2955,22 @@ pa_ip (str) s = expr_end; if (the_insn.exp.X_op == O_constant) { - int a, m; + int mb; - /* XXX the completer stored away tibits of information + /* XXX the completer stored away tidbits of information for us to extract. We need a cleaner way to do this. Now that we have lots of letters again, it would be good to rethink this. */ - m = (opcode & (1 << 8)) != 0; - a = (opcode & (1 << 9)) != 0; - opcode &= ~ (3 << 8); + mb = opcode & 1; + opcode -= mb; num = evaluate_absolute (&the_insn); - if ((a == 1 && num >= 0) || (a == 0 && num < 0)) + if (mb != (num < 0)) break; CHECK_FIELD (num, 8191, -8192, 0); - low_sign_unext (num, 14, &num); + num = low_sign_unext (num, 14); INSERT_FIELD_AND_CONTINUE (opcode, num, 0); } - else - { - break; - } + break; /* Handle a 14 bit immediate at 31. */ case 'K': @@ -2947,33 +2979,64 @@ pa_ip (str) s = expr_end; if (the_insn.exp.X_op == O_constant) { - int a, m; + int mb; - /* XXX the completer stored away tibits of information - for us to extract. We need a cleaner way to do this. - Now that we have lots of letters again, it would be - good to rethink this. */ - m = (opcode & (1 << 8)) != 0; - a = (opcode & (1 << 9)) != 0; - opcode &= ~ (3 << 8); + mb = opcode & 1; + opcode -= mb; num = evaluate_absolute (&the_insn); - if ((a == 1 && num < 0) || (a == 0 && num > 0)) + if (mb == (num < 0)) break; if (num % 4) break; CHECK_FIELD (num, 8191, -8192, 0); - if (num < 0) - opcode |= 1; - num &= 0x1fff; - num >>= 2; - INSERT_FIELD_AND_CONTINUE (opcode, num, 3); - } - else - { - break; + num = low_sign_unext (num, 14); + INSERT_FIELD_AND_CONTINUE (opcode, num, 0); } + break; - /* Handle 14 bit immediated, shifted left three times. */ + /* Handle a 16 bit immediate at 31. */ + case '<': + the_insn.field_selector = pa_chk_field_selector (&s); + get_expression (s); + s = expr_end; + if (the_insn.exp.X_op == O_constant) + { + int mb; + + mb = opcode & 1; + opcode -= mb; + num = evaluate_absolute (&the_insn); + if (mb != (num < 0)) + break; + CHECK_FIELD (num, 32767, -32768, 0); + num = re_assemble_16 (num); + INSERT_FIELD_AND_CONTINUE (opcode, num, 0); + } + break; + + /* Handle a 16 bit immediate at 31. */ + case '>': + the_insn.field_selector = pa_chk_field_selector (&s); + get_expression (s); + s = expr_end; + if (the_insn.exp.X_op == O_constant) + { + int mb; + + mb = opcode & 1; + opcode -= mb; + num = evaluate_absolute (&the_insn); + if (mb == (num < 0)) + break; + if (num % 4) + break; + CHECK_FIELD (num, 32767, -32768, 0); + num = re_assemble_16 (num); + INSERT_FIELD_AND_CONTINUE (opcode, num, 0); + } + break; + + /* Handle 14 bit immediate, shifted left three times. */ case '#': the_insn.field_selector = pa_chk_field_selector (&s); get_expression (s); @@ -3041,7 +3104,7 @@ pa_ip (str) { num = evaluate_absolute (&the_insn); CHECK_FIELD (num, 8191, -8192, 0); - low_sign_unext (num, 14, &num); + num = low_sign_unext (num, 14); INSERT_FIELD_AND_CONTINUE (opcode, num, 0); } else @@ -3065,8 +3128,8 @@ pa_ip (str) { num = evaluate_absolute (&the_insn); CHECK_FIELD (num >> 11, 1048575, -1048576, 0); - dis_assemble_21 (num, &num); - INSERT_FIELD_AND_CONTINUE (opcode, num, 0); + opcode |= re_assemble_21 (num); + continue; } else { @@ -3080,26 +3143,104 @@ pa_ip (str) continue; } + /* Handle a 16 bit immediate at 31 (PA 2.0 wide mode only). */ + case 'l': + the_insn.field_selector = pa_chk_field_selector (&s); + get_expression (s); + s = expr_end; + if (the_insn.exp.X_op == O_constant) + { + num = evaluate_absolute (&the_insn); + CHECK_FIELD (num, 32767, -32768, 0); + opcode |= re_assemble_16 (num); + continue; + } + else + { + /* ??? Is this valid for wide mode? */ + if (is_DP_relative (the_insn.exp)) + the_insn.reloc = R_HPPA_GOTOFF; + else if (is_PC_relative (the_insn.exp)) + the_insn.reloc = R_HPPA_PCREL_CALL; + else + the_insn.reloc = R_HPPA; + the_insn.format = 14; + continue; + } + + /* Handle a word-aligned 16-bit imm. at 31 (PA2.0 wide). */ + case 'y': + the_insn.field_selector = pa_chk_field_selector (&s); + get_expression (s); + s = expr_end; + if (the_insn.exp.X_op == O_constant) + { + num = evaluate_absolute (&the_insn); + CHECK_FIELD (num, 32767, -32768, 0); + CHECK_ALIGN (num, 4, 0); + opcode |= re_assemble_16 (num); + continue; + } + else + { + /* ??? Is this valid for wide mode? */ + if (is_DP_relative (the_insn.exp)) + the_insn.reloc = R_HPPA_GOTOFF; + else if (is_PC_relative (the_insn.exp)) + the_insn.reloc = R_HPPA_PCREL_CALL; + else + the_insn.reloc = R_HPPA; + the_insn.format = 14; + continue; + } + + /* Handle a dword-aligned 16-bit imm. at 31 (PA2.0 wide). */ + case '&': + the_insn.field_selector = pa_chk_field_selector (&s); + get_expression (s); + s = expr_end; + if (the_insn.exp.X_op == O_constant) + { + num = evaluate_absolute (&the_insn); + CHECK_FIELD (num, 32767, -32768, 0); + CHECK_ALIGN (num, 8, 0); + opcode |= re_assemble_16 (num); + continue; + } + else + { + /* ??? Is this valid for wide mode? */ + if (is_DP_relative (the_insn.exp)) + the_insn.reloc = R_HPPA_GOTOFF; + else if (is_PC_relative (the_insn.exp)) + the_insn.reloc = R_HPPA_PCREL_CALL; + else + the_insn.reloc = R_HPPA; + the_insn.format = 14; + continue; + } + /* Handle a 12 bit branch displacement. */ case 'w': the_insn.field_selector = pa_chk_field_selector (&s); get_expression (s); s = expr_end; the_insn.pcrel = 1; - if (!strcmp (S_GET_NAME (the_insn.exp.X_add_symbol), "L$0\001")) + if (!the_insn.exp.X_add_symbol + || !strcmp (S_GET_NAME (the_insn.exp.X_add_symbol), + "L$0\001")) { - unsigned int w1, w, result; - num = evaluate_absolute (&the_insn); if (num % 4) { as_bad (_("Branch to unaligned address")); break; } - CHECK_FIELD (num, 8199, -8184, 0); - sign_unext ((num - 8) >> 2, 12, &result); - dis_assemble_12 (result, &w1, &w); - INSERT_FIELD_AND_CONTINUE (opcode, ((w1 << 2) | w), 0); + if (the_insn.exp.X_add_symbol) + num -= 8; + CHECK_FIELD (num, 8191, -8192, 0); + opcode |= re_assemble_12 (num >> 2); + continue; } else { @@ -3121,23 +3262,17 @@ pa_ip (str) || !strcmp (S_GET_NAME (the_insn.exp.X_add_symbol), "L$0\001")) { - unsigned int w2, w1, w, result; - num = evaluate_absolute (&the_insn); if (num % 4) { as_bad (_("Branch to unaligned address")); break; } - CHECK_FIELD (num, 262143, -262144, 0); - if (the_insn.exp.X_add_symbol) num -= 8; - - sign_unext (num >> 2, 17, &result); - dis_assemble_17 (result, &w1, &w2, &w); - INSERT_FIELD_AND_CONTINUE (opcode, - ((w2 << 2) | (w1 << 16) | w), 0); + CHECK_FIELD (num, 262143, -262144, 0); + opcode |= re_assemble_17 (num >> 2); + continue; } else { @@ -3158,25 +3293,16 @@ pa_ip (str) || !strcmp (S_GET_NAME (the_insn.exp.X_add_symbol), "L$0\001")) { - unsigned int w3, w2, w1, w, result; - num = evaluate_absolute (&the_insn); if (num % 4) { as_bad (_("Branch to unaligned address")); break; } - CHECK_FIELD (num, 8388607, -8388608, 0); - if (the_insn.exp.X_add_symbol) num -= 8; - - sign_unext (num >> 2, 22, &result); - dis_assemble_22 (result, &w3, &w1, &w2, &w); - INSERT_FIELD_AND_CONTINUE (opcode, - ((w3 << 21) | (w2 << 2) - | (w1 << 16) | w), - 0); + CHECK_FIELD (num, 8388607, -8388608, 0); + opcode |= re_assemble_22 (num >> 2); } else { @@ -3197,23 +3323,17 @@ pa_ip (str) || !strcmp (S_GET_NAME (the_insn.exp.X_add_symbol), "L$0\001")) { - unsigned int w2, w1, w, result; - num = evaluate_absolute (&the_insn); if (num % 4) { as_bad (_("Branch to unaligned address")); break; } - CHECK_FIELD (num, 262143, -262144, 0); - if (the_insn.exp.X_add_symbol) num -= 8; - - sign_unext (num >> 2, 17, &result); - dis_assemble_17 (result, &w1, &w2, &w); - INSERT_FIELD_AND_CONTINUE (opcode, - ((w2 << 2) | (w1 << 16) | w), 0); + CHECK_FIELD (num, 262143, -262144, 0); + opcode |= re_assemble_17 (num >> 2); + continue; } else { @@ -3350,8 +3470,6 @@ pa_ip (str) num = pa_get_absolute_expression (&the_insn, &s); if (strict && the_insn.exp.X_op != O_constant) break; - if (the_insn.exp.X_op != O_constant) - break; s = expr_end; CHECK_FIELD (num, 31, 0, strict); INSERT_FIELD_AND_CONTINUE (opcode, num, 21); @@ -3380,7 +3498,7 @@ pa_ip (str) if (strict && the_insn.exp.X_op != O_constant) break; s = expr_end; - CHECK_FIELD (num, 671108864, 0, strict); + CHECK_FIELD (num, 67108863, 0, strict); INSERT_FIELD_AND_CONTINUE (opcode, num, 0); /* Handle a 3 bit SFU identifier at 25. */ @@ -3575,49 +3693,43 @@ pa_ip (str) { /* Float target register. */ case 't': - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 3)) break; - num = pa_parse_number (&s, 0); + num = (pa_number & ~FP_REG_RSEL) - FP_REG_BASE; CHECK_FIELD (num, 31, 0, 0); INSERT_FIELD_AND_CONTINUE (opcode, num, 0); /* Float target register with L/R selection. */ case 'T': { - struct pa_11_fp_reg_struct result; - - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 1)) break; - pa_parse_number (&s, &result); - CHECK_FIELD (result.number_part, 31, 0, 0); - opcode |= result.number_part; + num = (pa_number & ~FP_REG_RSEL) - FP_REG_BASE; + CHECK_FIELD (num, 31, 0, 0); + opcode |= num; /* 0x30 opcodes are FP arithmetic operation opcodes and need to be turned into 0x38 opcodes. This is not necessary for loads/stores. */ - if (need_pa11_opcode (&the_insn, &result) + if (need_pa11_opcode () && ((opcode & 0xfc000000) == 0x30000000)) opcode |= 1 << 27; - INSERT_FIELD_AND_CONTINUE (opcode, result.l_r_select & 1, 6); + opcode |= (pa_number & FP_REG_RSEL ? 1 << 6 : 0); + continue; } /* Float operand 1. */ case 'a': { - struct pa_11_fp_reg_struct result; - - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 1)) break; - pa_parse_number (&s, &result); - CHECK_FIELD (result.number_part, 31, 0, 0); - opcode |= result.number_part << 21; - if (need_pa11_opcode (&the_insn, &result)) + num = (pa_number & ~FP_REG_RSEL) - FP_REG_BASE; + CHECK_FIELD (num, 31, 0, 0); + opcode |= num << 21; + if (need_pa11_opcode ()) { - opcode |= (result.l_r_select & 1) << 7; + opcode |= (pa_number & FP_REG_RSEL ? 1 << 7 : 0); opcode |= 1 << 27; } continue; @@ -3627,32 +3739,26 @@ pa_ip (str) case 'X': case 'A': { - struct pa_11_fp_reg_struct result; - - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 1)) break; - pa_parse_number (&s, &result); - CHECK_FIELD (result.number_part, 31, 0, 0); - opcode |= result.number_part << 21; - opcode |= (result.l_r_select & 1) << 7; + num = (pa_number & ~FP_REG_RSEL) - FP_REG_BASE; + CHECK_FIELD (num, 31, 0, 0); + opcode |= num << 21; + opcode |= (pa_number & FP_REG_RSEL ? 1 << 7 : 0); continue; } /* Float operand 2. */ case 'b': { - struct pa_11_fp_reg_struct result; - - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 1)) break; - pa_parse_number (&s, &result); - CHECK_FIELD (result.number_part, 31, 0, 0); - opcode |= (result.number_part & 0x1f) << 16; - if (need_pa11_opcode (&the_insn, &result)) + num = (pa_number & ~FP_REG_RSEL) - FP_REG_BASE; + CHECK_FIELD (num, 31, 0, 0); + opcode |= num << 16; + if (need_pa11_opcode ()) { - opcode |= (result.l_r_select & 1) << 12; + opcode |= (pa_number & FP_REG_RSEL ? 1 << 12 : 0); opcode |= 1 << 27; } continue; @@ -3661,166 +3767,152 @@ pa_ip (str) /* Float operand 2 with L/R selection. */ case 'B': { - struct pa_11_fp_reg_struct result; - - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 1)) break; - pa_parse_number (&s, &result); - CHECK_FIELD (result.number_part, 31, 0, 0); - opcode |= (result.number_part & 0x1f) << 16; - opcode |= (result.l_r_select & 1) << 12; + num = (pa_number & ~FP_REG_RSEL) - FP_REG_BASE; + CHECK_FIELD (num, 31, 0, 0); + opcode |= num << 16; + opcode |= (pa_number & FP_REG_RSEL ? 1 << 12 : 0); continue; } /* Float operand 3 for fmpyfadd, fmpynfadd. */ case 'C': { - struct pa_11_fp_reg_struct result; - - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 1)) break; - pa_parse_number (&s, &result); - CHECK_FIELD (result.number_part, 31, 0, 0); - opcode |= (result.number_part & 0x1c) << 11; - opcode |= (result.number_part & 0x3) << 9; - opcode |= (result.l_r_select & 1) << 8; + num = (pa_number & ~FP_REG_RSEL) - FP_REG_BASE; + CHECK_FIELD (num, 31, 0, 0); + opcode |= (num & 0x1c) << 11; + opcode |= (num & 0x03) << 9; + opcode |= (pa_number & FP_REG_RSEL ? 1 << 8 : 0); continue; } /* Float mult operand 1 for fmpyadd, fmpysub */ case 'i': { - struct pa_11_fp_reg_struct result; - - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 1)) break; - pa_parse_number (&s, &result); - CHECK_FIELD (result.number_part, 31, 0, 0); + num = (pa_number & ~FP_REG_RSEL) - FP_REG_BASE; + CHECK_FIELD (num, 31, 0, 0); if (the_insn.fpof1 == SGL) { - if (result.number_part < 16) + if (num < 16) { as_bad (_("Invalid register for single precision fmpyadd or fmpysub")); break; } - - result.number_part &= 0xF; - result.number_part |= (result.l_r_select & 1) << 4; + num &= 0xF; + num |= (pa_number & FP_REG_RSEL ? 1 << 4 : 0); } - INSERT_FIELD_AND_CONTINUE (opcode, result.number_part, 21); + INSERT_FIELD_AND_CONTINUE (opcode, num, 21); } /* Float mult operand 2 for fmpyadd, fmpysub */ case 'j': { - struct pa_11_fp_reg_struct result; - - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 1)) break; - pa_parse_number (&s, &result); - CHECK_FIELD (result.number_part, 31, 0, 0); + num = (pa_number & ~FP_REG_RSEL) - FP_REG_BASE; + CHECK_FIELD (num, 31, 0, 0); if (the_insn.fpof1 == SGL) { - if (result.number_part < 16) + if (num < 16) { - as_bad (_("Invalid register for single precision fmpyadd or fmpysub")); - break; + as_bad (_("Invalid register for single precision fmpyadd or fmpysub")); + break; } - result.number_part &= 0xF; - result.number_part |= (result.l_r_select & 1) << 4; + num &= 0xF; + num |= (pa_number & FP_REG_RSEL ? 1 << 4 : 0); } - INSERT_FIELD_AND_CONTINUE (opcode, result.number_part, 16); + INSERT_FIELD_AND_CONTINUE (opcode, num, 16); } /* Float mult target for fmpyadd, fmpysub */ case 'k': { - struct pa_11_fp_reg_struct result; - - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 1)) break; - pa_parse_number (&s, &result); - CHECK_FIELD (result.number_part, 31, 0, 0); + num = (pa_number & ~FP_REG_RSEL) - FP_REG_BASE; + CHECK_FIELD (num, 31, 0, 0); if (the_insn.fpof1 == SGL) { - if (result.number_part < 16) + if (num < 16) { - as_bad (_("Invalid register for single precision fmpyadd or fmpysub")); - break; + as_bad (_("Invalid register for single precision fmpyadd or fmpysub")); + break; } - result.number_part &= 0xF; - result.number_part |= (result.l_r_select & 1) << 4; + num &= 0xF; + num |= (pa_number & FP_REG_RSEL ? 1 << 4 : 0); } - INSERT_FIELD_AND_CONTINUE (opcode, result.number_part, 0); + INSERT_FIELD_AND_CONTINUE (opcode, num, 0); } /* Float add operand 1 for fmpyadd, fmpysub */ case 'l': { - struct pa_11_fp_reg_struct result; - - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 1)) break; - pa_parse_number (&s, &result); - CHECK_FIELD (result.number_part, 31, 0, 0); + num = (pa_number & ~FP_REG_RSEL) - FP_REG_BASE; + CHECK_FIELD (num, 31, 0, 0); if (the_insn.fpof1 == SGL) { - if (result.number_part < 16) + if (num < 16) { - as_bad (_("Invalid register for single precision fmpyadd or fmpysub")); - break; + as_bad (_("Invalid register for single precision fmpyadd or fmpysub")); + break; } - result.number_part &= 0xF; - result.number_part |= (result.l_r_select & 1) << 4; + num &= 0xF; + num |= (pa_number & FP_REG_RSEL ? 1 << 4 : 0); } - INSERT_FIELD_AND_CONTINUE (opcode, result.number_part, 6); + INSERT_FIELD_AND_CONTINUE (opcode, num, 6); } /* Float add target for fmpyadd, fmpysub */ case 'm': { - struct pa_11_fp_reg_struct result; - - /* This should be more strict. Small steps. */ - if (strict && *s != '%') + if (!pa_parse_number (&s, 1)) break; - pa_parse_number (&s, &result); - CHECK_FIELD (result.number_part, 31, 0, 0); + num = (pa_number & ~FP_REG_RSEL) - FP_REG_BASE; + CHECK_FIELD (num, 31, 0, 0); if (the_insn.fpof1 == SGL) { - if (result.number_part < 16) + if (num < 16) { - as_bad (_("Invalid register for single precision fmpyadd or fmpysub")); - break; + as_bad (_("Invalid register for single precision fmpyadd or fmpysub")); + break; } - result.number_part &= 0xF; - result.number_part |= (result.l_r_select & 1) << 4; + num &= 0xF; + num |= (pa_number & FP_REG_RSEL ? 1 << 4 : 0); } - INSERT_FIELD_AND_CONTINUE (opcode, result.number_part, 11); + INSERT_FIELD_AND_CONTINUE (opcode, num, 11); } /* Handle L/R register halves like 'x'. */ + case 'E': case 'e': { - struct pa_11_fp_reg_struct result; - - if (strict && *s != '%') + if (!pa_parse_number (&s, 1)) break; - pa_parse_number (&s, &result); - CHECK_FIELD (result.number_part, 31, 0, 0); - opcode |= (result.number_part & 0x1f) << 16; - if (need_pa11_opcode (&the_insn, &result)) + num = (pa_number & ~FP_REG_RSEL) - FP_REG_BASE; + CHECK_FIELD (num, 31, 0, 0); + opcode |= num << 16; + if (need_pa11_opcode ()) { - opcode |= (result.l_r_select & 1) << 1; + opcode |= (pa_number & FP_REG_RSEL ? 1 << 1 : 0); } continue; } + + /* Float target register (PA 2.0 wide). */ + case 'x': + if (!pa_parse_number (&s, 3)) + break; + num = (pa_number & ~FP_REG_RSEL) - FP_REG_BASE; + CHECK_FIELD (num, 31, 0, 0); + INSERT_FIELD_AND_CONTINUE (opcode, num, 16); + default: abort (); } @@ -3936,16 +4028,17 @@ tc_gen_reloc (section, fixp) { arelent *reloc; struct hppa_fix_struct *hppa_fixp; - bfd_reloc_code_real_type code; static arelent *no_relocs = NULL; arelent **relocs; - bfd_reloc_code_real_type **codes; + reloc_type **codes; + reloc_type code; int n_relocs; int i; hppa_fixp = (struct hppa_fix_struct *) fixp->tc_fix_data; if (fixp->fx_addsy == 0) return &no_relocs; + assert (hppa_fixp != 0); assert (section != 0); @@ -3953,7 +4046,7 @@ tc_gen_reloc (section, fixp) reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); - codes = (bfd_reloc_code_real_type **) hppa_gen_reloc_type (stdoutput, + codes = hppa_gen_reloc_type (stdoutput, fixp->fx_r_type, hppa_fixp->fx_r_format, hppa_fixp->fx_r_field, @@ -3961,7 +4054,10 @@ tc_gen_reloc (section, fixp) symbol_get_bfdsym (fixp->fx_addsy)); if (codes == NULL) - abort (); + { + as_bad (_("Cannot handle fixup at %s:%d"), fixp->fx_file, fixp->fx_line); + abort (); + } for (n_relocs = 0; codes[n_relocs]; n_relocs++) ; @@ -3981,14 +4077,6 @@ tc_gen_reloc (section, fixp) code = *codes[0]; - reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); - *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); - reloc->howto = bfd_reloc_type_lookup (stdoutput, code); - reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; - reloc->addend = 0; /* default */ - - assert (reloc->howto && code == reloc->howto->type); - /* Now, do any processing that is dependent on the relocation type. */ switch (code) { @@ -4000,9 +4088,8 @@ tc_gen_reloc (section, fixp) case R_PARISC_PLABEL14R: /* For plabel relocations, the addend of the relocation should be either 0 (no static link) or 2 - (static link required). - - FIXME: We always assume no static link! + (static link required). This adjustment is done in + bfd/elf32-hppa.c:elf32_hppa_relocate_section. We also slam a zero addend into the DLT relative relocs; it doesn't make a lot of sense to use any addend since @@ -4010,19 +4097,37 @@ tc_gen_reloc (section, fixp) reloc->addend = 0; break; - case R_PARISC_PCREL21L: +#ifdef ELF_ARG_RELOC case R_PARISC_PCREL17R: case R_PARISC_PCREL17F: case R_PARISC_PCREL17C: - case R_PARISC_PCREL14R: - case R_PARISC_PCREL14F: - /* The constant is stored in the instruction. */ - reloc->addend = HPPA_R_ADDEND (hppa_fixp->fx_arg_reloc, 0); + case R_PARISC_DIR17R: + case R_PARISC_DIR17F: + case R_PARISC_PCREL21L: + case R_PARISC_DIR21L: + reloc->addend = HPPA_R_ADDEND (hppa_fixp->fx_arg_reloc, + fixp->fx_offset); break; +#endif + + case R_PARISC_DIR32: + /* Facilitate hand-crafted unwind info. */ + if (strcmp (section->name, UNWIND_SECTION_NAME) == 0) + code = R_PARISC_SEGREL32; + /* Fall thru */ + default: reloc->addend = fixp->fx_offset; break; } + + reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + reloc->howto = bfd_reloc_type_lookup (stdoutput, + (bfd_reloc_code_real_type) code); + reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; + + assert (reloc->howto && (unsigned int) code == reloc->howto->type); break; } #else /* OBJ_SOM */ @@ -4034,7 +4139,9 @@ tc_gen_reloc (section, fixp) relocs[i]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); *relocs[i]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); - relocs[i]->howto = bfd_reloc_type_lookup (stdoutput, code); + relocs[i]->howto = + bfd_reloc_type_lookup (stdoutput, + (bfd_reloc_code_real_type) code); relocs[i]->address = fixp->fx_frag->fr_address + fixp->fx_where; switch (code) @@ -4045,25 +4152,35 @@ tc_gen_reloc (section, fixp) relocs now and break out of the loop. */ assert (i == 1); relocs[0]->sym_ptr_ptr = (asymbol **) &(bfd_abs_symbol); - relocs[0]->howto = bfd_reloc_type_lookup (stdoutput, *codes[0]); + relocs[0]->howto = + bfd_reloc_type_lookup (stdoutput, + (bfd_reloc_code_real_type) *codes[0]); relocs[0]->address = fixp->fx_frag->fr_address + fixp->fx_where; relocs[0]->addend = 0; relocs[1]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); *relocs[1]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); - relocs[1]->howto = bfd_reloc_type_lookup (stdoutput, *codes[1]); + relocs[1]->howto = + bfd_reloc_type_lookup (stdoutput, + (bfd_reloc_code_real_type) *codes[1]); relocs[1]->address = fixp->fx_frag->fr_address + fixp->fx_where; relocs[1]->addend = 0; relocs[2]->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); *relocs[2]->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_subsy); - relocs[2]->howto = bfd_reloc_type_lookup (stdoutput, *codes[2]); + relocs[2]->howto = + bfd_reloc_type_lookup (stdoutput, + (bfd_reloc_code_real_type) *codes[2]); relocs[2]->address = fixp->fx_frag->fr_address + fixp->fx_where; relocs[2]->addend = 0; relocs[3]->sym_ptr_ptr = (asymbol **) &(bfd_abs_symbol); - relocs[3]->howto = bfd_reloc_type_lookup (stdoutput, *codes[3]); + relocs[3]->howto = + bfd_reloc_type_lookup (stdoutput, + (bfd_reloc_code_real_type) *codes[3]); relocs[3]->address = fixp->fx_frag->fr_address + fixp->fx_where; relocs[3]->addend = 0; relocs[4]->sym_ptr_ptr = (asymbol **) &(bfd_abs_symbol); - relocs[4]->howto = bfd_reloc_type_lookup (stdoutput, *codes[4]); + relocs[4]->howto = + bfd_reloc_type_lookup (stdoutput, + (bfd_reloc_code_real_type) *codes[4]); relocs[4]->address = fixp->fx_frag->fr_address + fixp->fx_where; relocs[4]->addend = 0; goto done; @@ -4129,8 +4246,8 @@ tc_gen_reloc (section, fixp) void md_convert_frag (abfd, sec, fragP) - register bfd *abfd; - register asection *sec; + register bfd *abfd ATTRIBUTE_UNUSED; + register asection *sec ATTRIBUTE_UNUSED; register fragS *fragP; { unsigned int address; @@ -4158,7 +4275,7 @@ md_convert_frag (abfd, sec, fragP) } } -/* Round up a section size to the appropriate boundary. */ +/* Round up a section size to the appropriate boundary. */ valueT md_section_align (segment, size) @@ -4175,7 +4292,7 @@ md_section_align (segment, size) int md_estimate_size_before_relax (fragP, segment) register fragS *fragP; - asection *segment; + asection *segment ATTRIBUTE_UNUSED; { int size; @@ -4187,35 +4304,85 @@ md_estimate_size_before_relax (fragP, segment) return size; } -CONST char *md_shortopts = ""; +#ifdef OBJ_ELF +# ifdef WARN_COMMENTS +const char *md_shortopts = "Vc"; +# else +const char *md_shortopts = "V"; +# endif +#else +# ifdef WARN_COMMENTS +const char *md_shortopts = "c"; +# else +const char *md_shortopts = ""; +# endif +#endif + struct option md_longopts[] = { +#ifdef WARN_COMMENTS + {"warn-comment", no_argument, NULL, 'c'}, +#endif {NULL, no_argument, NULL, 0} }; -size_t md_longopts_size = sizeof(md_longopts); +size_t md_longopts_size = sizeof (md_longopts); int md_parse_option (c, arg) - int c; - char *arg; + int c ATTRIBUTE_UNUSED; + char *arg ATTRIBUTE_UNUSED; { - return 0; + switch (c) + { + default: + return 0; + +#ifdef OBJ_ELF + case 'V': + print_version_id (); + break; +#endif +#ifdef WARN_COMMENTS + case 'c': + warn_comment = 1; + break; +#endif + } + + return 1; } void md_show_usage (stream) - FILE *stream; + FILE *stream ATTRIBUTE_UNUSED; { +#ifdef OBJ_ELF + fprintf (stream, _("\ + -Q ignored\n")); +#endif +#ifdef WARN_COMMENTS + fprintf (stream, _("\ + -c print a warning if a comment is found\n")); +#endif } /* We have no need to default values of symbols. */ symbolS * md_undefined_symbol (name) - char *name; + char *name ATTRIBUTE_UNUSED; { return 0; } +#if defined (OBJ_SOM) || defined (ELF_ARG_RELOC) +#define nonzero_dibits(x) \ + ((x) | (((x) & 0x55555555) << 1) | (((x) & 0xAAAAAAAA) >> 1)) +#define arg_reloc_stub_needed(CALLER, CALLEE) \ + (((CALLER) ^ (CALLEE)) & nonzero_dibits (CALLER) & nonzero_dibits (CALLEE)) +#else +#define arg_reloc_stub_needed(CALLER, CALLEE) 0 +#endif + /* Apply a fixup to an instruction. */ int @@ -4223,12 +4390,11 @@ md_apply_fix (fixP, valp) fixS *fixP; valueT *valp; { - char *buf = fixP->fx_where + fixP->fx_frag->fr_literal; + unsigned char *buf; struct hppa_fix_struct *hppa_fixP; - long new_val, result = 0; - unsigned int w1, w2, w, resulti; + offsetT new_val; + int insn, val, fmt; - hppa_fixP = (struct hppa_fix_struct *) fixP->tc_fix_data; /* SOM uses R_HPPA_ENTRY and R_HPPA_EXIT relocations which can never be "applied" (they are just markers). Likewise for R_HPPA_BEGIN_BRTAB and R_HPPA_END_BRTAB. */ @@ -4249,183 +4415,191 @@ md_apply_fix (fixP, valp) return 1; } #endif +#ifdef OBJ_ELF + if (fixP->fx_r_type == (int) R_PARISC_GNU_VTENTRY + || fixP->fx_r_type == (int) R_PARISC_GNU_VTINHERIT) + return 1; +#endif /* There should have been an HPPA specific fixup associated with the GAS fixup. */ - if (hppa_fixP) + hppa_fixP = (struct hppa_fix_struct *) fixP->tc_fix_data; + if (hppa_fixP == NULL) { - unsigned long buf_wd = bfd_get_32 (stdoutput, buf); - int fmt = bfd_hppa_insn2fmt (buf_wd); - - /* If there is a symbol associated with this fixup, then it's something - which will need a SOM relocation (except for some PC-relative relocs). - In such cases we should treat the "val" or "addend" as zero since it - will be added in as needed from fx_offset in tc_gen_reloc. */ - if ((fixP->fx_addsy != NULL - || fixP->fx_r_type == R_HPPA_NONE) -#ifdef OBJ_SOM - && fmt != 32 -#endif - ) - new_val = ((fmt == 12 || fmt == 17 || fmt == 22) ? 8 : 0); -#ifdef OBJ_SOM - /* These field selectors imply that we do not want an addend. */ - else if (hppa_fixP->fx_r_field == e_psel - || hppa_fixP->fx_r_field == e_rpsel - || hppa_fixP->fx_r_field == e_lpsel - || hppa_fixP->fx_r_field == e_tsel - || hppa_fixP->fx_r_field == e_rtsel - || hppa_fixP->fx_r_field == e_ltsel) - new_val = ((fmt == 12 || fmt == 17 || fmt == 22) ? 8 : 0); - /* This is truely disgusting. The machine independent code blindly - adds in the value of the symbol being relocated against. Damn! */ - else if (fmt == 32 - && fixP->fx_addsy != NULL - && S_GET_SEGMENT (fixP->fx_addsy) != bfd_com_section_ptr) - new_val = hppa_field_adjust (*valp - S_GET_VALUE (fixP->fx_addsy), - 0, hppa_fixP->fx_r_field); -#endif - else - new_val = hppa_field_adjust (*valp, 0, hppa_fixP->fx_r_field); - - /* Handle pc-relative exceptions from above. */ -#define arg_reloc_stub_needed(CALLER, CALLEE) \ - ((CALLEE) && (CALLER) && ((CALLEE) != (CALLER))) - if ((fmt == 12 || fmt == 17 || fmt == 22) - && fixP->fx_addsy - && fixP->fx_pcrel -#ifdef OBJ_SOM - && !arg_reloc_stub_needed ((long) ((obj_symbol_type *) - symbol_get_bfdsym (fixP->fx_addsy))->tc_data.ap.hppa_arg_reloc, - hppa_fixP->fx_arg_reloc) -#endif - && (((int)(*valp) > -262144 && (int)(*valp) < 262143) && fmt != 22) - && S_GET_SEGMENT (fixP->fx_addsy) == hppa_fixP->segment - && !(fixP->fx_subsy - && S_GET_SEGMENT (fixP->fx_subsy) != hppa_fixP->segment)) - - new_val = hppa_field_adjust (*valp, 0, hppa_fixP->fx_r_field); -#undef arg_reloc_stub_needed - - switch (fmt) - { - /* Handle all opcodes with the 'j' operand type. */ - case 14: - CHECK_FIELD (new_val, 8191, -8192, 0); - - /* Mask off 14 bits to be changed. */ - bfd_put_32 (stdoutput, - bfd_get_32 (stdoutput, buf) & 0xffffc000, - buf); - low_sign_unext (new_val, 14, &resulti); - result = resulti; - break; - - /* Handle all opcodes with the 'k' operand type. */ - case 21: - CHECK_FIELD (new_val, 2097152, 0, 0); - - /* Mask off 21 bits to be changed. */ - bfd_put_32 (stdoutput, - bfd_get_32 (stdoutput, buf) & 0xffe00000, - buf); - dis_assemble_21 (new_val, &resulti); - result = resulti; - break; - - /* Handle all the opcodes with the 'i' operand type. */ - case 11: - CHECK_FIELD (new_val, 1023, -1023, 0); - - /* Mask off 11 bits to be changed. */ - bfd_put_32 (stdoutput, - bfd_get_32 (stdoutput, buf) & 0xffff800, - buf); - low_sign_unext (new_val, 11, &resulti); - result = resulti; - break; - - /* Handle all the opcodes with the 'w' operand type. */ - case 12: - CHECK_FIELD (new_val, 8199, -8184, 0); - - /* Mask off 11 bits to be changed. */ - sign_unext ((new_val - 8) >> 2, 12, &resulti); - bfd_put_32 (stdoutput, - bfd_get_32 (stdoutput, buf) & 0xffffe002, - buf); - - dis_assemble_12 (resulti, &w1, &w); - result = ((w1 << 2) | w); - break; - - /* Handle some of the opcodes with the 'W' operand type. */ - case 17: - { - int distance = *valp; - - CHECK_FIELD (new_val, 262143, -262144, 0); - - /* If this is an absolute branch (ie no link) with an out of - range target, then we want to complain. */ - if (fixP->fx_r_type == R_HPPA_PCREL_CALL - && (distance > 262143 || distance < -262144) - && (bfd_get_32 (stdoutput, buf) & 0xffe00000) == 0xe8000000) - CHECK_FIELD (distance, 262143, -262144, 0); - - /* Mask off 17 bits to be changed. */ - bfd_put_32 (stdoutput, - bfd_get_32 (stdoutput, buf) & 0xffe0e002, - buf); - sign_unext ((new_val - 8) >> 2, 17, &resulti); - dis_assemble_17 (resulti, &w1, &w2, &w); - result = ((w2 << 2) | (w1 << 16) | w); - break; - } - - case 22: - { - int distance = *valp, w3; - - CHECK_FIELD (new_val, 8388607, -8388608, 0); - - /* If this is an absolute branch (ie no link) with an out of - range target, then we want to complain. */ - if (fixP->fx_r_type == R_HPPA_PCREL_CALL - && (distance > 8388607 || distance < -8388608) - && (bfd_get_32 (stdoutput, buf) & 0xffe00000) == 0xe8000000) - CHECK_FIELD (distance, 8388607, -8388608, 0); - - /* Mask off 22 bits to be changed. */ - bfd_put_32 (stdoutput, - bfd_get_32 (stdoutput, buf) & 0xfc00e002, - buf); - sign_unext ((new_val - 8) >> 2, 22, &resulti); - dis_assemble_22 (resulti, &w3, &w1, &w2, &w); - result = ((w3 << 21) | (w2 << 2) | (w1 << 16) | w); - break; - } - - case 32: - result = 0; - bfd_put_32 (stdoutput, new_val, buf); - break; - - default: - as_bad (_("Unknown relocation encountered in md_apply_fix.")); - return 0; - } - - /* Insert the relocation. */ - bfd_put_32 (stdoutput, bfd_get_32 (stdoutput, buf) | result, buf); - return 1; - } - else - { - printf (_("no hppa_fixup entry for this fixup (fixP = 0x%x, type = 0x%x)\n"), - (unsigned int) fixP, fixP->fx_r_type); + printf (_("no hppa_fixup entry for fixup type 0x%x at %s:%d"), + fixP->fx_r_type, fixP->fx_file, fixP->fx_line); return 0; } + + buf = fixP->fx_frag->fr_literal + fixP->fx_where; + insn = bfd_get_32 (stdoutput, buf); + fmt = bfd_hppa_insn2fmt (stdoutput, insn); + + /* If there is a symbol associated with this fixup, then it's something + which will need a SOM relocation (except for some PC-relative relocs). + In such cases we should treat the "val" or "addend" as zero since it + will be added in as needed from fx_offset in tc_gen_reloc. */ + if ((fixP->fx_addsy != NULL + || fixP->fx_r_type == (int) R_HPPA_NONE) +#ifdef OBJ_SOM + && fmt != 32 +#endif + ) + new_val = ((fmt == 12 || fmt == 17 || fmt == 22) ? 8 : 0); +#ifdef OBJ_SOM + /* These field selectors imply that we do not want an addend. */ + else if (hppa_fixP->fx_r_field == e_psel + || hppa_fixP->fx_r_field == e_rpsel + || hppa_fixP->fx_r_field == e_lpsel + || hppa_fixP->fx_r_field == e_tsel + || hppa_fixP->fx_r_field == e_rtsel + || hppa_fixP->fx_r_field == e_ltsel) + new_val = ((fmt == 12 || fmt == 17 || fmt == 22) ? 8 : 0); + /* This is truly disgusting. The machine independent code blindly + adds in the value of the symbol being relocated against. Damn! */ + else if (fmt == 32 + && fixP->fx_addsy != NULL + && S_GET_SEGMENT (fixP->fx_addsy) != bfd_com_section_ptr) + new_val = hppa_field_adjust (*valp - S_GET_VALUE (fixP->fx_addsy), + 0, hppa_fixP->fx_r_field); +#endif + else + new_val = hppa_field_adjust (*valp, 0, hppa_fixP->fx_r_field); + + /* Handle pc-relative exceptions from above. */ + if ((fmt == 12 || fmt == 17 || fmt == 22) + && fixP->fx_addsy + && fixP->fx_pcrel + && !arg_reloc_stub_needed (symbol_arg_reloc_info (fixP->fx_addsy), + hppa_fixP->fx_arg_reloc) +#ifdef OBJ_ELF + && (*valp - 8 + 8192 < 16384 + || (fmt == 17 && *valp - 8 + 262144 < 524288) + || (fmt == 22 && *valp - 8 + 8388608 < 16777216)) +#endif +#ifdef OBJ_SOM + && (*valp - 8 + 262144 < 524288 + || (fmt == 22 && *valp - 8 + 8388608 < 16777216)) +#endif + && !S_IS_EXTERNAL (fixP->fx_addsy) + && !S_IS_WEAK (fixP->fx_addsy) + && S_GET_SEGMENT (fixP->fx_addsy) == hppa_fixP->segment + && !(fixP->fx_subsy + && S_GET_SEGMENT (fixP->fx_subsy) != hppa_fixP->segment)) + { + new_val = hppa_field_adjust (*valp, 0, hppa_fixP->fx_r_field); + } + + switch (fmt) + { + case 10: + CHECK_FIELD (new_val, 8191, -8192, 0); + val = new_val; + + insn = (insn & ~ 0x3ff1) | (((val & 0x1ff8) << 1) + | ((val & 0x2000) >> 13)); + break; + case -11: + CHECK_FIELD (new_val, 8191, -8192, 0); + val = new_val; + + insn = (insn & ~ 0x3ff9) | (((val & 0x1ffc) << 1) + | ((val & 0x2000) >> 13)); + break; + /* Handle all opcodes with the 'j' operand type. */ + case 14: + CHECK_FIELD (new_val, 8191, -8192, 0); + val = new_val; + + insn = ((insn & ~ 0x3fff) | low_sign_unext (val, 14)); + break; + + /* Handle all opcodes with the 'k' operand type. */ + case 21: + CHECK_FIELD (new_val, 1048575, -1048576, 0); + val = new_val; + + insn = (insn & ~ 0x1fffff) | re_assemble_21 (val); + break; + + /* Handle all the opcodes with the 'i' operand type. */ + case 11: + CHECK_FIELD (new_val, 1023, -1024, 0); + val = new_val; + + insn = (insn & ~ 0x7ff) | low_sign_unext (val, 11); + break; + + /* Handle all the opcodes with the 'w' operand type. */ + case 12: + CHECK_FIELD (new_val - 8, 8191, -8192, 0); + val = new_val - 8; + + insn = (insn & ~ 0x1ffd) | re_assemble_12 (val >> 2); + break; + + /* Handle some of the opcodes with the 'W' operand type. */ + case 17: + { + offsetT distance = *valp; + + /* If this is an absolute branch (ie no link) with an out of + range target, then we want to complain. */ + if (fixP->fx_r_type == (int) R_HPPA_PCREL_CALL + && (insn & 0xffe00000) == 0xe8000000) + CHECK_FIELD (distance - 8, 262143, -262144, 0); + + CHECK_FIELD (new_val - 8, 262143, -262144, 0); + val = new_val - 8; + + insn = (insn & ~ 0x1f1ffd) | re_assemble_17 (val >> 2); + break; + } + + case 22: + { + offsetT distance = *valp; + + /* If this is an absolute branch (ie no link) with an out of + range target, then we want to complain. */ + if (fixP->fx_r_type == (int) R_HPPA_PCREL_CALL + && (insn & 0xffe00000) == 0xe8000000) + CHECK_FIELD (distance - 8, 8388607, -8388608, 0); + + CHECK_FIELD (new_val - 8, 8388607, -8388608, 0); + val = new_val - 8; + + insn = (insn & ~ 0x3ff1ffd) | re_assemble_22 (val >> 2); + break; + } + + case -10: + val = new_val; + insn = (insn & ~ 0xfff1) | re_assemble_16 (val & -8); + break; + + case -16: + val = new_val; + insn = (insn & ~ 0xfff9) | re_assemble_16 (val & -4); + break; + + case 16: + val = new_val; + insn = (insn & ~ 0xffff) | re_assemble_16 (val); + break; + + case 32: + insn = new_val; + break; + + default: + as_bad (_("Unknown relocation encountered in md_apply_fix.")); + return 0; + } + + /* Insert the relocation. */ + bfd_put_32 (stdoutput, insn, buf); + return 1; } /* Exactly what point is a PC-relative offset relative TO? @@ -4453,19 +4627,21 @@ is_end_of_statement () the most common will be a hex or decimal constant, but it could be a pre-defined register (Yuk!), or an absolute symbol. - Return a number or -1 for failure. + Return 1 on success or 0 on failure. If STRICT, then a missing + register prefix will cause a failure. The number itself is + returned in `pa_number'. - When parsing PA-89 FP register numbers RESULT will be - the address of a structure to return information about - L/R half of FP registers, store results there as appropriate. + IS_FLOAT indicates that a PA-89 FP register number should be + parsed; A `l' or `r' suffix is checked for if but 2 of IS_FLOAT is + not set. pa_parse_number can not handle negative constants and will fail horribly if it is passed such a constant. */ static int -pa_parse_number (s, result) +pa_parse_number (s, is_float) char **s; - struct pa_11_fp_reg_struct *result; + int is_float; { int num; char *name; @@ -4473,23 +4649,18 @@ pa_parse_number (s, result) symbolS *sym; int status; char *p = *s; + boolean have_prefix; /* Skip whitespace before the number. */ while (*p == ' ' || *p == '\t') p = p + 1; - /* Store info in RESULT if requested by caller. */ - if (result) - { - result->number_part = -1; - result->l_r_select = -1; - } - num = -1; - - if (isdigit (*p)) + pa_number = -1; + have_prefix = 0; + num = 0; + if (!strict && isdigit (*p)) { /* Looks like a number. */ - num = 0; if (*p == '0' && (*(p + 1) == 'x' || *(p + 1) == 'X')) { @@ -4517,35 +4688,36 @@ pa_parse_number (s, result) } } - /* Store info in RESULT if requested by the caller. */ - if (result) - { - result->number_part = num; + pa_number = num; - if (IS_R_SELECT (p)) + /* Check for a `l' or `r' suffix. */ + if (is_float) + { + pa_number += FP_REG_BASE; + if (! (is_float & 2)) { - result->l_r_select = 1; - ++p; + if (IS_R_SELECT (p)) + { + pa_number += FP_REG_RSEL; + ++p; + } + else if (IS_L_SELECT (p)) + { + ++p; + } } - else if (IS_L_SELECT (p)) - { - result->l_r_select = 0; - ++p; - } - else - result->l_r_select = 0; } } else if (*p == '%') { /* The number might be a predefined register. */ - num = 0; + have_prefix = 1; name = p; p++; c = *p; /* Tege hack: Special case for general registers as the general code makes a binary search with case translation, and is VERY - slow. */ + slow. */ if (c == 'r') { p++; @@ -4595,23 +4767,12 @@ pa_parse_number (s, result) *p = c; } - /* Store info in RESULT if requested by caller. */ - if (result) - { - result->number_part = num; - if (IS_R_SELECT (p - 1)) - result->l_r_select = 1; - else if (IS_L_SELECT (p - 1)) - result->l_r_select = 0; - else - result->l_r_select = 0; - } + pa_number = num; } else { /* And finally, it could be a symbol in the absolute section which - is effectively a constant. */ - num = 0; + is effectively a constant, or a register alias symbol. */ name = p; c = *p; while (is_part_of_name (c)) @@ -4622,16 +4783,23 @@ pa_parse_number (s, result) *p = 0; if ((sym = symbol_find (name)) != NULL) { - if (S_GET_SEGMENT (sym) == &bfd_abs_section) + if (S_GET_SEGMENT (sym) == reg_section) + { + num = S_GET_VALUE (sym); + /* Well, we don't really have one, but we do have a + register, so... */ + have_prefix = true; + } + else if (S_GET_SEGMENT (sym) == &bfd_abs_section) num = S_GET_VALUE (sym); - else + else if (!strict) { if (print_errors) as_bad (_("Non-absolute symbol: '%s'."), name); num = -1; } } - else + else if (!strict) { /* There is where we'd come for an undefined symbol or for an empty string. For an empty string we @@ -4648,24 +4816,18 @@ pa_parse_number (s, result) } *p = c; - /* Store info in RESULT if requested by caller. */ - if (result) - { - result->number_part = num; - if (IS_R_SELECT (p - 1)) - result->l_r_select = 1; - else if (IS_L_SELECT (p - 1)) - result->l_r_select = 0; - else - result->l_r_select = 0; - } + pa_number = num; } - *s = p; - return num; + if (!strict || have_prefix) + { + *s = p; + return 1; + } + return 0; } -#define REG_NAME_CNT (sizeof(pre_defined_registers) / sizeof(struct pd_reg)) +#define REG_NAME_CNT (sizeof (pre_defined_registers) / sizeof (struct pd_reg)) /* Given NAME, find the register number associated with that name, return the integer value associated with the given name or -1 on failure. */ @@ -4696,16 +4858,14 @@ reg_name_search (name) return -1; } - /* Return nonzero if the given INSN and L/R information will require a new PA-1.1 opcode. */ static int -need_pa11_opcode (insn, result) - struct pa_it *insn; - struct pa_11_fp_reg_struct *result; +need_pa11_opcode () { - if (result->l_r_select == 1 && !(insn->fpof1 == DBL && insn->fpof2 == DBL)) + if ((pa_number & FP_REG_RSEL) != 0 + && !(the_insn.fpof1 == DBL && the_insn.fpof2 == DBL)) { /* If this instruction is specific to a particular architecture, then set a new architecture. */ @@ -5001,7 +5161,7 @@ get_expression (str) return 0; } -/* Mark (via expr_end) the end of an absolute expression. FIXME. */ +/* Mark (via expr_end) the end of an absolute expression. FIXME. */ static int pa_get_absolute_expression (insn, strp) struct pa_it *insn; @@ -5017,7 +5177,7 @@ pa_get_absolute_expression (insn, strp) The PA assembly syntax is ambigious in a variety of ways. Consider this string "4 %r5" Is that the number 4 followed by the register - r5, or is that 4 MOD 5? + r5, or is that 4 MOD r5? If we get a modulo expresion When looking for an absolute, we try again cutting off the input string at the first whitespace character. */ @@ -5066,70 +5226,14 @@ static int evaluate_absolute (insn) struct pa_it *insn; { - int value; + offsetT value; expressionS exp; int field_selector = insn->field_selector; exp = insn->exp; value = exp.X_add_number; - switch (field_selector) - { - /* No change. */ - case e_fsel: - break; - - /* If bit 21 is on then add 0x800 and arithmetic shift right 11 bits. */ - case e_lssel: - if (value & 0x00000400) - value += 0x800; - value = (value & 0xfffff800) >> 11; - break; - - /* Sign extend from bit 21. */ - case e_rssel: - if (value & 0x00000400) - value |= 0xfffff800; - else - value &= 0x7ff; - break; - - /* Arithmetic shift right 11 bits. */ - case e_lsel: - value = (value & 0xfffff800) >> 11; - break; - - /* Set bits 0-20 to zero. */ - case e_rsel: - value = value & 0x7ff; - break; - - /* Add 0x800 and arithmetic shift right 11 bits. */ - case e_ldsel: - value += 0x800; - value = (value & 0xfffff800) >> 11; - break; - - /* Set bitgs 0-21 to one. */ - case e_rdsel: - value |= 0xfffff800; - break; - -#define RSEL_ROUND(c) (((c) + 0x1000) & ~0x1fff) - case e_rrsel: - value = (RSEL_ROUND (value) & 0x7ff) + (value - RSEL_ROUND (value)); - break; - - case e_lrsel: - value = (RSEL_ROUND (value) >> 11) & 0x1fffff; - break; -#undef RSEL_ROUND - - default: - BAD_CASE (field_selector); - break; - } - return value; + return hppa_field_adjust (0, value, field_selector); } /* Given an argument location specification return the associated @@ -5239,7 +5343,6 @@ pa_parse_nonneg_cmpsub_cmpltr (s, isbranch) c = **s; **s = 0x00; - if (strcmp (name, "=") == 0) { cmpltr = 1; @@ -5286,7 +5389,6 @@ pa_parse_nonneg_cmpsub_cmpltr (s, isbranch) if (nullify) *s = save_s; - return cmpltr; } @@ -5317,7 +5419,6 @@ pa_parse_neg_cmpsub_cmpltr (s, isbranch) c = **s; **s = 0x00; - if (strcasecmp (name, "tr") == 0) { cmpltr = 0; @@ -5368,11 +5469,9 @@ pa_parse_neg_cmpsub_cmpltr (s, isbranch) if (nullify) *s = save_s; - return cmpltr; } - /* Parse a 64 bit compare and branch completer returning the number (for encoding in instrutions) of the given completer. @@ -5386,7 +5485,6 @@ pa_parse_cmpb_64_cmpltr (s) int cmpltr; char *name = *s + 1; char c; - char *save_s = *s; cmpltr = -1; if (**s == ',') @@ -5468,7 +5566,6 @@ pa_parse_cmpb_64_cmpltr (s) **s = c; } - return cmpltr; } @@ -5482,7 +5579,6 @@ pa_parse_cmpib_64_cmpltr (s) int cmpltr; char *name = *s + 1; char c; - char *save_s = *s; cmpltr = -1; if (**s == ',') @@ -5532,7 +5628,6 @@ pa_parse_cmpib_64_cmpltr (s) **s = c; } - return cmpltr; } @@ -5793,6 +5888,7 @@ pa_parse_addb_64_cmpltr (s) alignment of the subspace if necessary. */ static void pa_align (bytes) + int bytes; { /* We must have a valid space and subspace. */ pa_check_current_space_and_subspace (); @@ -5811,7 +5907,7 @@ pa_align (bytes) static void pa_block (z) - int z; + int z ATTRIBUTE_UNUSED; { char *p; long int temp_fill; @@ -5849,7 +5945,7 @@ pa_block (z) static void pa_brtab (begin) - int begin; + int begin ATTRIBUTE_UNUSED; { #ifdef OBJ_SOM @@ -5860,7 +5956,7 @@ pa_brtab (begin) fix_new_hppa (frag_now, where - frag_now->fr_literal, 0, NULL, (offsetT) 0, NULL, 0, begin ? R_HPPA_BEGIN_BRTAB : R_HPPA_END_BRTAB, - e_fsel, 0, 0, NULL); + e_fsel, 0, 0, 0); #endif demand_empty_rest_of_line (); @@ -5870,7 +5966,7 @@ pa_brtab (begin) static void pa_try (begin) - int begin; + int begin ATTRIBUTE_UNUSED; { #ifdef OBJ_SOM expressionS exp; @@ -5885,7 +5981,7 @@ pa_try (begin) fix_new_hppa (frag_now, where - frag_now->fr_literal, 0, NULL, (offsetT) 0, begin ? NULL : &exp, 0, begin ? R_HPPA_BEGIN_TRY : R_HPPA_END_TRY, - e_fsel, 0, 0, NULL); + e_fsel, 0, 0, 0); #endif demand_empty_rest_of_line (); @@ -5897,7 +5993,7 @@ pa_try (begin) static void pa_call (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -5986,21 +6082,18 @@ static void pa_build_unwind_subspace (call_info) struct call_info *call_info; { - char *unwind; asection *seg, *save_seg; - asymbol *sym; - subsegT subseg, save_subseg; - int i, reloc; - char c, *p; + subsegT save_subseg; + unsigned int unwind; + int reloc; + char *p; - if (now_seg != text_section) + if ((bfd_get_section_flags (stdoutput, now_seg) + & (SEC_ALLOC | SEC_LOAD | SEC_READONLY)) + != (SEC_ALLOC | SEC_LOAD | SEC_READONLY)) return; - if (bfd_get_arch_info (stdoutput)->bits_per_address == 32) - reloc = R_PARISC_DIR32; - else - reloc = R_PARISC_SEGREL32; - + reloc = R_PARISC_SEGREL32; save_seg = now_seg; save_subseg = now_subseg; /* Get into the right seg/subseg. This may involve creating @@ -6018,20 +6111,16 @@ pa_build_unwind_subspace (call_info) subseg_set (seg, 0); - /* Get some space to hold relocation information for the unwind descriptor. */ - p = frag_more (4); - md_number_to_chars (p, 0, 4); + p = frag_more (16); /* Relocation info. for start offset of the function. */ + md_number_to_chars (p, 0, 4); fix_new_hppa (frag_now, p - frag_now->fr_literal, 4, call_info->start_symbol, (offsetT) 0, (expressionS *) NULL, 0, reloc, - e_fsel, 32, 0, NULL); - - p = frag_more (4); - md_number_to_chars (p, 0, 4); + e_fsel, 32, 0, 0); /* Relocation info. for end offset of the function. @@ -6040,21 +6129,18 @@ pa_build_unwind_subspace (call_info) symbol into the symbol table. It (should) end up giving the same value as call_info->start_symbol + function size once the linker is finished with its work. */ - - fix_new_hppa (frag_now, p - frag_now->fr_literal, 4, + md_number_to_chars (p + 4, 0, 4); + fix_new_hppa (frag_now, p + 4 - frag_now->fr_literal, 4, call_info->end_symbol, (offsetT) 0, (expressionS *) NULL, 0, reloc, - e_fsel, 32, 0, NULL); + e_fsel, 32, 0, 0); - /* Dump it. */ - unwind = (char *) &call_info->ci_unwind; - for (i = 8; i < sizeof (struct unwind_table); i++) - { - c = *(unwind + i); - { - FRAG_APPEND_1_CHAR (c); - } - } + /* Dump the descriptor. */ + unwind = UNWIND_LOW32 (&call_info->ci_unwind.descriptor); + md_number_to_chars (p + 8, unwind, 4); + + unwind = UNWIND_HIGH32 (&call_info->ci_unwind.descriptor); + md_number_to_chars (p + 12, unwind, 4); /* Return back to the original segment/subsegment. */ subseg_set (save_seg, save_subseg); @@ -6067,7 +6153,7 @@ pa_build_unwind_subspace (call_info) static void pa_callinfo (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { char *name, c, *p; int temp; @@ -6206,21 +6292,37 @@ pa_callinfo (unused) demand_empty_rest_of_line (); } -/* Switch into the code subspace. */ - +#if !(defined (OBJ_ELF) && defined (TE_LINUX)) +/* Switch to the text space. Like s_text, but delete our + label when finished. */ static void -pa_code (unused) - int unused; +pa_text (unused) + int unused ATTRIBUTE_UNUSED; { #ifdef OBJ_SOM current_space = is_defined_space ("$TEXT$"); current_subspace = pa_subsegment_to_subspace (current_space->sd_seg, 0); #endif + s_text (0); pa_undefine_label (); } +/* Switch to the data space. As usual delete our label. */ +static void +pa_data (unused) + int unused ATTRIBUTE_UNUSED; +{ +#ifdef OBJ_SOM + current_space = is_defined_space ("$PRIVATE$"); + current_subspace + = pa_subsegment_to_subspace (current_space->sd_seg, 0); +#endif + s_data (0); + pa_undefine_label (); +} + /* This is different than the standard GAS s_comm(). On HP9000/800 machines, the .comm pseudo-op has the following symtax: @@ -6243,7 +6345,7 @@ pa_code (unused) static void pa_comm (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { unsigned int size; symbolS *symbol; @@ -6270,12 +6372,13 @@ pa_comm (unused) } demand_empty_rest_of_line (); } +#endif /* !(defined (OBJ_ELF) && defined (TE_LINUX)) */ /* Process a .END pseudo-op. */ static void pa_end (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { demand_empty_rest_of_line (); } @@ -6283,7 +6386,7 @@ pa_end (unused) /* Process a .ENTER pseudo-op. This is not supported. */ static void pa_enter (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -6298,7 +6401,7 @@ pa_enter (unused) procesure. */ static void pa_entry (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -6327,16 +6430,39 @@ pa_entry (unused) denote the entry and exit points. */ if (last_call_info->start_symbol != NULL) { - char *where = frag_more (0); + char *where; + unsigned int u; + where = frag_more (0); + u = UNWIND_LOW32 (&last_call_info->ci_unwind.descriptor); fix_new_hppa (frag_now, where - frag_now->fr_literal, 0, NULL, (offsetT) 0, NULL, - 0, R_HPPA_ENTRY, e_fsel, 0, 0, - (int *) &last_call_info->ci_unwind.descriptor); + 0, R_HPPA_ENTRY, e_fsel, 0, 0, u); } #endif } +/* Silly nonsense for pa_equ. The only half-sensible use for this is + being able to subtract two register symbols that specify a range of + registers, to get the size of the range. */ +static int fudge_reg_expressions; + +int +hppa_force_reg_syms_absolute (resultP, op, rightP) + expressionS *resultP; + operatorT op ATTRIBUTE_UNUSED; + expressionS *rightP; +{ + if (fudge_reg_expressions + && rightP->X_op == O_register + && resultP->X_op == O_register) + { + rightP->X_op = O_constant; + resultP->X_op = O_constant; + } + return 0; /* Continue normal expr handling. */ +} + /* Handle a .EQU pseudo-op. */ static void @@ -6350,10 +6476,32 @@ pa_equ (reg) { symbol = label_symbol->lss_label; if (reg) - S_SET_VALUE (symbol, pa_parse_number (&input_line_pointer, 0)); + { + strict = 1; + if (!pa_parse_number (&input_line_pointer, 0)) + as_bad (_(".REG expression must be a register")); + S_SET_VALUE (symbol, pa_number); + S_SET_SEGMENT (symbol, reg_section); + } else - S_SET_VALUE (symbol, (unsigned int) get_absolute_expression ()); - S_SET_SEGMENT (symbol, bfd_abs_section_ptr); + { + expressionS exp; + segT seg; + + fudge_reg_expressions = 1; + seg = expression (&exp); + fudge_reg_expressions = 0; + if (exp.X_op != O_constant + && exp.X_op != O_register) + { + if (exp.X_op != O_absent) + as_bad (_("bad or irreducible absolute expression; zero assumed")); + exp.X_add_number = 0; + seg = absolute_section; + } + S_SET_VALUE (symbol, (unsigned int) exp.X_add_number); + S_SET_SEGMENT (symbol, seg); + } } else { @@ -6397,7 +6545,7 @@ process_exit () fix_new_hppa (frag_now, where - frag_now->fr_literal, 0, NULL, (offsetT) 0, NULL, 0, R_HPPA_EXIT, e_fsel, 0, 0, - (int *) &last_call_info->ci_unwind.descriptor + 1); + UNWIND_HIGH32 (&last_call_info->ci_unwind.descriptor)); #endif } @@ -6405,7 +6553,7 @@ process_exit () static void pa_exit (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -6438,7 +6586,7 @@ pa_exit (unused) static void pa_export (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { char *name, c, *p; symbolS *symbol; @@ -6455,8 +6603,13 @@ pa_export (unused) } else { - /* OK. Set the external bits and process argument relocations. */ + /* OK. Set the external bits and process argument relocations. + For the HP, weak and global are not mutually exclusive. + S_SET_EXTERNAL will not set BSF_GLOBAL if WEAK is set. + Call S_SET_EXTERNAL to get the other processing. Manually + set BSF_GLOBAL when we get back. */ S_SET_EXTERNAL (symbol); + symbol_get_bfdsym (symbol)->flags |= BSF_GLOBAL; p = input_line_pointer; *p = c; if (!is_end_of_statement ()) @@ -6479,13 +6632,13 @@ pa_type_args (symbolP, is_export) char *name, c, *p; unsigned int temp, arg_reloc; pa_symbol_type type = SYMBOL_TYPE_UNKNOWN; - obj_symbol_type *symbol = (obj_symbol_type *) symbol_get_bfdsym (symbolP); + asymbol *bfdsym = symbol_get_bfdsym (symbolP); if (strncasecmp (input_line_pointer, "absolute", 8) == 0) { input_line_pointer += 8; - symbol_get_bfdsym (symbolP)->flags &= ~BSF_FUNCTION; + bfdsym->flags &= ~BSF_FUNCTION; S_SET_SEGMENT (symbolP, bfd_abs_section_ptr); type = SYMBOL_TYPE_ABSOLUTE; } @@ -6504,50 +6657,58 @@ pa_type_args (symbolP, is_export) as_tsktsk (_("Using ENTRY rather than CODE in export directive for %s"), S_GET_NAME (symbolP)); - symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION; + bfdsym->flags |= BSF_FUNCTION; type = SYMBOL_TYPE_ENTRY; } else { - symbol_get_bfdsym (symbolP)->flags &= ~BSF_FUNCTION; + bfdsym->flags &= ~BSF_FUNCTION; type = SYMBOL_TYPE_CODE; } } else if (strncasecmp (input_line_pointer, "data", 4) == 0) { input_line_pointer += 4; - symbol_get_bfdsym (symbolP)->flags &= ~BSF_FUNCTION; - symbol_get_bfdsym (symbolP)->flags |= BSF_OBJECT; + bfdsym->flags &= ~BSF_FUNCTION; + bfdsym->flags |= BSF_OBJECT; type = SYMBOL_TYPE_DATA; } else if ((strncasecmp (input_line_pointer, "entry", 5) == 0)) { input_line_pointer += 5; - symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION; + bfdsym->flags |= BSF_FUNCTION; type = SYMBOL_TYPE_ENTRY; } else if (strncasecmp (input_line_pointer, "millicode", 9) == 0) { input_line_pointer += 9; - symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION; + bfdsym->flags |= BSF_FUNCTION; +#ifdef OBJ_ELF + { + elf_symbol_type *elfsym = (elf_symbol_type *) bfdsym; + elfsym->internal_elf_sym.st_info = + ELF_ST_INFO (ELF_ST_BIND (elfsym->internal_elf_sym.st_info), + STT_PARISC_MILLI); + } +#endif type = SYMBOL_TYPE_MILLICODE; } else if (strncasecmp (input_line_pointer, "plabel", 6) == 0) { input_line_pointer += 6; - symbol_get_bfdsym (symbolP)->flags &= ~BSF_FUNCTION; + bfdsym->flags &= ~BSF_FUNCTION; type = SYMBOL_TYPE_PLABEL; } else if (strncasecmp (input_line_pointer, "pri_prog", 8) == 0) { input_line_pointer += 8; - symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION; + bfdsym->flags |= BSF_FUNCTION; type = SYMBOL_TYPE_PRI_PROG; } else if (strncasecmp (input_line_pointer, "sec_prog", 8) == 0) { input_line_pointer += 8; - symbol_get_bfdsym (symbolP)->flags |= BSF_FUNCTION; + bfdsym->flags |= BSF_FUNCTION; type = SYMBOL_TYPE_SEC_PROG; } @@ -6555,7 +6716,7 @@ pa_type_args (symbolP, is_export) than BFD understands. This is how we get this information to the SOM BFD backend. */ #ifdef obj_set_symbol_type - obj_set_symbol_type (symbol_get_bfdsym (symbolP), (int) type); + obj_set_symbol_type (bfdsym, (int) type); #endif /* Now that the type of the exported symbol has been handled, @@ -6576,8 +6737,8 @@ pa_type_args (symbolP, is_export) name = input_line_pointer; c = get_symbol_end (); arg_reloc = pa_align_arg_reloc (temp, pa_build_arg_reloc (name)); -#ifdef OBJ_SOM - symbol->tc_data.ap.hppa_arg_reloc |= arg_reloc; +#if defined (OBJ_SOM) || defined (ELF_ARG_RELOC) + symbol_arg_reloc_info (symbolP) |= arg_reloc; #endif *input_line_pointer = c; } @@ -6590,8 +6751,8 @@ pa_type_args (symbolP, is_export) name = input_line_pointer; c = get_symbol_end (); arg_reloc = pa_build_arg_reloc (name); -#ifdef OBJ_SOM - symbol->tc_data.ap.hppa_arg_reloc |= arg_reloc; +#if defined (OBJ_SOM) || defined (ELF_ARG_RELOC) + symbol_arg_reloc_info (symbolP) |= arg_reloc; #endif *input_line_pointer = c; } @@ -6603,7 +6764,7 @@ pa_type_args (symbolP, is_export) input_line_pointer++; temp = atoi (input_line_pointer); #ifdef OBJ_SOM - symbol->tc_data.ap.hppa_priv_level = temp; + ((obj_symbol_type *) bfdsym)->tc_data.ap.hppa_priv_level = temp; #endif c = get_symbol_end (); *input_line_pointer = c; @@ -6625,7 +6786,7 @@ pa_type_args (symbolP, is_export) static void pa_import (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { char *name, c, *p; symbolS *symbol; @@ -6677,7 +6838,7 @@ pa_import (unused) static void pa_label (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { char *name, c, *p; @@ -6707,7 +6868,7 @@ pa_label (unused) static void pa_leave (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -6722,7 +6883,7 @@ pa_leave (unused) static void pa_level (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { char *level; @@ -6763,7 +6924,7 @@ pa_level (unused) static void pa_origin (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -6779,7 +6940,7 @@ pa_origin (unused) static void pa_param (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { char *name, c, *p; symbolS *symbol; @@ -6810,11 +6971,11 @@ pa_param (unused) } /* Handle a .PROC pseudo-op. It is used to mark the beginning - of a procedure from a syntatical point of view. */ + of a procedure from a syntactical point of view. */ static void pa_proc (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { struct call_info *call_info; @@ -6884,7 +7045,7 @@ pa_proc (unused) static void pa_procend (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { #ifdef OBJ_SOM @@ -6915,12 +7076,14 @@ pa_procend (unused) information when the label appears after the proc/procend. */ if (within_entry_exit) { - char *where = frag_more (0); + char *where; + unsigned int u; + where = frag_more (0); + u = UNWIND_LOW32 (&last_call_info->ci_unwind.descriptor); fix_new_hppa (frag_now, where - frag_now->fr_literal, 0, NULL, (offsetT) 0, NULL, - 0, R_HPPA_ENTRY, e_fsel, 0, 0, - (int *) &last_call_info->ci_unwind.descriptor); + 0, R_HPPA_ENTRY, e_fsel, 0, 0, u); } #endif } @@ -6951,6 +7114,7 @@ pa_procend (unused) pa_undefine_label (); } +#ifdef OBJ_SOM /* If VALUE is an exact power of two between zero and 2^31, then return log2 (VALUE). Else return -1. */ @@ -6969,8 +7133,6 @@ log2 (value) return shift; } - -#ifdef OBJ_SOM /* Check to make sure we have a valid space and subspace. */ static void @@ -6994,7 +7156,7 @@ pa_parse_space_stmt (space_name, create_flag) { char *name, *ptemp, c; char loadable, defined, private, sort; - int spnum, temp; + int spnum; asection *seg = NULL; sd_chain_struct *space; @@ -7028,10 +7190,11 @@ pa_parse_space_stmt (space_name, create_flag) /* First see if the space was specified as a number rather than as a name. According to the PA assembly manual the rest of the line should be ignored. */ - temp = pa_parse_number (&ptemp, 0); - if (temp >= 0) + strict = 0; + pa_parse_number (&ptemp, 0); + if (pa_number >= 0) { - spnum = temp; + spnum = pa_number; input_line_pointer = ptemp; } else @@ -7110,10 +7273,9 @@ pa_parse_space_stmt (space_name, create_flag) static void pa_space (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { char *name, c, *space_name, *save_s; - int temp; sd_chain_struct *sd_chain; if (within_procedure) @@ -7191,9 +7353,11 @@ pa_space (unused) /* It could be a space specified by number. */ print_errors = 0; save_s = input_line_pointer; - if ((temp = pa_parse_number (&input_line_pointer, 0)) >= 0) + strict = 0; + pa_parse_number (&input_line_pointer, 0); + if (pa_number >= 0) { - if ((sd_chain = pa_find_space_by_number (temp))) + if ((sd_chain = pa_find_space_by_number (pa_number))) { current_space = sd_chain; @@ -7229,7 +7393,7 @@ pa_space (unused) static void pa_spnum (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { char *name; char c; @@ -7478,7 +7642,6 @@ pa_subspace (create_new) SUBSPACE_DEFINED (current_subspace) = 1; } - /* Create default space and subspace dictionaries. */ static void @@ -7521,7 +7684,6 @@ pa_spaces_begin () /* Create the new section. */ segment = subseg_new (name, subsegment); - /* For SOM we want to replace the standard .text, .data, and .bss sections with our own. We also want to set BFD flags for all the built-in subspaces. */ @@ -7544,7 +7706,6 @@ pa_spaces_begin () | SEC_RELOC | SEC_HAS_CONTENTS)); - } else if (!strcmp (pa_def_subspaces[i].name, "$BSS$")) { @@ -7606,8 +7767,6 @@ pa_spaces_begin () } } - - /* Create a new space NAME, with the appropriate flags as defined by the given parameters. */ @@ -7972,11 +8131,6 @@ pa_stringer_aux (s) { unsigned int c = *s & CHAR_MASK; -#ifdef OBJ_SOM - /* We must have a valid space and subspace. */ - pa_check_current_space_and_subspace (); -#endif - switch (c) { case '\"': @@ -7999,9 +8153,14 @@ pa_stringer (append_zero) int i; /* Preprocess the string to handle PA-specific escape sequences. - For example, \xDD where DD is a hexidecimal number should be + For example, \xDD where DD is a hexadecimal number should be changed to \OOO where OOO is an octal number. */ +#ifdef OBJ_SOM + /* We must have a valid space and subspace. */ + pa_check_current_space_and_subspace (); +#endif + /* Skip the opening quote. */ s = input_line_pointer + 1; @@ -8020,7 +8179,7 @@ pa_stringer (append_zero) char dg; char *s_start = s; - /* Get pas the 'x'. */ + /* Get past the 'x'. */ s++; for (num_digit = 0, number = 0, dg = *s; num_digit < 2 @@ -8069,7 +8228,7 @@ pa_stringer (append_zero) static void pa_version (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { obj_version (0); pa_undefine_label (); @@ -8081,7 +8240,7 @@ pa_version (unused) static void pa_compiler (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { obj_som_compiler (0); pa_undefine_label (); @@ -8093,7 +8252,7 @@ pa_compiler (unused) static void pa_copyright (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { obj_copyright (0); pa_undefine_label (); @@ -8110,21 +8269,6 @@ pa_cons (nbytes) pa_undefine_label (); } -/* Switch to the data space. As usual delete our label. */ - -static void -pa_data (unused) - int unused; -{ -#ifdef OBJ_SOM - current_space = is_defined_space ("$PRIVATE$"); - current_subspace - = pa_subsegment_to_subspace (current_space->sd_seg, 0); -#endif - s_data (0); - pa_undefine_label (); -} - /* Like float_cons, but we need to undefine our label. */ static void @@ -8139,7 +8283,7 @@ pa_float_cons (float_type) static void pa_fill (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -8169,7 +8313,7 @@ pa_lcomm (needs_align) static void pa_lsym (unused) - int unused; + int unused ATTRIBUTE_UNUSED; { #ifdef OBJ_SOM /* We must have a valid space and subspace. */ @@ -8180,22 +8324,6 @@ pa_lsym (unused) pa_undefine_label (); } -/* Switch to the text space. Like s_text, but delete our - label when finished. */ -static void -pa_text (unused) - int unused; -{ -#ifdef OBJ_SOM - current_space = is_defined_space ("$TEXT$"); - current_subspace - = pa_subsegment_to_subspace (current_space->sd_seg, 0); -#endif - - s_text (0); - pa_undefine_label (); -} - /* On the PA relocations which involve function symbols must not be adjusted. This so that the linker can know when/how to create argument relocation stubs for indirect calls and calls to static functions. @@ -8233,6 +8361,17 @@ hppa_fix_adjustable (fixp) /* Reject reductions of symbols in 32bit relocs. */ if (fixp->fx_r_type == R_HPPA && hppa_fix->fx_r_format == 32) return 0; +#endif + +#ifdef OBJ_ELF + if (fixp->fx_r_type == (int) R_PARISC_GNU_VTINHERIT + || fixp->fx_r_type == (int) R_PARISC_GNU_VTENTRY) + return 0; +#endif + + if (fixp->fx_addsy && (S_IS_EXTERNAL (fixp->fx_addsy) + || S_IS_WEAK (fixp->fx_addsy))) + return 0; /* Reject reductions of symbols in sym1-sym2 expressions when the fixup will occur in a CODE subspace. @@ -8250,12 +8389,39 @@ hppa_fix_adjustable (fixp) } /* We can't adjust any relocs that use LR% and RR% field selectors. - That confuses the HP linker. */ + + If a symbol is reduced to a section symbol, the assembler will + adjust the addend unless the symbol happens to reside right at + the start of the section. Additionally, the linker has no choice + but to manipulate the addends when coalescing input sections for + "ld -r". Since an LR% field selector is defined to round the + addend, we can't change the addend without risking that a LR% and + it's corresponding (possible multiple) RR% field will no longer + sum to the right value. + + eg. Suppose we have + . ldil LR%foo+0,%r21 + . ldw RR%foo+0(%r21),%r26 + . ldw RR%foo+4(%r21),%r25 + + If foo is at address 4092 (decimal) in section `sect', then after + reducing to the section symbol we get + . LR%sect+4092 == (L%sect)+0 + . RR%sect+4092 == (R%sect)+4092 + . RR%sect+4096 == (R%sect)-4096 + and the last address loses because rounding the addend to 8k + mutiples takes us up to 8192 with an offset of -4096. + + In cases where the LR% expression is identical to the RR% one we + will never have a problem, but is so happens that gcc rounds + addends involved in LR% field selectors to work around a HP + linker bug. ie. We often have addresses like the last case + above where the LR% expression is offset from the RR% one. */ + if (hppa_fix->fx_r_field == e_lrsel || hppa_fix->fx_r_field == e_rrsel || hppa_fix->fx_r_field == e_nlrsel) return 0; -#endif /* Reject reductions of symbols in DLT relative relocs, relocations with plabels. */ @@ -8267,18 +8433,15 @@ hppa_fix_adjustable (fixp) || hppa_fix->fx_r_field == e_lpsel) return 0; - if (fixp->fx_addsy && S_IS_EXTERNAL (fixp->fx_addsy)) - return 0; - /* Reject absolute calls (jumps). */ if (hppa_fix->fx_r_type == R_HPPA_ABS_CALL) return 0; /* Reject reductions of function symbols. */ - if (fixp->fx_addsy == 0 || ! S_IS_FUNCTION (fixp->fx_addsy)) - return 1; + if (fixp->fx_addsy != 0 && S_IS_FUNCTION (fixp->fx_addsy)) + return 0; - return 0; + return 1; } /* Return nonzero if the fixup in FIXP will require a relocation, @@ -8287,46 +8450,61 @@ hppa_fix_adjustable (fixp) int hppa_force_relocation (fixp) - fixS *fixp; + struct fix *fixp; { struct hppa_fix_struct *hppa_fixp; - int distance; hppa_fixp = (struct hppa_fix_struct *) fixp->tc_fix_data; #ifdef OBJ_SOM - if (fixp->fx_r_type == R_HPPA_ENTRY || fixp->fx_r_type == R_HPPA_EXIT - || fixp->fx_r_type == R_HPPA_BEGIN_BRTAB - || fixp->fx_r_type == R_HPPA_END_BRTAB - || fixp->fx_r_type == R_HPPA_BEGIN_TRY - || fixp->fx_r_type == R_HPPA_END_TRY + if (fixp->fx_r_type == (int) R_HPPA_ENTRY + || fixp->fx_r_type == (int) R_HPPA_EXIT + || fixp->fx_r_type == (int) R_HPPA_BEGIN_BRTAB + || fixp->fx_r_type == (int) R_HPPA_END_BRTAB + || fixp->fx_r_type == (int) R_HPPA_BEGIN_TRY + || fixp->fx_r_type == (int) R_HPPA_END_TRY || (fixp->fx_addsy != NULL && fixp->fx_subsy != NULL && (hppa_fixp->segment->flags & SEC_CODE) != 0)) return 1; #endif - -#define arg_reloc_stub_needed(CALLER, CALLEE) \ - ((CALLEE) && (CALLER) && ((CALLEE) != (CALLER))) - -#ifdef OBJ_SOM - /* It is necessary to force PC-relative calls/jumps to have a relocation - entry if they're going to need either a argument relocation or long - call stub. FIXME. Can't we need the same for absolute calls? */ - if (fixp->fx_pcrel && fixp->fx_addsy - && (arg_reloc_stub_needed ((long) ((obj_symbol_type *) - symbol_get_bfdsym (fixp->fx_addsy))->tc_data.ap.hppa_arg_reloc, - hppa_fixp->fx_arg_reloc))) +#ifdef OBJ_ELF + if (fixp->fx_r_type == (int) R_PARISC_GNU_VTINHERIT + || fixp->fx_r_type == (int) R_PARISC_GNU_VTENTRY) return 1; #endif - distance = (fixp->fx_offset + S_GET_VALUE (fixp->fx_addsy) - - md_pcrel_from (fixp)); - /* Now check and see if we're going to need a long-branch stub. */ - if (fixp->fx_r_type == R_HPPA_PCREL_CALL - && (distance > 262143 || distance < -262144)) + + assert (fixp->fx_addsy != NULL); + + /* Ensure we emit a relocation for global symbols so that dynamic + linking works. */ + if (S_IS_EXTERNAL (fixp->fx_addsy) || S_IS_WEAK (fixp->fx_addsy)) return 1; - if (fixp->fx_r_type == R_HPPA_ABS_CALL) + /* It is necessary to force PC-relative calls/jumps to have a relocation + entry if they're going to need either a argument relocation or long + call stub. */ + if (fixp->fx_pcrel + && arg_reloc_stub_needed (symbol_arg_reloc_info (fixp->fx_addsy), + hppa_fixp->fx_arg_reloc)) + return 1; + + /* Now check to see if we're going to need a long-branch stub. */ + if (fixp->fx_r_type == (int) R_HPPA_PCREL_CALL) + { + valueT distance; + + distance = (fixp->fx_offset + S_GET_VALUE (fixp->fx_addsy) + - md_pcrel_from (fixp) - 8); + if (distance + 8388608 >= 16777216 + || (hppa_fixp->fx_r_format == 17 && distance + 262144 >= 524288) +#ifdef OBJ_ELF + || (hppa_fixp->fx_r_format == 12 && distance + 8192 >= 16384) +#endif + ) + return 1; + } + + if (fixp->fx_r_type == (int) R_HPPA_ABS_CALL) return 1; -#undef arg_reloc_stub_needed /* No need (yet) to force another relocations to be emitted. */ return 0; @@ -8342,10 +8520,18 @@ hppa_elf_mark_end_of_function () { /* ELF does not have EXIT relocations. All we do is create a temporary symbol marking the end of the function. */ - char *name = (char *) - xmalloc (strlen ("L$\001end_") + - strlen (S_GET_NAME (last_call_info->start_symbol)) + 1); + char *name; + if (last_call_info == NULL || last_call_info->start_symbol == NULL) + { + /* We have already warned about a missing label, + or other problems. */ + return; + } + + name = (char *) xmalloc (strlen ("L$\001end_") + + strlen (S_GET_NAME (last_call_info->start_symbol)) + + 1); if (name) { symbolS *symbolP; @@ -8410,12 +8596,48 @@ elf_hppa_final_processing () - S_GET_VALUE (call_info_pointer->start_symbol) + 4; } } -#endif -#ifdef OBJ_ELF -pa_end_of_source () +static void +pa_vtable_entry (ignore) + int ignore ATTRIBUTE_UNUSED; { - if (debug_type == DEBUG_DWARF2) - dwarf2_finish (); + struct fix *new_fix; + + new_fix = obj_elf_vtable_entry (0); + + if (new_fix) + { + struct hppa_fix_struct *hppa_fix = (struct hppa_fix_struct *) + obstack_alloc (¬es, sizeof (struct hppa_fix_struct)); + hppa_fix->fx_r_type = R_HPPA; + hppa_fix->fx_r_field = e_fsel; + hppa_fix->fx_r_format = 32; + hppa_fix->fx_arg_reloc = 0; + hppa_fix->segment = now_seg; + new_fix->tc_fix_data = (void *) hppa_fix; + new_fix->fx_r_type = (int) R_PARISC_GNU_VTENTRY; + } +} + +static void +pa_vtable_inherit (ignore) + int ignore ATTRIBUTE_UNUSED; +{ + struct fix *new_fix; + + new_fix = obj_elf_vtable_inherit (0); + + if (new_fix) + { + struct hppa_fix_struct *hppa_fix = (struct hppa_fix_struct *) + obstack_alloc (¬es, sizeof (struct hppa_fix_struct)); + hppa_fix->fx_r_type = R_HPPA; + hppa_fix->fx_r_field = e_fsel; + hppa_fix->fx_r_format = 32; + hppa_fix->fx_arg_reloc = 0; + hppa_fix->segment = now_seg; + new_fix->tc_fix_data = (void *) hppa_fix; + new_fix->fx_r_type = (int) R_PARISC_GNU_VTINHERIT; + } } #endif diff --git a/gnu/dist/toolchain/gas/config/tc-hppa.h b/gnu/dist/toolchain/gas/config/tc-hppa.h index 266c8caac654..013540c3f6da 100644 --- a/gnu/dist/toolchain/gas/config/tc-hppa.h +++ b/gnu/dist/toolchain/gas/config/tc-hppa.h @@ -1,5 +1,5 @@ /* tc-hppa.h -- Header file for the PA - Copyright (C) 1989, 93, 94, 95, 96, 97, 98, 99, 2000 + Copyright 1989, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -19,7 +19,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - /* HP PA-RISC support was contributed by the Center for Software Science at the University of Utah. */ @@ -28,7 +27,7 @@ (please PARAMize them!) not exporting structures and data items which are used solely within tc-hppa.c, etc. - Also refrain from adding any more object file dependent code, there is + Also refrain from adding any more object file dependent code, there is already far too much object file format dependent code in this file. In theory this file should contain only exported functions, structures and data declarations common to all PA assemblers. */ @@ -46,23 +45,38 @@ #define WORKING_DOT_WORD -/* FIXME. The lack of a place to put things which are both target cpu - and target format dependent makes hacks like this necessary. */ #ifdef OBJ_ELF -#ifdef BFD64 +#if TARGET_ARCH_SIZE == 64 #include "bfd/elf64-hppa.h" -#define TARGET_FORMAT "elf64-hppa" +#ifdef TE_LINUX +#define TARGET_FORMAT "elf64-hppa-linux" #else +#define TARGET_FORMAT "elf64-hppa" +#endif +#else /* TARGET_ARCH_SIZE == 32 */ #include "bfd/elf32-hppa.h" +#ifdef TE_LINUX +#define TARGET_FORMAT "elf32-hppa-linux" +#else #define TARGET_FORMAT "elf32-hppa" #endif #endif +#endif #ifdef OBJ_SOM #include "bfd/som.h" #define TARGET_FORMAT "som" #endif +#ifdef TE_LINUX +/* Define to compile in an extra assembler option, -c, which enables a + warning (once per file) when a comment is encountered. + The hppa comment char is a `;' which tends to occur in random C asm + statements. A semicolon is a line separator for most assemblers. + It's hard to find these lurking semicolons. Thus... */ +#define WARN_COMMENTS 1 +#endif + /* FIXME. Why oh why aren't these defined somewhere globally? */ #ifndef FALSE #define FALSE (0) @@ -71,18 +85,12 @@ #define ASEC_NULL (asection *)0 -/* Labels are not required to have a colon for a suffix. */ -#define LABELS_WITHOUT_COLONS 1 +/* pa_define_label gets used outside of tc-hppa.c via tc_frob_label. */ +extern void pa_define_label PARAMS ((symbolS *)); -/* FIXME. This should be static and declared in tc-hppa.c, but - pa_define_label gets used outside of tc-hppa.c via tc_frob_label. - Should also be PARAMized, but symbolS isn't available here. */ -extern void pa_define_label (); - -/* FIXME. Types not available here, so they can't be PARAMized. */ -extern void parse_cons_expression_hppa (); -extern void cons_fix_new_hppa (); -extern int hppa_force_relocation (); +extern void parse_cons_expression_hppa PARAMS ((expressionS *)); +extern void cons_fix_new_hppa PARAMS ((fragS *, int, int, expressionS *)); +extern int hppa_force_relocation PARAMS ((struct fix *)); /* This gets called before writing the object file to make sure things like entry/exit and proc/procend pairs match. */ @@ -98,13 +106,6 @@ extern void pa_check_eof PARAMS ((void)); #define RELOC_EXPANSION_POSSIBLE #define MAX_RELOC_EXPANSION 6 -/* FIXME. More things which are both HPPA and ELF specific. There is - nowhere to put such things. */ -#ifdef OBJ_ELF -#define elf_tc_final_processing elf_hppa_final_processing -void elf_hppa_final_processing PARAMS ((void)); -#endif - /* The PA needs to parse field selectors in .byte, etc. */ #define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) \ @@ -122,6 +123,7 @@ void elf_hppa_final_processing PARAMS ((void)); it will always follow a comma. */ #define TC_EOL_IN_INSN(PTR) (*(PTR) == '!' && (PTR)[-1] == ',') +int hppa_fix_adjustable PARAMS((struct fix *)); #define tc_fix_adjustable hppa_fix_adjustable /* Because of the strange PA calling conventions, it is sometimes @@ -141,7 +143,7 @@ void elf_hppa_final_processing PARAMS ((void)); /* We need to be able to make relocations involving the difference of two symbols. This includes the difference of two symbols when - one of them is undefined (this comes up in PIC code generation). + one of them is undefined (this comes up in PIC code generation). We don't define DIFF_EXPR_OK because it does the wrong thing if the add symbol is undefined and the sub symbol is a symbol in @@ -151,20 +153,45 @@ void elf_hppa_final_processing PARAMS ((void)); #endif #ifdef OBJ_ELF +/* It's OK to subtract two symbols in the same section without + emitting a relocation. */ +#define TC_FORCE_RELOCATION_SECTION(FIXP, SEC) 0 + +/* Handle .type psuedo. Given a type string of `millicode', set the + internal elf symbol type to STT_PARISC_MILLI, and return + BSF_FUNCTION for the BFD symbol type. */ +#define md_elf_symbol_type(name, sym, elf) \ + ((strcmp ((name), "millicode") == 0 \ + || strcmp ((name), "STT_PARISC_MILLI") == 0) \ + ? (((elf)->internal_elf_sym.st_info = ELF_ST_INFO \ + (ELF_ST_BIND ((elf)->internal_elf_sym.st_info), STT_PARISC_MILLI)\ + ), BSF_FUNCTION) \ + : -1) + #define tc_frob_symbol(sym,punt) \ { \ if ((S_GET_SEGMENT (sym) == &bfd_und_section && ! symbol_used_p (sym)) \ || (S_GET_SEGMENT (sym) == &bfd_abs_section \ && ! S_IS_EXTERNAL (sym)) \ - || strcmp (S_GET_NAME (sym), "$global$") == 0) \ + || strcmp (S_GET_NAME (sym), "$global$") == 0 \ + || strcmp (S_GET_NAME (sym), "$PIC_pcrel$0") == 0) \ punt = 1; \ } -#endif + +#define elf_tc_final_processing elf_hppa_final_processing +void elf_hppa_final_processing PARAMS ((void)); + +#define DWARF2_LINE_MIN_INSN_LENGTH 4 +#endif /* OBJ_ELF */ #define md_operand(x) -#ifdef OBJ_ELF -#define md_end() pa_end_of_source () -#endif + +/* Allow register expressions to be treated as absolute expressions. + A silly fudge required for backwards compatibility. */ +#define md_optimize_expr hppa_force_reg_syms_absolute + +int hppa_force_reg_syms_absolute + PARAMS ((expressionS *, operatorT, expressionS *)); #define TC_FIX_TYPE PTR #define TC_INIT_FIX_DATA(FIXP) ((FIXP)->tc_fix_data = NULL) diff --git a/gnu/dist/toolchain/gas/config/tc-i370.c b/gnu/dist/toolchain/gas/config/tc-i370.c index 2183273bcc3f..de9fce785bd0 100644 --- a/gnu/dist/toolchain/gas/config/tc-i370.c +++ b/gnu/dist/toolchain/gas/config/tc-i370.c @@ -18,7 +18,7 @@ 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. */ + 02111-1307, USA. */ /* This assembler implements a very hacked version of an elf-like thing * that gcc emits (when gcc is suitably hacked). To make it behave more @@ -75,18 +75,17 @@ const char EXP_CHARS[] = "eE"; as in 0d1.0. */ const char FLT_CHARS[] = "dD"; - void md_show_usage (stream) FILE *stream; { - fprintf(stream, "\ + fprintf (stream, "\ S/370 options: (these have not yet been tested and may not work) \n\ -u ignored\n\ -mregnames Allow symbolic names for registers\n\ -mno-regnames Do not allow symbolic names for registers\n"); #ifdef OBJ_ELF - fprintf(stream, "\ + fprintf (stream, "\ -mrelocatable support for GCC's -mrelocatble option\n\ -mrelocatable-lib support for GCC's -mrelocatble-lib option\n\ -V print assembler version number\n"); @@ -116,7 +115,6 @@ static void i370_elf_lcomm PARAMS ((int)); static void i370_elf_validate_fix PARAMS ((fixS *, segT)); #endif - /* The target specific pseudo-ops which we support. */ @@ -186,7 +184,6 @@ struct pd_reg 1. r which has the value . 2. r. which has the value . - Each floating point register has predefined names of the form: 1. f which has the value . 2. f. which has the value . @@ -194,7 +191,6 @@ struct pd_reg There are only four floating point registers, and these are commonly labelled 0,2,4 and 6. Thus, there is no f1, f3, etc. - There are individual registers as well: rbase or r.base has the value 3 (base register) rpgt or r.pgt has the value 4 (page origin table pointer) @@ -205,7 +201,7 @@ struct pd_reg dsa or r.dsa has the value 13 (stack pointer) lr has the value 14 (link reg) - The table is sorted. Suitable for searching by a binary search. */ + The table is sorted. Suitable for searching by a binary search. */ static const struct pd_reg pre_defined_registers[] = { @@ -222,7 +218,6 @@ static const struct pd_reg pre_defined_registers[] = { "f4", 4 }, { "f6", 6 }, - { "dsa",13 }, /* stack pointer */ { "lr", 14 }, /* Link Register */ { "pgt", 4 }, /* Page Origin Table Pointer */ @@ -279,7 +274,7 @@ static const struct pd_reg pre_defined_registers[] = }; -#define REG_NAME_CNT (sizeof(pre_defined_registers) / sizeof(struct pd_reg)) +#define REG_NAME_CNT (sizeof (pre_defined_registers) / sizeof (struct pd_reg)) /* Given NAME, find the register number associated with that name, return the integer value associated with the given name or -1 on failure. */ @@ -442,7 +437,7 @@ struct option md_longopts[] = { {NULL, no_argument, NULL, 0} }; -size_t md_longopts_size = sizeof(md_longopts); +size_t md_longopts_size = sizeof (md_longopts); int md_parse_option (c, arg) @@ -533,7 +528,7 @@ md_parse_option (c, arg) /* Set i370_cpu if it is not already set. Currently defaults to the reasonable superset; - but can be made more fine grained if desred. */ + but can be made more fine grained if desred. */ static void i370_set_cpu () @@ -541,7 +536,7 @@ i370_set_cpu () const char *default_os = TARGET_OS; const char *default_cpu = TARGET_CPU; - /* override with the superset for the moment. */ + /* override with the superset for the moment. */ i370_cpu = I370_OPCODE_ESA390_SUPERSET; if (i370_cpu == 0) { @@ -557,7 +552,7 @@ i370_set_cpu () } /* Figure out the BFD architecture to use. */ -// hack alert -- specify the different 370 architectures +/* hack alert -- specify the different 370 architectures */ enum bfd_architecture i370_arch () @@ -581,7 +576,7 @@ md_begin () i370_set_cpu (); #ifdef OBJ_ELF - /* Set the ELF flags if desired. */ + /* Set the ELF flags if desired. */ if (i370_flags) bfd_set_private_flags (stdoutput, i370_flags); #endif @@ -661,14 +656,13 @@ i370_insert_operand (insn, operand, val) #ifdef OBJ_ELF /* Parse @got, etc. and return the desired relocation. - * Currently, i370 does not support (don't really need to support) any - * of these fancier markups ... for example, no one is going to - * write 'L 6,=V(bogus)@got' it just doesn't make sense (at least to me). - * So basically, we could get away with this routine returning - * BFD_RELOC_UNUSED in all circumstances. However, I'll leave - * in for now in case someone ambitious finds a good use for this stuff ... - * this routine was pretty much just copied from the powerpc code ... - */ + Currently, i370 does not support (don't really need to support) any + of these fancier markups ... for example, no one is going to + write 'L 6,=V(bogus)@got' it just doesn't make sense (at least to me). + So basically, we could get away with this routine returning + BFD_RELOC_UNUSED in all circumstances. However, I'll leave + in for now in case someone ambitious finds a good use for this stuff ... + this routine was pretty much just copied from the powerpc code ... */ static bfd_reloc_code_real_type i370_elf_suffix (str_p, exp_p) char **str_p; @@ -688,15 +682,18 @@ i370_elf_suffix (str_p, exp_p) int len; struct map_bfd *ptr; -#define MAP(str,reloc) { str, sizeof(str)-1, reloc } +#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 ("fixup", BFD_RELOC_CTOR), /* warnings with -mrelocatable */ - { (char *)0, 0, BFD_RELOC_UNUSED } +#if 0 + MAP ("l", BFD_RELOC_LO16), + MAP ("h", BFD_RELOC_HI16), + MAP ("ha", BFD_RELOC_HI16_S), +#endif + /* warnings with -mrelocatable. */ + MAP ("fixup", BFD_RELOC_CTOR), + { (char *)0, 0, BFD_RELOC_UNUSED } }; if (*str++ != '@') @@ -751,8 +748,8 @@ i370_elf_suffix (str_p, exp_p) 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 i370_elf_cons (nbytes) register int nbytes; /* 1=.byte, 2=.word, 4=.long */ @@ -792,7 +789,7 @@ i370_elf_cons (nbytes) } while (*input_line_pointer++ == ','); - input_line_pointer--; /* Put terminator back into stream. */ + input_line_pointer--; /* Put terminator back into stream. */ demand_empty_rest_of_line (); } @@ -945,7 +942,7 @@ i370_ebcdic (unused) p = frag_more (nbytes); while (end > input_line_pointer) { - *p = ascebc [(unsigned char)(*input_line_pointer)]; + *p = ascebc [(unsigned char) (*input_line_pointer)]; ++p; ++input_line_pointer; } *p = '\0'; @@ -1273,11 +1270,10 @@ i370_elf_validate_fix (fixp, seg) } #endif /* OBJ_ELF */ - #define LITERAL_POOL_SUPPORT #ifdef LITERAL_POOL_SUPPORT -/* Provide support for literal pools within the text section. */ +/* Provide support for literal pools within the text section. */ /* Loosely based on similar code from tc-arm.c */ /* * We will use four symbols to locate four parts of the literal pool. @@ -1528,7 +1524,7 @@ i370_addr_offset (expressionS *exx) expression (exx); /* OK, now we have to subtract the "using" location */ - /* normally branches appear in the text section only... */ + /* normally branches appear in the text section only... */ if (0 == strncmp (now_seg->name, ".text", 5) || 0 > i370_using_other_regno) { i370_make_relative (exx, &i370_using_text_baseaddr); @@ -1755,7 +1751,6 @@ i370_ltorg (ignore) else as_bad ("bad alignment of %d bytes in literal pool", biggest_literal_size); if (0 == biggest_align) biggest_align = 1; - /* Align pool for short, word, double word accesses */ frag_align (biggest_align, 0, 0); record_alignment (now_seg, biggest_align); @@ -1763,7 +1758,7 @@ i370_ltorg (ignore) /* Note that the gas listing will print only the first five * entries in the pool .... wonder how to make it print more ... */ - /* output largest literals first, then the smaller ones. */ + /* output largest literals first, then the smaller ones. */ for (litsize=8; litsize; litsize /=2) { symbolS *current_poolP = NULL; @@ -1841,13 +1836,13 @@ i370_using (ignore) char *star; /* if "*" appears in a using, it means "." */ - /* replace it with "." so that expr doesn't get confused. */ + /* replace it with "." so that expr doesn't get confused. */ star = strchr (input_line_pointer, '*'); if (star) *star = '.'; /* the first arg to using will usually be ".", but it can - * be a more complex exprsssion too ... */ + * be a more complex exprsssion too ... */ expression (&baseaddr); if (star) *star = '*'; @@ -2171,7 +2166,7 @@ md_assemble (str) hold = input_line_pointer; input_line_pointer = str; - /* register names are only allowed where there are registers ... */ + /* register names are only allowed where there are registers ... */ if ((operand->flags & I370_OPERAND_GPR) != 0) { /* quickie hack to get past things like (,r13) */ @@ -2189,7 +2184,7 @@ md_assemble (str) /* check for a address constant expression */ /* We will put PSW-relative addresses in the text section, - * and adress literals in the .data (or other) section. */ + * and adress literals in the .data (or other) section. */ else if (i370_addr_cons (&ex)) use_other=1; else if (i370_addr_offset (&ex)) @@ -2224,7 +2219,7 @@ md_assemble (str) /* Allow @HA, @L, @H on constants. * Well actually, no we don't; there really don't make sense * (at least not to me) for the i370. However, this code is - * left here for any dubious future expansion reasons ... */ + * left here for any dubious future expansion reasons ... */ char *orig_str = str; if ((reloc = i370_elf_suffix (&str, &ex)) != BFD_RELOC_UNUSED) @@ -2343,7 +2338,7 @@ md_assemble (str) size = bfd_get_reloc_size (reloc_howto); if (size < 1 || size > 4) - abort(); + abort (); printf (" gwana doo fixup %d \n", i); fixP = fix_new_exp (frag_now, f - frag_now->fr_literal, size, @@ -2585,8 +2580,8 @@ i370_tc (ignore) } /* Turn a string in input_line_pointer into a floating point constant - of type type, and store the appropriate bytes in *litp. The number - of LITTLENUMS emitted is stored in *sizep . An error message is + of type TYPE, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. An error message is returned, or NULL on OK. */ char * @@ -2620,7 +2615,7 @@ md_atof (type, litp, sizep) } /* 360/370/390 have two float formats: an old, funky 360 single-precision - * format, and the ieee format. Support only the ieee format. */ + * format, and the ieee format. Support only the ieee format. */ t = atof_ieee (input_line_pointer, type, words); if (t) input_line_pointer = t; @@ -2684,7 +2679,6 @@ md_convert_frag (abfd, sec, fragp) /* We have no need to default values of symbols. */ -/*ARGSUSED*/ symbolS * md_undefined_symbol (name) char *name; @@ -2705,7 +2699,6 @@ md_pcrel_from_section (fixp, sec) return fixp->fx_frag->fr_address + fixp->fx_where; } - /* Apply a fixup to the object code. This is called for all the fixups we generated by the call to fix_new_exp, above. In the call above we used a reloc code which was the largest legal reloc code @@ -2797,7 +2790,7 @@ md_apply_fix3 (fixp, valuep, seg) #endif /* Fetch the instruction, insert the fully resolved operand value, and stuff the instruction back again. - fisxp->fx_size is the length of the instruction. */ + fisxp->fx_size is the length of the instruction. */ where = fixp->fx_frag->fr_literal + fixp->fx_where; insn.i[0] = bfd_getb32 ((unsigned char *) where); if (6 <= fixp->fx_size) @@ -2824,7 +2817,7 @@ md_apply_fix3 (fixp, valuep, seg) relocs. In fact, we support *zero* operand relocations ... Why? Because we are not expecting the compiler to generate any operands that need relocation. Due to the 12-bit naturew of - i370 addressing, this would be unusual. */ + i370 addressing, this would be unusual. */ #if 0 if ((operand->flags & I370_OPERAND_RELATIVE) != 0 && operand->bits == 12 @@ -2921,7 +2914,7 @@ md_apply_fix3 (fixp, valuep, seg) break; default: - fprintf(stderr, + fprintf (stderr, "Gas failure, reloc value %d\n", fixp->fx_r_type); fflush(stderr); abort (); diff --git a/gnu/dist/toolchain/gas/config/tc-i370.h b/gnu/dist/toolchain/gas/config/tc-i370.h index 8f32fa8b510e..4b0586327eae 100644 --- a/gnu/dist/toolchain/gas/config/tc-i370.h +++ b/gnu/dist/toolchain/gas/config/tc-i370.h @@ -17,7 +17,7 @@ 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. */ + 02111-1307, USA. */ #define TC_I370 diff --git a/gnu/dist/toolchain/gas/config/tc-i860.c b/gnu/dist/toolchain/gas/config/tc-i860.c index 3317282ba425..5454a76e1597 100644 --- a/gnu/dist/toolchain/gas/config/tc-i860.c +++ b/gnu/dist/toolchain/gas/config/tc-i860.c @@ -1,5 +1,9 @@ -/* tc-i860.c -- Assemble for the I860 - Copyright (C) 1989, 92, 93, 94, 95, 98, 1999 Free Software Foundation, Inc. +/* tc-i860.c -- Assembler for the Intel i860 architecture. + Copyright (C) 1989, 1992, 1993, 1994, 1995, 1998, 1999, 2000 + Free Software Foundation, Inc. + + Brought back from the dead and completely reworked + by Jason Eckhardt . This file is part of GAS, the GNU Assembler. @@ -17,124 +21,117 @@ with GAS; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include +#include +#include #include "as.h" - +#include "subsegs.h" #include "opcode/i860.h" +#include "elf/i860.h" -void md_begin (); -void md_number_to_chars (); -void md_assemble (); -char *md_atof (); -void md_convert_frag (); -int md_estimate_size_before_relax (); -void md_number_to_imm (); -void md_number_to_disp (); -void md_number_to_field (); -void md_ri_to_chars (); -static void i860_ip (); -/* void emit_machine_reloc(); */ +/* Defined by default since this is primarily a SVR4/860 assembler. + However, I'm trying to leave the door open for Intel syntax. Of course, + if full support for anything other than SVR4 is done, then we should + select this based on a command-line flag. */ +#define SYNTAX_SVR4 -const int md_reloc_size = sizeof (struct relocation_info); - -/* void (*md_emit_relocations)() = emit_machine_reloc; */ - -/* handle of the OPCODE hash table */ +/* The opcode hash table. */ static struct hash_control *op_hash = NULL; -static void s_dual (), s_enddual (); -static void s_atmp (); +/* These characters always start a comment. */ +const char comment_chars[] = "#!/"; -const pseudo_typeS - md_pseudo_table[] = -{ - {"dual", s_dual, 4}, - {"enddual", s_enddual, 4}, - {"atmp", s_atmp, 4}, - {NULL, 0, 0}, -}; - -/* This array holds the chars that always start a comment. If the - pre-processor is disabled, these aren't very useful */ -const char comment_chars[] = "!/"; /* JF removed '|' from comment_chars */ - -/* This array holds the chars that only start a comment at the beginning of - a line. If the line seems to have the form '# 123 filename' - .line and .file directives will appear in the pre-processed output */ -/* Note that input_file.c hand checks for '#' at the beginning of the - first line of the input file. This is because the compiler outputs - #NO_APP at the beginning of its output. */ -/* Also note that comments like this one will always work. */ +/* These characters start a comment at the beginning of a line. */ 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 nums */ +/* Characters that can be used to separate the mantissa from the exponent + in floating point numbers. */ const char EXP_CHARS[] = "eE"; -/* Chars that mean this number is a floating point constant */ -/* As in 0f12.456 */ -/* or 0d1.2345e12 */ +/* Characters that indicate this number is a floating point constant. + As in 0f12.456 or 0d1.2345e12. */ const char FLT_CHARS[] = "rRsSfFdDxXpP"; -/* Also be aware that MAXIMUM_NUMBER_OF_CHARS_FOR_FLOAT may have to be - changed in read.c . Ideally it shouldn't have to know about it at all, - but nothing is ideal around here. - */ -int size_reloc_info = sizeof (struct relocation_info); - -static unsigned char octal[256]; -#define isoctal(c) octal[c] -static unsigned char toHex[256]; +/* Register prefix. */ +#ifdef SYNTAX_SVR4 +static const char reg_prefix = '%'; +#else +static const char reg_prefix = 0; +#endif struct i860_it - { - char *error; - unsigned long opcode; - struct nlist *nlistp; - expressionS exp; - int pcrel; - enum expand_type expand; - enum highlow_type highlow; - enum reloc_type reloc; - } the_insn; - -#if __STDC__ == 1 - -static void print_insn (struct i860_it *insn); -static int getExpression (char *str); - -#else /* not __STDC__ */ - -static void print_insn (); -static int getExpression (); - -#endif /* not __STDC__ */ +{ + char *error; + unsigned long opcode; + expressionS exp; + enum expand_type expand; + bfd_reloc_code_real_type reloc; + int pcrel; + valueT fup; +} the_insn; static char *expr_end; -static char last_expand; /* error if expansion after branch */ +/* Indicates error if a pseudo operation was expanded after a branch. */ +static char last_expand; + +/* If true, then warn if any pseudo operations were expanded. */ +static int target_warn_expand = 0; + +/* Prototypes. */ +static void i860_process_insn PARAMS ((char *)); +static void s_dual PARAMS ((int)); +static void s_enddual PARAMS ((int)); +static void s_atmp PARAMS ((int)); +static int i860_get_expression PARAMS ((char *)); +static bfd_reloc_code_real_type obtain_reloc_for_imm16 + PARAMS ((fixS *, long *)); +#ifdef DEBUG_I860 +static void print_insn PARAMS ((struct i860_it *)); +#endif + +const pseudo_typeS md_pseudo_table[] = +{ +#ifdef OBJ_ELF + {"align", s_align_bytes, 0}, +#endif + {"dual", s_dual, 0}, + {"enddual", s_enddual, 0}, + {"atmp", s_atmp, 0}, + {NULL, 0, 0}, +}; + +/* Dual-instruction mode handling. */ enum dual { DUAL_OFF = 0, DUAL_ON, DUAL_DDOT, DUAL_ONDDOT, }; -static enum dual dual_mode = DUAL_OFF; /* dual-instruction mode */ +static enum dual dual_mode = DUAL_OFF; +/* Handle ".dual" directive. */ static void -s_dual () /* floating point instructions have dual set */ +s_dual (ignore) + int ignore ATTRIBUTE_UNUSED; { dual_mode = DUAL_ON; } +/* Handle ".enddual" directive. */ static void -s_enddual () /* floating point instructions have dual set */ +s_enddual (ignore) + int ignore ATTRIBUTE_UNUSED; { dual_mode = DUAL_OFF; } -static int atmp = 31; /* temporary register for pseudo's */ +/* Temporary register used when expanding assembler pseudo operations. */ +static int atmp = 31; static void -s_atmp () +s_atmp (ignore) + int ignore ATTRIBUTE_UNUSED; { register int temp; if (strncmp (input_line_pointer, "sp", 2) == 0) @@ -164,20 +161,21 @@ s_atmp () } /* This function is called once, at assembler startup time. It should - set up all the tables, etc. that the MD part of the assembler will need. */ + set up all the tables and data structures that the MD part of the + assembler will need. */ void md_begin () { - register char *retval = NULL; + const char *retval = NULL; int lose = 0; - register unsigned int i = 0; + unsigned int i = 0; op_hash = hash_new (); - while (i < NUMOPCODES) + while (i860_opcodes[i].name != NULL) { const char *name = i860_opcodes[i].name; - retval = hash_insert (op_hash, name, &i860_opcodes[i]); + retval = hash_insert (op_hash, name, (PTR)&i860_opcodes[i]); if (retval != NULL) { fprintf (stderr, _("internal error: can't hash `%s': %s\n"), @@ -188,44 +186,43 @@ md_begin () { if (i860_opcodes[i].match & i860_opcodes[i].lose) { - fprintf (stderr, _("internal error: losing opcode: `%s' \"%s\"\n"), + fprintf (stderr, + _("internal error: losing opcode: `%s' \"%s\"\n"), i860_opcodes[i].name, i860_opcodes[i].args); lose = 1; } ++i; } - while (i < NUMOPCODES - && !strcmp (i860_opcodes[i].name, name)); + while (i860_opcodes[i].name != NULL + && strcmp (i860_opcodes[i].name, name) == 0); } if (lose) - as_fatal (_("Broken assembler. No assembly attempted.")); - - for (i = '0'; i < '8'; ++i) - octal[i] = 1; - for (i = '0'; i <= '9'; ++i) - toHex[i] = i - '0'; - for (i = 'a'; i <= 'f'; ++i) - toHex[i] = i + 10 - 'a'; - for (i = 'A'; i <= 'F'; ++i) - toHex[i] = i + 10 - 'A'; + as_fatal (_("Defective assembler. No assembly attempted.")); } +/* This is the core of the machine-dependent assembler. STR points to a + machine dependent instruction. This function emits the frags/bytes + it assembles to. */ void md_assemble (str) char *str; { - char *toP; - int rsd; - int no_opcodes = 1; + char *destp; + int num_opcodes = 1; int i; struct i860_it pseudo[3]; assert (str); - i860_ip (str); - /* check for expandable flag to produce pseudo-instructions */ - if (the_insn.expand != 0 && the_insn.highlow == NO_SPEC) + /* Assemble the instruction. */ + i860_process_insn (str); + + /* Check for expandable flag to produce pseudo-instructions. This + is an undesirable feature that should be avoided. */ + if (the_insn.expand != 0 + && ! (the_insn.fup & (OP_SEL_HA | OP_SEL_H | OP_SEL_L | OP_SEL_GOT + | OP_SEL_GOTOFF | OP_SEL_PLT))) { for (i = 0; i < 3; i++) pseudo[i] = the_insn; @@ -234,101 +231,109 @@ md_assemble (str) { case E_DELAY: - no_opcodes = 1; + num_opcodes = 1; break; case E_MOV: - if (the_insn.exp.X_add_symbol == NULL && - the_insn.exp.X_op_symbol == NULL && - (the_insn.exp.X_add_number < (1 << 15) && - the_insn.exp.X_add_number >= -(1 << 15))) + if (the_insn.exp.X_add_symbol == NULL + && the_insn.exp.X_op_symbol == NULL + && (the_insn.exp.X_add_number < (1 << 15) + && the_insn.exp.X_add_number >= -(1 << 15))) break; - /* or l%const,r0,ireg_dest */ + + /* Emit "or l%const,r0,ireg_dest". */ pseudo[0].opcode = (the_insn.opcode & 0x001f0000) | 0xe4000000; - pseudo[0].highlow = PAIR; - /* orh h%const,ireg_dest,ireg_dest */ - pseudo[1].opcode = (the_insn.opcode & 0x03ffffff) | 0xec000000 | - ((the_insn.opcode & 0x001f0000) << 5); - pseudo[1].highlow = HIGH; - no_opcodes = 2; + pseudo[0].fup = (OP_IMM_S16 | OP_SEL_L); + + /* Emit "orh h%const,ireg_dest,ireg_dest". */ + pseudo[1].opcode = (the_insn.opcode & 0x03ffffff) | 0xec000000 + | ((the_insn.opcode & 0x001f0000) << 5); + pseudo[1].fup = (OP_IMM_S16 | OP_SEL_H); + + num_opcodes = 2; break; case E_ADDR: - if (the_insn.exp.X_add_symbol == NULL && - the_insn.exp.X_op_symbol == NULL) + if (the_insn.exp.X_add_symbol == NULL + && the_insn.exp.X_op_symbol == NULL + && (the_insn.exp.X_add_number < (1 << 15) + && the_insn.exp.X_add_number >= -(1 << 15))) break; - /* orh ha%addr_expr,r0,r31 */ + + /* Emit "orh ha%addr_expr,r0,r31". */ pseudo[0].opcode = 0xec000000 | (atmp << 16); - pseudo[0].highlow = HIGHADJ; - pseudo[0].reloc = LOW0; /* must overwrite */ - /* l%addr_expr(r31),ireg_dest */ - pseudo[1].opcode = (the_insn.opcode & ~0x003e0000) | (atmp << 21); - pseudo[1].highlow = PAIR; - no_opcodes = 2; + pseudo[0].fup = (OP_IMM_S16 | OP_SEL_HA); + + /* Emit "l%addr_expr(r31),ireg_dest". We pick up the fixup + information from the original instruction. */ + pseudo[1].opcode = (the_insn.opcode & ~0x03e00000) | (atmp << 21); + pseudo[1].fup = the_insn.fup | OP_SEL_L; + + num_opcodes = 2; break; - case E_U32: /* 2nd version emulates Intel as, not doc. */ - if (the_insn.exp.X_add_symbol == NULL && - the_insn.exp.X_op_symbol == NULL && - (the_insn.exp.X_add_number < (1 << 16) && - the_insn.exp.X_add_number >= 0)) + case E_U32: + if (the_insn.exp.X_add_symbol == NULL + && the_insn.exp.X_op_symbol == NULL + && (the_insn.exp.X_add_number < (1 << 16) + && the_insn.exp.X_add_number >= 0)) break; - /* $(opcode)h h%const,ireg_src2,ireg_dest - pseudo[0].opcode = (the_insn.opcode & 0xf3ffffff) | 0x0c000000; */ - /* $(opcode)h h%const,ireg_src2,r31 */ - pseudo[0].opcode = (the_insn.opcode & 0xf3e0ffff) | 0x0c000000 | - (atmp << 16); - pseudo[0].highlow = HIGH; - /* $(opcode) l%const,ireg_dest,ireg_dest - pseudo[1].opcode = (the_insn.opcode & 0xf01f0000) | 0x04000000 | - ((the_insn.opcode & 0x001f0000) << 5); */ - /* $(opcode) l%const,r31,ireg_dest */ - pseudo[1].opcode = (the_insn.opcode & 0xf01f0000) | 0x04000000 | - (atmp << 21); - pseudo[1].highlow = PAIR; - no_opcodes = 2; + + /* Emit "$(opcode)h h%const,ireg_src2,r31". */ + pseudo[0].opcode = (the_insn.opcode & 0xf3e0ffff) | 0x0c000000 + | (atmp << 16); + pseudo[0].fup = (OP_IMM_S16 | OP_SEL_H); + + /* Emit "$(opcode) l%const,r31,ireg_dest". */ + pseudo[1].opcode = (the_insn.opcode & 0xf01f0000) | 0x04000000 + | (atmp << 21); + pseudo[1].fup = (OP_IMM_S16 | OP_SEL_L); + + num_opcodes = 2; break; - case E_AND: /* 2nd version emulates Intel as, not doc. */ - if (the_insn.exp.X_add_symbol == NULL && - the_insn.exp.X_op_symbol == NULL && - (the_insn.exp.X_add_number < (1 << 16) && - the_insn.exp.X_add_number >= 0)) + case E_AND: + if (the_insn.exp.X_add_symbol == NULL + && the_insn.exp.X_op_symbol == NULL + && (the_insn.exp.X_add_number < (1 << 16) + && the_insn.exp.X_add_number >= 0)) break; - /* andnot h%const,ireg_src2,ireg_dest - pseudo[0].opcode = (the_insn.opcode & 0x03ffffff) | 0xd4000000; */ - /* andnot h%const,ireg_src2,r31 */ - pseudo[0].opcode = (the_insn.opcode & 0x03e0ffff) | 0xd4000000 | - (atmp << 16); - pseudo[0].highlow = HIGH; + + /* Emit "andnot h%const,ireg_src2,r31". */ + pseudo[0].opcode = (the_insn.opcode & 0x03e0ffff) | 0xd4000000 + | (atmp << 16); + pseudo[0].fup = (OP_IMM_S16 | OP_SEL_H); pseudo[0].exp.X_add_number = -1 - the_insn.exp.X_add_number; - /* andnot l%const,ireg_dest,ireg_dest - pseudo[1].opcode = (the_insn.opcode & 0x001f0000) | 0xd4000000 | - ((the_insn.opcode & 0x001f0000) << 5); */ - /* andnot l%const,r31,ireg_dest */ - pseudo[1].opcode = (the_insn.opcode & 0x001f0000) | 0xd4000000 | - (atmp << 21); - pseudo[1].highlow = PAIR; + + /* Emit "andnot l%const,r31,ireg_dest". */ + pseudo[1].opcode = (the_insn.opcode & 0x001f0000) | 0xd4000000 + | (atmp << 21); + pseudo[1].fup = (OP_IMM_S16 | OP_SEL_L); pseudo[1].exp.X_add_number = -1 - the_insn.exp.X_add_number; - no_opcodes = 2; + + num_opcodes = 2; break; case E_S32: - if (the_insn.exp.X_add_symbol == NULL && - the_insn.exp.X_op_symbol == NULL && - (the_insn.exp.X_add_number < (1 << 15) && - the_insn.exp.X_add_number >= -(1 << 15))) + if (the_insn.exp.X_add_symbol == NULL + && the_insn.exp.X_op_symbol == NULL + && (the_insn.exp.X_add_number < (1 << 15) + && the_insn.exp.X_add_number >= -(1 << 15))) break; - /* orh h%const,r0,r31 */ + + /* Emit "orh h%const,r0,r31". */ pseudo[0].opcode = 0xec000000 | (atmp << 16); - pseudo[0].highlow = HIGH; - /* or l%const,r31,r31 */ + pseudo[0].fup = (OP_IMM_S16 | OP_SEL_H); + + /* Emit "or l%const,r31,r31". */ pseudo[1].opcode = 0xe4000000 | (atmp << 21) | (atmp << 16); - pseudo[1].highlow = PAIR; - /* r31,ireg_src2,ireg_dest */ + pseudo[1].fup = (OP_IMM_S16 | OP_SEL_L); + + /* Emit "r31,ireg_src2,ireg_dest". */ pseudo[2].opcode = (the_insn.opcode & ~0x0400ffff) | (atmp << 11); - pseudo[2].reloc = NO_RELOC; - no_opcodes = 3; + pseudo[2].fup = OP_IMM_S16; + + num_opcodes = 3; break; default: @@ -336,61 +341,80 @@ md_assemble (str) } the_insn = pseudo[0]; - /* check for expanded opcode after branch or in dual */ - if (no_opcodes > 1 && last_expand == 1) + + /* Warn if an opcode is expanded after a delayed branch. */ + if (num_opcodes > 1 && last_expand == 1) as_warn (_("Expanded opcode after delayed branch: `%s'"), str); - if (no_opcodes > 1 && dual_mode != DUAL_OFF) + + /* Warn if an opcode is expanded in dual mode. */ + if (num_opcodes > 1 && dual_mode != DUAL_OFF) as_warn (_("Expanded opcode in dual mode: `%s'"), str); + + /* Notify if any expansions happen. */ + if (target_warn_expand && num_opcodes > 1) + as_warn (_("An instruction was expanded (%s)"), str); } i = 0; do - { /* always produce at least one opcode */ - toP = frag_more (4); - /* put out the opcode */ - md_number_to_chars (toP, the_insn.opcode, 4); + { + /* Output the opcode. Note that the i860 always reads instructions + as little-endian data. */ + destp = frag_more (4); + number_to_chars_littleendian (destp, the_insn.opcode, 4); - /* check for expanded opcode after branch or in dual */ + /* Check for expanded opcode after branch or in dual mode. */ last_expand = the_insn.pcrel; - /* put out the symbol-dependent stuff */ - if (the_insn.reloc != NO_RELOC) + /* Output the symbol-dependent stuff. */ + if (the_insn.fup != OP_NONE) { - fix_new (frag_now, /* which frag */ - (toP - frag_now->fr_literal), /* where */ - 4, /* size */ - &the_insn.exp, - the_insn.pcrel, - /* merge bit fields into one argument */ - (int) (((the_insn.highlow & 0x3) << 4) | (the_insn.reloc & 0xf))); + fixS *fix; + fix = fix_new_exp (frag_now, + destp - frag_now->fr_literal, + 4, + &the_insn.exp, + the_insn.pcrel, + the_insn.reloc); + + /* Despite the odd name, this is a scratch field. We use + it to encode operand type information. */ + fix->fx_addnumber = the_insn.fup; } the_insn = pseudo[++i]; } - while (--no_opcodes > 0); + while (--num_opcodes > 0); } +/* Assemble the instruction pointed to by STR. */ static void -i860_ip (str) +i860_process_insn (str) char *str; { char *s; const char *args; char c; - unsigned long i; struct i860_opcode *insn; - char *argsStart; + char *args_start; unsigned long opcode; unsigned int mask; int match = 0; int comma = 0; +#if 1 /* For compiler warnings. */ + args = 0; + insn = 0; + args_start = 0; + opcode = 0; +#endif - for (s = str; islower (*s) || *s == '.' || *s == '3'; ++s) + for (s = str; islower (*s) || *s == '.' || *s == '3' + || *s == '2' || *s == '1'; ++s) ; + switch (*s) { - case '\0': break; @@ -407,8 +431,9 @@ i860_ip (str) as_fatal (_("Unknown opcode: `%s'"), str); } + /* Check for dual mode ("d.") opcode prefix. */ if (strncmp (str, "d.", 2) == 0) - { /* check for d. opcode prefix */ + { if (dual_mode == DUAL_ON) dual_mode = DUAL_ONDDOT; else @@ -423,35 +448,34 @@ i860_ip (str) as_bad (_("Unknown opcode: `%s'"), str); return; } + if (comma) - { - *--s = ','; - } - argsStart = s; + *--s = ','; + + args_start = s; for (;;) { opcode = insn->match; memset (&the_insn, '\0', sizeof (the_insn)); - the_insn.reloc = NO_RELOC; + the_insn.reloc = BFD_RELOC_NONE; + the_insn.pcrel = 0; + the_insn.fup = OP_NONE; - /* - * Build the opcode, checking as we go to make - * sure that the operands match - */ - for (args = insn->args;; ++args) + /* Build the opcode, checking as we go that the operands match. */ + for (args = insn->args; ; ++args) { switch (*args) { - case '\0': /* end of args */ + /* End of args. */ + case '\0': if (*s == '\0') - { - match = 1; - } + match = 1; break; + /* These must match exactly. */ case '+': - case '(': /* these must match exactly */ + case '(': case ')': case ',': case ' ': @@ -459,24 +483,30 @@ i860_ip (str) continue; break; - case '#': /* must be at least one digit */ + /* Must be at least one digit. */ + case '#': if (isdigit (*s++)) { while (isdigit (*s)) - { - ++s; - } + ++s; continue; } break; - case '1': /* next operand must be a register */ + /* Next operand must be a register. */ + case '1': case '2': case 'd': + /* Check for register prefix if necessary. */ + if (reg_prefix && *s != reg_prefix) + goto error; + else + s++; + switch (*s) { - - case 'f': /* frame pointer */ + /* Frame pointer. */ + case 'f': s++; if (*s++ == 'p') { @@ -485,7 +515,8 @@ i860_ip (str) } goto error; - case 's': /* stack pointer */ + /* Stack pointer. */ + case 's': s++; if (*s++ == 'p') { @@ -494,7 +525,8 @@ i860_ip (str) } goto error; - case 'r': /* any register */ + /* Any register r0..r31. */ + case 'r': s++; if (!isdigit (c = *s++)) { @@ -503,27 +535,21 @@ i860_ip (str) if (isdigit (*s)) { if ((c = 10 * (c - '0') + (*s++ - '0')) >= 32) - { - goto error; - } + goto error; } else - { - c -= '0'; - } + c -= '0'; mask = c; break; - default: /* not this opcode */ + /* Not this opcode. */ + default: goto error; } - /* - * Got the register, now figure out where - * it goes in the opcode. - */ + + /* Obtained the register, now place it in the opcode. */ switch (*args) { - case '1': opcode |= mask << 11; continue; @@ -539,9 +565,16 @@ i860_ip (str) } break; - case 'e': /* next operand is a floating point register */ + /* Next operand is a floating point register. */ + case 'e': case 'f': case 'g': + /* Check for register prefix if necessary. */ + if (reg_prefix && *s != reg_prefix) + goto error; + else + s++; + if (*s++ == 'f' && isdigit (*s)) { mask = *s++; @@ -554,9 +587,8 @@ i860_ip (str) } } else - { - mask -= '0'; - } + mask -= '0'; + switch (*args) { @@ -571,19 +603,27 @@ i860_ip (str) case 'g': opcode |= mask << 16; if (dual_mode != DUAL_OFF) - opcode |= (1 << 9); /* dual mode instruction */ + opcode |= (1 << 9); if (dual_mode == DUAL_DDOT) dual_mode = DUAL_OFF; if (dual_mode == DUAL_ONDDOT) dual_mode = DUAL_ON; - if ((opcode & (1 << 10)) && (mask == ((opcode >> 11) & 0x1f))) - as_warn (_("Fsr1 equals fdest with Pipelining")); + if ((opcode & (1 << 10)) && mask != 0 + && (mask == ((opcode >> 11) & 0x1f))) + as_warn (_("Pipelined instruction: fsrc1 = fdest")); continue; } } break; - case 'c': /* next operand must be a control register */ + /* Next operand must be a control register. */ + case 'c': + /* Check for register prefix if necessary. */ + if (reg_prefix && *s != reg_prefix) + goto error; + else + s++; + if (strncmp (s, "fir", 3) == 0) { opcode |= 0x0 << 21; @@ -622,86 +662,170 @@ i860_ip (str) } break; - case '5': /* 5 bit immediate in src1 */ - memset (&the_insn, '\0', sizeof (the_insn)); - if (!getExpression (s)) + /* 5-bit immediate in src1. */ + case '5': + if (! i860_get_expression (s)) { s = expr_end; - if (the_insn.exp.X_add_number & ~0x1f) - as_bad (_("5-bit immediate too large")); - opcode |= (the_insn.exp.X_add_number & 0x1f) << 11; - memset (&the_insn, '\0', sizeof (the_insn)); - the_insn.reloc = NO_RELOC; + the_insn.fup |= OP_IMM_U5; continue; } break; - case 'l': /* 26 bit immediate, relative branch */ - the_insn.reloc = BRADDR; + /* 26-bit immediate, relative branch (lbroff). */ + case 'l': the_insn.pcrel = 1; + the_insn.fup |= OP_IMM_BR26; goto immediate; - case 's': /* 16 bit immediate, split relative branch */ - /* upper 5 bits of offset in dest field */ + /* 16-bit split immediate, relative branch (sbroff). */ + case 'r': the_insn.pcrel = 1; - the_insn.reloc = SPLIT0; + the_insn.fup |= OP_IMM_BR16; goto immediate; - case 'S': /* 16 bit immediate, split (st), aligned */ - if (opcode & (1 << 28)) - if (opcode & 0x1) - the_insn.reloc = SPLIT2; - else - the_insn.reloc = SPLIT1; + /* 16-bit split immediate. */ + case 's': + the_insn.fup |= OP_IMM_SPLIT16; + goto immediate; + + /* 16-bit split immediate, byte aligned (st.b). */ + case 'S': + the_insn.fup |= OP_IMM_SPLIT16; + goto immediate; + + /* 16-bit split immediate, half-word aligned (st.s). */ + case 'T': + the_insn.fup |= (OP_IMM_SPLIT16 | OP_ENCODE1 | OP_ALIGN2); + goto immediate; + + /* 16-bit split immediate, word aligned (st.l). */ + case 'U': + the_insn.fup |= (OP_IMM_SPLIT16 | OP_ENCODE1 | OP_ALIGN4); + goto immediate; + + /* 16-bit immediate. */ + case 'i': + the_insn.fup |= OP_IMM_S16; + goto immediate; + + /* 16-bit immediate, byte aligned (ld.b). */ + case 'I': + the_insn.fup |= OP_IMM_S16; + goto immediate; + + /* 16-bit immediate, half-word aligned (ld.s). */ + case 'J': + the_insn.fup |= (OP_IMM_S16 | OP_ENCODE1 | OP_ALIGN2); + goto immediate; + + /* 16-bit immediate, word aligned (ld.l, {p}fld.l, fst.l). */ + case 'K': + if (insn->name[0] == 'l') + the_insn.fup |= (OP_IMM_S16 | OP_ENCODE1 | OP_ALIGN4); else - the_insn.reloc = SPLIT0; + the_insn.fup |= (OP_IMM_S16 | OP_ENCODE2 | OP_ALIGN4); goto immediate; - case 'I': /* 16 bit immediate, aligned */ - if (opcode & (1 << 28)) - if (opcode & 0x1) - the_insn.reloc = LOW2; - else - the_insn.reloc = LOW1; - else - the_insn.reloc = LOW0; + /* 16-bit immediate, double-word aligned ({p}fld.d, fst.d). */ + case 'L': + the_insn.fup |= (OP_IMM_S16 | OP_ENCODE3 | OP_ALIGN8); goto immediate; - case 'i': /* 16 bit immediate */ - the_insn.reloc = LOW0; + /* 16-bit immediate, quad-word aligned (fld.q, fst.q). */ + case 'M': + the_insn.fup |= (OP_IMM_S16 | OP_ENCODE3 | OP_ALIGN16); /*FALLTHROUGH*/ + /* Handle the immediate for either the Intel syntax or + SVR4 syntax. The Intel syntax is "ha%immediate" + whereas SVR4 syntax is "[immediate]@ha". */ immediate: +#ifdef SYNTAX_SVR4 + if (*s == ' ') + s++; + + /* Note that if i860_get_expression() fails, we will still + have created U entries in the symbol table for the + 'symbols' in the input string. Try not to create U + symbols for registers, etc. */ + if (! i860_get_expression (s)) + s = expr_end; + else + goto error; + + if (strncmp (s, "@ha", 3) == 0) + { + the_insn.fup |= OP_SEL_HA; + s += 3; + } + else if (strncmp (s, "@h", 2) == 0) + { + the_insn.fup |= OP_SEL_H; + s += 2; + } + else if (strncmp (s, "@l", 2) == 0) + { + the_insn.fup |= OP_SEL_L; + s += 2; + } + else if (strncmp (s, "@gotoff", 7) == 0 + || strncmp (s, "@GOTOFF", 7) == 0) + { + as_bad (_("Assembler does not yet support PIC")); + the_insn.fup |= OP_SEL_GOTOFF; + s += 7; + } + else if (strncmp (s, "@got", 4) == 0 + || strncmp (s, "@GOT", 4) == 0) + { + as_bad (_("Assembler does not yet support PIC")); + the_insn.fup |= OP_SEL_GOT; + s += 4; + } + else if (strncmp (s, "@plt", 4) == 0 + || strncmp (s, "@PLT", 4) == 0) + { + as_bad (_("Assembler does not yet support PIC")); + the_insn.fup |= OP_SEL_PLT; + s += 4; + } + + the_insn.expand = insn->expand; + + continue; +#else /* ! SYNTAX_SVR4 */ if (*s == ' ') s++; if (strncmp (s, "ha%", 3) == 0) { - the_insn.highlow = HIGHADJ; + the_insn.fup |= OP_SEL_HA; s += 3; } else if (strncmp (s, "h%", 2) == 0) { - the_insn.highlow = HIGH; + the_insn.fup |= OP_SEL_H; s += 2; } else if (strncmp (s, "l%", 2) == 0) { - the_insn.highlow = PAIR; + the_insn.fup |= OP_SEL_L; s += 2; } the_insn.expand = insn->expand; - /* Note that if the getExpression() fails, we will still have - created U entries in the symbol table for the 'symbols' - in the input string. Try not to create U symbols for - registers, etc. */ + /* Note that if i860_get_expression() fails, we will still + have created U entries in the symbol table for the + 'symbols' in the input string. Try not to create U + symbols for registers, etc. */ + if (! i860_get_expression (s)) + s = expr_end; + else + goto error; - if (!getExpression (s)) - { - s = expr_end; - continue; - } + continue; +#endif /* SYNTAX_SVR4 */ break; default: @@ -713,16 +837,16 @@ i860_ip (str) if (match == 0) { /* Args don't match. */ - if (&insn[1] - i860_opcodes < NUMOPCODES - && !strcmp (insn->name, insn[1].name)) + if (insn[1].name != NULL + && ! strcmp (insn->name, insn[1].name)) { ++insn; - s = argsStart; + s = args_start; continue; } else { - as_bad (_("Illegal operands")); + as_bad (_("Illegal operands for %s"), insn->name); return; } } @@ -733,7 +857,7 @@ i860_ip (str) } static int -getExpression (str) +i860_get_expression (str) char *str; { char *save_in; @@ -756,17 +880,12 @@ getExpression (str) return 0; } +/* Turn a string in input_line_pointer into a floating point constant of + type TYPE, and store the appropriate bytes in *LITP. The number of + LITTLENUMS emitted is stored in *SIZEP. An error message is returned, + or NULL on OK. */ -/* - This is identical to the md_atof in m68k.c. I think this is right, - but I'm not sure. - - Turn a string in input_line_pointer into a floating point constant of type - type, and store the appropriate bytes in *litP. The number of LITTLENUMS - emitted is stored in *sizeP . An error message is returned, or NULL on OK. - */ - -/* Equal to MAX_PRECISION in atof-ieee.c */ +/* Equal to MAX_PRECISION in atof-ieee.c. */ #define MAX_LITTLENUMS 6 char * @@ -783,7 +902,6 @@ md_atof (type, litP, sizeP) switch (type) { - case 'f': case 'F': case 's': @@ -824,226 +942,60 @@ md_atof (type, litP, sizeP) return 0; } -/* - * Write out big-endian. - */ +/* Write out in current endian mode. */ void md_number_to_chars (buf, val, n) char *buf; valueT val; int n; { - number_to_chars_bigendian (buf, val, n); + if (target_big_endian) + number_to_chars_bigendian (buf, val, n); + else + number_to_chars_littleendian (buf, val, n); } -void -md_number_to_imm (buf, val, n, fixP) - char *buf; - long val; - int n; - fixS *fixP; -{ - enum reloc_type reloc = fixP->fx_r_type & 0xf; - enum highlow_type highlow = (fixP->fx_r_type >> 4) & 0x3; - - assert (buf); - assert (n == 4); /* always on i860 */ - - switch (highlow) - { - - case HIGHADJ: /* adjusts the high-order 16-bits */ - if (val & (1 << 15)) - val += (1 << 16); - - /*FALLTHROUGH*/ - - case HIGH: /* selects the high-order 16-bits */ - val >>= 16; - break; - - case PAIR: /* selects the low-order 16-bits */ - val = val & 0xffff; - break; - - default: - break; - } - - switch (reloc) - { - - case BRADDR: /* br,call,bc,bc.t,bnc,bnc.t w/26-bit immediate */ - if (fixP->fx_pcrel != 1) - as_bad (_("26-bit branch w/o pc relative set: 0x%08x"), val); - val >>= 2; /* align pcrel offset, see manual */ - - if (val >= (1 << 25) || val < -(1 << 25)) /* check for overflow */ - as_bad (_("26-bit branch offset overflow: 0x%08x"), val); - buf[0] = (buf[0] & 0xfc) | ((val >> 24) & 0x3); - buf[1] = val >> 16; - buf[2] = val >> 8; - buf[3] = val; - break; - - case SPLIT2: /* 16 bit immediate, 4-byte aligned */ - if (val & 0x3) - as_bad (_("16-bit immediate 4-byte alignment error: 0x%08x"), val); - val &= ~0x3; /* 4-byte align value */ - /*FALLTHROUGH*/ - case SPLIT1: /* 16 bit immediate, 2-byte aligned */ - if (val & 0x1) - as_bad (_("16-bit immediate 2-byte alignment error: 0x%08x"), val); - val &= ~0x1; /* 2-byte align value */ - /*FALLTHROUGH*/ - case SPLIT0: /* st,bla,bte,btne w/16-bit immediate */ - if (fixP->fx_pcrel == 1) - val >>= 2; /* align pcrel offset, see manual */ - /* check for bounds */ - if (highlow != PAIR && (val >= (1 << 16) || val < -(1 << 15))) - as_bad (_("16-bit branch offset overflow: 0x%08x"), val); - buf[1] = (buf[1] & ~0x1f) | ((val >> 11) & 0x1f); - buf[2] = (buf[2] & ~0x7) | ((val >> 8) & 0x7); - buf[3] |= val; /* perserve bottom opcode bits */ - break; - - case LOW4: /* fld,pfld,pst,flush 16-byte aligned */ - if (val & 0xf) - as_bad (_("16-bit immediate 16-byte alignment error: 0x%08x"), val); - val &= ~0xf; /* 16-byte align value */ - /*FALLTHROUGH*/ - case LOW3: /* fld,pfld,pst,flush 8-byte aligned */ - if (val & 0x7) - as_bad (_("16-bit immediate 8-byte alignment error: 0x%08x"), val); - val &= ~0x7; /* 8-byte align value */ - /*FALLTHROUGH*/ - case LOW2: /* 16 bit immediate, 4-byte aligned */ - if (val & 0x3) - as_bad (_("16-bit immediate 4-byte alignment error: 0x%08x"), val); - val &= ~0x3; /* 4-byte align value */ - /*FALLTHROUGH*/ - case LOW1: /* 16 bit immediate, 2-byte aligned */ - if (val & 0x1) - as_bad (_("16-bit immediate 2-byte alignment error: 0x%08x"), val); - val &= ~0x1; /* 2-byte align value */ - /*FALLTHROUGH*/ - case LOW0: /* 16 bit immediate, byte aligned */ - /* check for bounds */ - if (highlow != PAIR && (val >= (1 << 16) || val < -(1 << 15))) - as_bad (_("16-bit immediate overflow: 0x%08x"), val); - buf[2] = val >> 8; - buf[3] |= val; /* perserve bottom opcode bits */ - break; - - case NO_RELOC: - default: - as_bad (_("bad relocation type: 0x%02x"), reloc); - break; - } -} - -/* should never be called for i860 */ +/* This should never be called for i860. */ void md_number_to_disp (buf, val, n) - char *buf; - long val; + char *buf ATTRIBUTE_UNUSED; + long val ATTRIBUTE_UNUSED; + int n ATTRIBUTE_UNUSED; { as_fatal (_("md_number_to_disp\n")); } -/* should never be called for i860 */ +/* This should never be called for i860. */ void md_number_to_field (buf, val, fix) - char *buf; - long val; - void *fix; + char *buf ATTRIBUTE_UNUSED; + long val ATTRIBUTE_UNUSED; + void *fix ATTRIBUTE_UNUSED; { as_fatal (_("i860_number_to_field\n")); } -/* the bit-field entries in the relocation_info struct plays hell - with the byte-order problems of cross-assembly. So as a hack, - I added this mach. dependent ri twiddler. Ugly, but it gets - you there. -KWK */ -/* on i860: first 4 bytes are normal unsigned long address, next three - bytes are index, most sig. byte first. Byte 7 is broken up with - bit 7 as pcrel, bit 6 as extern, and the lower six bits as - relocation type (highlow 5-4). Next 4 bytes are long addend. */ -/* Thanx and a tip of the hat to Michael Bloom, mb@ttidca.tti.com */ -void -md_ri_to_chars (ri_p, ri) - struct relocation_info *ri_p, ri; -{ -#if 0 - unsigned char the_bytes[sizeof (*ri_p)]; - - /* this is easy */ - md_number_to_chars (the_bytes, ri.r_address, sizeof (ri.r_address)); - /* now the fun stuff */ - the_bytes[4] = (ri.r_index >> 16) & 0x0ff; - the_bytes[5] = (ri.r_index >> 8) & 0x0ff; - the_bytes[6] = ri.r_index & 0x0ff; - the_bytes[7] = ((ri.r_extern << 7) & 0x80) | (0 & 0x60) | (ri.r_type & 0x1F); - /* Also easy */ - md_number_to_chars (&the_bytes[8], ri.r_addend, sizeof (ri.r_addend)); - /* now put it back where you found it, Junior... */ - memcpy ((char *) ri_p, the_bytes, sizeof (*ri_p)); -#endif -} - -/* should never be called for i860 */ -void -md_convert_frag (headers, seg, fragP) - object_headers *headers; - segT seg; - register fragS *fragP; -{ - as_fatal (_("i860_convert_frag\n")); -} - -/* should never be called for i860 */ +/* This should never be called for i860. */ int md_estimate_size_before_relax (fragP, segtype) - register fragS *fragP; - segT segtype; + register fragS *fragP ATTRIBUTE_UNUSED; + segT segtype ATTRIBUTE_UNUSED; { as_fatal (_("i860_estimate_size_before_relax\n")); } -/* for debugging only, must match enum reloc_type */ -static char *Reloc[] = -{ - "NO_RELOC", - "BRADDR", - "LOW0", - "LOW1", - "LOW2", - "LOW3", - "LOW4", - "SPLIT0", - "SPLIT1", - "SPLIT2", - "RELOC_32", -}; -static char *Highlow[] = -{ - "NO_SPEC", - "PAIR", - "HIGH", - "HIGHADJ", -}; +#ifdef DEBUG_I860 static void print_insn (insn) struct i860_it *insn; { if (insn->error) - { - fprintf (stderr, "ERROR: %s\n"); - } - fprintf (stderr, "opcode=0x%08x\t", insn->opcode); - fprintf (stderr, "expand=0x%08x\t", insn->expand); - fprintf (stderr, "reloc = %s\t", Reloc[insn->reloc]); - fprintf (stderr, "highlow = %s\n", Highlow[insn->highlow]); + fprintf (stderr, "ERROR: %s\n", insn->error); + + fprintf (stderr, "opcode = 0x%08lx\t", insn->opcode); + fprintf (stderr, "expand = 0x%x\t", insn->expand); + fprintf (stderr, "reloc = %s\t\n", + bfd_get_reloc_code_name (insn->reloc)); fprintf (stderr, "exp = {\n"); fprintf (stderr, "\t\tX_add_symbol = %s\n", insn->exp.X_add_symbol ? @@ -1053,179 +1005,124 @@ print_insn (insn) insn->exp.X_op_symbol ? (S_GET_NAME (insn->exp.X_op_symbol) ? S_GET_NAME (insn->exp.X_op_symbol) : "???") : "0"); - fprintf (stderr, "\t\tX_add_number = %d\n", + fprintf (stderr, "\t\tX_add_number = %lx\n", insn->exp.X_add_number); fprintf (stderr, "}\n"); } +#endif /* DEBUG_I860 */ + +#ifdef OBJ_ELF +CONST char *md_shortopts = "VQ:"; +#else CONST char *md_shortopts = ""; +#endif + +#define OPTION_EB (OPTION_MD_BASE + 0) +#define OPTION_EL (OPTION_MD_BASE + 1) +#define OPTION_WARN_EXPAND (OPTION_MD_BASE + 2) + struct option md_longopts[] = { - {NULL, no_argument, NULL, 0} + { "EB", no_argument, NULL, OPTION_EB }, + { "EL", no_argument, NULL, OPTION_EL }, + { "mwarn-expand", no_argument, NULL, OPTION_WARN_EXPAND }, + { NULL, no_argument, NULL, 0 } }; -size_t md_longopts_size = sizeof(md_longopts); +size_t md_longopts_size = sizeof (md_longopts); int md_parse_option (c, arg) int c; - char *arg; + char *arg ATTRIBUTE_UNUSED; { - return 0; + switch (c) + { + case OPTION_EB: + target_big_endian = 1; + break; + + case OPTION_EL: + target_big_endian = 0; + break; + + case OPTION_WARN_EXPAND: + target_warn_expand = 1; + break; + +#ifdef OBJ_ELF + /* SVR4 argument compatibility (-V): print version ID. */ + case 'V': + print_version_id (); + break; + + /* SVR4 argument compatibility (-Qy, -Qn): controls whether + a .comment section should be emitted or not (ignored). */ + case 'Q': + break; +#endif + + default: + return 0; + } + + return 1; } void md_show_usage (stream) FILE *stream; { + fprintf (stream, _("\ + -EL generate code for little endian mode (default)\n\ + -EB generate code for big endian mode\n\ + -mwarn-expand warn if pseudo operations are expanded\n")); +#ifdef OBJ_ELF + /* SVR4 compatibility flags. */ + fprintf (stream, _("\ + -V print assembler version number\n\ + -Qy, -Qn ignored\n")); +#endif } + -#ifdef comment -/* - * I860 relocations are completely different, so it needs - * this machine dependent routine to emit them. - */ -void -emit_machine_reloc (fixP, segment_address_in_file) - register fixS *fixP; - relax_addressT segment_address_in_file; -{ - struct reloc_info_i860 ri; - register symbolS *symbolP; - extern char *next_object_file_charP; - long add_number; - - memset ((char *) &ri, '\0', sizeof (ri)); - for (; fixP; fixP = fixP->fx_next) - { - - if (fixP->fx_r_type & ~0x3f) - { - as_fatal ("fixP->fx_r_type = %d\n", fixP->fx_r_type); - } - ri.r_pcrel = fixP->fx_pcrel; - ri.r_type = fixP->fx_r_type; - - if ((symbolP = fixP->fx_addsy) != NULL) - { - ri.r_address = fixP->fx_frag->fr_address + - fixP->fx_where - segment_address_in_file; - if (!S_IS_DEFINED (symbolP)) - { - ri.r_extern = 1; - ri.r_symbolnum = symbolP->sy_number; - } - else - { - ri.r_extern = 0; - ri.r_symbolnum = S_GET_TYPE (symbolP); - } - if (symbolP && symbol_get_frag (symbolP)) - { - ri.r_addend = symbol_get_frag (symbolP)->fr_address; - } - ri.r_type = fixP->fx_r_type; - if (fixP->fx_pcrel) - { - /* preserve actual offset vs. pc + 4 */ - ri.r_addend -= (ri.r_address + 4); - } - else - { - ri.r_addend = fixP->fx_addnumber; - } - - md_ri_to_chars ((char *) &ri, ri); - append (&next_object_file_charP, (char *) &ri, sizeof (ri)); - } - } -} - -#endif /* comment */ - -#ifdef OBJ_AOUT - -/* on i860: first 4 bytes are normal unsigned long address, next three - bytes are index, most sig. byte first. Byte 7 is broken up with - bit 7 as pcrel, bit 6 as extern, and the lower six bits as - relocation type (highlow 5-4). Next 4 bytes are long addend. */ - -void -tc_aout_fix_to_chars (where, fixP, segment_address_in_file) - char *where; - fixS *fixP; - relax_addressT segment_address_in_file; -{ - long r_index; - long r_extern; - long r_addend = 0; - long r_address; - - know (fixP->fx_addsy); - know (!(fixP->fx_r_type & ~0x3f)); - - if (!S_IS_DEFINED (fixP->fx_addsy)) - { - r_extern = 1; - r_index = fixP->fx_addsy->sy_number; - } - else - { - r_extern = 0; - r_index = S_GET_TYPE (fixP->fx_addsy); - } - - md_number_to_chars (where, - r_address = fixP->fx_frag->fr_address + fixP->fx_where - segment_address_in_file, - 4); - - where[4] = (r_index >> 16) & 0x0ff; - where[5] = (r_index >> 8) & 0x0ff; - where[6] = r_index & 0x0ff; - where[7] = (((fixP->fx_pcrel << 7) & 0x80) - | ((r_extern << 6) & 0x40) - | (fixP->fx_r_type & 0x3F)); - - if (symbol_get_frag (fixP->fx_addsy)) - { - r_addend = symbol_get_frag (fixP->fx_addsy)->fr_address; - } - - if (fixP->fx_pcrel) - { - /* preserve actual offset vs. pc + 4 */ - r_addend -= (r_address + 4); - } - else - { - r_addend = fixP->fx_addnumber; - } - - md_number_to_chars (&where[8], r_addend, 4); -} - -#endif /* OBJ_AOUT */ - /* We have no need to default values of symbols. */ - -/* ARGSUSED */ symbolS * md_undefined_symbol (name) - char *name; + char *name ATTRIBUTE_UNUSED; { return 0; } +/* The i860 denotes auto-increment with '++'. */ +void +md_operand (exp) + expressionS *exp; +{ + char *s; + + for (s = input_line_pointer; *s; s++) + { + if (s[0] == '+' && s[1] == '+') + { + input_line_pointer += 2; + exp->X_op = O_register; + break; + } + } +} + /* Round up a section size to the appropriate boundary. */ valueT md_section_align (segment, size) - segT segment; - valueT size; + segT segment ATTRIBUTE_UNUSED; + valueT size ATTRIBUTE_UNUSED; { - return size; /* Byte alignment is fine */ + /* Byte alignment is fine. */ + return size; } -/* Exactly what point is a PC-relative offset relative TO? - On the i860, they're relative to the address of the offset, plus - its size. (??? Is this right? FIXME-SOON!) */ +/* On the i860, a PC-relative offset is relative to the address of the + of the offset plus its size. */ long md_pcrel_from (fixP) fixS *fixP; @@ -1233,31 +1130,268 @@ md_pcrel_from (fixP) return fixP->fx_size + fixP->fx_where + fixP->fx_frag->fr_address; } -void -md_apply_fix (fixP, val) - fixS *fixP; - long val; +/* Determine the relocation needed for non PC-relative 16-bit immediates. + Also adjust the given immediate as necessary. Finally, check that + all constraints (such as alignment) are satisfied. */ +static bfd_reloc_code_real_type +obtain_reloc_for_imm16 (fix, val) + fixS *fix; + long *val; { - char *place = fixP->fx_where + fixP->fx_frag->fr_literal; + valueT fup = fix->fx_addnumber; + bfd_reloc_code_real_type reloc; - /* looks to me like i860 never has bit fixes. Let's see. xoxorich. */ - know (fixP->fx_bit_fixP == NULL); - if (!fixP->fx_bit_fixP) + if (fix->fx_pcrel) + abort (); + + /* Check alignment restrictions. */ + if ((fup & OP_ALIGN2) && (*val & 0x1)) + as_bad_where (fix->fx_file, fix->fx_line, + _("This immediate requires 0 MOD 2 alignment")); + else if ((fup & OP_ALIGN4) && (*val & 0x3)) + as_bad_where (fix->fx_file, fix->fx_line, + _("This immediate requires 0 MOD 4 alignment")); + else if ((fup & OP_ALIGN8) && (*val & 0x7)) + as_bad_where (fix->fx_file, fix->fx_line, + _("This immediate requires 0 MOD 8 alignment")); + else if ((fup & OP_ALIGN16) && (*val & 0xf)) + as_bad_where (fix->fx_file, fix->fx_line, + _("This immediate requires 0 MOD 16 alignment")); + + if (fup & OP_SEL_HA) { - fixP->fx_addnumber = val; - md_number_to_imm (place, val, fixP->fx_size, fixP); + *val = (*val >> 16) + (*val & 0x8000 ? 1 : 0); + reloc = BFD_RELOC_860_HIGHADJ; + } + else if (fup & OP_SEL_H) + { + *val >>= 16; + reloc = BFD_RELOC_860_HIGH; + } + else if (fup & OP_SEL_L) + { + int num_encode; + if (fup & OP_IMM_SPLIT16) + { + if (fup & OP_ENCODE1) + { + num_encode = 1; + reloc = BFD_RELOC_860_SPLIT1; + } + else if (fup & OP_ENCODE2) + { + num_encode = 2; + reloc = BFD_RELOC_860_SPLIT2; + } + else + { + num_encode = 0; + reloc = BFD_RELOC_860_SPLIT0; + } + } + else + { + if (fup & OP_ENCODE1) + { + num_encode = 1; + reloc = BFD_RELOC_860_LOW1; + } + else if (fup & OP_ENCODE2) + { + num_encode = 2; + reloc = BFD_RELOC_860_LOW2; + } + else if (fup & OP_ENCODE3) + { + num_encode = 3; + reloc = BFD_RELOC_860_LOW3; + } + else + { + num_encode = 0; + reloc = BFD_RELOC_860_LOW0; + } + } + + /* Preserve size encode bits. */ + *val &= ~((1 << num_encode) - 1); } else { - md_number_to_field (place, val, fixP->fx_bit_fixP); + /* No selector. What reloc do we generate (???)? */ + reloc = BFD_RELOC_32; } + + return reloc; } -/* - * Local Variables: - * fill-column: 131 - * comment-column: 0 - * End: - */ +/* Attempt to simplify or eliminate a fixup. To indicate that a fixup + has been eliminated, set fix->fx_done. If fix->fx_addsy is non-NULL, + we will have to generate a reloc entry. */ +int +md_apply_fix3 (fix, valuep, seg) + fixS *fix; + valueT *valuep; + segT seg ATTRIBUTE_UNUSED; +{ -/* end of tc-i860.c */ + char *buf; + long val = (long) (*valuep); + unsigned long insn; + valueT fup; + + buf = fix->fx_frag->fr_literal + fix->fx_where; + + /* Recall that earlier we stored the opcode little-endian. */ + insn = bfd_getl32 (buf); + + /* We stored a fix-up in this oddly-named scratch field. */ + fup = fix->fx_addnumber; + + /* Determine the necessary relocations as well as inserting an + immediate into the instruction. */ + if (fup == OP_IMM_U5) + { + if (val & ~0x1f) + as_bad_where (fix->fx_file, fix->fx_line, + _("5-bit immediate too large")); + if (fix->fx_addsy) + as_bad_where (fix->fx_file, fix->fx_line, + _("5-bit field must be absolute")); + + insn |= (val & 0x1f) << 11; + bfd_putl32 (insn, buf); + fix->fx_r_type = BFD_RELOC_NONE; + fix->fx_done = 1; + } + else if (fup & OP_IMM_S16) + { + fix->fx_r_type = obtain_reloc_for_imm16 (fix, &val); + + /* Insert the immediate. */ + if (fix->fx_addsy) + fix->fx_done = 0; + else + { + insn |= val & 0xffff; + bfd_putl32 (insn, buf); + fix->fx_r_type = BFD_RELOC_NONE; + fix->fx_done = 1; + } + } + else if (fup & OP_IMM_U16) + { + abort (); + } + else if (fup & OP_IMM_SPLIT16) + { + fix->fx_r_type = obtain_reloc_for_imm16 (fix, &val); + + /* Insert the immediate. */ + if (fix->fx_addsy) + fix->fx_done = 0; + else + { + insn |= val & 0x7ff; + insn |= (val & 0xf800) << 5; + bfd_putl32 (insn, buf); + fix->fx_r_type = BFD_RELOC_NONE; + fix->fx_done = 1; + } + } + else if (fup & OP_IMM_BR16) + { + if (val & 0x3) + as_bad_where (fix->fx_file, fix->fx_line, + _("A branch offset requires 0 MOD 4 alignment")); + + val = val >> 2; + + /* Insert the immediate. */ + if (fix->fx_addsy) + { + fix->fx_done = 0; + fix->fx_r_type = BFD_RELOC_860_PC16; + } + else + { + insn |= (val & 0x7ff); + insn |= ((val & 0xf800) << 5); + bfd_putl32 (insn, buf); + fix->fx_r_type = BFD_RELOC_NONE; + fix->fx_done = 1; + } + } + else if (fup & OP_IMM_BR26) + { + if (val & 0x3) + as_bad_where (fix->fx_file, fix->fx_line, + _("A branch offset requires 0 MOD 4 alignment")); + + val >>= 2; + + /* Insert the immediate. */ + if (fix->fx_addsy) + { + fix->fx_r_type = BFD_RELOC_860_PC26; + fix->fx_done = 0; + } + else + { + insn |= (val & 0x3ffffff); + bfd_putl32 (insn, buf); + fix->fx_r_type = BFD_RELOC_NONE; + fix->fx_done = 1; + } + } + else if (fup != OP_NONE) + { + as_bad_where (fix->fx_file, fix->fx_line, + _("Unrecognized fix-up (0x%08x)"), fup); + abort (); + } + else + { + /* I believe only fix-ups such as ".long .ep.main-main+0xc8000000" + reach here (???). */ + if (fix->fx_addsy) + { + fix->fx_r_type = BFD_RELOC_32; + fix->fx_done = 0; + } + else + { + insn |= (val & 0xffffffff); + bfd_putl32 (insn, buf); + fix->fx_r_type = BFD_RELOC_NONE; + fix->fx_done = 1; + } + } + + /* Return value ignored. */ + return 0; +} + +/* Generate a machine dependent reloc from a fixup. */ +arelent* +tc_gen_reloc (section, fixp) + asection *section ATTRIBUTE_UNUSED; + fixS *fixp; +{ + arelent *reloc; + + reloc = xmalloc (sizeof (*reloc)); + reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; + reloc->addend = fixp->fx_offset; + reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type); + + if (! reloc->howto) + { + as_bad_where (fixp->fx_file, fixp->fx_line, + "Cannot represent %s relocation in object file", + bfd_get_reloc_code_name (fixp->fx_r_type)); + } + return reloc; +} diff --git a/gnu/dist/toolchain/gas/config/tc-i860.h b/gnu/dist/toolchain/gas/config/tc-i860.h index afb21c1b556b..79a808fe7b73 100644 --- a/gnu/dist/toolchain/gas/config/tc-i860.h +++ b/gnu/dist/toolchain/gas/config/tc-i860.h @@ -1,5 +1,9 @@ -/* tc-i860.h -- Header file for the I860 - Copyright (C) 1991, 92, 95, 1998 Free Software Foundation, Inc. +/* tc-i860.h -- Header file for the i860. + Copyright (C) 1991, 1992, 1995, 1998, 2000 + Free Software Foundation, Inc. + + Brought back from the dead and completely reworked + by Jason Eckhardt . This file is part of GAS, the GNU Assembler. @@ -17,23 +21,64 @@ with GAS; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef TC_I860 #define TC_I860 1 -#define TARGET_BYTES_BIG_ENDIAN 1 +#ifndef BFD_ASSEMBLER +#error i860 support requires BFD_ASSEMBLER +#endif + +enum i860_fix_info +{ + OP_NONE = 0x00000, + OP_IMM_U5 = 0x00001, + OP_IMM_S16 = 0x00002, + OP_IMM_U16 = 0x00004, + OP_IMM_SPLIT16 = 0x00008, + OP_IMM_BR26 = 0x00010, + OP_IMM_BR16 = 0x00020, + OP_ENCODE1 = 0x00040, + OP_ENCODE2 = 0x00080, + OP_ENCODE3 = 0x00100, + OP_SEL_HA = 0x00200, + OP_SEL_H = 0x00400, + OP_SEL_L = 0x00800, + OP_SEL_GOT = 0x01000, + OP_SEL_GOTOFF = 0x02000, + OP_SEL_PLT = 0x04000, + OP_ALIGN2 = 0x08000, + OP_ALIGN4 = 0x10000, + OP_ALIGN8 = 0x20000, + OP_ALIGN16 = 0x40000 +}; + +/* Set the endianness we are using. Default to little endian. */ +#ifndef TARGET_BYTES_BIG_ENDIAN +#define TARGET_BYTES_BIG_ENDIAN 0 +#endif + +/* Whether or not the target is big endian. */ +extern int target_big_endian; + +/* BFD target architecture. */ +#define TARGET_ARCH bfd_arch_i860 + +/* The target BFD format. */ +#ifdef OBJ_ELF +#define TARGET_FORMAT (target_big_endian ? "elf32-i860" : "elf32-i860-little") +#else +#error i860 GAS currently supports only the ELF object format +#endif #define WORKING_DOT_WORD +#define MD_APPLY_FIX3 +#define TC_HANDLES_FX_DONE +#define DIFF_EXPR_OK -#define tc_headers_hook(a) {;} /* not used */ -#define tc_crawl_symbol_chain(a) {;} /* not used */ -#define tc_aout_pre_write_hook(x) {;} /* not used */ +/* Permit temporary numeric labels. */ +#define LOCAL_LABELS_FB 1 +#define LISTING_HEADER "GAS for i860" -#define md_operand(x) +#define md_convert_frag(b,s,f) as_fatal (_("i860_convert_frag\n")); -/* - * Local Variables: - * comment-column: 0 - * fill-column: 131 - * End: - */ - -/* end of tc-i860.h */ +#endif /* TC_I860 */ diff --git a/gnu/dist/toolchain/gas/config/tc-i960.c b/gnu/dist/toolchain/gas/config/tc-i960.c index d8c15c09911f..81ea6d83bb43 100644 --- a/gnu/dist/toolchain/gas/config/tc-i960.c +++ b/gnu/dist/toolchain/gas/config/tc-i960.c @@ -1,5 +1,5 @@ /* tc-i960.c - All the i80960-specific stuff - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. This file is part of GAS. @@ -19,7 +19,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* See comment on md_parse_option for 80960-specific invocation options. */ +/* See comment on md_parse_option for 80960-specific invocation options. */ /* There are 4 different lengths of (potentially) symbol-based displacements in the 80960 instruction set, each of which could require address fix-ups @@ -178,11 +178,11 @@ const char comment_chars[] = "#"; #NO_APP at the beginning of its output. */ -/* Also note that comments started like this one will always work. */ +/* Also note that comments started like this one will always work. */ -const char line_comment_chars[1]; +const char line_comment_chars[] = ""; -const char line_separator_chars[1]; +const char line_separator_chars[] = ";"; /* Chars that can be used to separate mant from exp in floating point nums */ const char EXP_CHARS[] = "eE"; @@ -192,7 +192,6 @@ const char EXP_CHARS[] = "eE"; */ const char FLT_CHARS[] = "fFdDtT"; - /* Table used by base assembler to relax addresses based on varying length instructions. The fields are: 1) most positive reach of this state, @@ -242,13 +241,11 @@ const pseudo_typeS md_pseudo_table[] = #define adds(e) e.X_add_symbol #define offs(e) e.X_add_number - /* Branch-prediction bits for CTRL/COBR format opcodes */ #define BP_MASK 0x00000002 /* Mask for branch-prediction bit */ #define BP_TAKEN 0x00000000 /* Value to OR in to predict branch */ #define BP_NOT_TAKEN 0x00000002 /* Value to OR in to predict no branch */ - /* Some instruction opcodes that we need explicitly */ #define BE 0x12000000 #define BG 0x11000000 @@ -268,14 +265,12 @@ const pseudo_typeS md_pseudo_table[] = #define CALLS 0x66003800 #define RET 0x0a000000 - -/* These masks are used to build up a set of MEMB mode bits. */ +/* These masks are used to build up a set of MEMB mode bits. */ #define A_BIT 0x0400 #define I_BIT 0x0800 #define MEMB_BIT 0x1000 #define D_BIT 0x2000 - /* Mask for the only mode bit in a MEMA instruction (if set, abase reg is used). */ #define MEMA_ABASE 0x2000 @@ -294,7 +289,6 @@ typedef struct memS; - /* The two pieces of info we need to generate a register operand */ struct regop { @@ -303,7 +297,6 @@ struct regop int n; /* Register number or literal value */ }; - /* Number and assembler mnemonic for all registers that can appear in operands. */ static const struct @@ -449,13 +442,11 @@ aregs[] = { NULL, 0 }, /* END OF LIST */ }; - /* Hash tables */ static struct hash_control *op_hash; /* Opcode mnemonics */ static struct hash_control *reg_hash; /* Register name hash table */ static struct hash_control *areg_hash; /* Abase register hash table */ - /* Architecture for which we are assembling */ #define ARCH_ANY 0 /* Default: no architecture checking done */ #define ARCH_KA 1 @@ -470,7 +461,6 @@ int iclasses_seen; /* OR of instruction classes (I_* constants) * instructions. */ - /* BRANCH-PREDICTION INSTRUMENTATION The following supports generation of branch-prediction instrumentation @@ -592,7 +582,6 @@ md_assemble (textP) const char *bp_error_msg = _("branch prediction invalid on this opcode"); - /* Parse instruction into opcode and operands */ memset (args, '\0', sizeof (args)); n_ops = i_scan (textP, args); @@ -611,8 +600,6 @@ md_assemble (textP) } } - - /* Check for branch-prediction suffix on opcode mnemonic, strip it off */ n = strlen (args[0]) - 1; branch_predict = 0; @@ -735,9 +722,8 @@ md_chars_to_number (val, n) return retval; } - #define MAX_LITTLENUMS 6 -#define LNUM_SIZE sizeof(LITTLENUM_TYPE) +#define LNUM_SIZE sizeof (LITTLENUM_TYPE) /***************************************************************************** md_atof: convert ascii to floating point @@ -808,7 +794,6 @@ md_atof (type, litP, sizeP) return 0; } - /***************************************************************************** md_number_to_imm @@ -822,7 +807,6 @@ md_number_to_imm (buf, val, n) md_number_to_chars (buf, val, n); } - /***************************************************************************** md_number_to_disp @@ -918,7 +902,6 @@ md_number_to_field (instrP, val, bfixP) A table of all such "Labels" is also generated. - -AKA, -AKB, -AKC, -ASA, -ASB, -AMC, -ACA: Select the 80960 architecture. Instructions or features not supported by the selected architecture cause fatal errors. @@ -1264,7 +1247,6 @@ cobr_fmt (arg, opcode, oP) instr |= (regop.n << 14) | regop.special; } - if (n < 3) { emit (instr); @@ -1293,7 +1275,6 @@ cobr_fmt (arg, opcode, oP) } } /* cobr_fmt() */ - /***************************************************************************** ctrl_fmt: generate a CTRL-format instruction @@ -1309,7 +1290,6 @@ ctrl_fmt (targP, opcode, num_ops) * how often the branch is taken */ - if (num_ops == 0) { emit (opcode); /* Output opcode */ @@ -1339,7 +1319,6 @@ ctrl_fmt (targP, opcode, num_ops) } - /***************************************************************************** emit: output instruction binary @@ -1359,7 +1338,6 @@ emit (instr) return toP; } - /***************************************************************************** get_args: break individual arguments out of comma-separated list @@ -1439,7 +1417,6 @@ get_args (p, args) return n; } - /***************************************************************************** get_cdisp: handle displacement for a COBR or CTRL instruction. @@ -1529,7 +1506,6 @@ get_cdisp (dispP, ifmtP, instr, numbits, var_frag, callj) } } - /***************************************************************************** get_ispec: parse a memory operand for an index specification @@ -1600,7 +1576,6 @@ get_regnum (regname) return (rP == NULL) ? -1 : *rP; } - /***************************************************************************** i_scan: perform lexical scan of ascii assembler instruction. @@ -1621,7 +1596,7 @@ get_regnum (regname) *************************************************************************** */ static int i_scan (iP, args) - /* Pointer to ascii instruction; MUCKED BY US. */ + /* Pointer to ascii instruction; MUCKED BY US. */ register char *iP; /* Output arg: pointers to opcode and operands placed here. MUST ACCOMMODATE 4 ENTRIES. */ @@ -1652,7 +1627,6 @@ i_scan (iP, args) return (get_args (iP, args)); } /* i_scan() */ - /***************************************************************************** mem_fmt: generate a MEMA- or MEMB-format instruction @@ -1680,7 +1654,7 @@ mem_fmt (args, oP, callx) memset (&instr, '\0', sizeof (memS)); instr.opcode = oP->opcode; - /* Process operands. */ + /* Process operands. */ for (i = 1; i <= oP->num_ops; i++) { opdesc = oP->operand[i - 1]; @@ -1771,7 +1745,6 @@ mem_fmt (args, oP, callx) } } /* memfmt() */ - /***************************************************************************** mema_to_memb: convert a MEMA-format opcode to a MEMB-format opcode. @@ -1804,7 +1777,6 @@ mema_to_memb (opcodeP) md_number_to_chars (opcodeP, opcode, 4); } /* mema_to_memb() */ - /***************************************************************************** parse_expr: parse an expression @@ -1858,7 +1830,6 @@ parse_expr (textP, expP) } } - /***************************************************************************** parse_ldcont: Parse and replace a 'ldconst' pseudo-instruction with an appropriate @@ -1885,7 +1856,6 @@ parse_ldconst (arg) static char buf2[5]; /* Literal for second operand */ expressionS e; /* Parsed expression */ - arg[3] = NULL; /* So we can tell at the end if it got used or not */ parse_expr (arg[1], &e); @@ -2020,7 +1990,6 @@ parse_memop (memP, argP, optype) 16 /* MEM16 */ }; - iprel_flag = mode = 0; /* Any index present? */ @@ -2208,7 +2177,7 @@ parse_po (po_num) extern char is_end_of_line[]; - /* Advance input pointer to end of line. */ + /* Advance input pointer to end of line. */ p = input_line_pointer; while (!is_end_of_line[(unsigned char) *input_line_pointer]) { @@ -2358,7 +2327,6 @@ reg_fmt (args, oP) struct regop regop; /* Description of register operand */ int n_ops; /* Number of operands */ - instr = oP->opcode; n_ops = oP->num_ops; @@ -2425,7 +2393,6 @@ reg_fmt (args, oP) emit (instr); } - /***************************************************************************** relax_cobr: Replace cobr instruction in a code fragment with equivalent branch and @@ -2512,7 +2479,6 @@ relax_cobr (fragP) frag_wane (fragP); } - /***************************************************************************** reloc_callj: Relocate a 'callj' instruction @@ -2580,7 +2546,6 @@ reloc_callj (fixP) /* else Symbol is neither a sysproc nor a leafproc */ } - /***************************************************************************** s_leafproc: process .leafproc pseudo-op @@ -2610,7 +2575,7 @@ s_leafproc (n_ops, args) return; } /* Check number of arguments */ - /* Find or create symbol for 'call' entry point. */ + /* Find or create symbol for 'call' entry point. */ callP = symbol_find_or_make (args[1]); if (TC_S_IS_CALLNAME (callP)) @@ -2644,7 +2609,6 @@ s_leafproc (n_ops, args) } /* if only one arg, or the args are the same */ } - /* s_sysproc: process .sysproc pseudo-op @@ -2670,7 +2634,7 @@ s_sysproc (n_ops, args) return; } /* bad arg count */ - /* Parse "entry_num" argument and check it for validity. */ + /* Parse "entry_num" argument and check it for validity. */ parse_expr (args[2], &exp); if (exp.X_op != O_constant || (offs (exp) < 0) @@ -2692,7 +2656,6 @@ s_sysproc (n_ops, args) TC_S_FORCE_TO_SYSPROC (symP); } - /***************************************************************************** shift_ok: Determine if a "shlo" instruction can be used to implement a "ldconst". @@ -2729,7 +2692,6 @@ shift_ok (n) return shift; } - /* syntax: issue syntax error */ static void @@ -2738,7 +2700,6 @@ syntax () as_bad (_("syntax error")); } /* syntax() */ - /* targ_has_sfr: Return TRUE iff the target architecture supports the specified @@ -2764,7 +2725,6 @@ targ_has_sfr (n) } } - /* targ_has_iclass: Return TRUE iff the target architecture supports the indicated @@ -2826,9 +2786,8 @@ s_endian (ignore) demand_empty_rest_of_line (); } -/* We have no need to default values of symbols. */ +/* We have no need to default values of symbols. */ -/* ARGSUSED */ symbolS * md_undefined_symbol (name) char *name; @@ -2838,7 +2797,7 @@ md_undefined_symbol (name) /* Exactly what point is a PC-relative offset relative TO? On the i960, they're relative to the address of the instruction, - which we have set up as the address of the fixup too. */ + which we have set up as the address of the fixup too. */ long md_pcrel_from (fixP) fixS *fixP; @@ -2940,7 +2899,7 @@ tc_bout_fix_to_chars (where, fixP, segment_address_in_file) ri.r_index = S_GET_TYPE (symbolP); } - /* Output the relocation information in machine-dependent form. */ + /* Output the relocation information in machine-dependent form. */ md_ri_to_chars (where, &ri); } @@ -3248,7 +3207,7 @@ i960_validate_fix (fixP, this_segment_type, add_symbolPP) if (fixP->fx_tcbit && TC_S_IS_CALLNAME (add_symbolP)) { /* Relocation should be done via the associated 'bal' - entry point symbol. */ + entry point symbol. */ if (!TC_S_IS_BALNAME (tc_get_bal_of_call (add_symbolP))) { @@ -3273,7 +3232,7 @@ i960_validate_fix (fixP, this_segment_type, add_symbolPP) displacement and are only to be used for local branches: flag as error, don't generate relocation. */ as_bad (_("can't use COBR format with external label")); - fixP->fx_addsy = NULL; /* No relocations please. */ + fixP->fx_addsy = NULL; /* No relocations please. */ return 1; } } diff --git a/gnu/dist/toolchain/gas/config/tc-i960.h b/gnu/dist/toolchain/gas/config/tc-i960.h index 2746edeeb232..798092fb9ab3 100644 --- a/gnu/dist/toolchain/gas/config/tc-i960.h +++ b/gnu/dist/toolchain/gas/config/tc-i960.h @@ -1,5 +1,5 @@ /* tc-i960.h - Basic 80960 instruction formats. - Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 1999 + Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -17,7 +17,7 @@ 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. */ + 02111-1307, USA. */ #ifndef TC_I960 #define TC_I960 1 @@ -101,7 +101,7 @@ extern int tc_coff_sizemachdep (); #define N_CALLNAME ((char)-1) #define N_BALNAME ((char)-2) -/* i960 uses a custom relocation record. */ +/* i960 uses a custom relocation record. */ /* let obj-aout.h know */ #define CUSTOM_RELOC_FORMAT 1 @@ -155,6 +155,9 @@ extern int i960_validate_fix PARAMS ((struct fix *, segT, symbolS **)); #ifndef OBJ_ELF #define tc_fix_adjustable(FIXP) ((FIXP)->fx_bsr == 0) +/* This arranges for gas/write.c to not apply a relocation if + tc_fix_adjustable() says it is not adjustable. */ +#define TC_FIX_ADJUSTABLE(fixP) tc_fix_adjustable (fixP) #else #define tc_fix_adjustable(FIXP) \ ((FIXP)->fx_bsr == 0 \ @@ -188,5 +191,3 @@ extern const struct relax_type md_relax_table[]; #define TC_INIT_FIX_DATA(F) ((F)->tc_fix_data.bsr = 0) #endif - -/* end of tc-i960.h */ diff --git a/gnu/dist/toolchain/gas/config/tc-ia64.c b/gnu/dist/toolchain/gas/config/tc-ia64.c new file mode 100644 index 000000000000..fab050a9dec5 --- /dev/null +++ b/gnu/dist/toolchain/gas/config/tc-ia64.c @@ -0,0 +1,10142 @@ +/* tc-ia64.c -- Assembler for the HP/Intel IA-64 architecture. + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation. + Contributed by David Mosberger-Tang + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GAS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +/* + TODO: + + - optional operands + - directives: + .alias + .eb + .estate + .lb + .popsection + .previous + .psr + .pushsection + - labels are wrong if automatic alignment is introduced + (e.g., checkout the second real10 definition in test-data.s) + - DV-related stuff: + .safe_across_calls and any other DV-related directives I don't + have documentation for. + verify mod-sched-brs reads/writes are checked/marked (and other + notes) + + */ + +#include "as.h" +#include "dwarf2dbg.h" +#include "subsegs.h" + +#include "opcode/ia64.h" + +#include "elf/ia64.h" + +#define NELEMS(a) ((int) (sizeof (a)/sizeof ((a)[0]))) +#define MIN(a,b) ((a) < (b) ? (a) : (b)) + +#define NUM_SLOTS 4 +#define PREV_SLOT md.slot[(md.curr_slot + NUM_SLOTS - 1) % NUM_SLOTS] +#define CURR_SLOT md.slot[md.curr_slot] + +#define O_pseudo_fixup (O_max + 1) + +enum special_section + { + SPECIAL_SECTION_BSS = 0, + SPECIAL_SECTION_SBSS, + SPECIAL_SECTION_SDATA, + SPECIAL_SECTION_RODATA, + SPECIAL_SECTION_COMMENT, + SPECIAL_SECTION_UNWIND, + SPECIAL_SECTION_UNWIND_INFO + }; + +enum reloc_func + { + FUNC_FPTR_RELATIVE, + FUNC_GP_RELATIVE, + FUNC_LT_RELATIVE, + FUNC_PC_RELATIVE, + FUNC_PLT_RELATIVE, + FUNC_SEC_RELATIVE, + FUNC_SEG_RELATIVE, + FUNC_LTV_RELATIVE, + FUNC_LT_FPTR_RELATIVE, + }; + +enum reg_symbol + { + REG_GR = 0, + REG_FR = (REG_GR + 128), + REG_AR = (REG_FR + 128), + REG_CR = (REG_AR + 128), + REG_P = (REG_CR + 128), + REG_BR = (REG_P + 64), + REG_IP = (REG_BR + 8), + REG_CFM, + REG_PR, + REG_PR_ROT, + REG_PSR, + REG_PSR_L, + REG_PSR_UM, + /* The following are pseudo-registers for use by gas only. */ + IND_CPUID, + IND_DBR, + IND_DTR, + IND_ITR, + IND_IBR, + IND_MEM, + IND_MSR, + IND_PKR, + IND_PMC, + IND_PMD, + IND_RR, + /* The following pseudo-registers are used for unwind directives only: */ + REG_PSP, + REG_PRIUNAT, + REG_NUM + }; + +enum dynreg_type + { + DYNREG_GR = 0, /* dynamic general purpose register */ + DYNREG_FR, /* dynamic floating point register */ + DYNREG_PR, /* dynamic predicate register */ + DYNREG_NUM_TYPES + }; + +enum operand_match_result + { + OPERAND_MATCH, + OPERAND_OUT_OF_RANGE, + OPERAND_MISMATCH + }; + +/* On the ia64, we can't know the address of a text label until the + instructions are packed into a bundle. To handle this, we keep + track of the list of labels that appear in front of each + instruction. */ +struct label_fix +{ + struct label_fix *next; + struct symbol *sym; +}; + +extern int target_big_endian; + +/* Characters which always start a comment. */ +const char comment_chars[] = ""; + +/* Characters which start a comment at the beginning of a line. */ +const char line_comment_chars[] = "#"; + +/* Characters which may be used to separate multiple commands on a + single line. */ +const char line_separator_chars[] = ";"; + +/* Characters which are used to indicate an exponent in a floating + point number. */ +const char EXP_CHARS[] = "eE"; + +/* Characters which mean that a number is a floating point constant, + as in 0d1.0. */ +const char FLT_CHARS[] = "rRsSfFdDxXpP"; + +/* ia64-specific option processing: */ + +const char *md_shortopts = "m:N:x::"; + +struct option md_longopts[] = + { +#define OPTION_MCONSTANT_GP (OPTION_MD_BASE + 1) + {"mconstant-gp", no_argument, NULL, OPTION_MCONSTANT_GP}, +#define OPTION_MAUTO_PIC (OPTION_MD_BASE + 2) + {"mauto-pic", no_argument, NULL, OPTION_MAUTO_PIC} + }; + +size_t md_longopts_size = sizeof (md_longopts); + +static struct + { + struct hash_control *pseudo_hash; /* pseudo opcode hash table */ + struct hash_control *reg_hash; /* register name hash table */ + struct hash_control *dynreg_hash; /* dynamic register hash table */ + struct hash_control *const_hash; /* constant hash table */ + struct hash_control *entry_hash; /* code entry hint hash table */ + + symbolS *regsym[REG_NUM]; + + /* If X_op is != O_absent, the registername for the instruction's + qualifying predicate. If NULL, p0 is assumed for instructions + that are predicatable. */ + expressionS qp; + + unsigned int + manual_bundling : 1, + debug_dv: 1, + detect_dv: 1, + explicit_mode : 1, /* which mode we're in */ + default_explicit_mode : 1, /* which mode is the default */ + mode_explicitly_set : 1, /* was the current mode explicitly set? */ + auto_align : 1, + keep_pending_output : 1; + + /* Each bundle consists of up to three instructions. We keep + track of four most recent instructions so we can correctly set + the end_of_insn_group for the last instruction in a bundle. */ + int curr_slot; + int num_slots_in_use; + struct slot + { + unsigned int + end_of_insn_group : 1, + manual_bundling_on : 1, + manual_bundling_off : 1; + signed char user_template; /* user-selected template, if any */ + unsigned char qp_regno; /* qualifying predicate */ + /* This duplicates a good fraction of "struct fix" but we + can't use a "struct fix" instead since we can't call + fix_new_exp() until we know the address of the instruction. */ + int num_fixups; + struct insn_fix + { + bfd_reloc_code_real_type code; + enum ia64_opnd opnd; /* type of operand in need of fix */ + unsigned int is_pcrel : 1; /* is operand pc-relative? */ + expressionS expr; /* the value to be inserted */ + } + fixup[2]; /* at most two fixups per insn */ + struct ia64_opcode *idesc; + struct label_fix *label_fixups; + struct label_fix *tag_fixups; + struct unw_rec_list *unwind_record; /* Unwind directive. */ + expressionS opnd[6]; + char *src_file; + unsigned int src_line; + struct dwarf2_line_info debug_line; + } + slot[NUM_SLOTS]; + + segT last_text_seg; + + struct dynreg + { + struct dynreg *next; /* next dynamic register */ + const char *name; + unsigned short base; /* the base register number */ + unsigned short num_regs; /* # of registers in this set */ + } + *dynreg[DYNREG_NUM_TYPES], in, loc, out, rot; + + flagword flags; /* ELF-header flags */ + + struct mem_offset { + unsigned hint:1; /* is this hint currently valid? */ + bfd_vma offset; /* mem.offset offset */ + bfd_vma base; /* mem.offset base */ + } mem_offset; + + int path; /* number of alt. entry points seen */ + const char **entry_labels; /* labels of all alternate paths in + the current DV-checking block. */ + int maxpaths; /* size currently allocated for + entry_labels */ + /* Support for hardware errata workarounds. */ + + /* Record data about the last three insn groups. */ + struct group + { + /* B-step workaround. + For each predicate register, this is set if the corresponding insn + group conditionally sets this register with one of the affected + instructions. */ + int p_reg_set[64]; + /* B-step workaround. + For each general register, this is set if the corresponding insn + a) is conditional one one of the predicate registers for which + P_REG_SET is 1 in the corresponding entry of the previous group, + b) sets this general register with one of the affected + instructions. */ + int g_reg_set_conditionally[128]; + } last_groups[3]; + int group_idx; + } +md; + +/* application registers: */ + +#define AR_K0 0 +#define AR_K7 7 +#define AR_RSC 16 +#define AR_BSP 17 +#define AR_BSPSTORE 18 +#define AR_RNAT 19 +#define AR_UNAT 36 +#define AR_FPSR 40 +#define AR_ITC 44 +#define AR_PFS 64 +#define AR_LC 65 + +static const struct + { + const char *name; + int regnum; + } +ar[] = + { + {"ar.k0", 0}, {"ar.k1", 1}, {"ar.k2", 2}, {"ar.k3", 3}, + {"ar.k4", 4}, {"ar.k5", 5}, {"ar.k6", 6}, {"ar.k7", 7}, + {"ar.rsc", 16}, {"ar.bsp", 17}, + {"ar.bspstore", 18}, {"ar.rnat", 19}, + {"ar.fcr", 21}, {"ar.eflag", 24}, + {"ar.csd", 25}, {"ar.ssd", 26}, + {"ar.cflg", 27}, {"ar.fsr", 28}, + {"ar.fir", 29}, {"ar.fdr", 30}, + {"ar.ccv", 32}, {"ar.unat", 36}, + {"ar.fpsr", 40}, {"ar.itc", 44}, + {"ar.pfs", 64}, {"ar.lc", 65}, + {"ar.ec", 66}, + }; + +#define CR_IPSR 16 +#define CR_ISR 17 +#define CR_IIP 19 +#define CR_IFA 20 +#define CR_ITIR 21 +#define CR_IIPA 22 +#define CR_IFS 23 +#define CR_IIM 24 +#define CR_IHA 25 +#define CR_IVR 65 +#define CR_TPR 66 +#define CR_EOI 67 +#define CR_IRR0 68 +#define CR_IRR3 71 +#define CR_LRR0 80 +#define CR_LRR1 81 + +/* control registers: */ +static const struct + { + const char *name; + int regnum; + } +cr[] = + { + {"cr.dcr", 0}, + {"cr.itm", 1}, + {"cr.iva", 2}, + {"cr.pta", 8}, + {"cr.gpta", 9}, + {"cr.ipsr", 16}, + {"cr.isr", 17}, + {"cr.iip", 19}, + {"cr.ifa", 20}, + {"cr.itir", 21}, + {"cr.iipa", 22}, + {"cr.ifs", 23}, + {"cr.iim", 24}, + {"cr.iha", 25}, + {"cr.lid", 64}, + {"cr.ivr", 65}, + {"cr.tpr", 66}, + {"cr.eoi", 67}, + {"cr.irr0", 68}, + {"cr.irr1", 69}, + {"cr.irr2", 70}, + {"cr.irr3", 71}, + {"cr.itv", 72}, + {"cr.pmv", 73}, + {"cr.cmcv", 74}, + {"cr.lrr0", 80}, + {"cr.lrr1", 81} + }; + +#define PSR_MFL 4 +#define PSR_IC 13 +#define PSR_DFL 18 +#define PSR_CPL 32 + +static const struct const_desc + { + const char *name; + valueT value; + } +const_bits[] = + { + /* PSR constant masks: */ + + /* 0: reserved */ + {"psr.be", ((valueT) 1) << 1}, + {"psr.up", ((valueT) 1) << 2}, + {"psr.ac", ((valueT) 1) << 3}, + {"psr.mfl", ((valueT) 1) << 4}, + {"psr.mfh", ((valueT) 1) << 5}, + /* 6-12: reserved */ + {"psr.ic", ((valueT) 1) << 13}, + {"psr.i", ((valueT) 1) << 14}, + {"psr.pk", ((valueT) 1) << 15}, + /* 16: reserved */ + {"psr.dt", ((valueT) 1) << 17}, + {"psr.dfl", ((valueT) 1) << 18}, + {"psr.dfh", ((valueT) 1) << 19}, + {"psr.sp", ((valueT) 1) << 20}, + {"psr.pp", ((valueT) 1) << 21}, + {"psr.di", ((valueT) 1) << 22}, + {"psr.si", ((valueT) 1) << 23}, + {"psr.db", ((valueT) 1) << 24}, + {"psr.lp", ((valueT) 1) << 25}, + {"psr.tb", ((valueT) 1) << 26}, + {"psr.rt", ((valueT) 1) << 27}, + /* 28-31: reserved */ + /* 32-33: cpl (current privilege level) */ + {"psr.is", ((valueT) 1) << 34}, + {"psr.mc", ((valueT) 1) << 35}, + {"psr.it", ((valueT) 1) << 36}, + {"psr.id", ((valueT) 1) << 37}, + {"psr.da", ((valueT) 1) << 38}, + {"psr.dd", ((valueT) 1) << 39}, + {"psr.ss", ((valueT) 1) << 40}, + /* 41-42: ri (restart instruction) */ + {"psr.ed", ((valueT) 1) << 43}, + {"psr.bn", ((valueT) 1) << 44}, + }; + +/* indirect register-sets/memory: */ + +static const struct + { + const char *name; + int regnum; + } +indirect_reg[] = + { + { "CPUID", IND_CPUID }, + { "cpuid", IND_CPUID }, + { "dbr", IND_DBR }, + { "dtr", IND_DTR }, + { "itr", IND_ITR }, + { "ibr", IND_IBR }, + { "msr", IND_MSR }, + { "pkr", IND_PKR }, + { "pmc", IND_PMC }, + { "pmd", IND_PMD }, + { "rr", IND_RR }, + }; + +/* Pseudo functions used to indicate relocation types (these functions + start with an at sign (@). */ +static struct + { + const char *name; + enum pseudo_type + { + PSEUDO_FUNC_NONE, + PSEUDO_FUNC_RELOC, + PSEUDO_FUNC_CONST, + PSEUDO_FUNC_REG, + PSEUDO_FUNC_FLOAT + } + type; + union + { + unsigned long ival; + symbolS *sym; + } + u; + } +pseudo_func[] = + { + /* reloc pseudo functions (these must come first!): */ + { "fptr", PSEUDO_FUNC_RELOC, { 0 } }, + { "gprel", PSEUDO_FUNC_RELOC, { 0 } }, + { "ltoff", PSEUDO_FUNC_RELOC, { 0 } }, + { "pcrel", PSEUDO_FUNC_RELOC, { 0 } }, + { "pltoff", PSEUDO_FUNC_RELOC, { 0 } }, + { "secrel", PSEUDO_FUNC_RELOC, { 0 } }, + { "segrel", PSEUDO_FUNC_RELOC, { 0 } }, + { "ltv", PSEUDO_FUNC_RELOC, { 0 } }, + { "", 0, { 0 } }, /* placeholder for FUNC_LT_FPTR_RELATIVE */ + + /* mbtype4 constants: */ + { "alt", PSEUDO_FUNC_CONST, { 0xa } }, + { "brcst", PSEUDO_FUNC_CONST, { 0x0 } }, + { "mix", PSEUDO_FUNC_CONST, { 0x8 } }, + { "rev", PSEUDO_FUNC_CONST, { 0xb } }, + { "shuf", PSEUDO_FUNC_CONST, { 0x9 } }, + + /* fclass constants: */ + { "nat", PSEUDO_FUNC_CONST, { 0x100 } }, + { "qnan", PSEUDO_FUNC_CONST, { 0x080 } }, + { "snan", PSEUDO_FUNC_CONST, { 0x040 } }, + { "pos", PSEUDO_FUNC_CONST, { 0x001 } }, + { "neg", PSEUDO_FUNC_CONST, { 0x002 } }, + { "zero", PSEUDO_FUNC_CONST, { 0x004 } }, + { "unorm", PSEUDO_FUNC_CONST, { 0x008 } }, + { "norm", PSEUDO_FUNC_CONST, { 0x010 } }, + { "inf", PSEUDO_FUNC_CONST, { 0x020 } }, + + { "natval", PSEUDO_FUNC_CONST, { 0x100 } }, /* old usage */ + + /* unwind-related constants: */ + { "svr4", PSEUDO_FUNC_CONST, { 0 } }, + { "hpux", PSEUDO_FUNC_CONST, { 1 } }, + { "nt", PSEUDO_FUNC_CONST, { 2 } }, + + /* unwind-related registers: */ + { "priunat",PSEUDO_FUNC_REG, { REG_PRIUNAT } } + }; + +/* 41-bit nop opcodes (one per unit): */ +static const bfd_vma nop[IA64_NUM_UNITS] = + { + 0x0000000000LL, /* NIL => break 0 */ + 0x0008000000LL, /* I-unit nop */ + 0x0008000000LL, /* M-unit nop */ + 0x4000000000LL, /* B-unit nop */ + 0x0008000000LL, /* F-unit nop */ + 0x0008000000LL, /* L-"unit" nop */ + 0x0008000000LL, /* X-unit nop */ + }; + +/* Can't be `const' as it's passed to input routines (which have the + habit of setting temporary sentinels. */ +static char special_section_name[][20] = + { + {".bss"}, {".sbss"}, {".sdata"}, {".rodata"}, {".comment"}, + {".IA_64.unwind"}, {".IA_64.unwind_info"} + }; + +/* The best template for a particular sequence of up to three + instructions: */ +#define N IA64_NUM_TYPES +static unsigned char best_template[N][N][N]; +#undef N + +/* Resource dependencies currently in effect */ +static struct rsrc { + int depind; /* dependency index */ + const struct ia64_dependency *dependency; /* actual dependency */ + unsigned specific:1, /* is this a specific bit/regno? */ + link_to_qp_branch:1; /* will a branch on the same QP clear it?*/ + int index; /* specific regno/bit within dependency */ + int note; /* optional qualifying note (0 if none) */ +#define STATE_NONE 0 +#define STATE_STOP 1 +#define STATE_SRLZ 2 + int insn_srlz; /* current insn serialization state */ + int data_srlz; /* current data serialization state */ + int qp_regno; /* qualifying predicate for this usage */ + char *file; /* what file marked this dependency */ + unsigned int line; /* what line marked this dependency */ + struct mem_offset mem_offset; /* optional memory offset hint */ + enum { CMP_NONE, CMP_OR, CMP_AND } cmp_type; /* OR or AND compare? */ + int path; /* corresponding code entry index */ +} *regdeps = NULL; +static int regdepslen = 0; +static int regdepstotlen = 0; +static const char *dv_mode[] = { "RAW", "WAW", "WAR" }; +static const char *dv_sem[] = { "none", "implied", "impliedf", + "data", "instr", "specific", "stop", "other" }; +static const char *dv_cmp_type[] = { "none", "OR", "AND" }; + +/* Current state of PR mutexation */ +static struct qpmutex { + valueT prmask; + int path; +} *qp_mutexes = NULL; /* QP mutex bitmasks */ +static int qp_mutexeslen = 0; +static int qp_mutexestotlen = 0; +static valueT qp_safe_across_calls = 0; + +/* Current state of PR implications */ +static struct qp_imply { + unsigned p1:6; + unsigned p2:6; + unsigned p2_branched:1; + int path; +} *qp_implies = NULL; +static int qp_implieslen = 0; +static int qp_impliestotlen = 0; + +/* Keep track of static GR values so that indirect register usage can + sometimes be tracked. */ +static struct gr { + unsigned known:1; + int path; + valueT value; +} gr_values[128] = {{ 1, 0, 0 }}; + +/* These are the routines required to output the various types of + unwind records. */ + +/* A slot_number is a frag address plus the slot index (0-2). We use the + frag address here so that if there is a section switch in the middle of + a function, then instructions emitted to a different section are not + counted. Since there may be more than one frag for a function, this + means we also need to keep track of which frag this address belongs to + so we can compute inter-frag distances. This also nicely solves the + problem with nops emitted for align directives, which can't easily be + counted, but can easily be derived from frag sizes. */ + +typedef struct unw_rec_list { + unwind_record r; + unsigned long slot_number; + fragS *slot_frag; + struct unw_rec_list *next; +} unw_rec_list; + +#define SLOT_NUM_NOT_SET (unsigned)-1 + +static struct +{ + unsigned long next_slot_number; + fragS *next_slot_frag; + + /* Maintain a list of unwind entries for the current function. */ + unw_rec_list *list; + unw_rec_list *tail; + + /* Any unwind entires that should be attached to the current slot + that an insn is being constructed for. */ + unw_rec_list *current_entry; + + /* These are used to create the unwind table entry for this function. */ + symbolS *proc_start; + symbolS *proc_end; + symbolS *info; /* pointer to unwind info */ + symbolS *personality_routine; + segT saved_text_seg; + subsegT saved_text_subseg; + unsigned int force_unwind_entry : 1; /* force generation of unwind entry? */ + + /* TRUE if processing unwind directives in a prologue region. */ + int prologue; + int prologue_mask; + unsigned int prologue_count; /* number of .prologues seen so far */ +} unwind; + +typedef void (*vbyte_func) PARAMS ((int, char *, char *)); + +/* Forward delarations: */ +static int ar_is_in_integer_unit PARAMS ((int regnum)); +static void set_section PARAMS ((char *name)); +static unsigned int set_regstack PARAMS ((unsigned int, unsigned int, + unsigned int, unsigned int)); +static void dot_radix PARAMS ((int)); +static void dot_special_section PARAMS ((int)); +static void dot_proc PARAMS ((int)); +static void dot_fframe PARAMS ((int)); +static void dot_vframe PARAMS ((int)); +static void dot_vframesp PARAMS ((int)); +static void dot_vframepsp PARAMS ((int)); +static void dot_save PARAMS ((int)); +static void dot_restore PARAMS ((int)); +static void dot_restorereg PARAMS ((int)); +static void dot_restorereg_p PARAMS ((int)); +static void dot_handlerdata PARAMS ((int)); +static void dot_unwentry PARAMS ((int)); +static void dot_altrp PARAMS ((int)); +static void dot_savemem PARAMS ((int)); +static void dot_saveg PARAMS ((int)); +static void dot_savef PARAMS ((int)); +static void dot_saveb PARAMS ((int)); +static void dot_savegf PARAMS ((int)); +static void dot_spill PARAMS ((int)); +static void dot_spillreg PARAMS ((int)); +static void dot_spillmem PARAMS ((int)); +static void dot_spillreg_p PARAMS ((int)); +static void dot_spillmem_p PARAMS ((int)); +static void dot_label_state PARAMS ((int)); +static void dot_copy_state PARAMS ((int)); +static void dot_unwabi PARAMS ((int)); +static void dot_personality PARAMS ((int)); +static void dot_body PARAMS ((int)); +static void dot_prologue PARAMS ((int)); +static void dot_endp PARAMS ((int)); +static void dot_template PARAMS ((int)); +static void dot_regstk PARAMS ((int)); +static void dot_rot PARAMS ((int)); +static void dot_byteorder PARAMS ((int)); +static void dot_psr PARAMS ((int)); +static void dot_alias PARAMS ((int)); +static void dot_ln PARAMS ((int)); +static char *parse_section_name PARAMS ((void)); +static void dot_xdata PARAMS ((int)); +static void stmt_float_cons PARAMS ((int)); +static void stmt_cons_ua PARAMS ((int)); +static void dot_xfloat_cons PARAMS ((int)); +static void dot_xstringer PARAMS ((int)); +static void dot_xdata_ua PARAMS ((int)); +static void dot_xfloat_cons_ua PARAMS ((int)); +static void print_prmask PARAMS ((valueT mask)); +static void dot_pred_rel PARAMS ((int)); +static void dot_reg_val PARAMS ((int)); +static void dot_dv_mode PARAMS ((int)); +static void dot_entry PARAMS ((int)); +static void dot_mem_offset PARAMS ((int)); +static void add_unwind_entry PARAMS((unw_rec_list *ptr)); +static symbolS *declare_register PARAMS ((const char *name, int regnum)); +static void declare_register_set PARAMS ((const char *, int, int)); +static unsigned int operand_width PARAMS ((enum ia64_opnd)); +static enum operand_match_result operand_match PARAMS ((const struct ia64_opcode *idesc, + int index, + expressionS *e)); +static int parse_operand PARAMS ((expressionS *e)); +static struct ia64_opcode * parse_operands PARAMS ((struct ia64_opcode *)); +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)); +static bfd_reloc_code_real_type ia64_gen_real_reloc_type PARAMS ((struct symbol *sym, + bfd_reloc_code_real_type r_type)); +static void insn_group_break PARAMS ((int, int, int)); +static void mark_resource PARAMS ((struct ia64_opcode *, const struct ia64_dependency *, + struct rsrc *, int depind, int path)); +static void add_qp_mutex PARAMS((valueT mask)); +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 void clear_register_values PARAMS ((void)); +static void print_dependency PARAMS ((const char *action, int depind)); +static void instruction_serialization PARAMS ((void)); +static void data_serialization PARAMS ((void)); +static void remove_marked_resource PARAMS ((struct rsrc *)); +static int is_conditional_branch PARAMS ((struct ia64_opcode *)); +static int is_taken_branch PARAMS ((struct ia64_opcode *)); +static int is_interruption_or_rfi PARAMS ((struct ia64_opcode *)); +static int depends_on PARAMS ((int, struct ia64_opcode *)); +static int specify_resource PARAMS ((const struct ia64_dependency *, + struct ia64_opcode *, int, struct rsrc [], int, int)); +static int check_dv PARAMS((struct ia64_opcode *idesc)); +static void check_dependencies PARAMS((struct ia64_opcode *)); +static void mark_resources PARAMS((struct ia64_opcode *)); +static void update_dependencies PARAMS((struct ia64_opcode *)); +static void note_register_values PARAMS((struct ia64_opcode *)); +static int qp_mutex PARAMS ((int, int, int)); +static int resources_match PARAMS ((struct rsrc *, struct ia64_opcode *, int, int, int)); +static void output_vbyte_mem PARAMS ((int, char *, char *)); +static void count_output PARAMS ((int, char *, char *)); +static void output_R1_format PARAMS ((vbyte_func, unw_record_type, int)); +static void output_R2_format PARAMS ((vbyte_func, int, int, unsigned long)); +static void output_R3_format PARAMS ((vbyte_func, unw_record_type, unsigned long)); +static void output_P1_format PARAMS ((vbyte_func, int)); +static void output_P2_format PARAMS ((vbyte_func, int, int)); +static void output_P3_format PARAMS ((vbyte_func, unw_record_type, int)); +static void output_P4_format PARAMS ((vbyte_func, unsigned char *, unsigned long)); +static void output_P5_format PARAMS ((vbyte_func, int, unsigned long)); +static void output_P6_format PARAMS ((vbyte_func, unw_record_type, int)); +static void output_P7_format PARAMS ((vbyte_func, unw_record_type, unsigned long, unsigned long)); +static void output_P8_format PARAMS ((vbyte_func, unw_record_type, unsigned long)); +static void output_P9_format PARAMS ((vbyte_func, int, int)); +static void output_P10_format PARAMS ((vbyte_func, int, int)); +static void output_B1_format PARAMS ((vbyte_func, unw_record_type, unsigned long)); +static void output_B2_format PARAMS ((vbyte_func, unsigned long, unsigned long)); +static void output_B3_format PARAMS ((vbyte_func, unsigned long, unsigned long)); +static void output_B4_format PARAMS ((vbyte_func, unw_record_type, unsigned long)); +static char format_ab_reg PARAMS ((int, int)); +static void output_X1_format PARAMS ((vbyte_func, unw_record_type, int, int, unsigned long, + unsigned long)); +static void output_X2_format PARAMS ((vbyte_func, int, int, int, int, int, unsigned long)); +static void output_X3_format PARAMS ((vbyte_func, unw_record_type, int, int, int, unsigned long, + unsigned long)); +static void output_X4_format PARAMS ((vbyte_func, int, int, int, int, int, int, unsigned long)); +static void free_list_records PARAMS ((unw_rec_list *)); +static unw_rec_list *output_prologue PARAMS ((void)); +static unw_rec_list *output_prologue_gr PARAMS ((unsigned int, unsigned int)); +static unw_rec_list *output_body PARAMS ((void)); +static unw_rec_list *output_mem_stack_f PARAMS ((unsigned int)); +static unw_rec_list *output_mem_stack_v PARAMS ((void)); +static unw_rec_list *output_psp_gr PARAMS ((unsigned int)); +static unw_rec_list *output_psp_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_rp_when PARAMS ((void)); +static unw_rec_list *output_rp_gr PARAMS ((unsigned int)); +static unw_rec_list *output_rp_br PARAMS ((unsigned int)); +static unw_rec_list *output_rp_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_rp_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_pfs_when PARAMS ((void)); +static unw_rec_list *output_pfs_gr PARAMS ((unsigned int)); +static unw_rec_list *output_pfs_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_pfs_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_preds_when PARAMS ((void)); +static unw_rec_list *output_preds_gr PARAMS ((unsigned int)); +static unw_rec_list *output_preds_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_preds_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_fr_mem PARAMS ((unsigned int)); +static unw_rec_list *output_frgr_mem PARAMS ((unsigned int, unsigned int)); +static unw_rec_list *output_gr_gr PARAMS ((unsigned int, unsigned int)); +static unw_rec_list *output_gr_mem PARAMS ((unsigned int)); +static unw_rec_list *output_br_mem PARAMS ((unsigned int)); +static unw_rec_list *output_br_gr PARAMS ((unsigned int, unsigned int)); +static unw_rec_list *output_spill_base PARAMS ((unsigned int)); +static unw_rec_list *output_unat_when PARAMS ((void)); +static unw_rec_list *output_unat_gr PARAMS ((unsigned int)); +static unw_rec_list *output_unat_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_unat_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_lc_when PARAMS ((void)); +static unw_rec_list *output_lc_gr PARAMS ((unsigned int)); +static unw_rec_list *output_lc_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_lc_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_fpsr_when PARAMS ((void)); +static unw_rec_list *output_fpsr_gr PARAMS ((unsigned int)); +static unw_rec_list *output_fpsr_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_fpsr_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_priunat_when_gr PARAMS ((void)); +static unw_rec_list *output_priunat_when_mem PARAMS ((void)); +static unw_rec_list *output_priunat_gr PARAMS ((unsigned int)); +static unw_rec_list *output_priunat_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_priunat_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_bsp_when PARAMS ((void)); +static unw_rec_list *output_bsp_gr PARAMS ((unsigned int)); +static unw_rec_list *output_bsp_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_bsp_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_bspstore_when PARAMS ((void)); +static unw_rec_list *output_bspstore_gr PARAMS ((unsigned int)); +static unw_rec_list *output_bspstore_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_bspstore_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_rnat_when PARAMS ((void)); +static unw_rec_list *output_rnat_gr PARAMS ((unsigned int)); +static unw_rec_list *output_rnat_psprel PARAMS ((unsigned int)); +static unw_rec_list *output_rnat_sprel PARAMS ((unsigned int)); +static unw_rec_list *output_unwabi PARAMS ((unsigned long, unsigned long)); +static unw_rec_list *output_epilogue PARAMS ((unsigned long)); +static unw_rec_list *output_label_state PARAMS ((unsigned long)); +static unw_rec_list *output_copy_state PARAMS ((unsigned long)); +static unw_rec_list *output_spill_psprel PARAMS ((unsigned int, unsigned int, unsigned int)); +static unw_rec_list *output_spill_sprel PARAMS ((unsigned int, unsigned int, unsigned int)); +static unw_rec_list *output_spill_psprel_p PARAMS ((unsigned int, unsigned int, unsigned int, + unsigned int)); +static unw_rec_list *output_spill_sprel_p PARAMS ((unsigned int, unsigned int, unsigned int, + unsigned int)); +static unw_rec_list *output_spill_reg PARAMS ((unsigned int, unsigned int, unsigned int, + unsigned int)); +static unw_rec_list *output_spill_reg_p PARAMS ((unsigned int, unsigned int, unsigned int, + unsigned int, unsigned int)); +static void process_one_record PARAMS ((unw_rec_list *, vbyte_func)); +static void process_unw_records PARAMS ((unw_rec_list *, vbyte_func)); +static int calc_record_size PARAMS ((unw_rec_list *)); +static void set_imask PARAMS ((unw_rec_list *, unsigned long, unsigned long, unsigned int)); +static int count_bits PARAMS ((unsigned long)); +static unsigned long slot_index PARAMS ((unsigned long, fragS *, + unsigned long, fragS *)); +static unw_rec_list *optimize_unw_records PARAMS ((unw_rec_list *)); +static void fixup_unw_records PARAMS ((unw_rec_list *)); +static int output_unw_records PARAMS ((unw_rec_list *, void **)); +static int convert_expr_to_ab_reg PARAMS ((expressionS *, unsigned int *, unsigned int *)); +static int convert_expr_to_xy_reg PARAMS ((expressionS *, unsigned int *, unsigned int *)); +static int generate_unwind_image PARAMS ((const char *)); + +/* Build the unwind section name by appending the (possibly stripped) + text section NAME to the unwind PREFIX. The resulting string + pointer is assigned to RESULT. The string is allocated on the + 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'; \ + result = _result; \ + } \ +while (0) + +/* Determine if application register REGNUM resides in the integer + unit (as opposed to the memory unit). */ +static int +ar_is_in_integer_unit (reg) + int reg; +{ + reg -= REG_AR; + + return (reg == 64 /* pfs */ + || reg == 65 /* lc */ + || reg == 66 /* ec */ + /* ??? ias accepts and puts these in the integer unit. */ + || (reg >= 112 && reg <= 127)); +} + +/* Switch to section NAME and create section if necessary. It's + rather ugly that we have to manipulate input_line_pointer but I + don't see any other way to accomplish the same thing without + changing obj-elf.c (which may be the Right Thing, in the end). */ +static void +set_section (name) + char *name; +{ + char *saved_input_line_pointer; + + saved_input_line_pointer = input_line_pointer; + input_line_pointer = name; + obj_elf_section (0); + input_line_pointer = saved_input_line_pointer; +} + +/* Map SHF_IA_64_SHORT to SEC_SMALL_DATA. */ + +flagword +ia64_elf_section_flags (flags, attr, type) + flagword flags; + int attr, type ATTRIBUTE_UNUSED; +{ + if (attr & SHF_IA_64_SHORT) + flags |= SEC_SMALL_DATA; + return flags; +} + +int +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) + return SHT_PROGBITS; + + len = sizeof (ELF_STRING_ia64_unwind) - 1; + if (strncmp (str, ELF_STRING_ia64_unwind, len) == 0) + return SHT_IA_64_UNWIND; + + return -1; +} + +static unsigned int +set_regstack (ins, locs, outs, rots) + unsigned int ins, locs, outs, rots; +{ + /* Size of frame. */ + unsigned int sof; + + sof = ins + locs + outs; + if (sof > 96) + { + as_bad ("Size of frame exceeds maximum of 96 registers"); + return 0; + } + if (rots > sof) + { + as_warn ("Size of rotating registers exceeds frame size"); + return 0; + } + md.in.base = REG_GR + 32; + md.loc.base = md.in.base + ins; + md.out.base = md.loc.base + locs; + + md.in.num_regs = ins; + md.loc.num_regs = locs; + md.out.num_regs = outs; + md.rot.num_regs = rots; + return sof; +} + +void +ia64_flush_insns () +{ + struct label_fix *lfix; + segT saved_seg; + subsegT saved_subseg; + unw_rec_list *ptr; + + if (!md.last_text_seg) + return; + + saved_seg = now_seg; + saved_subseg = now_subseg; + + subseg_set (md.last_text_seg, 0); + + while (md.num_slots_in_use > 0) + emit_one_bundle (); /* force out queued instructions */ + + /* In case there are labels following the last instruction, resolve + those now: */ + for (lfix = CURR_SLOT.label_fixups; lfix; lfix = lfix->next) + { + S_SET_VALUE (lfix->sym, frag_now_fix ()); + symbol_set_frag (lfix->sym, frag_now); + } + CURR_SLOT.label_fixups = 0; + for (lfix = CURR_SLOT.tag_fixups; lfix; lfix = lfix->next) + { + S_SET_VALUE (lfix->sym, frag_now_fix ()); + symbol_set_frag (lfix->sym, frag_now); + } + CURR_SLOT.tag_fixups = 0; + + /* In case there are unwind directives following the last instruction, + resolve those now. We only handle body and prologue directives here. + Give an error for others. */ + for (ptr = unwind.current_entry; ptr; ptr = ptr->next) + { + if (ptr->r.type == prologue || ptr->r.type == prologue_gr + || ptr->r.type == body) + { + ptr->slot_number = (unsigned long) frag_more (0); + ptr->slot_frag = frag_now; + } + else + as_bad (_("Unwind directive not followed by an instruction.")); + } + unwind.current_entry = NULL; + + subseg_set (saved_seg, saved_subseg); + + if (md.qp.X_op == O_register) + as_bad ("qualifying predicate not followed by instruction"); +} + +void +ia64_do_align (nbytes) + int nbytes; +{ + char *saved_input_line_pointer = input_line_pointer; + + input_line_pointer = ""; + s_align_bytes (nbytes); + input_line_pointer = saved_input_line_pointer; +} + +void +ia64_cons_align (nbytes) + int nbytes; +{ + if (md.auto_align) + { + char *saved_input_line_pointer = input_line_pointer; + input_line_pointer = ""; + s_align_bytes (nbytes); + input_line_pointer = saved_input_line_pointer; + } +} + +/* Output COUNT bytes to a memory location. */ +static unsigned char *vbyte_mem_ptr = NULL; + +void +output_vbyte_mem (count, ptr, comment) + int count; + char *ptr; + char *comment ATTRIBUTE_UNUSED; +{ + int x; + if (vbyte_mem_ptr == NULL) + abort (); + + if (count == 0) + return; + for (x = 0; x < count; x++) + *(vbyte_mem_ptr++) = ptr[x]; +} + +/* Count the number of bytes required for records. */ +static int vbyte_count = 0; +void +count_output (count, ptr, comment) + int count; + char *ptr ATTRIBUTE_UNUSED; + char *comment ATTRIBUTE_UNUSED; +{ + vbyte_count += count; +} + +static void +output_R1_format (f, rtype, rlen) + vbyte_func f; + unw_record_type rtype; + int rlen; +{ + int r = 0; + char byte; + if (rlen > 0x1f) + { + output_R3_format (f, rtype, rlen); + return; + } + + if (rtype == body) + r = 1; + else if (rtype != prologue) + as_bad ("record type is not valid"); + + byte = UNW_R1 | (r << 5) | (rlen & 0x1f); + (*f) (1, &byte, NULL); +} + +static void +output_R2_format (f, mask, grsave, rlen) + vbyte_func f; + int mask, grsave; + unsigned long rlen; +{ + char bytes[20]; + int count = 2; + mask = (mask & 0x0f); + grsave = (grsave & 0x7f); + + bytes[0] = (UNW_R2 | (mask >> 1)); + bytes[1] = (((mask & 0x01) << 7) | grsave); + count += output_leb128 (bytes + 2, rlen, 0); + (*f) (count, bytes, NULL); +} + +static void +output_R3_format (f, rtype, rlen) + vbyte_func f; + unw_record_type rtype; + unsigned long rlen; +{ + int r = 0, count; + char bytes[20]; + if (rlen <= 0x1f) + { + output_R1_format (f, rtype, rlen); + return; + } + + if (rtype == body) + r = 1; + else if (rtype != prologue) + as_bad ("record type is not valid"); + bytes[0] = (UNW_R3 | r); + count = output_leb128 (bytes + 1, rlen, 0); + (*f) (count + 1, bytes, NULL); +} + +static void +output_P1_format (f, brmask) + vbyte_func f; + int brmask; +{ + char byte; + byte = UNW_P1 | (brmask & 0x1f); + (*f) (1, &byte, NULL); +} + +static void +output_P2_format (f, brmask, gr) + vbyte_func f; + int brmask; + int gr; +{ + char bytes[2]; + brmask = (brmask & 0x1f); + bytes[0] = UNW_P2 | (brmask >> 1); + bytes[1] = (((brmask & 1) << 7) | gr); + (*f) (2, bytes, NULL); +} + +static void +output_P3_format (f, rtype, reg) + vbyte_func f; + unw_record_type rtype; + int reg; +{ + char bytes[2]; + int r = 0; + reg = (reg & 0x7f); + switch (rtype) + { + case psp_gr: + r = 0; + break; + case rp_gr: + r = 1; + break; + case pfs_gr: + r = 2; + break; + case preds_gr: + r = 3; + break; + case unat_gr: + r = 4; + break; + case lc_gr: + r = 5; + break; + case rp_br: + r = 6; + break; + case rnat_gr: + r = 7; + break; + case bsp_gr: + r = 8; + break; + case bspstore_gr: + r = 9; + break; + case fpsr_gr: + r = 10; + break; + case priunat_gr: + r = 11; + break; + default: + as_bad ("Invalid record type for P3 format."); + } + bytes[0] = (UNW_P3 | (r >> 1)); + bytes[1] = (((r & 1) << 7) | reg); + (*f) (2, bytes, NULL); +} + +static void +output_P4_format (f, imask, imask_size) + vbyte_func f; + unsigned char *imask; + unsigned long imask_size; +{ + imask[0] = UNW_P4; + (*f) (imask_size, imask, NULL); +} + +static void +output_P5_format (f, grmask, frmask) + vbyte_func f; + int grmask; + unsigned long frmask; +{ + char bytes[4]; + grmask = (grmask & 0x0f); + + bytes[0] = UNW_P5; + bytes[1] = ((grmask << 4) | ((frmask & 0x000f0000) >> 16)); + bytes[2] = ((frmask & 0x0000ff00) >> 8); + bytes[3] = (frmask & 0x000000ff); + (*f) (4, bytes, NULL); +} + +static void +output_P6_format (f, rtype, rmask) + vbyte_func f; + unw_record_type rtype; + int rmask; +{ + char byte; + int r = 0; + + if (rtype == gr_mem) + r = 1; + else if (rtype != fr_mem) + as_bad ("Invalid record type for format P6"); + byte = (UNW_P6 | (r << 4) | (rmask & 0x0f)); + (*f) (1, &byte, NULL); +} + +static void +output_P7_format (f, rtype, w1, w2) + vbyte_func f; + unw_record_type rtype; + unsigned long w1; + unsigned long w2; +{ + char bytes[20]; + int count = 1; + int r = 0; + count += output_leb128 (bytes + 1, w1, 0); + switch (rtype) + { + case mem_stack_f: + r = 0; + count += output_leb128 (bytes + count, w2 >> 4, 0); + break; + case mem_stack_v: + r = 1; + break; + case spill_base: + r = 2; + break; + case psp_sprel: + r = 3; + break; + case rp_when: + r = 4; + break; + case rp_psprel: + r = 5; + break; + case pfs_when: + r = 6; + break; + case pfs_psprel: + r = 7; + break; + case preds_when: + r = 8; + break; + case preds_psprel: + r = 9; + break; + case lc_when: + r = 10; + break; + case lc_psprel: + r = 11; + break; + case unat_when: + r = 12; + break; + case unat_psprel: + r = 13; + break; + case fpsr_when: + r = 14; + break; + case fpsr_psprel: + r = 15; + break; + default: + break; + } + bytes[0] = (UNW_P7 | r); + (*f) (count, bytes, NULL); +} + +static void +output_P8_format (f, rtype, t) + vbyte_func f; + unw_record_type rtype; + unsigned long t; +{ + char bytes[20]; + int r = 0; + int count = 2; + bytes[0] = UNW_P8; + switch (rtype) + { + case rp_sprel: + r = 1; + break; + case pfs_sprel: + r = 2; + break; + case preds_sprel: + r = 3; + break; + case lc_sprel: + r = 4; + break; + case unat_sprel: + r = 5; + break; + case fpsr_sprel: + r = 6; + break; + case bsp_when: + r = 7; + break; + case bsp_psprel: + r = 8; + break; + case bsp_sprel: + r = 9; + break; + case bspstore_when: + r = 10; + break; + case bspstore_psprel: + r = 11; + break; + case bspstore_sprel: + r = 12; + break; + case rnat_when: + r = 13; + break; + case rnat_psprel: + r = 14; + break; + case rnat_sprel: + r = 15; + break; + case priunat_when_gr: + r = 16; + break; + case priunat_psprel: + r = 17; + break; + case priunat_sprel: + r = 18; + break; + case priunat_when_mem: + r = 19; + break; + default: + break; + } + bytes[1] = r; + count += output_leb128 (bytes + 2, t, 0); + (*f) (count, bytes, NULL); +} + +static void +output_P9_format (f, grmask, gr) + vbyte_func f; + int grmask; + int gr; +{ + char bytes[3]; + bytes[0] = UNW_P9; + bytes[1] = (grmask & 0x0f); + bytes[2] = (gr & 0x7f); + (*f) (3, bytes, NULL); +} + +static void +output_P10_format (f, abi, context) + vbyte_func f; + int abi; + int context; +{ + char bytes[3]; + bytes[0] = UNW_P10; + bytes[1] = (abi & 0xff); + bytes[2] = (context & 0xff); + (*f) (3, bytes, NULL); +} + +static void +output_B1_format (f, rtype, label) + vbyte_func f; + unw_record_type rtype; + unsigned long label; +{ + char byte; + int r = 0; + if (label > 0x1f) + { + output_B4_format (f, rtype, label); + return; + } + if (rtype == copy_state) + r = 1; + else if (rtype != label_state) + as_bad ("Invalid record type for format B1"); + + byte = (UNW_B1 | (r << 5) | (label & 0x1f)); + (*f) (1, &byte, NULL); +} + +static void +output_B2_format (f, ecount, t) + vbyte_func f; + unsigned long ecount; + unsigned long t; +{ + char bytes[20]; + int count = 1; + if (ecount > 0x1f) + { + output_B3_format (f, ecount, t); + return; + } + bytes[0] = (UNW_B2 | (ecount & 0x1f)); + count += output_leb128 (bytes + 1, t, 0); + (*f) (count, bytes, NULL); +} + +static void +output_B3_format (f, ecount, t) + vbyte_func f; + unsigned long ecount; + unsigned long t; +{ + char bytes[20]; + int count = 1; + if (ecount <= 0x1f) + { + output_B2_format (f, ecount, t); + return; + } + bytes[0] = UNW_B3; + count += output_leb128 (bytes + 1, t, 0); + count += output_leb128 (bytes + count, ecount, 0); + (*f) (count, bytes, NULL); +} + +static void +output_B4_format (f, rtype, label) + vbyte_func f; + unw_record_type rtype; + unsigned long label; +{ + char bytes[20]; + int r = 0; + int count = 1; + if (label <= 0x1f) + { + output_B1_format (f, rtype, label); + return; + } + + if (rtype == copy_state) + r = 1; + else if (rtype != label_state) + as_bad ("Invalid record type for format B1"); + + bytes[0] = (UNW_B4 | (r << 3)); + count += output_leb128 (bytes + 1, label, 0); + (*f) (count, bytes, NULL); +} + +static char +format_ab_reg (ab, reg) + int ab; + int reg; +{ + int ret; + ab = (ab & 3); + reg = (reg & 0x1f); + ret = (ab << 5) | reg; + return ret; +} + +static void +output_X1_format (f, rtype, ab, reg, t, w1) + vbyte_func f; + unw_record_type rtype; + int ab, reg; + unsigned long t; + unsigned long w1; +{ + char bytes[20]; + int r = 0; + int count = 2; + bytes[0] = UNW_X1; + + if (rtype == spill_sprel) + r = 1; + else if (rtype != spill_psprel) + as_bad ("Invalid record type for format X1"); + bytes[1] = ((r << 7) | format_ab_reg (ab, reg)); + count += output_leb128 (bytes + 2, t, 0); + count += output_leb128 (bytes + count, w1, 0); + (*f) (count, bytes, NULL); +} + +static void +output_X2_format (f, ab, reg, x, y, treg, t) + vbyte_func f; + int ab, reg; + int x, y, treg; + unsigned long t; +{ + char bytes[20]; + int count = 3; + bytes[0] = UNW_X2; + bytes[1] = (((x & 1) << 7) | format_ab_reg (ab, reg)); + bytes[2] = (((y & 1) << 7) | (treg & 0x7f)); + count += output_leb128 (bytes + 3, t, 0); + (*f) (count, bytes, NULL); +} + +static void +output_X3_format (f, rtype, qp, ab, reg, t, w1) + vbyte_func f; + unw_record_type rtype; + int qp; + int ab, reg; + unsigned long t; + unsigned long w1; +{ + char bytes[20]; + int r = 0; + int count = 3; + bytes[0] = UNW_X3; + + if (rtype == spill_sprel_p) + r = 1; + else if (rtype != spill_psprel_p) + as_bad ("Invalid record type for format X3"); + bytes[1] = ((r << 7) | (qp & 0x3f)); + bytes[2] = format_ab_reg (ab, reg); + count += output_leb128 (bytes + 3, t, 0); + count += output_leb128 (bytes + count, w1, 0); + (*f) (count, bytes, NULL); +} + +static void +output_X4_format (f, qp, ab, reg, x, y, treg, t) + vbyte_func f; + int qp; + int ab, reg; + int x, y, treg; + unsigned long t; +{ + char bytes[20]; + int count = 4; + bytes[0] = UNW_X4; + bytes[1] = (qp & 0x3f); + bytes[2] = (((x & 1) << 7) | format_ab_reg (ab, reg)); + bytes[3] = (((y & 1) << 7) | (treg & 0x7f)); + count += output_leb128 (bytes + 4, t, 0); + (*f) (count, bytes, NULL); +} + +/* This function allocates a record list structure, and initializes fields. */ + +static unw_rec_list * +alloc_record (unw_record_type t) +{ + unw_rec_list *ptr; + ptr = xmalloc (sizeof (*ptr)); + ptr->next = NULL; + ptr->slot_number = SLOT_NUM_NOT_SET; + ptr->r.type = t; + return ptr; +} + +/* This function frees an entire list of record structures. */ + +void +free_list_records (unw_rec_list *first) +{ + unw_rec_list *ptr; + for (ptr = first; ptr != NULL;) + { + unw_rec_list *tmp = ptr; + + if ((tmp->r.type == prologue || tmp->r.type == prologue_gr) + && tmp->r.record.r.mask.i) + free (tmp->r.record.r.mask.i); + + ptr = ptr->next; + free (tmp); + } +} + +static unw_rec_list * +output_prologue () +{ + unw_rec_list *ptr = alloc_record (prologue); + memset (&ptr->r.record.r.mask, 0, sizeof (ptr->r.record.r.mask)); + return ptr; +} + +static unw_rec_list * +output_prologue_gr (saved_mask, reg) + unsigned int saved_mask; + unsigned int reg; +{ + unw_rec_list *ptr = alloc_record (prologue_gr); + memset (&ptr->r.record.r.mask, 0, sizeof (ptr->r.record.r.mask)); + ptr->r.record.r.grmask = saved_mask; + ptr->r.record.r.grsave = reg; + return ptr; +} + +static unw_rec_list * +output_body () +{ + unw_rec_list *ptr = alloc_record (body); + return ptr; +} + +static unw_rec_list * +output_mem_stack_f (size) + unsigned int size; +{ + unw_rec_list *ptr = alloc_record (mem_stack_f); + ptr->r.record.p.size = size; + return ptr; +} + +static unw_rec_list * +output_mem_stack_v () +{ + unw_rec_list *ptr = alloc_record (mem_stack_v); + return ptr; +} + +static unw_rec_list * +output_psp_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (psp_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_psp_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (psp_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_rp_when () +{ + unw_rec_list *ptr = alloc_record (rp_when); + return ptr; +} + +static unw_rec_list * +output_rp_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (rp_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_rp_br (br) + unsigned int br; +{ + unw_rec_list *ptr = alloc_record (rp_br); + ptr->r.record.p.br = br; + return ptr; +} + +static unw_rec_list * +output_rp_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (rp_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_rp_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (rp_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_pfs_when () +{ + unw_rec_list *ptr = alloc_record (pfs_when); + return ptr; +} + +static unw_rec_list * +output_pfs_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (pfs_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_pfs_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (pfs_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_pfs_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (pfs_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_preds_when () +{ + unw_rec_list *ptr = alloc_record (preds_when); + return ptr; +} + +static unw_rec_list * +output_preds_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (preds_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_preds_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (preds_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_preds_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (preds_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_fr_mem (mask) + unsigned int mask; +{ + unw_rec_list *ptr = alloc_record (fr_mem); + ptr->r.record.p.rmask = mask; + return ptr; +} + +static unw_rec_list * +output_frgr_mem (gr_mask, fr_mask) + unsigned int gr_mask; + unsigned int fr_mask; +{ + unw_rec_list *ptr = alloc_record (frgr_mem); + ptr->r.record.p.grmask = gr_mask; + ptr->r.record.p.frmask = fr_mask; + return ptr; +} + +static unw_rec_list * +output_gr_gr (mask, reg) + unsigned int mask; + unsigned int reg; +{ + unw_rec_list *ptr = alloc_record (gr_gr); + ptr->r.record.p.grmask = mask; + ptr->r.record.p.gr = reg; + return ptr; +} + +static unw_rec_list * +output_gr_mem (mask) + unsigned int mask; +{ + unw_rec_list *ptr = alloc_record (gr_mem); + ptr->r.record.p.rmask = mask; + return ptr; +} + +static unw_rec_list * +output_br_mem (unsigned int mask) +{ + unw_rec_list *ptr = alloc_record (br_mem); + ptr->r.record.p.brmask = mask; + return ptr; +} + +static unw_rec_list * +output_br_gr (save_mask, reg) + unsigned int save_mask; + unsigned int reg; +{ + unw_rec_list *ptr = alloc_record (br_gr); + ptr->r.record.p.brmask = save_mask; + ptr->r.record.p.gr = reg; + return ptr; +} + +static unw_rec_list * +output_spill_base (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (spill_base); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_unat_when () +{ + unw_rec_list *ptr = alloc_record (unat_when); + return ptr; +} + +static unw_rec_list * +output_unat_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (unat_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_unat_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (unat_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_unat_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (unat_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_lc_when () +{ + unw_rec_list *ptr = alloc_record (lc_when); + return ptr; +} + +static unw_rec_list * +output_lc_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (lc_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_lc_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (lc_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_lc_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (lc_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_fpsr_when () +{ + unw_rec_list *ptr = alloc_record (fpsr_when); + return ptr; +} + +static unw_rec_list * +output_fpsr_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (fpsr_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_fpsr_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (fpsr_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_fpsr_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (fpsr_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_priunat_when_gr () +{ + unw_rec_list *ptr = alloc_record (priunat_when_gr); + return ptr; +} + +static unw_rec_list * +output_priunat_when_mem () +{ + unw_rec_list *ptr = alloc_record (priunat_when_mem); + return ptr; +} + +static unw_rec_list * +output_priunat_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (priunat_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_priunat_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (priunat_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_priunat_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (priunat_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_bsp_when () +{ + unw_rec_list *ptr = alloc_record (bsp_when); + return ptr; +} + +static unw_rec_list * +output_bsp_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (bsp_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_bsp_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (bsp_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_bsp_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (bsp_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_bspstore_when () +{ + unw_rec_list *ptr = alloc_record (bspstore_when); + return ptr; +} + +static unw_rec_list * +output_bspstore_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (bspstore_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_bspstore_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (bspstore_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_bspstore_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (bspstore_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_rnat_when () +{ + unw_rec_list *ptr = alloc_record (rnat_when); + return ptr; +} + +static unw_rec_list * +output_rnat_gr (gr) + unsigned int gr; +{ + unw_rec_list *ptr = alloc_record (rnat_gr); + ptr->r.record.p.gr = gr; + return ptr; +} + +static unw_rec_list * +output_rnat_psprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (rnat_psprel); + ptr->r.record.p.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_rnat_sprel (offset) + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (rnat_sprel); + ptr->r.record.p.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_unwabi (abi, context) + unsigned long abi; + unsigned long context; +{ + unw_rec_list *ptr = alloc_record (unwabi); + ptr->r.record.p.abi = abi; + ptr->r.record.p.context = context; + return ptr; +} + +static unw_rec_list * +output_epilogue (unsigned long ecount) +{ + unw_rec_list *ptr = alloc_record (epilogue); + ptr->r.record.b.ecount = ecount; + return ptr; +} + +static unw_rec_list * +output_label_state (unsigned long label) +{ + unw_rec_list *ptr = alloc_record (label_state); + ptr->r.record.b.label = label; + return ptr; +} + +static unw_rec_list * +output_copy_state (unsigned long label) +{ + unw_rec_list *ptr = alloc_record (copy_state); + ptr->r.record.b.label = label; + return ptr; +} + +static unw_rec_list * +output_spill_psprel (ab, reg, offset) + unsigned int ab; + unsigned int reg; + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (spill_psprel); + ptr->r.record.x.ab = ab; + ptr->r.record.x.reg = reg; + ptr->r.record.x.pspoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_spill_sprel (ab, reg, offset) + unsigned int ab; + unsigned int reg; + unsigned int offset; +{ + unw_rec_list *ptr = alloc_record (spill_sprel); + ptr->r.record.x.ab = ab; + ptr->r.record.x.reg = reg; + ptr->r.record.x.spoff = offset / 4; + return ptr; +} + +static unw_rec_list * +output_spill_psprel_p (ab, reg, offset, predicate) + unsigned int ab; + unsigned int reg; + unsigned int offset; + unsigned int predicate; +{ + unw_rec_list *ptr = alloc_record (spill_psprel_p); + ptr->r.record.x.ab = ab; + ptr->r.record.x.reg = reg; + ptr->r.record.x.pspoff = offset / 4; + ptr->r.record.x.qp = predicate; + return ptr; +} + +static unw_rec_list * +output_spill_sprel_p (ab, reg, offset, predicate) + unsigned int ab; + unsigned int reg; + unsigned int offset; + unsigned int predicate; +{ + unw_rec_list *ptr = alloc_record (spill_sprel_p); + ptr->r.record.x.ab = ab; + ptr->r.record.x.reg = reg; + ptr->r.record.x.spoff = offset / 4; + ptr->r.record.x.qp = predicate; + return ptr; +} + +static unw_rec_list * +output_spill_reg (ab, reg, targ_reg, xy) + unsigned int ab; + unsigned int reg; + unsigned int targ_reg; + unsigned int xy; +{ + unw_rec_list *ptr = alloc_record (spill_reg); + ptr->r.record.x.ab = ab; + ptr->r.record.x.reg = reg; + ptr->r.record.x.treg = targ_reg; + ptr->r.record.x.xy = xy; + return ptr; +} + +static unw_rec_list * +output_spill_reg_p (ab, reg, targ_reg, xy, predicate) + unsigned int ab; + unsigned int reg; + unsigned int targ_reg; + unsigned int xy; + unsigned int predicate; +{ + unw_rec_list *ptr = alloc_record (spill_reg_p); + ptr->r.record.x.ab = ab; + ptr->r.record.x.reg = reg; + ptr->r.record.x.treg = targ_reg; + ptr->r.record.x.xy = xy; + ptr->r.record.x.qp = predicate; + return ptr; +} + +/* Given a unw_rec_list process the correct format with the + specified function. */ + +static void +process_one_record (ptr, f) + unw_rec_list *ptr; + vbyte_func f; +{ + unsigned long fr_mask, gr_mask; + + switch (ptr->r.type) + { + case gr_mem: + case fr_mem: + case br_mem: + case frgr_mem: + /* These are taken care of by prologue/prologue_gr. */ + break; + + case prologue_gr: + case prologue: + if (ptr->r.type == prologue_gr) + output_R2_format (f, ptr->r.record.r.grmask, + ptr->r.record.r.grsave, ptr->r.record.r.rlen); + else + output_R1_format (f, ptr->r.type, ptr->r.record.r.rlen); + + /* Output descriptor(s) for union of register spills (if any). */ + gr_mask = ptr->r.record.r.mask.gr_mem; + fr_mask = ptr->r.record.r.mask.fr_mem; + if (fr_mask) + { + if ((fr_mask & ~0xfUL) == 0) + output_P6_format (f, fr_mem, fr_mask); + else + { + output_P5_format (f, gr_mask, fr_mask); + gr_mask = 0; + } + } + if (gr_mask) + output_P6_format (f, gr_mem, gr_mask); + if (ptr->r.record.r.mask.br_mem) + output_P1_format (f, ptr->r.record.r.mask.br_mem); + + /* output imask descriptor if necessary: */ + if (ptr->r.record.r.mask.i) + output_P4_format (f, ptr->r.record.r.mask.i, + ptr->r.record.r.imask_size); + break; + + case body: + output_R1_format (f, ptr->r.type, ptr->r.record.r.rlen); + break; + case mem_stack_f: + case mem_stack_v: + output_P7_format (f, ptr->r.type, ptr->r.record.p.t, + ptr->r.record.p.size); + break; + case psp_gr: + case rp_gr: + case pfs_gr: + case preds_gr: + case unat_gr: + case lc_gr: + case fpsr_gr: + case priunat_gr: + case bsp_gr: + case bspstore_gr: + case rnat_gr: + output_P3_format (f, ptr->r.type, ptr->r.record.p.gr); + break; + case rp_br: + output_P3_format (f, rp_br, ptr->r.record.p.br); + break; + case psp_sprel: + output_P7_format (f, psp_sprel, ptr->r.record.p.spoff, 0); + break; + case rp_when: + case pfs_when: + case preds_when: + case unat_when: + case lc_when: + case fpsr_when: + output_P7_format (f, ptr->r.type, ptr->r.record.p.t, 0); + break; + case rp_psprel: + case pfs_psprel: + case preds_psprel: + case unat_psprel: + case lc_psprel: + case fpsr_psprel: + case spill_base: + output_P7_format (f, ptr->r.type, ptr->r.record.p.pspoff, 0); + break; + case rp_sprel: + case pfs_sprel: + case preds_sprel: + case unat_sprel: + case lc_sprel: + case fpsr_sprel: + case priunat_sprel: + case bsp_sprel: + case bspstore_sprel: + case rnat_sprel: + output_P8_format (f, ptr->r.type, ptr->r.record.p.spoff); + break; + case gr_gr: + output_P9_format (f, ptr->r.record.p.grmask, ptr->r.record.p.gr); + break; + case br_gr: + output_P2_format (f, ptr->r.record.p.brmask, ptr->r.record.p.gr); + break; + case spill_mask: + as_bad ("spill_mask record unimplemented."); + break; + case priunat_when_gr: + case priunat_when_mem: + case bsp_when: + case bspstore_when: + case rnat_when: + output_P8_format (f, ptr->r.type, ptr->r.record.p.t); + break; + case priunat_psprel: + case bsp_psprel: + case bspstore_psprel: + case rnat_psprel: + output_P8_format (f, ptr->r.type, ptr->r.record.p.pspoff); + break; + case unwabi: + output_P10_format (f, ptr->r.record.p.abi, ptr->r.record.p.context); + break; + case epilogue: + output_B3_format (f, ptr->r.record.b.ecount, ptr->r.record.b.t); + break; + case label_state: + case copy_state: + output_B4_format (f, ptr->r.type, ptr->r.record.b.label); + break; + case spill_psprel: + output_X1_format (f, ptr->r.type, ptr->r.record.x.ab, + ptr->r.record.x.reg, ptr->r.record.x.t, + ptr->r.record.x.pspoff); + break; + case spill_sprel: + output_X1_format (f, ptr->r.type, ptr->r.record.x.ab, + ptr->r.record.x.reg, ptr->r.record.x.t, + ptr->r.record.x.spoff); + break; + case spill_reg: + output_X2_format (f, ptr->r.record.x.ab, ptr->r.record.x.reg, + ptr->r.record.x.xy >> 1, ptr->r.record.x.xy, + ptr->r.record.x.treg, ptr->r.record.x.t); + break; + case spill_psprel_p: + output_X3_format (f, ptr->r.type, ptr->r.record.x.qp, + ptr->r.record.x.ab, ptr->r.record.x.reg, + ptr->r.record.x.t, ptr->r.record.x.pspoff); + break; + case spill_sprel_p: + output_X3_format (f, ptr->r.type, ptr->r.record.x.qp, + ptr->r.record.x.ab, ptr->r.record.x.reg, + ptr->r.record.x.t, ptr->r.record.x.spoff); + break; + case spill_reg_p: + output_X4_format (f, ptr->r.record.x.qp, ptr->r.record.x.ab, + ptr->r.record.x.reg, ptr->r.record.x.xy >> 1, + ptr->r.record.x.xy, ptr->r.record.x.treg, + ptr->r.record.x.t); + break; + default: + as_bad ("record_type_not_valid"); + break; + } +} + +/* Given a unw_rec_list list, process all the records with + the specified function. */ +static void +process_unw_records (list, f) + unw_rec_list *list; + vbyte_func f; +{ + unw_rec_list *ptr; + for (ptr = list; ptr; ptr = ptr->next) + process_one_record (ptr, f); +} + +/* Determine the size of a record list in bytes. */ +static int +calc_record_size (list) + unw_rec_list *list; +{ + vbyte_count = 0; + process_unw_records (list, count_output); + return vbyte_count; +} + +/* Update IMASK bitmask to reflect the fact that one or more registers + of type TYPE are saved starting at instruction with index T. If N + bits are set in REGMASK, it is assumed that instructions T through + T+N-1 save these registers. + + TYPE values: + 0: no save + 1: instruction saves next fp reg + 2: instruction saves next general reg + 3: instruction saves next branch reg */ +static void +set_imask (region, regmask, t, type) + unw_rec_list *region; + unsigned long regmask; + unsigned long t; + unsigned int type; +{ + unsigned char *imask; + unsigned long imask_size; + unsigned int i; + int pos; + + imask = region->r.record.r.mask.i; + imask_size = region->r.record.r.imask_size; + if (!imask) + { + imask_size = (region->r.record.r.rlen * 2 + 7) / 8 + 1; + imask = xmalloc (imask_size); + memset (imask, 0, imask_size); + + region->r.record.r.imask_size = imask_size; + region->r.record.r.mask.i = imask; + } + + i = (t / 4) + 1; + pos = 2 * (3 - t % 4); + while (regmask) + { + if (i >= imask_size) + { + as_bad ("Ignoring attempt to spill beyond end of region"); + return; + } + + imask[i] |= (type & 0x3) << pos; + + regmask &= (regmask - 1); + pos -= 2; + if (pos < 0) + { + pos = 0; + ++i; + } + } +} + +static int +count_bits (unsigned long mask) +{ + int n = 0; + + while (mask) + { + mask &= mask - 1; + ++n; + } + return n; +} + +/* Return the number of instruction slots from FIRST_ADDR to SLOT_ADDR. + SLOT_FRAG is the frag containing SLOT_ADDR, and FIRST_FRAG is the frag + containing FIRST_ADDR. */ + +unsigned long +slot_index (slot_addr, slot_frag, first_addr, first_frag) + unsigned long slot_addr; + fragS *slot_frag; + unsigned long first_addr; + fragS *first_frag; +{ + unsigned long index = 0; + + /* First time we are called, the initial address and frag are invalid. */ + if (first_addr == 0) + return 0; + + /* If the two addresses are in different frags, then we need to add in + the remaining size of this frag, and then the entire size of intermediate + frags. */ + while (slot_frag != first_frag) + { + unsigned long start_addr = (unsigned long) &first_frag->fr_literal; + + /* Add in the full size of the frag converted to instruction slots. */ + index += 3 * (first_frag->fr_fix >> 4); + /* Subtract away the initial part before first_addr. */ + index -= (3 * ((first_addr >> 4) - (start_addr >> 4)) + + ((first_addr & 0x3) - (start_addr & 0x3))); + + /* Move to the beginning of the next frag. */ + first_frag = first_frag->fr_next; + first_addr = (unsigned long) &first_frag->fr_literal; + } + + /* Add in the used part of the last frag. */ + index += (3 * ((slot_addr >> 4) - (first_addr >> 4)) + + ((slot_addr & 0x3) - (first_addr & 0x3))); + return index; +} + +/* Optimize unwind record directives. */ + +static unw_rec_list * +optimize_unw_records (list) + unw_rec_list *list; +{ + if (!list) + return NULL; + + /* If the only unwind record is ".prologue" or ".prologue" followed + by ".body", then we can optimize the unwind directives away. */ + if (list->r.type == prologue + && (list->next == NULL + || (list->next->r.type == body && list->next->next == NULL))) + return NULL; + + return list; +} + +/* Given a complete record list, process any records which have + unresolved fields, (ie length counts for a prologue). After + this has been run, all neccessary information should be available + within each record to generate an image. */ + +static void +fixup_unw_records (list) + unw_rec_list *list; +{ + unw_rec_list *ptr, *region = 0; + unsigned long first_addr = 0, rlen = 0, t; + fragS *first_frag = 0; + + for (ptr = list; ptr; ptr = ptr->next) + { + if (ptr->slot_number == SLOT_NUM_NOT_SET) + as_bad (" Insn slot not set in unwind record."); + t = slot_index (ptr->slot_number, ptr->slot_frag, + first_addr, first_frag); + switch (ptr->r.type) + { + case prologue: + case prologue_gr: + case body: + { + unw_rec_list *last; + int size, dir_len = 0; + unsigned long last_addr; + fragS *last_frag; + + first_addr = ptr->slot_number; + first_frag = ptr->slot_frag; + ptr->slot_number = 0; + /* Find either the next body/prologue start, or the end of + the list, and determine the size of the region. */ + last_addr = unwind.next_slot_number; + last_frag = unwind.next_slot_frag; + for (last = ptr->next; last != NULL; last = last->next) + if (last->r.type == prologue || last->r.type == prologue_gr + || last->r.type == body) + { + last_addr = last->slot_number; + last_frag = last->slot_frag; + break; + } + else if (!last->next) + { + /* In the absence of an explicit .body directive, + the prologue ends after the last instruction + covered by an unwind directive. */ + if (ptr->r.type != body) + { + last_addr = last->slot_number; + last_frag = last->slot_frag; + switch (last->r.type) + { + case frgr_mem: + dir_len = (count_bits (last->r.record.p.frmask) + + count_bits (last->r.record.p.grmask)); + break; + case fr_mem: + case gr_mem: + dir_len += count_bits (last->r.record.p.rmask); + break; + case br_mem: + case br_gr: + dir_len += count_bits (last->r.record.p.brmask); + break; + case gr_gr: + dir_len += count_bits (last->r.record.p.grmask); + break; + default: + dir_len = 1; + break; + } + } + break; + } + size = (slot_index (last_addr, last_frag, first_addr, first_frag) + + dir_len); + rlen = ptr->r.record.r.rlen = size; + region = ptr; + break; + } + case epilogue: + ptr->r.record.b.t = rlen - 1 - t; + break; + + case mem_stack_f: + case mem_stack_v: + case rp_when: + case pfs_when: + case preds_when: + case unat_when: + case lc_when: + case fpsr_when: + case priunat_when_gr: + case priunat_when_mem: + case bsp_when: + case bspstore_when: + case rnat_when: + ptr->r.record.p.t = t; + break; + + case spill_reg: + case spill_sprel: + case spill_psprel: + case spill_reg_p: + case spill_sprel_p: + case spill_psprel_p: + ptr->r.record.x.t = t; + break; + + case frgr_mem: + if (!region) + { + as_bad ("frgr_mem record before region record!\n"); + return; + } + region->r.record.r.mask.fr_mem |= ptr->r.record.p.frmask; + region->r.record.r.mask.gr_mem |= ptr->r.record.p.grmask; + set_imask (region, ptr->r.record.p.frmask, t, 1); + set_imask (region, ptr->r.record.p.grmask, t, 2); + break; + case fr_mem: + if (!region) + { + as_bad ("fr_mem record before region record!\n"); + return; + } + region->r.record.r.mask.fr_mem |= ptr->r.record.p.rmask; + set_imask (region, ptr->r.record.p.rmask, t, 1); + break; + case gr_mem: + if (!region) + { + as_bad ("gr_mem record before region record!\n"); + return; + } + region->r.record.r.mask.gr_mem |= ptr->r.record.p.rmask; + set_imask (region, ptr->r.record.p.rmask, t, 2); + break; + case br_mem: + if (!region) + { + as_bad ("br_mem record before region record!\n"); + return; + } + region->r.record.r.mask.br_mem |= ptr->r.record.p.brmask; + set_imask (region, ptr->r.record.p.brmask, t, 3); + break; + + case gr_gr: + if (!region) + { + as_bad ("gr_gr record before region record!\n"); + return; + } + set_imask (region, ptr->r.record.p.grmask, t, 2); + break; + case br_gr: + if (!region) + { + as_bad ("br_gr record before region record!\n"); + return; + } + set_imask (region, ptr->r.record.p.brmask, t, 3); + break; + + default: + break; + } + } +} + +/* 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. */ +static int +output_unw_records (list, ptr) + unw_rec_list *list; + void **ptr; +{ + int size, x, extra = 0; + unsigned char *mem; + + *ptr = NULL; + + list = optimize_unw_records (list); + 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); + + 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; + } + return size; +} + +static int +convert_expr_to_ab_reg (e, ab, regp) + expressionS *e; + unsigned int *ab; + unsigned int *regp; +{ + unsigned int reg; + + if (e->X_op != O_register) + return 0; + + reg = e->X_add_number; + if (reg >= (REG_GR + 4) && reg <= (REG_GR + 7)) + { + *ab = 0; + *regp = reg - REG_GR; + } + else if ((reg >= (REG_FR + 2) && reg <= (REG_FR + 5)) + || (reg >= (REG_FR + 16) && reg <= (REG_FR + 31))) + { + *ab = 1; + *regp = reg - REG_FR; + } + else if (reg >= (REG_BR + 1) && reg <= (REG_BR + 5)) + { + *ab = 2; + *regp = reg - REG_BR; + } + else + { + *ab = 3; + switch (reg) + { + case REG_PR: *regp = 0; break; + case REG_PSP: *regp = 1; break; + case REG_PRIUNAT: *regp = 2; break; + case REG_BR + 0: *regp = 3; break; + case REG_AR + AR_BSP: *regp = 4; break; + case REG_AR + AR_BSPSTORE: *regp = 5; break; + case REG_AR + AR_RNAT: *regp = 6; break; + case REG_AR + AR_UNAT: *regp = 7; break; + case REG_AR + AR_FPSR: *regp = 8; break; + case REG_AR + AR_PFS: *regp = 9; break; + case REG_AR + AR_LC: *regp = 10; break; + + default: + return 0; + } + } + return 1; +} + +static int +convert_expr_to_xy_reg (e, xy, regp) + expressionS *e; + unsigned int *xy; + unsigned int *regp; +{ + unsigned int reg; + + if (e->X_op != O_register) + return 0; + + reg = e->X_add_number; + + if (/* reg >= REG_GR && */ reg <= (REG_GR + 127)) + { + *xy = 0; + *regp = reg - REG_GR; + } + else if (reg >= REG_FR && reg <= (REG_FR + 127)) + { + *xy = 1; + *regp = reg - REG_FR; + } + else if (reg >= REG_BR && reg <= (REG_BR + 7)) + { + *xy = 2; + *regp = reg - REG_BR; + } + else + return -1; + return 1; +} + +static void +dot_radix (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + int radix; + + SKIP_WHITESPACE (); + radix = *input_line_pointer++; + + if (radix != 'C' && !is_end_of_line[(unsigned char) radix]) + { + as_bad ("Radix `%c' unsupported", *input_line_pointer); + ignore_rest_of_line (); + return; + } +} + +/* .sbss, .bss etc. are macros that expand into ".section SECNAME". */ +static void +dot_special_section (which) + int which; +{ + set_section ((char *) special_section_name[which]); +} + +static void +add_unwind_entry (ptr) + unw_rec_list *ptr; +{ + if (unwind.tail) + unwind.tail->next = ptr; + else + unwind.list = ptr; + unwind.tail = ptr; + + /* The current entry can in fact be a chain of unwind entries. */ + if (unwind.current_entry == NULL) + unwind.current_entry = ptr; +} + +static void +dot_fframe (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + + parse_operand (&e); + + if (e.X_op != O_constant) + as_bad ("Operand to .fframe must be a constant"); + else + add_unwind_entry (output_mem_stack_f (e.X_add_number)); +} + +static void +dot_vframe (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + unsigned reg; + + parse_operand (&e); + reg = e.X_add_number - REG_GR; + if (e.X_op == O_register && reg < 128) + { + add_unwind_entry (output_mem_stack_v ()); + if (! (unwind.prologue_mask & 2)) + add_unwind_entry (output_psp_gr (reg)); + } + else + as_bad ("First operand to .vframe must be a general register"); +} + +static void +dot_vframesp (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + + parse_operand (&e); + if (e.X_op == O_constant) + { + add_unwind_entry (output_mem_stack_v ()); + add_unwind_entry (output_psp_sprel (e.X_add_number)); + } + else + as_bad ("First operand to .vframesp must be a general register"); +} + +static void +dot_vframepsp (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + + parse_operand (&e); + if (e.X_op == O_constant) + { + add_unwind_entry (output_mem_stack_v ()); + add_unwind_entry (output_psp_sprel (e.X_add_number)); + } + else + as_bad ("First operand to .vframepsp must be a general register"); +} + +static void +dot_save (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e1, e2; + int sep; + int reg1, reg2; + + sep = parse_operand (&e1); + if (sep != ',') + as_bad ("No second operand to .save"); + sep = parse_operand (&e2); + + reg1 = e1.X_add_number; + reg2 = e2.X_add_number - REG_GR; + + /* Make sure its a valid ar.xxx reg, OR its br0, aka 'rp'. */ + if (e1.X_op == O_register) + { + if (e2.X_op == O_register && reg2 >= 0 && reg2 < 128) + { + switch (reg1) + { + case REG_AR + AR_BSP: + add_unwind_entry (output_bsp_when ()); + add_unwind_entry (output_bsp_gr (reg2)); + break; + case REG_AR + AR_BSPSTORE: + add_unwind_entry (output_bspstore_when ()); + add_unwind_entry (output_bspstore_gr (reg2)); + break; + case REG_AR + AR_RNAT: + add_unwind_entry (output_rnat_when ()); + add_unwind_entry (output_rnat_gr (reg2)); + break; + case REG_AR + AR_UNAT: + add_unwind_entry (output_unat_when ()); + add_unwind_entry (output_unat_gr (reg2)); + break; + case REG_AR + AR_FPSR: + add_unwind_entry (output_fpsr_when ()); + add_unwind_entry (output_fpsr_gr (reg2)); + break; + case REG_AR + AR_PFS: + add_unwind_entry (output_pfs_when ()); + if (! (unwind.prologue_mask & 4)) + add_unwind_entry (output_pfs_gr (reg2)); + break; + case REG_AR + AR_LC: + add_unwind_entry (output_lc_when ()); + add_unwind_entry (output_lc_gr (reg2)); + break; + case REG_BR: + add_unwind_entry (output_rp_when ()); + if (! (unwind.prologue_mask & 8)) + add_unwind_entry (output_rp_gr (reg2)); + break; + case REG_PR: + add_unwind_entry (output_preds_when ()); + if (! (unwind.prologue_mask & 1)) + add_unwind_entry (output_preds_gr (reg2)); + break; + case REG_PRIUNAT: + add_unwind_entry (output_priunat_when_gr ()); + add_unwind_entry (output_priunat_gr (reg2)); + break; + default: + as_bad ("First operand not a valid register"); + } + } + else + as_bad (" Second operand not a valid register"); + } + else + as_bad ("First operand not a register"); +} + +static void +dot_restore (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e1, e2; + unsigned long ecount; /* # of _additional_ regions to pop */ + int sep; + + sep = parse_operand (&e1); + if (e1.X_op != O_register || e1.X_add_number != REG_GR + 12) + { + as_bad ("First operand to .restore must be stack pointer (sp)"); + return; + } + + if (sep == ',') + { + parse_operand (&e2); + if (e2.X_op != O_constant || e2.X_add_number < 0) + { + as_bad ("Second operand to .restore must be a constant >= 0"); + return; + } + ecount = e2.X_add_number; + } + else + ecount = unwind.prologue_count - 1; + add_unwind_entry (output_epilogue (ecount)); + + if (ecount < unwind.prologue_count) + unwind.prologue_count -= ecount + 1; + else + unwind.prologue_count = 0; +} + +static void +dot_restorereg (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + unsigned int ab, reg; + expressionS e; + + parse_operand (&e); + + if (!convert_expr_to_ab_reg (&e, &ab, ®)) + { + as_bad ("First operand to .restorereg must be a preserved register"); + return; + } + add_unwind_entry (output_spill_reg (ab, reg, 0, 0)); +} + +static void +dot_restorereg_p (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + unsigned int qp, ab, reg; + expressionS e1, e2; + int sep; + + sep = parse_operand (&e1); + if (sep != ',') + { + as_bad ("No second operand to .restorereg.p"); + return; + } + + parse_operand (&e2); + + qp = e1.X_add_number - REG_P; + if (e1.X_op != O_register || qp > 63) + { + as_bad ("First operand to .restorereg.p must be a predicate"); + return; + } + + if (!convert_expr_to_ab_reg (&e2, &ab, ®)) + { + as_bad ("Second operand to .restorereg.p must be a preserved register"); + return; + } + add_unwind_entry (output_spill_reg_p (ab, reg, 0, 0, qp)); +} + +static int +generate_unwind_image (text_name) + const char *text_name; +{ + int size; + unsigned char *unw_rec; + + /* Force out pending instructions, to make sure all unwind records have + a valid slot_number field. */ + ia64_flush_insns (); + + /* 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 there are unwind records, switch sections, and output the info. */ + if (size != 0) + { + unsigned char *where; + char *sec_name; + expressionS exp; + + 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. */ + record_alignment (now_seg, 3); + + /* Set expression which points to start of unwind descriptor area. */ + unwind.info = expr_build_dot (); + + where = (unsigned char *) frag_more (size); + + /* Issue a label for this address, and keep track of it to put it + in the unwind section. */ + + /* Copy the information from the unwind record into this section. The + data is already in the correct byte order. */ + memcpy (where, unw_rec, size); + + /* Add the personality address to the image. */ + if (unwind.personality_routine != 0) + { + 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); + unwind.personality_routine = 0; + } + } + + free_list_records (unwind.list); + unwind.list = unwind.tail = unwind.current_entry = NULL; + + return size; +} + +static void +dot_handlerdata (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + const char *text_name = segment_name (now_seg); + + /* If text section name starts with ".text" (which it should), + strip this prefix off. */ + if (strcmp (text_name, ".text") == 0) + text_name = ""; + + unwind.force_unwind_entry = 1; + + /* Remember which segment we're in so we can switch back after .endp */ + unwind.saved_text_seg = now_seg; + unwind.saved_text_subseg = now_subseg; + + /* Generate unwind info into unwind-info section and then leave that + section as the currently active one so dataXX directives go into + the language specific data area of the unwind info block. */ + generate_unwind_image (text_name); + demand_empty_rest_of_line (); +} + +static void +dot_unwentry (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + unwind.force_unwind_entry = 1; + demand_empty_rest_of_line (); +} + +static void +dot_altrp (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + unsigned reg; + + parse_operand (&e); + reg = e.X_add_number - REG_BR; + if (e.X_op == O_register && reg < 8) + add_unwind_entry (output_rp_br (reg)); + else + as_bad ("First operand not a valid branch register"); +} + +static void +dot_savemem (psprel) + int psprel; +{ + expressionS e1, e2; + int sep; + int reg1, val; + + sep = parse_operand (&e1); + if (sep != ',') + as_bad ("No second operand to .save%ssp", psprel ? "p" : ""); + sep = parse_operand (&e2); + + reg1 = e1.X_add_number; + val = e2.X_add_number; + + /* Make sure its a valid ar.xxx reg, OR its br0, aka 'rp'. */ + if (e1.X_op == O_register) + { + if (e2.X_op == O_constant) + { + switch (reg1) + { + case REG_AR + AR_BSP: + add_unwind_entry (output_bsp_when ()); + add_unwind_entry ((psprel + ? output_bsp_psprel + : output_bsp_sprel) (val)); + break; + case REG_AR + AR_BSPSTORE: + add_unwind_entry (output_bspstore_when ()); + add_unwind_entry ((psprel + ? output_bspstore_psprel + : output_bspstore_sprel) (val)); + break; + case REG_AR + AR_RNAT: + add_unwind_entry (output_rnat_when ()); + add_unwind_entry ((psprel + ? output_rnat_psprel + : output_rnat_sprel) (val)); + break; + case REG_AR + AR_UNAT: + add_unwind_entry (output_unat_when ()); + add_unwind_entry ((psprel + ? output_unat_psprel + : output_unat_sprel) (val)); + break; + case REG_AR + AR_FPSR: + add_unwind_entry (output_fpsr_when ()); + add_unwind_entry ((psprel + ? output_fpsr_psprel + : output_fpsr_sprel) (val)); + break; + case REG_AR + AR_PFS: + add_unwind_entry (output_pfs_when ()); + add_unwind_entry ((psprel + ? output_pfs_psprel + : output_pfs_sprel) (val)); + break; + case REG_AR + AR_LC: + add_unwind_entry (output_lc_when ()); + add_unwind_entry ((psprel + ? output_lc_psprel + : output_lc_sprel) (val)); + break; + case REG_BR: + add_unwind_entry (output_rp_when ()); + add_unwind_entry ((psprel + ? output_rp_psprel + : output_rp_sprel) (val)); + break; + case REG_PR: + add_unwind_entry (output_preds_when ()); + add_unwind_entry ((psprel + ? output_preds_psprel + : output_preds_sprel) (val)); + break; + case REG_PRIUNAT: + add_unwind_entry (output_priunat_when_mem ()); + add_unwind_entry ((psprel + ? output_priunat_psprel + : output_priunat_sprel) (val)); + break; + default: + as_bad ("First operand not a valid register"); + } + } + else + as_bad (" Second operand not a valid constant"); + } + else + as_bad ("First operand not a register"); +} + +static void +dot_saveg (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e1, e2; + int sep; + sep = parse_operand (&e1); + if (sep == ',') + parse_operand (&e2); + + if (e1.X_op != O_constant) + as_bad ("First operand to .save.g must be a constant."); + else + { + int grmask = e1.X_add_number; + if (sep != ',') + add_unwind_entry (output_gr_mem (grmask)); + else + { + int reg = e2.X_add_number - REG_GR; + if (e2.X_op == O_register && reg >= 0 && reg < 128) + add_unwind_entry (output_gr_gr (grmask, reg)); + else + as_bad ("Second operand is an invalid register."); + } + } +} + +static void +dot_savef (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e1; + int sep; + sep = parse_operand (&e1); + + if (e1.X_op != O_constant) + as_bad ("Operand to .save.f must be a constant."); + else + add_unwind_entry (output_fr_mem (e1.X_add_number)); +} + +static void +dot_saveb (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e1, e2; + unsigned int reg; + unsigned char sep; + int brmask; + + sep = parse_operand (&e1); + if (e1.X_op != O_constant) + { + as_bad ("First operand to .save.b must be a constant."); + return; + } + brmask = e1.X_add_number; + + if (sep == ',') + { + sep = parse_operand (&e2); + reg = e2.X_add_number - REG_GR; + if (e2.X_op != O_register || reg > 127) + { + as_bad ("Second operand to .save.b must be a general register."); + return; + } + add_unwind_entry (output_br_gr (brmask, e2.X_add_number)); + } + else + add_unwind_entry (output_br_mem (brmask)); + + if (!is_end_of_line[sep] && !is_it_end_of_statement ()) + ignore_rest_of_line (); +} + +static void +dot_savegf (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e1, e2; + int sep; + sep = parse_operand (&e1); + if (sep == ',') + parse_operand (&e2); + + if (e1.X_op != O_constant || sep != ',' || e2.X_op != O_constant) + as_bad ("Both operands of .save.gf must be constants."); + else + { + int grmask = e1.X_add_number; + int frmask = e2.X_add_number; + add_unwind_entry (output_frgr_mem (grmask, frmask)); + } +} + +static void +dot_spill (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + unsigned char sep; + + sep = parse_operand (&e); + if (!is_end_of_line[sep] && !is_it_end_of_statement ()) + ignore_rest_of_line (); + + if (e.X_op != O_constant) + as_bad ("Operand to .spill must be a constant"); + else + add_unwind_entry (output_spill_base (e.X_add_number)); +} + +static void +dot_spillreg (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + int sep, ab, xy, reg, treg; + expressionS e1, e2; + + sep = parse_operand (&e1); + if (sep != ',') + { + as_bad ("No second operand to .spillreg"); + return; + } + + parse_operand (&e2); + + if (!convert_expr_to_ab_reg (&e1, &ab, ®)) + { + as_bad ("First operand to .spillreg must be a preserved register"); + return; + } + + if (!convert_expr_to_xy_reg (&e2, &xy, &treg)) + { + as_bad ("Second operand to .spillreg must be a register"); + return; + } + + add_unwind_entry (output_spill_reg (ab, reg, treg, xy)); +} + +static void +dot_spillmem (psprel) + int psprel; +{ + expressionS e1, e2; + int sep, ab, reg; + + sep = parse_operand (&e1); + if (sep != ',') + { + as_bad ("Second operand missing"); + return; + } + + parse_operand (&e2); + + if (!convert_expr_to_ab_reg (&e1, &ab, ®)) + { + as_bad ("First operand to .spill%s must be a preserved register", + psprel ? "psp" : "sp"); + return; + } + + if (e2.X_op != O_constant) + { + as_bad ("Second operand to .spill%s must be a constant", + psprel ? "psp" : "sp"); + return; + } + + if (psprel) + add_unwind_entry (output_spill_psprel (ab, reg, e2.X_add_number)); + else + add_unwind_entry (output_spill_sprel (ab, reg, e2.X_add_number)); +} + +static void +dot_spillreg_p (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + int sep, ab, xy, reg, treg; + expressionS e1, e2, e3; + unsigned int qp; + + sep = parse_operand (&e1); + if (sep != ',') + { + as_bad ("No second and third operand to .spillreg.p"); + return; + } + + sep = parse_operand (&e2); + if (sep != ',') + { + as_bad ("No third operand to .spillreg.p"); + return; + } + + parse_operand (&e3); + + qp = e1.X_add_number - REG_P; + + if (e1.X_op != O_register || qp > 63) + { + as_bad ("First operand to .spillreg.p must be a predicate"); + return; + } + + if (!convert_expr_to_ab_reg (&e2, &ab, ®)) + { + as_bad ("Second operand to .spillreg.p must be a preserved register"); + return; + } + + if (!convert_expr_to_xy_reg (&e3, &xy, &treg)) + { + as_bad ("Third operand to .spillreg.p must be a register"); + return; + } + + add_unwind_entry (output_spill_reg_p (ab, reg, treg, xy, qp)); +} + +static void +dot_spillmem_p (psprel) + int psprel; +{ + expressionS e1, e2, e3; + int sep, ab, reg; + unsigned int qp; + + sep = parse_operand (&e1); + if (sep != ',') + { + as_bad ("Second operand missing"); + return; + } + + parse_operand (&e2); + if (sep != ',') + { + as_bad ("Second operand missing"); + return; + } + + parse_operand (&e3); + + qp = e1.X_add_number - REG_P; + if (e1.X_op != O_register || qp > 63) + { + as_bad ("First operand to .spill%s_p must be a predicate", + psprel ? "psp" : "sp"); + return; + } + + if (!convert_expr_to_ab_reg (&e2, &ab, ®)) + { + as_bad ("Second operand to .spill%s_p must be a preserved register", + psprel ? "psp" : "sp"); + return; + } + + if (e3.X_op != O_constant) + { + as_bad ("Third operand to .spill%s_p must be a constant", + psprel ? "psp" : "sp"); + return; + } + + if (psprel) + add_unwind_entry (output_spill_psprel_p (qp, ab, reg, e3.X_add_number)); + else + add_unwind_entry (output_spill_sprel_p (qp, ab, reg, e3.X_add_number)); +} + +static void +dot_label_state (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + + parse_operand (&e); + if (e.X_op != O_constant) + { + as_bad ("Operand to .label_state must be a constant"); + return; + } + add_unwind_entry (output_label_state (e.X_add_number)); +} + +static void +dot_copy_state (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + + parse_operand (&e); + if (e.X_op != O_constant) + { + as_bad ("Operand to .copy_state must be a constant"); + return; + } + add_unwind_entry (output_copy_state (e.X_add_number)); +} + +static void +dot_unwabi (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e1, e2; + unsigned char sep; + + sep = parse_operand (&e1); + if (sep != ',') + { + as_bad ("Second operand to .unwabi missing"); + return; + } + sep = parse_operand (&e2); + if (!is_end_of_line[sep] && !is_it_end_of_statement ()) + ignore_rest_of_line (); + + if (e1.X_op != O_constant) + { + as_bad ("First operand to .unwabi must be a constant"); + return; + } + + if (e2.X_op != O_constant) + { + as_bad ("Second operand to .unwabi must be a constant"); + return; + } + + add_unwind_entry (output_unwabi (e1.X_add_number, e2.X_add_number)); +} + +static void +dot_personality (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + char *name, *p, c; + SKIP_WHITESPACE (); + name = input_line_pointer; + c = get_symbol_end (); + p = input_line_pointer; + unwind.personality_routine = symbol_find_or_make (name); + unwind.force_unwind_entry = 1; + *p = c; + SKIP_WHITESPACE (); + demand_empty_rest_of_line (); +} + +static void +dot_proc (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + char *name, *p, c; + symbolS *sym; + + unwind.proc_start = expr_build_dot (); + /* Parse names of main and alternate entry points and mark them as + function symbols: */ + while (1) + { + SKIP_WHITESPACE (); + name = input_line_pointer; + c = get_symbol_end (); + p = input_line_pointer; + sym = symbol_find_or_make (name); + if (unwind.proc_start == 0) + { + unwind.proc_start = sym; + } + symbol_get_bfdsym (sym)->flags |= BSF_FUNCTION; + *p = c; + SKIP_WHITESPACE (); + if (*input_line_pointer != ',') + break; + ++input_line_pointer; + } + demand_empty_rest_of_line (); + ia64_do_align (16); + + unwind.prologue_count = 0; + unwind.list = unwind.tail = unwind.current_entry = NULL; + unwind.personality_routine = 0; +} + +static void +dot_body (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + unwind.prologue = 0; + unwind.prologue_mask = 0; + + add_unwind_entry (output_body ()); + demand_empty_rest_of_line (); +} + +static void +dot_prologue (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + unsigned char sep; + int mask = 0, grsave = 0; + + if (!is_it_end_of_statement ()) + { + expressionS e1, e2; + sep = parse_operand (&e1); + if (sep != ',') + as_bad ("No second operand to .prologue"); + sep = parse_operand (&e2); + if (!is_end_of_line[sep] && !is_it_end_of_statement ()) + ignore_rest_of_line (); + + if (e1.X_op == O_constant) + { + mask = e1.X_add_number; + + if (e2.X_op == O_constant) + grsave = e2.X_add_number; + else if (e2.X_op == O_register + && (grsave = e2.X_add_number - REG_GR) < 128) + ; + else + as_bad ("Second operand not a constant or general register"); + + add_unwind_entry (output_prologue_gr (mask, grsave)); + } + else + as_bad ("First operand not a constant"); + } + else + add_unwind_entry (output_prologue ()); + + unwind.prologue = 1; + unwind.prologue_mask = mask; + ++unwind.prologue_count; +} + +static void +dot_endp (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS e; + unsigned char *ptr; + int bytes_per_address; + long where; + segT saved_seg; + subsegT saved_subseg; + const char *sec_name, *text_name; + + if (unwind.saved_text_seg) + { + saved_seg = unwind.saved_text_seg; + saved_subseg = unwind.saved_text_subseg; + unwind.saved_text_seg = NULL; + } + else + { + saved_seg = now_seg; + saved_subseg = now_subseg; + } + + /* + Use a slightly ugly scheme to derive the unwind section names from + the text section name: + + text sect. unwind table sect. + name: name: comments: + ---------- ----------------- -------------------------------- + .text .IA_64.unwind + .text.foo .IA_64.unwind.text.foo + .foo .IA_64.unwind.foo + _info .IA_64.unwind_info gas issues error message (ditto) + _infoFOO .IA_64.unwind_infoFOO gas issues error message (ditto) + + This mapping is done so that: + + (a) An object file with unwind info only in .text will use + unwind section names .IA_64.unwind and .IA_64.unwind_info. + This follows the letter of the ABI and also ensures backwards + compatibility with older toolchains. + + (b) An object file with unwind info in multiple text sections + will use separate unwind sections for each text section. + This allows us to properly set the "sh_info" and "sh_link" + fields in SHT_IA_64_UNWIND as required by the ABI and also + lets GNU ld support programs with multiple segments + containing unwind info (as might be the case for certain + embedded applications). + + (c) An error is issued if there would be a name clash. + */ + text_name = segment_name (saved_seg); + if (strncmp (text_name, "_info", 5) == 0) + { + as_bad ("Illegal section name `%s' (causes unwind section name clash)", + text_name); + ignore_rest_of_line (); + return; + } + 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. */ + if (!unwind.info) + generate_unwind_image (text_name); + + if (unwind.info || unwind.force_unwind_entry) + { + subseg_set (md.last_text_seg, 0); + unwind.proc_end = expr_build_dot (); + + make_unw_section_name (SPECIAL_SECTION_UNWIND, text_name, sec_name); + set_section ((char *) sec_name); + 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); + + ptr = frag_more (24); + where = frag_now_fix () - 24; + bytes_per_address = bfd_arch_bits_per_address (stdoutput) / 8; + + /* Issue the values of a) Proc Begin, b) Proc End, c) Unwind Record. */ + e.X_op = O_pseudo_fixup; + e.X_op_symbol = pseudo_func[FUNC_SEG_RELATIVE].u.sym; + e.X_add_number = 0; + e.X_add_symbol = unwind.proc_start; + ia64_cons_fix_new (frag_now, where, bytes_per_address, &e); + + e.X_op = O_pseudo_fixup; + e.X_op_symbol = pseudo_func[FUNC_SEG_RELATIVE].u.sym; + e.X_add_number = 0; + e.X_add_symbol = unwind.proc_end; + ia64_cons_fix_new (frag_now, where + bytes_per_address, + bytes_per_address, &e); + + if (unwind.info) + { + e.X_op = O_pseudo_fixup; + e.X_op_symbol = pseudo_func[FUNC_SEG_RELATIVE].u.sym; + e.X_add_number = 0; + e.X_add_symbol = unwind.info; + ia64_cons_fix_new (frag_now, where + (bytes_per_address * 2), + bytes_per_address, &e); + } + else + md_number_to_chars (ptr + (bytes_per_address * 2), 0, + bytes_per_address); + + } + subseg_set (saved_seg, saved_subseg); + unwind.proc_start = unwind.proc_end = unwind.info = 0; +} + +static void +dot_template (template) + int template; +{ + CURR_SLOT.user_template = template; +} + +static void +dot_regstk (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + int ins, locs, outs, rots; + + if (is_it_end_of_statement ()) + ins = locs = outs = rots = 0; + else + { + ins = get_absolute_expression (); + if (*input_line_pointer++ != ',') + goto err; + locs = get_absolute_expression (); + if (*input_line_pointer++ != ',') + goto err; + outs = get_absolute_expression (); + if (*input_line_pointer++ != ',') + goto err; + rots = get_absolute_expression (); + } + set_regstack (ins, locs, outs, rots); + return; + + err: + as_bad ("Comma expected"); + ignore_rest_of_line (); +} + +static void +dot_rot (type) + int type; +{ + unsigned num_regs, num_alloced = 0; + struct dynreg **drpp, *dr; + int ch, base_reg = 0; + char *name, *start; + size_t len; + + switch (type) + { + case DYNREG_GR: base_reg = REG_GR + 32; break; + case DYNREG_FR: base_reg = REG_FR + 32; break; + case DYNREG_PR: base_reg = REG_P + 16; break; + default: break; + } + + /* First, remove existing names from hash table. */ + for (dr = md.dynreg[type]; dr && dr->num_regs; dr = dr->next) + { + hash_delete (md.dynreg_hash, dr->name); + dr->num_regs = 0; + } + + drpp = &md.dynreg[type]; + while (1) + { + start = input_line_pointer; + ch = get_symbol_end (); + *input_line_pointer = ch; + len = (input_line_pointer - start); + + SKIP_WHITESPACE (); + if (*input_line_pointer != '[') + { + as_bad ("Expected '['"); + goto err; + } + ++input_line_pointer; /* skip '[' */ + + num_regs = get_absolute_expression (); + + if (*input_line_pointer++ != ']') + { + as_bad ("Expected ']'"); + goto err; + } + SKIP_WHITESPACE (); + + num_alloced += num_regs; + switch (type) + { + case DYNREG_GR: + if (num_alloced > md.rot.num_regs) + { + as_bad ("Used more than the declared %d rotating registers", + md.rot.num_regs); + goto err; + } + break; + case DYNREG_FR: + if (num_alloced > 96) + { + as_bad ("Used more than the available 96 rotating registers"); + goto err; + } + break; + case DYNREG_PR: + if (num_alloced > 48) + { + as_bad ("Used more than the available 48 rotating registers"); + goto err; + } + break; + + default: + break; + } + + name = obstack_alloc (¬es, len + 1); + memcpy (name, start, len); + name[len] = '\0'; + + if (!*drpp) + { + *drpp = obstack_alloc (¬es, sizeof (*dr)); + memset (*drpp, 0, sizeof (*dr)); + } + + dr = *drpp; + dr->name = name; + dr->num_regs = num_regs; + dr->base = base_reg; + drpp = &dr->next; + base_reg += num_regs; + + if (hash_insert (md.dynreg_hash, name, dr)) + { + as_bad ("Attempt to redefine register set `%s'", name); + goto err; + } + + if (*input_line_pointer != ',') + break; + ++input_line_pointer; /* skip comma */ + SKIP_WHITESPACE (); + } + demand_empty_rest_of_line (); + return; + + err: + ignore_rest_of_line (); +} + +static void +dot_byteorder (byteorder) + int byteorder; +{ + target_big_endian = byteorder; +} + +static void +dot_psr (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + char *option; + int ch; + + while (1) + { + option = input_line_pointer; + ch = get_symbol_end (); + if (strcmp (option, "lsb") == 0) + md.flags &= ~EF_IA_64_BE; + else if (strcmp (option, "msb") == 0) + md.flags |= EF_IA_64_BE; + else if (strcmp (option, "abi32") == 0) + md.flags &= ~EF_IA_64_ABI64; + else if (strcmp (option, "abi64") == 0) + md.flags |= EF_IA_64_ABI64; + else + as_bad ("Unknown psr option `%s'", option); + *input_line_pointer = ch; + + SKIP_WHITESPACE (); + if (*input_line_pointer != ',') + break; + + ++input_line_pointer; + SKIP_WHITESPACE (); + } + demand_empty_rest_of_line (); +} + +static void +dot_alias (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + as_bad (".alias not implemented yet"); +} + +static void +dot_ln (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + new_logical_line (0, get_absolute_expression ()); + demand_empty_rest_of_line (); +} + +static char * +parse_section_name () +{ + char *name; + int len; + + SKIP_WHITESPACE (); + if (*input_line_pointer != '"') + { + as_bad ("Missing section name"); + ignore_rest_of_line (); + return 0; + } + name = demand_copy_C_string (&len); + if (!name) + { + ignore_rest_of_line (); + return 0; + } + SKIP_WHITESPACE (); + if (*input_line_pointer != ',') + { + as_bad ("Comma expected after section name"); + ignore_rest_of_line (); + return 0; + } + ++input_line_pointer; /* skip comma */ + return name; +} + +static void +dot_xdata (size) + int size; +{ + char *name = parse_section_name (); + if (!name) + return; + + md.keep_pending_output = 1; + set_section (name); + cons (size); + obj_elf_previous (0); + md.keep_pending_output = 0; +} + +/* Why doesn't float_cons() call md_cons_align() the way cons() does? */ + +static void +stmt_float_cons (kind) + int kind; +{ + size_t size; + + switch (kind) + { + case 'd': size = 8; break; + case 'x': size = 10; break; + + case 'f': + default: + size = 4; + break; + } + ia64_do_align (size); + float_cons (kind); +} + +static void +stmt_cons_ua (size) + int size; +{ + int saved_auto_align = md.auto_align; + + md.auto_align = 0; + cons (size); + md.auto_align = saved_auto_align; +} + +static void +dot_xfloat_cons (kind) + int kind; +{ + char *name = parse_section_name (); + if (!name) + return; + + md.keep_pending_output = 1; + set_section (name); + stmt_float_cons (kind); + obj_elf_previous (0); + md.keep_pending_output = 0; +} + +static void +dot_xstringer (zero) + int zero; +{ + char *name = parse_section_name (); + if (!name) + return; + + md.keep_pending_output = 1; + set_section (name); + stringer (zero); + obj_elf_previous (0); + md.keep_pending_output = 0; +} + +static void +dot_xdata_ua (size) + int size; +{ + int saved_auto_align = md.auto_align; + char *name = parse_section_name (); + if (!name) + return; + + md.keep_pending_output = 1; + set_section (name); + md.auto_align = 0; + cons (size); + md.auto_align = saved_auto_align; + obj_elf_previous (0); + md.keep_pending_output = 0; +} + +static void +dot_xfloat_cons_ua (kind) + int kind; +{ + int saved_auto_align = md.auto_align; + char *name = parse_section_name (); + if (!name) + return; + + md.keep_pending_output = 1; + set_section (name); + md.auto_align = 0; + stmt_float_cons (kind); + md.auto_align = saved_auto_align; + obj_elf_previous (0); + md.keep_pending_output = 0; +} + +/* .reg.val ,value */ + +static void +dot_reg_val (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + expressionS reg; + + expression (®); + if (reg.X_op != O_register) + { + as_bad (_("Register name expected")); + ignore_rest_of_line (); + } + else if (*input_line_pointer++ != ',') + { + as_bad (_("Comma expected")); + ignore_rest_of_line (); + } + else + { + valueT value = get_absolute_expression (); + int regno = reg.X_add_number; + if (regno < REG_GR || regno > REG_GR + 128) + as_warn (_("Register value annotation ignored")); + else + { + gr_values[regno - REG_GR].known = 1; + gr_values[regno - REG_GR].value = value; + gr_values[regno - REG_GR].path = md.path; + } + } + demand_empty_rest_of_line (); +} + +/* select dv checking mode + .auto + .explicit + .default + + A stop is inserted when changing modes + */ + +static void +dot_dv_mode (type) + int type; +{ + if (md.manual_bundling) + as_warn (_("Directive invalid within a bundle")); + + if (type == 'E' || type == 'A') + md.mode_explicitly_set = 0; + else + md.mode_explicitly_set = 1; + + md.detect_dv = 1; + switch (type) + { + case 'A': + case 'a': + if (md.explicit_mode) + insn_group_break (1, 0, 0); + md.explicit_mode = 0; + break; + case 'E': + case 'e': + if (!md.explicit_mode) + insn_group_break (1, 0, 0); + md.explicit_mode = 1; + break; + default: + case 'd': + if (md.explicit_mode != md.default_explicit_mode) + insn_group_break (1, 0, 0); + md.explicit_mode = md.default_explicit_mode; + md.mode_explicitly_set = 0; + break; + } +} + +static void +print_prmask (mask) + valueT mask; +{ + int regno; + char *comma = ""; + for (regno = 0; regno < 64; regno++) + { + if (mask & ((valueT) 1 << regno)) + { + fprintf (stderr, "%s p%d", comma, regno); + comma = ","; + } + } +} + +/* + .pred.rel.clear [p1 [,p2 [,...]]] (also .pred.rel "clear") + .pred.rel.imply p1, p2 (also .pred.rel "imply") + .pred.rel.mutex p1, p2 [,...] (also .pred.rel "mutex") + .pred.safe_across_calls p1 [, p2 [,...]] + */ + +static void +dot_pred_rel (type) + int type; +{ + valueT mask = 0; + int count = 0; + int p1 = -1, p2 = -1; + + if (type == 0) + { + if (*input_line_pointer != '"') + { + as_bad (_("Missing predicate relation type")); + ignore_rest_of_line (); + return; + } + else + { + int len; + char *form = demand_copy_C_string (&len); + if (strcmp (form, "mutex") == 0) + type = 'm'; + else if (strcmp (form, "clear") == 0) + type = 'c'; + else if (strcmp (form, "imply") == 0) + type = 'i'; + else + { + as_bad (_("Unrecognized predicate relation type")); + ignore_rest_of_line (); + return; + } + } + if (*input_line_pointer == ',') + ++input_line_pointer; + SKIP_WHITESPACE (); + } + + SKIP_WHITESPACE (); + while (1) + { + valueT bit = 1; + int regno; + + if (toupper (*input_line_pointer) != 'P' + || (regno = atoi (++input_line_pointer)) < 0 + || regno > 63) + { + as_bad (_("Predicate register expected")); + ignore_rest_of_line (); + return; + } + while (isdigit (*input_line_pointer)) + ++input_line_pointer; + if (p1 == -1) + p1 = regno; + else if (p2 == -1) + p2 = regno; + bit <<= regno; + if (mask & bit) + as_warn (_("Duplicate predicate register ignored")); + mask |= bit; + count++; + /* See if it's a range. */ + if (*input_line_pointer == '-') + { + valueT stop = 1; + ++input_line_pointer; + + if (toupper (*input_line_pointer) != 'P' + || (regno = atoi (++input_line_pointer)) < 0 + || regno > 63) + { + as_bad (_("Predicate register expected")); + ignore_rest_of_line (); + return; + } + while (isdigit (*input_line_pointer)) + ++input_line_pointer; + stop <<= regno; + if (bit >= stop) + { + as_bad (_("Bad register range")); + ignore_rest_of_line (); + return; + } + while (bit < stop) + { + bit <<= 1; + mask |= bit; + count++; + } + SKIP_WHITESPACE (); + } + if (*input_line_pointer != ',') + break; + ++input_line_pointer; + SKIP_WHITESPACE (); + } + + switch (type) + { + case 'c': + if (count == 0) + mask = ~(valueT) 0; + clear_qp_mutex (mask); + clear_qp_implies (mask, (valueT) 0); + break; + case 'i': + if (count != 2 || p1 == -1 || p2 == -1) + as_bad (_("Predicate source and target required")); + else if (p1 == 0 || p2 == 0) + as_bad (_("Use of p0 is not valid in this context")); + else + add_qp_imply (p1, p2); + break; + case 'm': + if (count < 2) + { + as_bad (_("At least two PR arguments expected")); + break; + } + else if (mask & 1) + { + as_bad (_("Use of p0 is not valid in this context")); + break; + } + add_qp_mutex (mask); + break; + case 's': + /* note that we don't override any existing relations */ + if (count == 0) + { + as_bad (_("At least one PR argument expected")); + break; + } + if (md.debug_dv) + { + fprintf (stderr, "Safe across calls: "); + print_prmask (mask); + fprintf (stderr, "\n"); + } + qp_safe_across_calls = mask; + break; + } + demand_empty_rest_of_line (); +} + +/* .entry label [, label [, ...]] + Hint to DV code that the given labels are to be considered entry points. + Otherwise, only global labels are considered entry points. */ + +static void +dot_entry (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + const char *err; + char *name; + int c; + symbolS *symbolP; + + do + { + name = input_line_pointer; + c = get_symbol_end (); + symbolP = symbol_find_or_make (name); + + err = hash_insert (md.entry_hash, S_GET_NAME (symbolP), (PTR) symbolP); + if (err) + as_fatal (_("Inserting \"%s\" into entry hint table failed: %s"), + name, err); + + *input_line_pointer = c; + SKIP_WHITESPACE (); + c = *input_line_pointer; + if (c == ',') + { + input_line_pointer++; + SKIP_WHITESPACE (); + if (*input_line_pointer == '\n') + c = '\n'; + } + } + while (c == ','); + + demand_empty_rest_of_line (); +} + +/* .mem.offset offset, base + "base" is used to distinguish between offsets from a different base. */ + +static void +dot_mem_offset (dummy) + int dummy ATTRIBUTE_UNUSED; +{ + md.mem_offset.hint = 1; + md.mem_offset.offset = get_absolute_expression (); + if (*input_line_pointer != ',') + { + as_bad (_("Comma expected")); + ignore_rest_of_line (); + return; + } + ++input_line_pointer; + md.mem_offset.base = get_absolute_expression (); + demand_empty_rest_of_line (); +} + +/* ia64-specific pseudo-ops: */ +const pseudo_typeS md_pseudo_table[] = + { + { "radix", dot_radix, 0 }, + { "lcomm", s_lcomm_bytes, 1 }, + { "bss", dot_special_section, SPECIAL_SECTION_BSS }, + { "sbss", dot_special_section, SPECIAL_SECTION_SBSS }, + { "sdata", dot_special_section, SPECIAL_SECTION_SDATA }, + { "rodata", dot_special_section, SPECIAL_SECTION_RODATA }, + { "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 }, + { "proc", dot_proc, 0 }, + { "body", dot_body, 0 }, + { "prologue", dot_prologue, 0 }, + { "endp", dot_endp, 0 }, + { "file", dwarf2_directive_file, 0 }, + { "loc", dwarf2_directive_loc, 0 }, + + { "fframe", dot_fframe, 0 }, + { "vframe", dot_vframe, 0 }, + { "vframesp", dot_vframesp, 0 }, + { "vframepsp", dot_vframepsp, 0 }, + { "save", dot_save, 0 }, + { "restore", dot_restore, 0 }, + { "restorereg", dot_restorereg, 0 }, + { "restorereg.p", dot_restorereg_p, 0 }, + { "handlerdata", dot_handlerdata, 0 }, + { "unwentry", dot_unwentry, 0 }, + { "altrp", dot_altrp, 0 }, + { "savesp", dot_savemem, 0 }, + { "savepsp", dot_savemem, 1 }, + { "save.g", dot_saveg, 0 }, + { "save.f", dot_savef, 0 }, + { "save.b", dot_saveb, 0 }, + { "save.gf", dot_savegf, 0 }, + { "spill", dot_spill, 0 }, + { "spillreg", dot_spillreg, 0 }, + { "spillsp", dot_spillmem, 0 }, + { "spillpsp", dot_spillmem, 1 }, + { "spillreg.p", dot_spillreg_p, 0 }, + { "spillsp.p", dot_spillmem_p, 0 }, + { "spillpsp.p", dot_spillmem_p, 1 }, + { "label_state", dot_label_state, 0 }, + { "copy_state", dot_copy_state, 0 }, + { "unwabi", dot_unwabi, 0 }, + { "personality", dot_personality, 0 }, +#if 0 + { "estate", dot_estate, 0 }, +#endif + { "mii", dot_template, 0x0 }, + { "mli", dot_template, 0x2 }, /* old format, for compatibility */ + { "mlx", dot_template, 0x2 }, + { "mmi", dot_template, 0x4 }, + { "mfi", dot_template, 0x6 }, + { "mmf", dot_template, 0x7 }, + { "mib", dot_template, 0x8 }, + { "mbb", dot_template, 0x9 }, + { "bbb", dot_template, 0xb }, + { "mmb", dot_template, 0xc }, + { "mfb", dot_template, 0xe }, +#if 0 + { "lb", dot_scope, 0 }, + { "le", dot_scope, 1 }, +#endif + { "align", s_align_bytes, 0 }, + { "regstk", dot_regstk, 0 }, + { "rotr", dot_rot, DYNREG_GR }, + { "rotf", dot_rot, DYNREG_FR }, + { "rotp", dot_rot, DYNREG_PR }, + { "lsb", dot_byteorder, 0 }, + { "msb", dot_byteorder, 1 }, + { "psr", dot_psr, 0 }, + { "alias", dot_alias, 0 }, + { "ln", dot_ln, 0 }, /* source line info (for debugging) */ + + { "xdata1", dot_xdata, 1 }, + { "xdata2", dot_xdata, 2 }, + { "xdata4", dot_xdata, 4 }, + { "xdata8", dot_xdata, 8 }, + { "xreal4", dot_xfloat_cons, 'f' }, + { "xreal8", dot_xfloat_cons, 'd' }, + { "xreal10", dot_xfloat_cons, 'x' }, + { "xstring", dot_xstringer, 0 }, + { "xstringz", dot_xstringer, 1 }, + + /* unaligned versions: */ + { "xdata2.ua", dot_xdata_ua, 2 }, + { "xdata4.ua", dot_xdata_ua, 4 }, + { "xdata8.ua", dot_xdata_ua, 8 }, + { "xreal4.ua", dot_xfloat_cons_ua, 'f' }, + { "xreal8.ua", dot_xfloat_cons_ua, 'd' }, + { "xreal10.ua", dot_xfloat_cons_ua, 'x' }, + + /* annotations/DV checking support */ + { "entry", dot_entry, 0 }, + { "mem.offset", dot_mem_offset, 0 }, + { "pred.rel", dot_pred_rel, 0 }, + { "pred.rel.clear", dot_pred_rel, 'c' }, + { "pred.rel.imply", dot_pred_rel, 'i' }, + { "pred.rel.mutex", dot_pred_rel, 'm' }, + { "pred.safe_across_calls", dot_pred_rel, 's' }, + { "reg.val", dot_reg_val, 0 }, + { "auto", dot_dv_mode, 'a' }, + { "explicit", dot_dv_mode, 'e' }, + { "default", dot_dv_mode, 'd' }, + + { NULL, 0, 0 } + }; + +static const struct pseudo_opcode + { + const char *name; + void (*handler) (int); + int arg; + } +pseudo_opcode[] = + { + /* these are more like pseudo-ops, but don't start with a dot */ + { "data1", cons, 1 }, + { "data2", cons, 2 }, + { "data4", cons, 4 }, + { "data8", cons, 8 }, + { "real4", stmt_float_cons, 'f' }, + { "real8", stmt_float_cons, 'd' }, + { "real10", stmt_float_cons, 'x' }, + { "string", stringer, 0 }, + { "stringz", stringer, 1 }, + + /* unaligned versions: */ + { "data2.ua", stmt_cons_ua, 2 }, + { "data4.ua", stmt_cons_ua, 4 }, + { "data8.ua", stmt_cons_ua, 8 }, + { "real4.ua", float_cons, 'f' }, + { "real8.ua", float_cons, 'd' }, + { "real10.ua", float_cons, 'x' }, + }; + +/* Declare a register by creating a symbol for it and entering it in + the symbol table. */ + +static symbolS * +declare_register (name, regnum) + const char *name; + int regnum; +{ + const char *err; + symbolS *sym; + + sym = symbol_new (name, reg_section, regnum, &zero_address_frag); + + err = hash_insert (md.reg_hash, S_GET_NAME (sym), (PTR) sym); + if (err) + as_fatal ("Inserting \"%s\" into register table failed: %s", + name, err); + + return sym; +} + +static void +declare_register_set (prefix, num_regs, base_regnum) + const char *prefix; + int num_regs; + int base_regnum; +{ + char name[8]; + int i; + + for (i = 0; i < num_regs; ++i) + { + sprintf (name, "%s%u", prefix, i); + declare_register (name, base_regnum + i); + } +} + +static unsigned int +operand_width (opnd) + enum ia64_opnd opnd; +{ + const struct ia64_operand *odesc = &elf64_ia64_operands[opnd]; + unsigned int bits = 0; + int i; + + bits = 0; + for (i = 0; i < NELEMS (odesc->field) && odesc->field[i].bits; ++i) + bits += odesc->field[i].bits; + + return bits; +} + +static enum operand_match_result +operand_match (idesc, index, e) + const struct ia64_opcode *idesc; + int index; + expressionS *e; +{ + enum ia64_opnd opnd = idesc->operands[index]; + int bits, relocatable = 0; + struct insn_fix *fix; + bfd_signed_vma val; + + switch (opnd) + { + /* constants: */ + + case IA64_OPND_AR_CCV: + if (e->X_op == O_register && e->X_add_number == REG_AR + 32) + return OPERAND_MATCH; + break; + + case IA64_OPND_AR_PFS: + if (e->X_op == O_register && e->X_add_number == REG_AR + 64) + return OPERAND_MATCH; + break; + + case IA64_OPND_GR0: + if (e->X_op == O_register && e->X_add_number == REG_GR + 0) + return OPERAND_MATCH; + break; + + case IA64_OPND_IP: + if (e->X_op == O_register && e->X_add_number == REG_IP) + return OPERAND_MATCH; + break; + + case IA64_OPND_PR: + if (e->X_op == O_register && e->X_add_number == REG_PR) + return OPERAND_MATCH; + break; + + case IA64_OPND_PR_ROT: + if (e->X_op == O_register && e->X_add_number == REG_PR_ROT) + return OPERAND_MATCH; + break; + + case IA64_OPND_PSR: + if (e->X_op == O_register && e->X_add_number == REG_PSR) + return OPERAND_MATCH; + break; + + case IA64_OPND_PSR_L: + if (e->X_op == O_register && e->X_add_number == REG_PSR_L) + return OPERAND_MATCH; + break; + + case IA64_OPND_PSR_UM: + if (e->X_op == O_register && e->X_add_number == REG_PSR_UM) + return OPERAND_MATCH; + break; + + case IA64_OPND_C1: + if (e->X_op == O_constant) + { + if (e->X_add_number == 1) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_C8: + if (e->X_op == O_constant) + { + if (e->X_add_number == 8) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_C16: + if (e->X_op == O_constant) + { + if (e->X_add_number == 16) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + /* register operands: */ + + case IA64_OPND_AR3: + if (e->X_op == O_register && e->X_add_number >= REG_AR + && e->X_add_number < REG_AR + 128) + return OPERAND_MATCH; + break; + + case IA64_OPND_B1: + case IA64_OPND_B2: + if (e->X_op == O_register && e->X_add_number >= REG_BR + && e->X_add_number < REG_BR + 8) + return OPERAND_MATCH; + break; + + case IA64_OPND_CR3: + if (e->X_op == O_register && e->X_add_number >= REG_CR + && e->X_add_number < REG_CR + 128) + return OPERAND_MATCH; + break; + + case IA64_OPND_F1: + case IA64_OPND_F2: + case IA64_OPND_F3: + case IA64_OPND_F4: + if (e->X_op == O_register && e->X_add_number >= REG_FR + && e->X_add_number < REG_FR + 128) + return OPERAND_MATCH; + break; + + case IA64_OPND_P1: + case IA64_OPND_P2: + if (e->X_op == O_register && e->X_add_number >= REG_P + && e->X_add_number < REG_P + 64) + return OPERAND_MATCH; + break; + + case IA64_OPND_R1: + case IA64_OPND_R2: + case IA64_OPND_R3: + if (e->X_op == O_register && e->X_add_number >= REG_GR + && e->X_add_number < REG_GR + 128) + return OPERAND_MATCH; + break; + + case IA64_OPND_R3_2: + if (e->X_op == O_register && e->X_add_number >= REG_GR) + { + if (e->X_add_number < REG_GR + 4) + return OPERAND_MATCH; + else if (e->X_add_number < REG_GR + 128) + return OPERAND_OUT_OF_RANGE; + } + break; + + /* indirect operands: */ + case IA64_OPND_CPUID_R3: + case IA64_OPND_DBR_R3: + case IA64_OPND_DTR_R3: + case IA64_OPND_ITR_R3: + case IA64_OPND_IBR_R3: + case IA64_OPND_MSR_R3: + case IA64_OPND_PKR_R3: + case IA64_OPND_PMC_R3: + case IA64_OPND_PMD_R3: + case IA64_OPND_RR_R3: + if (e->X_op == O_index && e->X_op_symbol + && (S_GET_VALUE (e->X_op_symbol) - IND_CPUID + == opnd - IA64_OPND_CPUID_R3)) + return OPERAND_MATCH; + break; + + case IA64_OPND_MR3: + if (e->X_op == O_index && !e->X_op_symbol) + return OPERAND_MATCH; + break; + + /* immediate operands: */ + case IA64_OPND_CNT2a: + case IA64_OPND_LEN4: + case IA64_OPND_LEN6: + bits = operand_width (idesc->operands[index]); + if (e->X_op == O_constant) + { + if ((bfd_vma) (e->X_add_number - 1) < ((bfd_vma) 1 << bits)) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_CNT2b: + if (e->X_op == O_constant) + { + if ((bfd_vma) (e->X_add_number - 1) < 3) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_CNT2c: + val = e->X_add_number; + if (e->X_op == O_constant) + { + if ((val == 0 || val == 7 || val == 15 || val == 16)) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_SOR: + /* SOR must be an integer multiple of 8 */ + if (e->X_op == O_constant && e->X_add_number & 0x7) + return OPERAND_OUT_OF_RANGE; + case IA64_OPND_SOF: + case IA64_OPND_SOL: + if (e->X_op == O_constant) + { + if ((bfd_vma) e->X_add_number <= 96) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_IMMU62: + if (e->X_op == O_constant) + { + if ((bfd_vma) e->X_add_number < ((bfd_vma) 1 << 62)) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + else + { + /* FIXME -- need 62-bit relocation type */ + as_bad (_("62-bit relocation not yet implemented")); + } + break; + + case IA64_OPND_IMMU64: + if (e->X_op == O_symbol || e->X_op == O_pseudo_fixup + || e->X_op == O_subtract) + { + fix = CURR_SLOT.fixup + CURR_SLOT.num_fixups; + fix->code = BFD_RELOC_IA64_IMM64; + if (e->X_op != O_subtract) + { + fix->code = ia64_gen_real_reloc_type (e->X_op_symbol, fix->code); + if (e->X_op == O_pseudo_fixup) + e->X_op = O_symbol; + } + + fix->opnd = idesc->operands[index]; + fix->expr = *e; + fix->is_pcrel = 0; + ++CURR_SLOT.num_fixups; + return OPERAND_MATCH; + } + else if (e->X_op == O_constant) + return OPERAND_MATCH; + break; + + case IA64_OPND_CCNT5: + case IA64_OPND_CNT5: + case IA64_OPND_CNT6: + case IA64_OPND_CPOS6a: + case IA64_OPND_CPOS6b: + case IA64_OPND_CPOS6c: + case IA64_OPND_IMMU2: + case IA64_OPND_IMMU7a: + case IA64_OPND_IMMU7b: + case IA64_OPND_IMMU21: + case IA64_OPND_IMMU24: + case IA64_OPND_MBTYPE4: + case IA64_OPND_MHTYPE8: + case IA64_OPND_POS6: + bits = operand_width (idesc->operands[index]); + if (e->X_op == O_constant) + { + if ((bfd_vma) e->X_add_number < ((bfd_vma) 1 << bits)) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_IMMU9: + bits = operand_width (idesc->operands[index]); + if (e->X_op == O_constant) + { + if ((bfd_vma) e->X_add_number < ((bfd_vma) 1 << bits)) + { + int lobits = e->X_add_number & 0x3; + if (((bfd_vma) e->X_add_number & 0x3C) != 0 && lobits == 0) + e->X_add_number |= (bfd_vma) 0x3; + return OPERAND_MATCH; + } + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_IMM44: + /* least 16 bits must be zero */ + if ((e->X_add_number & 0xffff) != 0) + /* XXX technically, this is wrong: we should not be issuing warning + messages until we're sure this instruction pattern is going to + be used! */ + as_warn (_("lower 16 bits of mask ignored")); + + if (e->X_op == O_constant) + { + if (((e->X_add_number >= 0 + && (bfd_vma) e->X_add_number < ((bfd_vma) 1 << 44)) + || (e->X_add_number < 0 + && (bfd_vma) -e->X_add_number <= ((bfd_vma) 1 << 44)))) + { + /* sign-extend */ + if (e->X_add_number >= 0 + && (e->X_add_number & ((bfd_vma) 1 << 43)) != 0) + { + e->X_add_number |= ~(((bfd_vma) 1 << 44) - 1); + } + return OPERAND_MATCH; + } + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_IMM17: + /* bit 0 is a don't care (pr0 is hardwired to 1) */ + if (e->X_op == O_constant) + { + if (((e->X_add_number >= 0 + && (bfd_vma) e->X_add_number < ((bfd_vma) 1 << 17)) + || (e->X_add_number < 0 + && (bfd_vma) -e->X_add_number <= ((bfd_vma) 1 << 17)))) + { + /* sign-extend */ + if (e->X_add_number >= 0 + && (e->X_add_number & ((bfd_vma) 1 << 16)) != 0) + { + e->X_add_number |= ~(((bfd_vma) 1 << 17) - 1); + } + return OPERAND_MATCH; + } + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_IMM14: + case IA64_OPND_IMM22: + relocatable = 1; + case IA64_OPND_IMM1: + case IA64_OPND_IMM8: + case IA64_OPND_IMM8U4: + case IA64_OPND_IMM8M1: + case IA64_OPND_IMM8M1U4: + case IA64_OPND_IMM8M1U8: + case IA64_OPND_IMM9a: + case IA64_OPND_IMM9b: + bits = operand_width (idesc->operands[index]); + if (relocatable && (e->X_op == O_symbol + || e->X_op == O_subtract + || e->X_op == O_pseudo_fixup)) + { + fix = CURR_SLOT.fixup + CURR_SLOT.num_fixups; + + if (idesc->operands[index] == IA64_OPND_IMM14) + fix->code = BFD_RELOC_IA64_IMM14; + else + fix->code = BFD_RELOC_IA64_IMM22; + + if (e->X_op != O_subtract) + { + fix->code = ia64_gen_real_reloc_type (e->X_op_symbol, fix->code); + if (e->X_op == O_pseudo_fixup) + e->X_op = O_symbol; + } + + fix->opnd = idesc->operands[index]; + fix->expr = *e; + fix->is_pcrel = 0; + ++CURR_SLOT.num_fixups; + return OPERAND_MATCH; + } + else if (e->X_op != O_constant + && ! (e->X_op == O_big && opnd == IA64_OPND_IMM8M1U8)) + return OPERAND_MISMATCH; + + if (opnd == IA64_OPND_IMM8M1U4) + { + /* Zero is not valid for unsigned compares that take an adjusted + constant immediate range. */ + if (e->X_add_number == 0) + return OPERAND_OUT_OF_RANGE; + + /* Sign-extend 32-bit unsigned numbers, so that the following range + checks will work. */ + val = e->X_add_number; + if (((val & (~(bfd_vma) 0 << 32)) == 0) + && ((val & ((bfd_vma) 1 << 31)) != 0)) + val = ((val << 32) >> 32); + + /* Check for 0x100000000. This is valid because + 0x100000000-1 is the same as ((uint32_t) -1). */ + if (val == ((bfd_signed_vma) 1 << 32)) + return OPERAND_MATCH; + + val = val - 1; + } + else if (opnd == IA64_OPND_IMM8M1U8) + { + /* Zero is not valid for unsigned compares that take an adjusted + constant immediate range. */ + if (e->X_add_number == 0) + return OPERAND_OUT_OF_RANGE; + + /* Check for 0x10000000000000000. */ + if (e->X_op == O_big) + { + if (generic_bignum[0] == 0 + && generic_bignum[1] == 0 + && generic_bignum[2] == 0 + && generic_bignum[3] == 0 + && generic_bignum[4] == 1) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + else + val = e->X_add_number - 1; + } + else if (opnd == IA64_OPND_IMM8M1) + val = e->X_add_number - 1; + else if (opnd == IA64_OPND_IMM8U4) + { + /* Sign-extend 32-bit unsigned numbers, so that the following range + checks will work. */ + val = e->X_add_number; + if (((val & (~(bfd_vma) 0 << 32)) == 0) + && ((val & ((bfd_vma) 1 << 31)) != 0)) + val = ((val << 32) >> 32); + } + else + val = e->X_add_number; + + if ((val >= 0 && (bfd_vma) val < ((bfd_vma) 1 << (bits - 1))) + || (val < 0 && (bfd_vma) -val <= ((bfd_vma) 1 << (bits - 1)))) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + + case IA64_OPND_INC3: + /* +/- 1, 4, 8, 16 */ + val = e->X_add_number; + if (val < 0) + val = -val; + if (e->X_op == O_constant) + { + if ((val == 1 || val == 4 || val == 8 || val == 16)) + return OPERAND_MATCH; + else + return OPERAND_OUT_OF_RANGE; + } + break; + + case IA64_OPND_TGT25: + case IA64_OPND_TGT25b: + case IA64_OPND_TGT25c: + case IA64_OPND_TGT64: + if (e->X_op == O_symbol) + { + fix = CURR_SLOT.fixup + CURR_SLOT.num_fixups; + if (opnd == IA64_OPND_TGT25) + fix->code = BFD_RELOC_IA64_PCREL21F; + else if (opnd == IA64_OPND_TGT25b) + fix->code = BFD_RELOC_IA64_PCREL21M; + else if (opnd == IA64_OPND_TGT25c) + fix->code = BFD_RELOC_IA64_PCREL21B; + else if (opnd == IA64_OPND_TGT64) + fix->code = BFD_RELOC_IA64_PCREL60B; + else + abort (); + + 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; + ++CURR_SLOT.num_fixups; + return OPERAND_MATCH; + } + case IA64_OPND_TAG13: + case IA64_OPND_TAG13b: + switch (e->X_op) + { + case O_constant: + return OPERAND_MATCH; + + case O_symbol: + fix = CURR_SLOT.fixup + CURR_SLOT.num_fixups; + fix->code = ia64_gen_real_reloc_type (e->X_op_symbol, 0); + fix->opnd = idesc->operands[index]; + fix->expr = *e; + fix->is_pcrel = 1; + ++CURR_SLOT.num_fixups; + return OPERAND_MATCH; + + default: + break; + } + break; + + default: + break; + } + return OPERAND_MISMATCH; +} + +static int +parse_operand (e) + expressionS *e; +{ + int sep = '\0'; + + memset (e, 0, sizeof (*e)); + e->X_op = O_absent; + SKIP_WHITESPACE (); + if (*input_line_pointer != '}') + expression (e); + sep = *input_line_pointer++; + + if (sep == '}') + { + if (!md.manual_bundling) + as_warn ("Found '}' when manual bundling is off"); + else + CURR_SLOT.manual_bundling_off = 1; + md.manual_bundling = 0; + sep = '\0'; + } + return sep; +} + +/* Returns the next entry in the opcode table that matches the one in + IDESC, and frees the entry in IDESC. If no matching entry is + found, NULL is returned instead. */ + +static struct ia64_opcode * +get_next_opcode (struct ia64_opcode *idesc) +{ + struct ia64_opcode *next = ia64_find_next_opcode (idesc); + ia64_free_opcode (idesc); + return next; +} + +/* Parse the operands for the opcode and find the opcode variant that + matches the specified operands, or NULL if no match is possible. */ + +static struct ia64_opcode * +parse_operands (idesc) + struct ia64_opcode *idesc; +{ + int i = 0, highest_unmatched_operand, num_operands = 0, num_outputs = 0; + int error_pos, out_of_range_pos, curr_out_of_range_pos, sep = 0; + enum ia64_opnd expected_operand = IA64_OPND_NIL; + enum operand_match_result result; + char mnemonic[129]; + char *first_arg = 0, *end, *saved_input_pointer; + unsigned int sof; + + assert (strlen (idesc->name) <= 128); + + strcpy (mnemonic, idesc->name); + if (idesc->operands[2] == IA64_OPND_SOF) + { + /* To make the common idiom "alloc loc?=ar.pfs,0,1,0,0" work, we + can't parse the first operand until we have parsed the + remaining operands of the "alloc" instruction. */ + SKIP_WHITESPACE (); + first_arg = input_line_pointer; + end = strchr (input_line_pointer, '='); + if (!end) + { + as_bad ("Expected separator `='"); + return 0; + } + input_line_pointer = end + 1; + ++i; + ++num_outputs; + } + + for (; i < NELEMS (CURR_SLOT.opnd); ++i) + { + sep = parse_operand (CURR_SLOT.opnd + i); + if (CURR_SLOT.opnd[i].X_op == O_absent) + break; + + ++num_operands; + + if (sep != '=' && sep != ',') + break; + + if (sep == '=') + { + if (num_outputs > 0) + as_bad ("Duplicate equal sign (=) in instruction"); + else + num_outputs = i + 1; + } + } + if (sep != '\0') + { + as_bad ("Illegal operand separator `%c'", sep); + return 0; + } + + if (idesc->operands[2] == IA64_OPND_SOF) + { + /* map alloc r1=ar.pfs,i,l,o,r to alloc r1=ar.pfs,(i+l+o),(i+l),r */ + know (strcmp (idesc->name, "alloc") == 0); + if (num_operands == 5 /* first_arg not included in this count! */ + && CURR_SLOT.opnd[2].X_op == O_constant + && CURR_SLOT.opnd[3].X_op == O_constant + && CURR_SLOT.opnd[4].X_op == O_constant + && CURR_SLOT.opnd[5].X_op == O_constant) + { + sof = set_regstack (CURR_SLOT.opnd[2].X_add_number, + CURR_SLOT.opnd[3].X_add_number, + CURR_SLOT.opnd[4].X_add_number, + CURR_SLOT.opnd[5].X_add_number); + + /* now we can parse the first arg: */ + saved_input_pointer = input_line_pointer; + input_line_pointer = first_arg; + sep = parse_operand (CURR_SLOT.opnd + 0); + if (sep != '=') + --num_outputs; /* force error */ + input_line_pointer = saved_input_pointer; + + CURR_SLOT.opnd[2].X_add_number = sof; + CURR_SLOT.opnd[3].X_add_number + = sof - CURR_SLOT.opnd[4].X_add_number; + CURR_SLOT.opnd[4] = CURR_SLOT.opnd[5]; + } + } + + highest_unmatched_operand = 0; + curr_out_of_range_pos = -1; + error_pos = 0; + expected_operand = idesc->operands[0]; + for (; idesc; idesc = get_next_opcode (idesc)) + { + if (num_outputs != idesc->num_outputs) + continue; /* mismatch in # of outputs */ + + CURR_SLOT.num_fixups = 0; + + /* Try to match all operands. If we see an out-of-range operand, + then continue trying to match the rest of the operands, since if + the rest match, then this idesc will give the best error message. */ + + out_of_range_pos = -1; + for (i = 0; i < num_operands && idesc->operands[i]; ++i) + { + result = operand_match (idesc, i, CURR_SLOT.opnd + i); + if (result != OPERAND_MATCH) + { + if (result != OPERAND_OUT_OF_RANGE) + break; + if (out_of_range_pos < 0) + /* remember position of the first out-of-range operand: */ + out_of_range_pos = i; + } + } + + /* If we did not match all operands, or if at least one operand was + out-of-range, then this idesc does not match. Keep track of which + idesc matched the most operands before failing. If we have two + idescs that failed at the same position, and one had an out-of-range + operand, then prefer the out-of-range operand. Thus if we have + "add r0=0x1000000,r1" we get an error saying the constant is out + of range instead of an error saying that the constant should have been + a register. */ + + if (i != num_operands || out_of_range_pos >= 0) + { + if (i > highest_unmatched_operand + || (i == highest_unmatched_operand + && out_of_range_pos > curr_out_of_range_pos)) + { + highest_unmatched_operand = i; + if (out_of_range_pos >= 0) + { + expected_operand = idesc->operands[out_of_range_pos]; + error_pos = out_of_range_pos; + } + else + { + expected_operand = idesc->operands[i]; + error_pos = i; + } + curr_out_of_range_pos = out_of_range_pos; + } + continue; + } + + if (num_operands < NELEMS (idesc->operands) + && idesc->operands[num_operands]) + continue; /* mismatch in number of arguments */ + + break; + } + if (!idesc) + { + if (expected_operand) + as_bad ("Operand %u of `%s' should be %s", + error_pos + 1, mnemonic, + elf64_ia64_operands[expected_operand].desc); + else + as_bad ("Operand mismatch"); + return 0; + } + return idesc; +} + +/* Keep track of state necessary to determine whether a NOP is necessary + to avoid an erratum in A and B step Itanium chips, and return 1 if we + detect a case where additional NOPs may be necessary. */ +static int +errata_nop_necessary_p (slot, insn_unit) + struct slot *slot; + enum ia64_unit insn_unit; +{ + int i; + struct group *this_group = md.last_groups + md.group_idx; + struct group *prev_group = md.last_groups + (md.group_idx + 2) % 3; + struct ia64_opcode *idesc = slot->idesc; + + /* Test whether this could be the first insn in a problematic sequence. */ + if (insn_unit == IA64_UNIT_F) + { + for (i = 0; i < idesc->num_outputs; i++) + if (idesc->operands[i] == IA64_OPND_P1 + || idesc->operands[i] == IA64_OPND_P2) + { + int regno = slot->opnd[i].X_add_number - REG_P; + /* Ignore invalid operands; they generate errors elsewhere. */ + if (regno >= 64) + return 0; + this_group->p_reg_set[regno] = 1; + } + } + + /* Test whether this could be the second insn in a problematic sequence. */ + if (insn_unit == IA64_UNIT_M && slot->qp_regno > 0 + && prev_group->p_reg_set[slot->qp_regno]) + { + for (i = 0; i < idesc->num_outputs; i++) + if (idesc->operands[i] == IA64_OPND_R1 + || idesc->operands[i] == IA64_OPND_R2 + || idesc->operands[i] == IA64_OPND_R3) + { + int regno = slot->opnd[i].X_add_number - REG_GR; + /* Ignore invalid operands; they generate errors elsewhere. */ + if (regno >= 128) + return 0; + if (strncmp (idesc->name, "add", 3) != 0 + && strncmp (idesc->name, "sub", 3) != 0 + && strncmp (idesc->name, "shladd", 6) != 0 + && (idesc->flags & IA64_OPCODE_POSTINC) == 0) + this_group->g_reg_set_conditionally[regno] = 1; + } + } + + /* Test whether this could be the third insn in a problematic sequence. */ + for (i = 0; i < NELEMS (idesc->operands) && idesc->operands[i]; i++) + { + if (/* For fc, ptc, ptr, tak, thash, tpa, ttag, probe, ptr, ptc. */ + idesc->operands[i] == IA64_OPND_R3 + /* For mov indirect. */ + || idesc->operands[i] == IA64_OPND_RR_R3 + || idesc->operands[i] == IA64_OPND_DBR_R3 + || idesc->operands[i] == IA64_OPND_IBR_R3 + || idesc->operands[i] == IA64_OPND_PKR_R3 + || idesc->operands[i] == IA64_OPND_PMC_R3 + || idesc->operands[i] == IA64_OPND_PMD_R3 + || idesc->operands[i] == IA64_OPND_MSR_R3 + || idesc->operands[i] == IA64_OPND_CPUID_R3 + /* For itr. */ + || idesc->operands[i] == IA64_OPND_ITR_R3 + || idesc->operands[i] == IA64_OPND_DTR_R3 + /* Normal memory addresses (load, store, xchg, cmpxchg, etc.). */ + || idesc->operands[i] == IA64_OPND_MR3) + { + int regno = slot->opnd[i].X_add_number - REG_GR; + /* Ignore invalid operands; they generate errors elsewhere. */ + if (regno >= 128) + return 0; + if (idesc->operands[i] == IA64_OPND_R3) + { + if (strcmp (idesc->name, "fc") != 0 + && strcmp (idesc->name, "tak") != 0 + && strcmp (idesc->name, "thash") != 0 + && strcmp (idesc->name, "tpa") != 0 + && strcmp (idesc->name, "ttag") != 0 + && strncmp (idesc->name, "ptr", 3) != 0 + && strncmp (idesc->name, "ptc", 3) != 0 + && strncmp (idesc->name, "probe", 5) != 0) + return 0; + } + if (prev_group->g_reg_set_conditionally[regno]) + return 1; + } + } + return 0; +} + +static void +build_insn (slot, insnp) + struct slot *slot; + bfd_vma *insnp; +{ + const struct ia64_operand *odesc, *o2desc; + struct ia64_opcode *idesc = slot->idesc; + bfd_signed_vma insn, val; + const char *err; + int i; + + insn = idesc->opcode | slot->qp_regno; + + for (i = 0; i < NELEMS (idesc->operands) && idesc->operands[i]; ++i) + { + if (slot->opnd[i].X_op == O_register + || slot->opnd[i].X_op == O_constant + || slot->opnd[i].X_op == O_index) + val = slot->opnd[i].X_add_number; + else if (slot->opnd[i].X_op == O_big) + { + /* This must be the value 0x10000000000000000. */ + assert (idesc->operands[i] == IA64_OPND_IMM8M1U8); + val = 0; + } + else + val = 0; + + switch (idesc->operands[i]) + { + case IA64_OPND_IMMU64: + *insnp++ = (val >> 22) & 0x1ffffffffffLL; + insn |= (((val & 0x7f) << 13) | (((val >> 7) & 0x1ff) << 27) + | (((val >> 16) & 0x1f) << 22) | (((val >> 21) & 0x1) << 21) + | (((val >> 63) & 0x1) << 36)); + continue; + + case IA64_OPND_IMMU62: + val &= 0x3fffffffffffffffULL; + if (val != slot->opnd[i].X_add_number) + as_warn (_("Value truncated to 62 bits")); + *insnp++ = (val >> 21) & 0x1ffffffffffLL; + insn |= (((val & 0xfffff) << 6) | (((val >> 20) & 0x1) << 36)); + continue; + + case IA64_OPND_TGT64: + val >>= 4; + *insnp++ = ((val >> 20) & 0x7fffffffffLL) << 2; + insn |= ((((val >> 59) & 0x1) << 36) + | (((val >> 0) & 0xfffff) << 13)); + continue; + + case IA64_OPND_AR3: + val -= REG_AR; + break; + + case IA64_OPND_B1: + case IA64_OPND_B2: + val -= REG_BR; + break; + + case IA64_OPND_CR3: + val -= REG_CR; + break; + + case IA64_OPND_F1: + case IA64_OPND_F2: + case IA64_OPND_F3: + case IA64_OPND_F4: + val -= REG_FR; + break; + + case IA64_OPND_P1: + case IA64_OPND_P2: + val -= REG_P; + break; + + case IA64_OPND_R1: + case IA64_OPND_R2: + case IA64_OPND_R3: + case IA64_OPND_R3_2: + case IA64_OPND_CPUID_R3: + case IA64_OPND_DBR_R3: + case IA64_OPND_DTR_R3: + case IA64_OPND_ITR_R3: + case IA64_OPND_IBR_R3: + case IA64_OPND_MR3: + case IA64_OPND_MSR_R3: + case IA64_OPND_PKR_R3: + case IA64_OPND_PMC_R3: + case IA64_OPND_PMD_R3: + case IA64_OPND_RR_R3: + val -= REG_GR; + break; + + default: + break; + } + + odesc = elf64_ia64_operands + idesc->operands[i]; + err = (*odesc->insert) (odesc, val, &insn); + if (err) + as_bad_where (slot->src_file, slot->src_line, + "Bad operand value: %s", err); + if (idesc->flags & IA64_OPCODE_PSEUDO) + { + if ((idesc->flags & IA64_OPCODE_F2_EQ_F3) + && odesc == elf64_ia64_operands + IA64_OPND_F3) + { + o2desc = elf64_ia64_operands + IA64_OPND_F2; + (*o2desc->insert) (o2desc, val, &insn); + } + if ((idesc->flags & IA64_OPCODE_LEN_EQ_64MCNT) + && (odesc == elf64_ia64_operands + IA64_OPND_CPOS6a + || odesc == elf64_ia64_operands + IA64_OPND_POS6)) + { + o2desc = elf64_ia64_operands + IA64_OPND_LEN6; + (*o2desc->insert) (o2desc, 64 - val, &insn); + } + } + } + *insnp = insn; +} + +static void +emit_one_bundle () +{ + unsigned int manual_bundling_on = 0, manual_bundling_off = 0; + unsigned int manual_bundling = 0; + enum ia64_unit required_unit, insn_unit = 0; + enum ia64_insn_type type[3], insn_type; + unsigned int template, orig_template; + bfd_vma insn[3] = { -1, -1, -1 }; + struct ia64_opcode *idesc; + int end_of_insn_group = 0, user_template = -1; + int n, i, j, first, curr; + unw_rec_list *ptr; + bfd_vma t0 = 0, t1 = 0; + struct label_fix *lfix; + struct insn_fix *ifix; + char mnemonic[16]; + fixS *fix; + char *f; + + first = (md.curr_slot + NUM_SLOTS - md.num_slots_in_use) % NUM_SLOTS; + know (first >= 0 & first < NUM_SLOTS); + n = MIN (3, md.num_slots_in_use); + + /* Determine template: user user_template if specified, best match + otherwise: */ + + if (md.slot[first].user_template >= 0) + user_template = template = md.slot[first].user_template; + else + { + /* Auto select appropriate template. */ + memset (type, 0, sizeof (type)); + curr = first; + for (i = 0; i < n; ++i) + { + if (md.slot[curr].label_fixups && i != 0) + break; + type[i] = md.slot[curr].idesc->type; + curr = (curr + 1) % NUM_SLOTS; + } + template = best_template[type[0]][type[1]][type[2]]; + } + + /* initialize instructions with appropriate nops: */ + for (i = 0; i < 3; ++i) + insn[i] = nop[ia64_templ_desc[template].exec_unit[i]]; + + f = frag_more (16); + + /* now fill in slots with as many insns as possible: */ + curr = first; + idesc = md.slot[curr].idesc; + end_of_insn_group = 0; + for (i = 0; i < 3 && md.num_slots_in_use > 0; ++i) + { + /* Set the slot number for prologue/body records now as those + refer to the current point, not the point after the + instruction has been issued: */ + /* Don't try to delete prologue/body records here, as that will cause + them to also be deleted from the master list of unwind records. */ + for (ptr = md.slot[curr].unwind_record; ptr; ptr = ptr->next) + if (ptr->r.type == prologue || ptr->r.type == prologue_gr + || ptr->r.type == body) + { + ptr->slot_number = (unsigned long) f + i; + ptr->slot_frag = frag_now; + } + + if (idesc->flags & IA64_OPCODE_SLOT2) + { + if (manual_bundling && i != 2) + as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line, + "`%s' must be last in bundle", idesc->name); + else + i = 2; + } + if (idesc->flags & IA64_OPCODE_LAST) + { + int required_slot; + unsigned int required_template; + + /* If we need a stop bit after an M slot, our only choice is + template 5 (M;;MI). If we need a stop bit after a B + slot, our only choice is to place it at the end of the + bundle, because the only available templates are MIB, + MBB, BBB, MMB, and MFB. We don't handle anything other + than M and B slots because these are the only kind of + instructions that can have the IA64_OPCODE_LAST bit set. */ + required_template = template; + switch (idesc->type) + { + case IA64_TYPE_M: + required_slot = 0; + required_template = 5; + break; + + case IA64_TYPE_B: + required_slot = 2; + break; + + default: + as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line, + "Internal error: don't know how to force %s to end" + "of instruction group", idesc->name); + required_slot = i; + break; + } + if (manual_bundling && i != required_slot) + as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line, + "`%s' must be last in instruction group", + idesc->name); + if (required_slot < i) + /* Can't fit this instruction. */ + break; + + i = required_slot; + if (required_template != template) + { + /* If we switch the template, we need to reset the NOPs + after slot i. The slot-types of the instructions ahead + of i never change, so we don't need to worry about + changing NOPs in front of this slot. */ + for (j = i; j < 3; ++j) + insn[j] = nop[ia64_templ_desc[required_template].exec_unit[j]]; + } + template = required_template; + } + if (curr != first && md.slot[curr].label_fixups) + { + if (manual_bundling_on) + as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line, + "Label must be first in a bundle"); + /* This insn must go into the first slot of a bundle. */ + break; + } + + manual_bundling_on = md.slot[curr].manual_bundling_on; + manual_bundling_off = md.slot[curr].manual_bundling_off; + + if (manual_bundling_on) + { + if (curr == first) + manual_bundling = 1; + else + break; /* need to start a new bundle */ + } + + if (end_of_insn_group && md.num_slots_in_use >= 1) + { + /* We need an instruction group boundary in the middle of a + bundle. See if we can switch to an other template with + an appropriate boundary. */ + + orig_template = template; + if (i == 1 && (user_template == 4 + || (user_template < 0 + && (ia64_templ_desc[template].exec_unit[0] + == IA64_UNIT_M)))) + { + template = 5; + end_of_insn_group = 0; + } + else if (i == 2 && (user_template == 0 + || (user_template < 0 + && (ia64_templ_desc[template].exec_unit[1] + == IA64_UNIT_I))) + /* This test makes sure we don't switch the template if + the next instruction is one that needs to be first in + an instruction group. Since all those instructions are + in the M group, there is no way such an instruction can + fit in this bundle even if we switch the template. The + reason we have to check for this is that otherwise we + may end up generating "MI;;I M.." which has the deadly + effect that the second M instruction is no longer the + first in the bundle! --davidm 99/12/16 */ + && (idesc->flags & IA64_OPCODE_FIRST) == 0) + { + template = 1; + end_of_insn_group = 0; + } + else if (curr != first) + /* can't fit this insn */ + break; + + if (template != orig_template) + /* if we switch the template, we need to reset the NOPs + after slot i. The slot-types of the instructions ahead + of i never change, so we don't need to worry about + changing NOPs in front of this slot. */ + for (j = i; j < 3; ++j) + insn[j] = nop[ia64_templ_desc[template].exec_unit[j]]; + } + required_unit = ia64_templ_desc[template].exec_unit[i]; + + /* resolve dynamic opcodes such as "break" and "nop": */ + if (idesc->type == IA64_TYPE_DYN) + { + if ((strcmp (idesc->name, "nop") == 0) + || (strcmp (idesc->name, "break") == 0)) + insn_unit = required_unit; + else if (strcmp (idesc->name, "chk.s") == 0) + { + insn_unit = IA64_UNIT_M; + if (required_unit == IA64_UNIT_I) + insn_unit = IA64_UNIT_I; + } + else + as_fatal ("emit_one_bundle: unexpected dynamic op"); + + sprintf (mnemonic, "%s.%c", idesc->name, "?imbf??"[insn_unit]); + ia64_free_opcode (idesc); + md.slot[curr].idesc = idesc = ia64_find_opcode (mnemonic); +#if 0 + know (!idesc->next); /* no resolved dynamic ops have collisions */ +#endif + } + else + { + insn_type = idesc->type; + insn_unit = IA64_UNIT_NIL; + switch (insn_type) + { + case IA64_TYPE_A: + if (required_unit == IA64_UNIT_I || required_unit == IA64_UNIT_M) + insn_unit = required_unit; + break; + case IA64_TYPE_X: insn_unit = IA64_UNIT_L; break; + case IA64_TYPE_I: insn_unit = IA64_UNIT_I; break; + case IA64_TYPE_M: insn_unit = IA64_UNIT_M; break; + case IA64_TYPE_B: insn_unit = IA64_UNIT_B; break; + case IA64_TYPE_F: insn_unit = IA64_UNIT_F; break; + default: break; + } + } + + if (insn_unit != required_unit) + { + if (required_unit == IA64_UNIT_L + && insn_unit == IA64_UNIT_I + && !(idesc->flags & IA64_OPCODE_X_IN_MLX)) + { + /* we got ourselves an MLX template but the current + instruction isn't an X-unit, or an I-unit instruction + that can go into the X slot of an MLX template. Duh. */ + if (md.num_slots_in_use >= NUM_SLOTS) + { + as_bad_where (md.slot[curr].src_file, + md.slot[curr].src_line, + "`%s' can't go in X slot of " + "MLX template", idesc->name); + /* drop this insn so we don't livelock: */ + --md.num_slots_in_use; + } + break; + } + continue; /* try next slot */ + } + + { + bfd_vma addr; + + addr = frag_now->fr_address + frag_now_fix () - 16 + i; + dwarf2_gen_line_info (addr, &md.slot[curr].debug_line); + } + + if (errata_nop_necessary_p (md.slot + curr, insn_unit)) + as_warn (_("Additional NOP may be necessary to workaround Itanium processor A/B step errata")); + + build_insn (md.slot + curr, insn + i); + + /* Set slot counts for non prologue/body unwind records. */ + for (ptr = md.slot[curr].unwind_record; ptr; ptr = ptr->next) + if (ptr->r.type != prologue && ptr->r.type != prologue_gr + && ptr->r.type != body) + { + ptr->slot_number = (unsigned long) f + i; + ptr->slot_frag = frag_now; + } + md.slot[curr].unwind_record = NULL; + + if (required_unit == IA64_UNIT_L) + { + know (i == 1); + /* skip one slot for long/X-unit instructions */ + ++i; + } + --md.num_slots_in_use; + + /* now is a good time to fix up the labels for this insn: */ + for (lfix = md.slot[curr].label_fixups; lfix; lfix = lfix->next) + { + S_SET_VALUE (lfix->sym, frag_now_fix () - 16); + symbol_set_frag (lfix->sym, frag_now); + } + /* and fix up the tags also. */ + for (lfix = md.slot[curr].tag_fixups; lfix; lfix = lfix->next) + { + S_SET_VALUE (lfix->sym, frag_now_fix () - 16 + i); + symbol_set_frag (lfix->sym, frag_now); + } + + for (j = 0; j < md.slot[curr].num_fixups; ++j) + { + ifix = md.slot[curr].fixup + j; + fix = fix_new_exp (frag_now, frag_now_fix () - 16 + i, 8, + &ifix->expr, ifix->is_pcrel, ifix->code); + fix->tc_fix_data.opnd = ifix->opnd; + fix->fx_plt = (fix->fx_r_type == BFD_RELOC_IA64_PLTOFF22); + fix->fx_file = md.slot[curr].src_file; + fix->fx_line = md.slot[curr].src_line; + } + + end_of_insn_group = md.slot[curr].end_of_insn_group; + + if (end_of_insn_group) + { + md.group_idx = (md.group_idx + 1) % 3; + memset (md.last_groups + md.group_idx, 0, sizeof md.last_groups[0]); + } + + /* clear slot: */ + ia64_free_opcode (md.slot[curr].idesc); + memset (md.slot + curr, 0, sizeof (md.slot[curr])); + md.slot[curr].user_template = -1; + + if (manual_bundling_off) + { + manual_bundling = 0; + break; + } + curr = (curr + 1) % NUM_SLOTS; + idesc = md.slot[curr].idesc; + } + if (manual_bundling) + { + if (md.num_slots_in_use > 0) + as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line, + "`%s' does not fit into %s template", + idesc->name, ia64_templ_desc[template].name); + else + as_bad_where (md.slot[curr].src_file, md.slot[curr].src_line, + "Missing '}' at end of file"); + } + know (md.num_slots_in_use < NUM_SLOTS); + + t0 = end_of_insn_group | (template << 1) | (insn[0] << 5) | (insn[1] << 46); + t1 = ((insn[1] >> 18) & 0x7fffff) | (insn[2] << 23); + + number_to_chars_littleendian (f + 0, t0, 8); + number_to_chars_littleendian (f + 8, t1, 8); + + unwind.next_slot_number = (unsigned long) f + 16; + unwind.next_slot_frag = frag_now; +} + +int +md_parse_option (c, arg) + int c; + char *arg; +{ + switch (c) + { + /* Switches from the Intel assembler. */ + case 'm': + if (strcmp (arg, "ilp64") == 0 + || strcmp (arg, "lp64") == 0 + || strcmp (arg, "p64") == 0) + { + md.flags |= EF_IA_64_ABI64; + } + else if (strcmp (arg, "ilp32") == 0) + { + md.flags &= ~EF_IA_64_ABI64; + } + else if (strcmp (arg, "le") == 0) + { + md.flags &= ~EF_IA_64_BE; + } + else if (strcmp (arg, "be") == 0) + { + md.flags |= EF_IA_64_BE; + } + else + return 0; + break; + + case 'N': + if (strcmp (arg, "so") == 0) + { + /* Suppress signon message. */ + } + else if (strcmp (arg, "pi") == 0) + { + /* Reject privileged instructions. FIXME */ + } + else if (strcmp (arg, "us") == 0) + { + /* Allow union of signed and unsigned range. FIXME */ + } + else if (strcmp (arg, "close_fcalls") == 0) + { + /* Do not resolve global function calls. */ + } + else + return 0; + break; + + case 'C': + /* temp[="prefix"] Insert temporary labels into the object file + symbol table prefixed by "prefix". + Default prefix is ":temp:". + */ + break; + + case 'a': + /* indirect= Assume unannotated indirect branches behavior + according to -- + exit: branch out from the current context (default) + labels: all labels in context may be branch targets + */ + if (strncmp (arg, "indirect=", 9) != 0) + return 0; + break; + + case 'x': + /* -X conflicts with an ignored option, use -x instead */ + md.detect_dv = 1; + if (!arg || strcmp (arg, "explicit") == 0) + { + /* set default mode to explicit */ + md.default_explicit_mode = 1; + break; + } + else if (strcmp (arg, "auto") == 0) + { + md.default_explicit_mode = 0; + } + else if (strcmp (arg, "debug") == 0) + { + md.debug_dv = 1; + } + else if (strcmp (arg, "debugx") == 0) + { + md.default_explicit_mode = 1; + md.debug_dv = 1; + } + else + { + as_bad (_("Unrecognized option '-x%s'"), arg); + } + break; + + case 'S': + /* nops Print nops statistics. */ + break; + + /* GNU specific switches for gcc. */ + case OPTION_MCONSTANT_GP: + md.flags |= EF_IA_64_CONS_GP; + break; + + case OPTION_MAUTO_PIC: + md.flags |= EF_IA_64_NOFUNCDESC_CONS_GP; + break; + + default: + return 0; + } + + return 1; +} + +void +md_show_usage (stream) + FILE *stream; +{ + fputs (_("\ +IA-64 options:\n\ + -milp32|-milp64|-mlp64|-mp64 select data model (default -mlp64)\n\ + -mle | -mbe select little- or big-endian byte order (default -mle)\n\ + -x | -xexplicit turn on dependency violation checking (default)\n\ + -xauto automagically remove dependency violations\n\ + -xdebug debug dependency violation checker\n"), + stream); +} + +/* Return true if TYPE fits in TEMPL at SLOT. */ + +static int +match (int templ, int type, int slot) +{ + enum ia64_unit unit; + int result; + + unit = ia64_templ_desc[templ].exec_unit[slot]; + switch (type) + { + case IA64_TYPE_DYN: result = 1; break; /* for nop and break */ + case IA64_TYPE_A: + result = (unit == IA64_UNIT_I || unit == IA64_UNIT_M); + break; + case IA64_TYPE_X: result = (unit == IA64_UNIT_L); break; + case IA64_TYPE_I: result = (unit == IA64_UNIT_I); break; + case IA64_TYPE_M: result = (unit == IA64_UNIT_M); break; + case IA64_TYPE_B: result = (unit == IA64_UNIT_B); break; + case IA64_TYPE_F: result = (unit == IA64_UNIT_F); break; + default: result = 0; break; + } + return result; +} + +/* Add a bit of extra goodness if a nop of type F or B would fit + in TEMPL at SLOT. */ + +static inline int +extra_goodness (int templ, int slot) +{ + if (slot == 1 && match (templ, IA64_TYPE_F, slot)) + return 2; + if (slot == 2 && match (templ, IA64_TYPE_B, slot)) + return 1; + return 0; +} + +/* This function is called once, at assembler startup time. It sets + up all the tables, etc. that the MD part of the assembler will need + that can be determined before arguments are parsed. */ +void +md_begin () +{ + int i, j, k, t, total, ar_base, cr_base, goodness, best, regnum, ok; + const char *err; + char name[8]; + + md.auto_align = 1; + md.explicit_mode = md.default_explicit_mode; + + bfd_set_section_alignment (stdoutput, text_section, 4); + + target_big_endian = TARGET_BYTES_BIG_ENDIAN; + pseudo_func[FUNC_FPTR_RELATIVE].u.sym = + symbol_new (".", undefined_section, FUNC_FPTR_RELATIVE, + &zero_address_frag); + + pseudo_func[FUNC_GP_RELATIVE].u.sym = + symbol_new (".", undefined_section, FUNC_GP_RELATIVE, + &zero_address_frag); + + pseudo_func[FUNC_LT_RELATIVE].u.sym = + symbol_new (".", undefined_section, FUNC_LT_RELATIVE, + &zero_address_frag); + + pseudo_func[FUNC_PC_RELATIVE].u.sym = + symbol_new (".", undefined_section, FUNC_PC_RELATIVE, + &zero_address_frag); + + pseudo_func[FUNC_PLT_RELATIVE].u.sym = + symbol_new (".", undefined_section, FUNC_PLT_RELATIVE, + &zero_address_frag); + + pseudo_func[FUNC_SEC_RELATIVE].u.sym = + symbol_new (".", undefined_section, FUNC_SEC_RELATIVE, + &zero_address_frag); + + pseudo_func[FUNC_SEG_RELATIVE].u.sym = + symbol_new (".", undefined_section, FUNC_SEG_RELATIVE, + &zero_address_frag); + + pseudo_func[FUNC_LTV_RELATIVE].u.sym = + symbol_new (".", undefined_section, FUNC_LTV_RELATIVE, + &zero_address_frag); + + pseudo_func[FUNC_LT_FPTR_RELATIVE].u.sym = + symbol_new (".", undefined_section, FUNC_LT_FPTR_RELATIVE, + &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 + F and B nops in the chosen bundles, which is good because these + pipelines are least likely to be overcommitted. */ + for (i = 0; i < IA64_NUM_TYPES; ++i) + for (j = 0; j < IA64_NUM_TYPES; ++j) + for (k = 0; k < IA64_NUM_TYPES; ++k) + { + best = 0; + for (t = 0; t < NELEMS (ia64_templ_desc); ++t) + { + goodness = 0; + if (match (t, i, 0)) + { + if (match (t, j, 1)) + { + if (match (t, k, 2)) + goodness = 3 + 3 + 3; + else + goodness = 3 + 3 + extra_goodness (t, 2); + } + else if (match (t, j, 2)) + goodness = 3 + 3 + extra_goodness (t, 1); + else + { + goodness = 3; + goodness += extra_goodness (t, 1); + goodness += extra_goodness (t, 2); + } + } + else if (match (t, i, 1)) + { + if (match (t, j, 2)) + goodness = 3 + 3; + else + goodness = 3 + extra_goodness (t, 2); + } + else if (match (t, i, 2)) + goodness = 3 + extra_goodness (t, 1); + + if (goodness > best) + { + best = goodness; + best_template[i][j][k] = t; + } + } + } + + for (i = 0; i < NUM_SLOTS; ++i) + md.slot[i].user_template = -1; + + md.pseudo_hash = hash_new (); + for (i = 0; i < NELEMS (pseudo_opcode); ++i) + { + err = hash_insert (md.pseudo_hash, pseudo_opcode[i].name, + (void *) (pseudo_opcode + i)); + if (err) + as_fatal ("ia64.md_begin: can't hash `%s': %s", + pseudo_opcode[i].name, err); + } + + md.reg_hash = hash_new (); + md.dynreg_hash = hash_new (); + md.const_hash = hash_new (); + md.entry_hash = hash_new (); + + /* general registers: */ + + total = 128; + for (i = 0; i < total; ++i) + { + sprintf (name, "r%d", i - REG_GR); + md.regsym[i] = declare_register (name, i); + } + + /* floating point registers: */ + total += 128; + for (; i < total; ++i) + { + sprintf (name, "f%d", i - REG_FR); + md.regsym[i] = declare_register (name, i); + } + + /* application registers: */ + total += 128; + ar_base = i; + for (; i < total; ++i) + { + sprintf (name, "ar%d", i - REG_AR); + md.regsym[i] = declare_register (name, i); + } + + /* control registers: */ + total += 128; + cr_base = i; + for (; i < total; ++i) + { + sprintf (name, "cr%d", i - REG_CR); + md.regsym[i] = declare_register (name, i); + } + + /* predicate registers: */ + total += 64; + for (; i < total; ++i) + { + sprintf (name, "p%d", i - REG_P); + md.regsym[i] = declare_register (name, i); + } + + /* branch registers: */ + total += 8; + for (; i < total; ++i) + { + sprintf (name, "b%d", i - REG_BR); + md.regsym[i] = declare_register (name, i); + } + + md.regsym[REG_IP] = declare_register ("ip", REG_IP); + md.regsym[REG_CFM] = declare_register ("cfm", REG_CFM); + md.regsym[REG_PR] = declare_register ("pr", REG_PR); + md.regsym[REG_PR_ROT] = declare_register ("pr.rot", REG_PR_ROT); + md.regsym[REG_PSR] = declare_register ("psr", REG_PSR); + md.regsym[REG_PSR_L] = declare_register ("psr.l", REG_PSR_L); + md.regsym[REG_PSR_UM] = declare_register ("psr.um", REG_PSR_UM); + + for (i = 0; i < NELEMS (indirect_reg); ++i) + { + regnum = indirect_reg[i].regnum; + md.regsym[regnum] = declare_register (indirect_reg[i].name, regnum); + } + + /* define synonyms for application registers: */ + for (i = REG_AR; i < REG_AR + NELEMS (ar); ++i) + md.regsym[i] = declare_register (ar[i - REG_AR].name, + REG_AR + ar[i - REG_AR].regnum); + + /* define synonyms for control registers: */ + for (i = REG_CR; i < REG_CR + NELEMS (cr); ++i) + md.regsym[i] = declare_register (cr[i - REG_CR].name, + REG_CR + cr[i - REG_CR].regnum); + + declare_register ("gp", REG_GR + 1); + declare_register ("sp", REG_GR + 12); + declare_register ("rp", REG_BR + 0); + + /* pseudo-registers used to specify unwind info: */ + declare_register ("psp", REG_PSP); + + declare_register_set ("ret", 4, REG_GR + 8); + declare_register_set ("farg", 8, REG_FR + 8); + declare_register_set ("fret", 8, REG_FR + 8); + + for (i = 0; i < NELEMS (const_bits); ++i) + { + err = hash_insert (md.const_hash, const_bits[i].name, + (PTR) (const_bits + i)); + if (err) + as_fatal ("Inserting \"%s\" into constant hash table failed: %s", + name, err); + } + + /* Set the architecture and machine depending on defaults and command line + options. */ + if (md.flags & EF_IA_64_ABI64) + ok = bfd_set_arch_mach (stdoutput, bfd_arch_ia64, bfd_mach_ia64_elf64); + else + ok = bfd_set_arch_mach (stdoutput, bfd_arch_ia64, bfd_mach_ia64_elf32); + + if (! ok) + as_warn (_("Could not set architecture and machine")); + + md.mem_offset.hint = 0; + md.path = 0; + md.maxpaths = 0; + md.entry_labels = NULL; +} + +/* Set the elf type to 64 bit ABI by default. Cannot do this in md_begin + because that is called after md_parse_option which is where we do the + dynamic changing of md.flags based on -mlp64 or -milp32. Also, set the + default endianness. */ + +void +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; +} + +/* Return a string for the target object file format. */ + +const char * +ia64_target_format () +{ + if (OUTPUT_FLAVOR == bfd_target_elf_flavour) + { + if (md.flags & EF_IA_64_BE) + { + if (md.flags & EF_IA_64_ABI64) + return "elf64-ia64-big"; + else + return "elf32-ia64-big"; + } + else + { + if (md.flags & EF_IA_64_ABI64) + return "elf64-ia64-little"; + else + return "elf32-ia64-little"; + } + } + else + return "unknown-format"; +} + +void +ia64_end_of_source () +{ + /* terminate insn group upon reaching end of file: */ + insn_group_break (1, 0, 0); + + /* emits slots we haven't written yet: */ + ia64_flush_insns (); + + bfd_set_private_flags (stdoutput, md.flags); + + md.mem_offset.hint = 0; +} + +void +ia64_start_line () +{ + if (md.qp.X_op == O_register) + as_bad ("qualifying predicate not followed by instruction"); + md.qp.X_op = O_absent; + + if (ignore_input ()) + return; + + if (input_line_pointer[0] == ';' && input_line_pointer[-1] == ';') + { + if (md.detect_dv && !md.explicit_mode) + as_warn (_("Explicit stops are ignored in auto mode")); + else + insn_group_break (1, 0, 0); + } +} + +/* This is a hook for ia64_frob_label, so that it can distinguish tags from + labels. */ +static int defining_tag = 0; + +int +ia64_unrecognized_line (ch) + int ch; +{ + switch (ch) + { + case '(': + expression (&md.qp); + if (*input_line_pointer++ != ')') + { + as_bad ("Expected ')'"); + return 0; + } + if (md.qp.X_op != O_register) + { + as_bad ("Qualifying predicate expected"); + return 0; + } + if (md.qp.X_add_number < REG_P || md.qp.X_add_number >= REG_P + 64) + { + as_bad ("Predicate register expected"); + return 0; + } + return 1; + + case '{': + if (md.manual_bundling) + as_warn ("Found '{' when manual bundling is already turned on"); + else + CURR_SLOT.manual_bundling_on = 1; + md.manual_bundling = 1; + + /* Bundling is only acceptable in explicit mode + or when in default automatic mode. */ + if (md.detect_dv && !md.explicit_mode) + { + if (!md.mode_explicitly_set + && !md.default_explicit_mode) + dot_dv_mode ('E'); + else + as_warn (_("Found '{' after explicit switch to automatic mode")); + } + return 1; + + case '}': + if (!md.manual_bundling) + as_warn ("Found '}' when manual bundling is off"); + else + PREV_SLOT.manual_bundling_off = 1; + md.manual_bundling = 0; + + /* switch back to automatic mode, if applicable */ + if (md.detect_dv + && md.explicit_mode + && !md.mode_explicitly_set + && !md.default_explicit_mode) + dot_dv_mode ('A'); + + /* Allow '{' to follow on the same line. We also allow ";;", but that + happens automatically because ';' is an end of line marker. */ + SKIP_WHITESPACE (); + if (input_line_pointer[0] == '{') + { + input_line_pointer++; + return ia64_unrecognized_line ('{'); + } + + demand_empty_rest_of_line (); + return 1; + + case '[': + { + char *s; + char c; + symbolS *tag; + int temp; + + if (md.qp.X_op == O_register) + { + as_bad ("Tag must come before qualifying predicate."); + return 0; + } + + /* This implements just enough of read_a_source_file in read.c to + recognize labels. */ + if (is_name_beginner (*input_line_pointer)) + { + s = input_line_pointer; + c = get_symbol_end (); + } + else if (LOCAL_LABELS_FB + && isdigit ((unsigned char) *input_line_pointer)) + { + temp = 0; + while (isdigit ((unsigned char) *input_line_pointer)) + temp = (temp * 10) + *input_line_pointer++ - '0'; + fb_label_instance_inc (temp); + s = fb_label_name (temp, 0); + c = *input_line_pointer; + } + else + { + s = NULL; + c = '\0'; + } + if (c != ':') + { + /* Put ':' back for error messages' sake. */ + *input_line_pointer++ = ':'; + as_bad ("Expected ':'"); + return 0; + } + + defining_tag = 1; + tag = colon (s); + defining_tag = 0; + /* Put ':' back for error messages' sake. */ + *input_line_pointer++ = ':'; + if (*input_line_pointer++ != ']') + { + as_bad ("Expected ']'"); + return 0; + } + if (! tag) + { + as_bad ("Tag name expected"); + return 0; + } + return 1; + } + + default: + break; + } + + /* Not a valid line. */ + return 0; +} + +void +ia64_frob_label (sym) + struct symbol *sym; +{ + struct label_fix *fix; + + /* Tags need special handling since they are not bundle breaks like + labels. */ + if (defining_tag) + { + fix = obstack_alloc (¬es, sizeof (*fix)); + fix->sym = sym; + fix->next = CURR_SLOT.tag_fixups; + CURR_SLOT.tag_fixups = fix; + + return; + } + + if (bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) + { + md.last_text_seg = now_seg; + fix = obstack_alloc (¬es, sizeof (*fix)); + fix->sym = sym; + fix->next = CURR_SLOT.label_fixups; + CURR_SLOT.label_fixups = fix; + + /* Keep track of how many code entry points we've seen. */ + if (md.path == md.maxpaths) + { + md.maxpaths += 20; + md.entry_labels = (const char **) + xrealloc ((void *) md.entry_labels, + md.maxpaths * sizeof (char *)); + } + md.entry_labels[md.path++] = S_GET_NAME (sym); + } +} + +void +ia64_flush_pending_output () +{ + if (!md.keep_pending_output + && bfd_get_section_flags (stdoutput, now_seg) & SEC_CODE) + { + /* ??? This causes many unnecessary stop bits to be emitted. + Unfortunately, it isn't clear if it is safe to remove this. */ + insn_group_break (1, 0, 0); + ia64_flush_insns (); + } +} + +/* Do ia64-specific expression optimization. All that's done here is + to transform index expressions that are either due to the indexing + of rotating registers or due to the indexing of indirect register + sets. */ +int +ia64_optimize_expr (l, op, r) + expressionS *l; + operatorT op; + expressionS *r; +{ + unsigned num_regs; + + if (op == O_index) + { + if (l->X_op == O_register && r->X_op == O_constant) + { + num_regs = (l->X_add_number >> 16); + if ((unsigned) r->X_add_number >= num_regs) + { + if (!num_regs) + as_bad ("No current frame"); + else + as_bad ("Index out of range 0..%u", num_regs - 1); + r->X_add_number = 0; + } + l->X_add_number = (l->X_add_number & 0xffff) + r->X_add_number; + return 1; + } + else if (l->X_op == O_register && r->X_op == O_register) + { + if (l->X_add_number < IND_CPUID || l->X_add_number > IND_RR + || l->X_add_number == IND_MEM) + { + as_bad ("Indirect register set name expected"); + l->X_add_number = IND_CPUID; + } + l->X_op = O_index; + l->X_op_symbol = md.regsym[l->X_add_number]; + l->X_add_number = r->X_add_number; + return 1; + } + } + return 0; +} + +int +ia64_parse_name (name, e) + char *name; + expressionS *e; +{ + struct const_desc *cdesc; + struct dynreg *dr = 0; + unsigned int regnum; + struct symbol *sym; + char *end; + + /* first see if NAME is a known register name: */ + sym = hash_find (md.reg_hash, name); + if (sym) + { + e->X_op = O_register; + e->X_add_number = S_GET_VALUE (sym); + return 1; + } + + cdesc = hash_find (md.const_hash, name); + if (cdesc) + { + e->X_op = O_constant; + e->X_add_number = cdesc->value; + return 1; + } + + /* check for inN, locN, or outN: */ + switch (name[0]) + { + case 'i': + if (name[1] == 'n' && isdigit (name[2])) + { + dr = &md.in; + name += 2; + } + break; + + case 'l': + if (name[1] == 'o' && name[2] == 'c' && isdigit (name[3])) + { + dr = &md.loc; + name += 3; + } + break; + + case 'o': + if (name[1] == 'u' && name[2] == 't' && isdigit (name[3])) + { + dr = &md.out; + name += 3; + } + break; + + default: + break; + } + + if (dr) + { + /* The name is inN, locN, or outN; parse the register number. */ + regnum = strtoul (name, &end, 10); + if (end > name && *end == '\0') + { + if ((unsigned) regnum >= dr->num_regs) + { + if (!dr->num_regs) + as_bad ("No current frame"); + else + as_bad ("Register number out of range 0..%u", + dr->num_regs - 1); + regnum = 0; + } + e->X_op = O_register; + e->X_add_number = dr->base + regnum; + return 1; + } + } + + if ((dr = hash_find (md.dynreg_hash, name))) + { + /* We've got ourselves the name of a rotating register set. + Store the base register number in the low 16 bits of + X_add_number and the size of the register set in the top 16 + bits. */ + e->X_op = O_register; + e->X_add_number = dr->base | (dr->num_regs << 16); + return 1; + } + return 0; +} + +/* Remove the '#' suffix that indicates a symbol as opposed to a register. */ + +char * +ia64_canonicalize_symbol_name (name) + char *name; +{ + size_t len = strlen (name); + if (len > 1 && name[len - 1] == '#') + name[len - 1] = '\0'; + return name; +} + +static int +is_conditional_branch (idesc) + struct ia64_opcode *idesc; +{ + return (strncmp (idesc->name, "br", 2) == 0 + && (strcmp (idesc->name, "br") == 0 + || strncmp (idesc->name, "br.cond", 7) == 0 + || strncmp (idesc->name, "br.call", 7) == 0 + || strncmp (idesc->name, "br.ret", 6) == 0 + || strcmp (idesc->name, "brl") == 0 + || strncmp (idesc->name, "brl.cond", 7) == 0 + || strncmp (idesc->name, "brl.call", 7) == 0 + || strncmp (idesc->name, "brl.ret", 6) == 0)); +} + +/* Return whether the given opcode is a taken branch. If there's any doubt, + returns zero. */ + +static int +is_taken_branch (idesc) + struct ia64_opcode *idesc; +{ + return ((is_conditional_branch (idesc) && CURR_SLOT.qp_regno == 0) + || strncmp (idesc->name, "br.ia", 5) == 0); +} + +/* Return whether the given opcode is an interruption or rfi. If there's any + doubt, returns zero. */ + +static int +is_interruption_or_rfi (idesc) + struct ia64_opcode *idesc; +{ + if (strcmp (idesc->name, "rfi") == 0) + return 1; + return 0; +} + +/* Returns the index of the given dependency in the opcode's list of chks, or + -1 if there is no dependency. */ + +static int +depends_on (depind, idesc) + int depind; + struct ia64_opcode *idesc; +{ + int i; + const struct ia64_opcode_dependency *dep = idesc->dependencies; + for (i = 0; i < dep->nchks; i++) + { + if (depind == DEP (dep->chks[i])) + return i; + } + return -1; +} + +/* Determine a set of specific resources used for a particular resource + class. Returns the number of specific resources identified For those + cases which are not determinable statically, the resource returned is + marked nonspecific. + + Meanings of value in 'NOTE': + 1) only read/write when the register number is explicitly encoded in the + insn. + 2) only read CFM when accessing a rotating GR, FR, or PR. mov pr only + accesses CFM when qualifying predicate is in the rotating region. + 3) general register value is used to specify an indirect register; not + determinable statically. + 4) only read the given resource when bits 7:0 of the indirect index + register value does not match the register number of the resource; not + determinable statically. + 5) all rules are implementation specific. + 6) only when both the index specified by the reader and the index specified + by the writer have the same value in bits 63:61; not determinable + statically. + 7) only access the specified resource when the corresponding mask bit is + set + 8) PSR.dfh is only read when these insns reference FR32-127. PSR.dfl is + only read when these insns reference FR2-31 + 9) PSR.mfl is only written when these insns write FR2-31. PSR.mfh is only + written when these insns write FR32-127 + 10) The PSR.bn bit is only accessed when one of GR16-31 is specified in the + instruction + 11) The target predicates are written independently of PR[qp], but source + registers are only read if PR[qp] is true. Since the state of PR[qp] + cannot statically be determined, all source registers are marked used. + 12) This insn only reads the specified predicate register when that + register is the PR[qp]. + 13) This reference to ld-c only applies to teh GR whose value is loaded + with data returned from memory, not the post-incremented address register. + 14) The RSE resource includes the implementation-specific RSE internal + state resources. At least one (and possibly more) of these resources are + read by each instruction listed in IC:rse-readers. At least one (and + possibly more) of these resources are written by each insn listed in + IC:rse-writers. + 15+16) Represents reserved instructions, which the assembler does not + generate. + + Memory resources (i.e. locations in memory) are *not* marked or tracked by + this code; there are no dependency violations based on memory access. +*/ + +#define MAX_SPECS 256 +#define DV_CHK 1 +#define DV_REG 0 + +static int +specify_resource (dep, idesc, type, specs, note, path) + const struct ia64_dependency *dep; + struct ia64_opcode *idesc; + int type; /* is this a DV chk or a DV reg? */ + struct rsrc specs[MAX_SPECS]; /* returned specific resources */ + int note; /* resource note for this insn's usage */ + int path; /* which execution path to examine */ +{ + int count = 0; + int i; + int rsrc_write = 0; + struct rsrc tmpl; + + if (dep->mode == IA64_DV_WAW + || (dep->mode == IA64_DV_RAW && type == DV_REG) + || (dep->mode == IA64_DV_WAR && type == DV_CHK)) + rsrc_write = 1; + + /* template for any resources we identify */ + tmpl.dependency = dep; + tmpl.note = note; + tmpl.insn_srlz = tmpl.data_srlz = 0; + tmpl.qp_regno = CURR_SLOT.qp_regno; + tmpl.link_to_qp_branch = 1; + tmpl.mem_offset.hint = 0; + tmpl.specific = 1; + tmpl.index = 0; + tmpl.cmp_type = CMP_NONE; + +#define UNHANDLED \ +as_warn (_("Unhandled dependency %s for %s (%s), note %d"), \ +dep->name, idesc->name, (rsrc_write?"write":"read"), note) +#define KNOWN(REG) (gr_values[REG].known && gr_values[REG].path >= path) + + /* we don't need to track these */ + if (dep->semantics == IA64_DVS_NONE) + return 0; + + switch (dep->specifier) + { + case IA64_RS_AR_K: + if (note == 1) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_AR3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_AR; + if (regno >= 0 && regno <= 7) + { + specs[count] = tmpl; + specs[count++].index = regno; + } + } + } + else if (note == 0) + { + for (i = 0; i < 8; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_AR_UNAT: + /* This is a mov =AR or mov AR= instruction. */ + if (idesc->operands[!rsrc_write] == IA64_OPND_AR3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_AR; + if (regno == AR_UNAT) + { + specs[count++] = tmpl; + } + } + else + { + /* This is a spill/fill, or other instruction that modifies the + unat register. */ + + /* Unless we can determine the specific bits used, mark the whole + thing; bits 8:3 of the memory address indicate the bit used in + UNAT. The .mem.offset hint may be used to eliminate a small + subset of conflicts. */ + specs[count] = tmpl; + if (md.mem_offset.hint) + { + if (md.debug_dv) + fprintf (stderr, " Using hint for spill/fill\n"); + /* The index isn't actually used, just set it to something + approximating the bit index. */ + specs[count].index = (md.mem_offset.offset >> 3) & 0x3F; + specs[count].mem_offset.hint = 1; + specs[count].mem_offset.offset = md.mem_offset.offset; + specs[count++].mem_offset.base = md.mem_offset.base; + } + else + { + specs[count++].specific = 0; + } + } + break; + + case IA64_RS_AR: + if (note == 1) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_AR3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_AR; + if ((regno >= 8 && regno <= 15) + || (regno >= 20 && regno <= 23) + || (regno >= 31 && regno <= 39) + || (regno >= 41 && regno <= 47) + || (regno >= 67 && regno <= 111)) + { + specs[count] = tmpl; + specs[count++].index = regno; + } + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_ARb: + if (note == 1) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_AR3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_AR; + if ((regno >= 48 && regno <= 63) + || (regno >= 112 && regno <= 127)) + { + specs[count] = tmpl; + specs[count++].index = regno; + } + } + } + else if (note == 0) + { + for (i = 48; i < 64; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + for (i = 112; i < 128; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_BR: + if (note != 1) + { + UNHANDLED; + } + else + { + if (rsrc_write) + { + for (i = 0; i < idesc->num_outputs; i++) + if (idesc->operands[i] == IA64_OPND_B1 + || idesc->operands[i] == IA64_OPND_B2) + { + specs[count] = tmpl; + specs[count++].index = + CURR_SLOT.opnd[i].X_add_number - REG_BR; + } + } + else + { + for (i = idesc->num_outputs;i < NELEMS (idesc->operands); i++) + if (idesc->operands[i] == IA64_OPND_B1 + || idesc->operands[i] == IA64_OPND_B2) + { + specs[count] = tmpl; + specs[count++].index = + CURR_SLOT.opnd[i].X_add_number - REG_BR; + } + } + } + break; + + case IA64_RS_CPUID: /* four or more registers */ + if (note == 3) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_CPUID_R3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_GR; + if (regno >= 0 && regno < NELEMS (gr_values) + && KNOWN (regno)) + { + specs[count] = tmpl; + specs[count++].index = gr_values[regno].value & 0xFF; + } + else + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_DBR: /* four or more registers */ + if (note == 3) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_DBR_R3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_GR; + if (regno >= 0 && regno < NELEMS (gr_values) + && KNOWN (regno)) + { + specs[count] = tmpl; + specs[count++].index = gr_values[regno].value & 0xFF; + } + else + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + } + else if (note == 0 && !rsrc_write) + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_IBR: /* four or more registers */ + if (note == 3) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_IBR_R3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_GR; + if (regno >= 0 && regno < NELEMS (gr_values) + && KNOWN (regno)) + { + specs[count] = tmpl; + specs[count++].index = gr_values[regno].value & 0xFF; + } + else + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_MSR: + if (note == 5) + { + /* These are implementation specific. Force all references to + conflict with all other references. */ + specs[count] = tmpl; + specs[count++].specific = 0; + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_PKR: /* 16 or more registers */ + if (note == 3 || note == 4) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_PKR_R3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_GR; + if (regno >= 0 && regno < NELEMS (gr_values) + && KNOWN (regno)) + { + if (note == 3) + { + specs[count] = tmpl; + specs[count++].index = gr_values[regno].value & 0xFF; + } + else + for (i = 0; i < NELEMS (gr_values); i++) + { + /* Uses all registers *except* the one in R3. */ + if ((unsigned)i != (gr_values[regno].value & 0xFF)) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + } + else + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + } + else if (note == 0) + { + /* probe et al. */ + specs[count] = tmpl; + specs[count++].specific = 0; + } + break; + + case IA64_RS_PMC: /* four or more registers */ + if (note == 3) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_PMC_R3 + || (!rsrc_write && idesc->operands[1] == IA64_OPND_PMD_R3)) + + { + int index = ((idesc->operands[1] == IA64_OPND_R3 && !rsrc_write) + ? 1 : !rsrc_write); + int regno = CURR_SLOT.opnd[index].X_add_number - REG_GR; + if (regno >= 0 && regno < NELEMS (gr_values) + && KNOWN (regno)) + { + specs[count] = tmpl; + specs[count++].index = gr_values[regno].value & 0xFF; + } + else + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_PMD: /* four or more registers */ + if (note == 3) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_PMD_R3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_GR; + if (regno >= 0 && regno < NELEMS (gr_values) + && KNOWN (regno)) + { + specs[count] = tmpl; + specs[count++].index = gr_values[regno].value & 0xFF; + } + else + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_RR: /* eight registers */ + if (note == 6) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_RR_R3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_GR; + if (regno >= 0 && regno < NELEMS (gr_values) + && KNOWN (regno)) + { + specs[count] = tmpl; + specs[count++].index = (gr_values[regno].value >> 61) & 0x7; + } + else + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + } + else if (note == 0 && !rsrc_write) + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_CR_IRR: + if (note == 0) + { + /* handle mov-from-CR-IVR; it's a read that writes CR[IRR] */ + int regno = CURR_SLOT.opnd[1].X_add_number - REG_CR; + if (rsrc_write + && idesc->operands[1] == IA64_OPND_CR3 + && regno == CR_IVR) + { + for (i = 0; i < 4; i++) + { + specs[count] = tmpl; + specs[count++].index = CR_IRR0 + i; + } + } + } + else if (note == 1) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_CR; + if (idesc->operands[!rsrc_write] == IA64_OPND_CR3 + && regno >= CR_IRR0 + && regno <= CR_IRR3) + { + specs[count] = tmpl; + specs[count++].index = regno; + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_CR_LRR: + if (note != 1) + { + UNHANDLED; + } + else + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_CR; + if (idesc->operands[!rsrc_write] == IA64_OPND_CR3 + && (regno == CR_LRR0 || regno == CR_LRR1)) + { + specs[count] = tmpl; + specs[count++].index = regno; + } + } + break; + + case IA64_RS_CR: + if (note == 1) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_CR3) + { + specs[count] = tmpl; + specs[count++].index = + CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_CR; + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_FR: + case IA64_RS_FRb: + if (note != 1) + { + UNHANDLED; + } + else if (rsrc_write) + { + if (dep->specifier == IA64_RS_FRb + && idesc->operands[0] == IA64_OPND_F1) + { + specs[count] = tmpl; + specs[count++].index = CURR_SLOT.opnd[0].X_add_number - REG_FR; + } + } + else + { + for (i = idesc->num_outputs; i < NELEMS (idesc->operands); i++) + { + if (idesc->operands[i] == IA64_OPND_F2 + || idesc->operands[i] == IA64_OPND_F3 + || idesc->operands[i] == IA64_OPND_F4) + { + specs[count] = tmpl; + specs[count++].index = + CURR_SLOT.opnd[i].X_add_number - REG_FR; + } + } + } + break; + + case IA64_RS_GR: + if (note == 13) + { + /* This reference applies only to the GR whose value is loaded with + data returned from memory. */ + specs[count] = tmpl; + specs[count++].index = CURR_SLOT.opnd[0].X_add_number - REG_GR; + } + else if (note == 1) + { + if (rsrc_write) + { + for (i = 0; i < idesc->num_outputs; i++) + if (idesc->operands[i] == IA64_OPND_R1 + || idesc->operands[i] == IA64_OPND_R2 + || idesc->operands[i] == IA64_OPND_R3) + { + specs[count] = tmpl; + specs[count++].index = + CURR_SLOT.opnd[i].X_add_number - REG_GR; + } + if (idesc->flags & IA64_OPCODE_POSTINC) + for (i = 0; i < NELEMS (idesc->operands); i++) + if (idesc->operands[i] == IA64_OPND_MR3) + { + specs[count] = tmpl; + specs[count++].index = + CURR_SLOT.opnd[i].X_add_number - REG_GR; + } + } + else + { + /* Look for anything that reads a GR. */ + for (i = 0; i < NELEMS (idesc->operands); i++) + { + if (idesc->operands[i] == IA64_OPND_MR3 + || idesc->operands[i] == IA64_OPND_CPUID_R3 + || idesc->operands[i] == IA64_OPND_DBR_R3 + || idesc->operands[i] == IA64_OPND_IBR_R3 + || idesc->operands[i] == IA64_OPND_MSR_R3 + || idesc->operands[i] == IA64_OPND_PKR_R3 + || idesc->operands[i] == IA64_OPND_PMC_R3 + || idesc->operands[i] == IA64_OPND_PMD_R3 + || idesc->operands[i] == IA64_OPND_RR_R3 + || ((i >= idesc->num_outputs) + && (idesc->operands[i] == IA64_OPND_R1 + || idesc->operands[i] == IA64_OPND_R2 + || idesc->operands[i] == IA64_OPND_R3 + /* addl source register. */ + || idesc->operands[i] == IA64_OPND_R3_2))) + { + specs[count] = tmpl; + specs[count++].index = + CURR_SLOT.opnd[i].X_add_number - REG_GR; + } + } + } + } + else + { + UNHANDLED; + } + break; + + /* This is the same as IA64_RS_PRr, except that the register range is + from 1 - 15, and there are no rotating register reads/writes here. */ + case IA64_RS_PR: + if (note == 0) + { + for (i = 1; i < 16; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + else if (note == 7) + { + valueT mask = 0; + /* Mark only those registers indicated by the mask. */ + if (rsrc_write) + { + mask = CURR_SLOT.opnd[2].X_add_number; + for (i = 1; i < 16; i++) + if (mask & ((valueT) 1 << i)) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + else + { + UNHANDLED; + } + } + else if (note == 11) /* note 11 implies note 1 as well */ + { + if (rsrc_write) + { + for (i = 0; i < idesc->num_outputs; i++) + { + if (idesc->operands[i] == IA64_OPND_P1 + || idesc->operands[i] == IA64_OPND_P2) + { + int regno = CURR_SLOT.opnd[i].X_add_number - REG_P; + if (regno >= 1 && regno < 16) + { + specs[count] = tmpl; + specs[count++].index = regno; + } + } + } + } + else + { + UNHANDLED; + } + } + else if (note == 12) + { + if (CURR_SLOT.qp_regno >= 1 && CURR_SLOT.qp_regno < 16) + { + specs[count] = tmpl; + specs[count++].index = CURR_SLOT.qp_regno; + } + } + else if (note == 1) + { + if (rsrc_write) + { + 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; + + if ((idesc->operands[0] == IA64_OPND_P1 + || idesc->operands[0] == IA64_OPND_P2) + && p1 >= 1 && p1 < 16) + { + specs[count] = tmpl; + specs[count].cmp_type = + (or_andcm ? CMP_OR : (and_orcm ? CMP_AND : CMP_NONE)); + specs[count++].index = p1; + } + if ((idesc->operands[1] == IA64_OPND_P1 + || idesc->operands[1] == IA64_OPND_P2) + && p2 >= 1 && p2 < 16) + { + specs[count] = tmpl; + specs[count].cmp_type = + (or_andcm ? CMP_AND : (and_orcm ? CMP_OR : CMP_NONE)); + specs[count++].index = p2; + } + } + else + { + if (CURR_SLOT.qp_regno >= 1 && CURR_SLOT.qp_regno < 16) + { + specs[count] = tmpl; + specs[count++].index = CURR_SLOT.qp_regno; + } + if (idesc->operands[1] == IA64_OPND_PR) + { + for (i = 1; i < 16; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + } + } + else + { + UNHANDLED; + } + break; + + /* This is the general case for PRs. IA64_RS_PR and IA64_RS_PR63 are + simplified cases of this. */ + case IA64_RS_PRr: + if (note == 0) + { + for (i = 16; i < 63; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + else if (note == 7) + { + valueT mask = 0; + /* Mark only those registers indicated by the mask. */ + if (rsrc_write + && idesc->operands[0] == IA64_OPND_PR) + { + mask = CURR_SLOT.opnd[2].X_add_number; + if (mask & ((valueT) 1<<16)) + for (i = 16; i < 63; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + else if (rsrc_write + && idesc->operands[0] == IA64_OPND_PR_ROT) + { + for (i = 16; i < 63; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + else + { + UNHANDLED; + } + } + else if (note == 11) /* note 11 implies note 1 as well */ + { + if (rsrc_write) + { + for (i = 0; i < idesc->num_outputs; i++) + { + if (idesc->operands[i] == IA64_OPND_P1 + || idesc->operands[i] == IA64_OPND_P2) + { + int regno = CURR_SLOT.opnd[i].X_add_number - REG_P; + if (regno >= 16 && regno < 63) + { + specs[count] = tmpl; + specs[count++].index = regno; + } + } + } + } + else + { + UNHANDLED; + } + } + else if (note == 12) + { + if (CURR_SLOT.qp_regno >= 16 && CURR_SLOT.qp_regno < 63) + { + specs[count] = tmpl; + specs[count++].index = CURR_SLOT.qp_regno; + } + } + else if (note == 1) + { + if (rsrc_write) + { + 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; + + if ((idesc->operands[0] == IA64_OPND_P1 + || idesc->operands[0] == IA64_OPND_P2) + && p1 >= 16 && p1 < 63) + { + specs[count] = tmpl; + specs[count].cmp_type = + (or_andcm ? CMP_OR : (and_orcm ? CMP_AND : CMP_NONE)); + specs[count++].index = p1; + } + if ((idesc->operands[1] == IA64_OPND_P1 + || idesc->operands[1] == IA64_OPND_P2) + && p2 >= 16 && p2 < 63) + { + specs[count] = tmpl; + specs[count].cmp_type = + (or_andcm ? CMP_AND : (and_orcm ? CMP_OR : CMP_NONE)); + specs[count++].index = p2; + } + } + else + { + if (CURR_SLOT.qp_regno >= 16 && CURR_SLOT.qp_regno < 63) + { + specs[count] = tmpl; + specs[count++].index = CURR_SLOT.qp_regno; + } + if (idesc->operands[1] == IA64_OPND_PR) + { + for (i = 16; i < 63; i++) + { + specs[count] = tmpl; + specs[count++].index = i; + } + } + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_PSR: + /* Verify that the instruction is using the PSR bit indicated in + dep->regindex. */ + if (note == 0) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_PSR_UM) + { + if (dep->regindex < 6) + { + specs[count++] = tmpl; + } + } + else if (idesc->operands[!rsrc_write] == IA64_OPND_PSR) + { + if (dep->regindex < 32 + || dep->regindex == 35 + || dep->regindex == 36 + || (!rsrc_write && dep->regindex == PSR_CPL)) + { + specs[count++] = tmpl; + } + } + else if (idesc->operands[!rsrc_write] == IA64_OPND_PSR_L) + { + if (dep->regindex < 32 + || dep->regindex == 35 + || dep->regindex == 36 + || (rsrc_write && dep->regindex == PSR_CPL)) + { + specs[count++] = tmpl; + } + } + else + { + /* Several PSR bits have very specific dependencies. */ + switch (dep->regindex) + { + default: + specs[count++] = tmpl; + break; + case PSR_IC: + if (rsrc_write) + { + specs[count++] = tmpl; + } + else + { + /* Only certain CR accesses use PSR.ic */ + if (idesc->operands[0] == IA64_OPND_CR3 + || idesc->operands[1] == IA64_OPND_CR3) + { + int index = + ((idesc->operands[0] == IA64_OPND_CR3) + ? 0 : 1); + int regno = + CURR_SLOT.opnd[index].X_add_number - REG_CR; + + switch (regno) + { + default: + break; + case CR_ITIR: + case CR_IFS: + case CR_IIM: + case CR_IIP: + case CR_IPSR: + case CR_ISR: + case CR_IFA: + case CR_IHA: + case CR_IIPA: + specs[count++] = tmpl; + break; + } + } + } + break; + case PSR_CPL: + if (rsrc_write) + { + specs[count++] = tmpl; + } + else + { + /* Only some AR accesses use cpl */ + if (idesc->operands[0] == IA64_OPND_AR3 + || idesc->operands[1] == IA64_OPND_AR3) + { + int index = + ((idesc->operands[0] == IA64_OPND_AR3) + ? 0 : 1); + int regno = + CURR_SLOT.opnd[index].X_add_number - REG_AR; + + if (regno == AR_ITC + || (index == 0 + && (regno == AR_ITC + || regno == AR_RSC + || (regno >= AR_K0 + && regno <= AR_K7)))) + { + specs[count++] = tmpl; + } + } + else + { + specs[count++] = tmpl; + } + break; + } + } + } + } + else if (note == 7) + { + valueT mask = 0; + if (idesc->operands[0] == IA64_OPND_IMMU24) + { + mask = CURR_SLOT.opnd[0].X_add_number; + } + else + { + UNHANDLED; + } + if (mask & ((valueT) 1 << dep->regindex)) + { + specs[count++] = tmpl; + } + } + else if (note == 8) + { + int min = dep->regindex == PSR_DFL ? 2 : 32; + int max = dep->regindex == PSR_DFL ? 31 : 127; + /* dfh is read on FR32-127; dfl is read on FR2-31 */ + for (i = 0; i < NELEMS (idesc->operands); i++) + { + if (idesc->operands[i] == IA64_OPND_F1 + || idesc->operands[i] == IA64_OPND_F2 + || idesc->operands[i] == IA64_OPND_F3 + || idesc->operands[i] == IA64_OPND_F4) + { + int reg = CURR_SLOT.opnd[i].X_add_number - REG_FR; + if (reg >= min && reg <= max) + { + specs[count++] = tmpl; + } + } + } + } + else if (note == 9) + { + int min = dep->regindex == PSR_MFL ? 2 : 32; + int max = dep->regindex == PSR_MFL ? 31 : 127; + /* mfh is read on writes to FR32-127; mfl is read on writes to + FR2-31 */ + for (i = 0; i < idesc->num_outputs; i++) + { + if (idesc->operands[i] == IA64_OPND_F1) + { + int reg = CURR_SLOT.opnd[i].X_add_number - REG_FR; + if (reg >= min && reg <= max) + { + specs[count++] = tmpl; + } + } + } + } + else if (note == 10) + { + for (i = 0; i < NELEMS (idesc->operands); i++) + { + if (idesc->operands[i] == IA64_OPND_R1 + || idesc->operands[i] == IA64_OPND_R2 + || idesc->operands[i] == IA64_OPND_R3) + { + int regno = CURR_SLOT.opnd[i].X_add_number - REG_GR; + if (regno >= 16 && regno <= 31) + { + specs[count++] = tmpl; + } + } + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_AR_FPSR: + if (idesc->operands[!rsrc_write] == IA64_OPND_AR3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_AR; + if (regno == AR_FPSR) + { + specs[count++] = tmpl; + } + } + else + { + specs[count++] = tmpl; + } + break; + + case IA64_RS_ARX: + /* Handle all AR[REG] resources */ + if (note == 0 || note == 1) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_AR; + if (idesc->operands[!rsrc_write] == IA64_OPND_AR3 + && regno == dep->regindex) + { + specs[count++] = tmpl; + } + /* other AR[REG] resources may be affected by AR accesses */ + else if (idesc->operands[0] == IA64_OPND_AR3) + { + /* AR[] writes */ + regno = CURR_SLOT.opnd[0].X_add_number - REG_AR; + switch (dep->regindex) + { + default: + break; + case AR_BSP: + case AR_RNAT: + if (regno == AR_BSPSTORE) + { + specs[count++] = tmpl; + } + case AR_RSC: + if (!rsrc_write && + (regno == AR_BSPSTORE + || regno == AR_RNAT)) + { + specs[count++] = tmpl; + } + break; + } + } + else if (idesc->operands[1] == IA64_OPND_AR3) + { + /* AR[] reads */ + regno = CURR_SLOT.opnd[1].X_add_number - REG_AR; + switch (dep->regindex) + { + default: + break; + case AR_RSC: + if (regno == AR_BSPSTORE || regno == AR_RNAT) + { + specs[count++] = tmpl; + } + break; + } + } + else + { + specs[count++] = tmpl; + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_CRX: + /* Handle all CR[REG] resources */ + if (note == 0 || note == 1) + { + if (idesc->operands[!rsrc_write] == IA64_OPND_CR3) + { + int regno = CURR_SLOT.opnd[!rsrc_write].X_add_number - REG_CR; + if (regno == dep->regindex) + { + specs[count++] = tmpl; + } + else if (!rsrc_write) + { + /* Reads from CR[IVR] affect other resources. */ + if (regno == CR_IVR) + { + if ((dep->regindex >= CR_IRR0 + && dep->regindex <= CR_IRR3) + || dep->regindex == CR_TPR) + { + specs[count++] = tmpl; + } + } + } + } + else + { + specs[count++] = tmpl; + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_INSERVICE: + /* look for write of EOI (67) or read of IVR (65) */ + if ((idesc->operands[0] == IA64_OPND_CR3 + && CURR_SLOT.opnd[0].X_add_number - REG_CR == CR_EOI) + || (idesc->operands[1] == IA64_OPND_CR3 + && CURR_SLOT.opnd[1].X_add_number - REG_CR == CR_IVR)) + { + specs[count++] = tmpl; + } + break; + + case IA64_RS_GR0: + if (note == 1) + { + specs[count++] = tmpl; + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_CFM: + if (note != 2) + { + specs[count++] = tmpl; + } + else + { + /* Check if any of the registers accessed are in the rotating region. + mov to/from pr accesses CFM only when qp_regno is in the rotating + region */ + for (i = 0; i < NELEMS (idesc->operands); i++) + { + if (idesc->operands[i] == IA64_OPND_R1 + || idesc->operands[i] == IA64_OPND_R2 + || idesc->operands[i] == IA64_OPND_R3) + { + int num = CURR_SLOT.opnd[i].X_add_number - REG_GR; + /* Assumes that md.rot.num_regs is always valid */ + if (md.rot.num_regs > 0 + && num > 31 + && num < 31 + md.rot.num_regs) + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + else if (idesc->operands[i] == IA64_OPND_F1 + || idesc->operands[i] == IA64_OPND_F2 + || idesc->operands[i] == IA64_OPND_F3 + || idesc->operands[i] == IA64_OPND_F4) + { + int num = CURR_SLOT.opnd[i].X_add_number - REG_FR; + if (num > 31) + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + else if (idesc->operands[i] == IA64_OPND_P1 + || idesc->operands[i] == IA64_OPND_P2) + { + int num = CURR_SLOT.opnd[i].X_add_number - REG_P; + if (num > 15) + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + } + if (CURR_SLOT.qp_regno > 15) + { + specs[count] = tmpl; + specs[count++].specific = 0; + } + } + break; + + /* This is the same as IA64_RS_PRr, except simplified to account for + the fact that there is only one register. */ + case IA64_RS_PR63: + if (note == 0) + { + specs[count++] = tmpl; + } + else if (note == 7) + { + valueT mask = 0; + if (idesc->operands[2] == IA64_OPND_IMM17) + mask = CURR_SLOT.opnd[2].X_add_number; + if (mask & ((valueT) 1 << 63)) + specs[count++] = tmpl; + } + else if (note == 11) + { + if ((idesc->operands[0] == IA64_OPND_P1 + && CURR_SLOT.opnd[0].X_add_number - REG_P == 63) + || (idesc->operands[1] == IA64_OPND_P2 + && CURR_SLOT.opnd[1].X_add_number - REG_P == 63)) + { + specs[count++] = tmpl; + } + } + else if (note == 12) + { + if (CURR_SLOT.qp_regno == 63) + { + specs[count++] = tmpl; + } + } + else if (note == 1) + { + if (rsrc_write) + { + 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; + + if (p1 == 63 + && (idesc->operands[0] == IA64_OPND_P1 + || idesc->operands[0] == IA64_OPND_P2)) + { + specs[count] = tmpl; + specs[count++].cmp_type = + (or_andcm ? CMP_OR : (and_orcm ? CMP_AND : CMP_NONE)); + } + if (p2 == 63 + && (idesc->operands[1] == IA64_OPND_P1 + || idesc->operands[1] == IA64_OPND_P2)) + { + specs[count] = tmpl; + specs[count++].cmp_type = + (or_andcm ? CMP_AND : (and_orcm ? CMP_OR : CMP_NONE)); + } + } + else + { + if (CURR_SLOT.qp_regno == 63) + { + specs[count++] = tmpl; + } + } + } + else + { + UNHANDLED; + } + break; + + case IA64_RS_RSE: + /* FIXME we can identify some individual RSE written resources, but RSE + read resources have not yet been completely identified, so for now + treat RSE as a single resource */ + if (strncmp (idesc->name, "mov", 3) == 0) + { + if (rsrc_write) + { + if (idesc->operands[0] == IA64_OPND_AR3 + && CURR_SLOT.opnd[0].X_add_number - REG_AR == AR_BSPSTORE) + { + specs[count] = tmpl; + specs[count++].index = 0; /* IA64_RSE_BSPLOAD/RNATBITINDEX */ + } + } + else + { + if (idesc->operands[0] == IA64_OPND_AR3) + { + if (CURR_SLOT.opnd[0].X_add_number - REG_AR == AR_BSPSTORE + || CURR_SLOT.opnd[0].X_add_number - REG_AR == AR_RNAT) + { + specs[count++] = tmpl; + } + } + else if (idesc->operands[1] == IA64_OPND_AR3) + { + if (CURR_SLOT.opnd[1].X_add_number - REG_AR == AR_BSP + || CURR_SLOT.opnd[1].X_add_number - REG_AR == AR_BSPSTORE + || CURR_SLOT.opnd[1].X_add_number - REG_AR == AR_RNAT) + { + specs[count++] = tmpl; + } + } + } + } + else + { + specs[count++] = tmpl; + } + break; + + case IA64_RS_ANY: + /* FIXME -- do any of these need to be non-specific? */ + specs[count++] = tmpl; + break; + + default: + as_bad (_("Unrecognized dependency specifier %d\n"), dep->specifier); + break; + } + + return count; +} + +/* Clear branch flags on marked resources. This breaks the link between the + QP of the marking instruction and a subsequent branch on the same QP. */ + +static void +clear_qp_branch_flag (mask) + valueT mask; +{ + int i; + for (i = 0; i < regdepslen; i++) + { + valueT bit = ((valueT) 1 << regdeps[i].qp_regno); + if ((bit & mask) != 0) + { + regdeps[i].link_to_qp_branch = 0; + } + } +} + +/* Remove any mutexes which contain any of the PRs indicated in the mask. + + Any changes to a PR clears the mutex relations which include that PR. */ + +static void +clear_qp_mutex (mask) + valueT mask; +{ + int i; + + i = 0; + while (i < qp_mutexeslen) + { + if ((qp_mutexes[i].prmask & mask) != 0) + { + if (md.debug_dv) + { + fprintf (stderr, " Clearing mutex relation"); + print_prmask (qp_mutexes[i].prmask); + fprintf (stderr, "\n"); + } + qp_mutexes[i] = qp_mutexes[--qp_mutexeslen]; + } + else + ++i; + } +} + +/* Clear implies relations which contain PRs in the given masks. + P1_MASK indicates the source of the implies relation, while P2_MASK + indicates the implied PR. */ + +static void +clear_qp_implies (p1_mask, p2_mask) + valueT p1_mask; + valueT p2_mask; +{ + int i; + + i = 0; + while (i < qp_implieslen) + { + if ((((valueT) 1 << qp_implies[i].p1) & p1_mask) != 0 + || (((valueT) 1 << qp_implies[i].p2) & p2_mask) != 0) + { + if (md.debug_dv) + fprintf (stderr, "Clearing implied relation PR%d->PR%d\n", + qp_implies[i].p1, qp_implies[i].p2); + qp_implies[i] = qp_implies[--qp_implieslen]; + } + else + ++i; + } +} + +/* Add the PRs specified to the list of implied relations. */ + +static void +add_qp_imply (p1, p2) + int p1, p2; +{ + valueT mask; + valueT bit; + int i; + + /* p0 is not meaningful here. */ + if (p1 == 0 || p2 == 0) + abort (); + + if (p1 == p2) + return; + + /* If it exists already, ignore it. */ + for (i = 0; i < qp_implieslen; i++) + { + if (qp_implies[i].p1 == p1 + && qp_implies[i].p2 == p2 + && qp_implies[i].path == md.path + && !qp_implies[i].p2_branched) + return; + } + + if (qp_implieslen == qp_impliestotlen) + { + qp_impliestotlen += 20; + qp_implies = (struct qp_imply *) + xrealloc ((void *) qp_implies, + qp_impliestotlen * sizeof (struct qp_imply)); + } + if (md.debug_dv) + fprintf (stderr, " Registering PR%d implies PR%d\n", p1, p2); + qp_implies[qp_implieslen].p1 = p1; + qp_implies[qp_implieslen].p2 = p2; + qp_implies[qp_implieslen].path = md.path; + qp_implies[qp_implieslen++].p2_branched = 0; + + /* Add in the implied transitive relations; for everything that p2 implies, + make p1 imply that, too; for everything that implies p1, make it imply p2 + as well. */ + for (i = 0; i < qp_implieslen; i++) + { + if (qp_implies[i].p1 == p2) + add_qp_imply (p1, qp_implies[i].p2); + if (qp_implies[i].p2 == p1) + add_qp_imply (qp_implies[i].p1, p2); + } + /* Add in mutex relations implied by this implies relation; for each mutex + relation containing p2, duplicate it and replace p2 with p1. */ + bit = (valueT) 1 << p1; + mask = (valueT) 1 << p2; + for (i = 0; i < qp_mutexeslen; i++) + { + if (qp_mutexes[i].prmask & mask) + add_qp_mutex ((qp_mutexes[i].prmask & ~mask) | bit); + } +} + +/* Add the PRs specified in the mask to the mutex list; this means that only + one of the PRs can be true at any time. PR0 should never be included in + the mask. */ + +static void +add_qp_mutex (mask) + valueT mask; +{ + if (mask & 0x1) + abort (); + + if (qp_mutexeslen == qp_mutexestotlen) + { + qp_mutexestotlen += 20; + qp_mutexes = (struct qpmutex *) + xrealloc ((void *) qp_mutexes, + qp_mutexestotlen * sizeof (struct qpmutex)); + } + if (md.debug_dv) + { + fprintf (stderr, " Registering mutex on"); + print_prmask (mask); + fprintf (stderr, "\n"); + } + qp_mutexes[qp_mutexeslen].path = md.path; + qp_mutexes[qp_mutexeslen++].prmask = mask; +} + +static void +clear_register_values () +{ + int i; + if (md.debug_dv) + fprintf (stderr, " Clearing register values\n"); + for (i = 1; i < NELEMS (gr_values); i++) + gr_values[i].known = 0; +} + +/* Keep track of register values/changes which affect DV tracking. + + optimization note: should add a flag to classes of insns where otherwise we + have to examine a group of strings to identify them. */ + +static void +note_register_values (idesc) + struct ia64_opcode *idesc; +{ + valueT qp_changemask = 0; + int i; + + /* Invalidate values for registers being written to. */ + for (i = 0; i < idesc->num_outputs; i++) + { + if (idesc->operands[i] == IA64_OPND_R1 + || idesc->operands[i] == IA64_OPND_R2 + || idesc->operands[i] == IA64_OPND_R3) + { + int regno = CURR_SLOT.opnd[i].X_add_number - REG_GR; + if (regno > 0 && regno < NELEMS (gr_values)) + gr_values[regno].known = 0; + } + else if (idesc->operands[i] == IA64_OPND_R3_2) + { + int regno = CURR_SLOT.opnd[i].X_add_number - REG_GR; + if (regno > 0 && regno < 4) + gr_values[regno].known = 0; + } + else if (idesc->operands[i] == IA64_OPND_P1 + || idesc->operands[i] == IA64_OPND_P2) + { + int regno = CURR_SLOT.opnd[i].X_add_number - REG_P; + qp_changemask |= (valueT) 1 << regno; + } + else if (idesc->operands[i] == IA64_OPND_PR) + { + if (idesc->operands[2] & (valueT) 0x10000) + qp_changemask = ~(valueT) 0x1FFFF | idesc->operands[2]; + else + qp_changemask = idesc->operands[2]; + break; + } + else if (idesc->operands[i] == IA64_OPND_PR_ROT) + { + if (idesc->operands[1] & ((valueT) 1 << 43)) + qp_changemask = ~(valueT) 0xFFFFFFFFFFF | idesc->operands[1]; + else + qp_changemask = idesc->operands[1]; + qp_changemask &= ~(valueT) 0xFFFF; + break; + } + } + + /* Always clear qp branch flags on any PR change. */ + /* FIXME there may be exceptions for certain compares. */ + clear_qp_branch_flag (qp_changemask); + + /* Invalidate rotating registers on insns which affect RRBs in CFM. */ + if (idesc->flags & IA64_OPCODE_MOD_RRBS) + { + qp_changemask |= ~(valueT) 0xFFFF; + if (strcmp (idesc->name, "clrrrb.pr") != 0) + { + for (i = 32; i < 32 + md.rot.num_regs; i++) + gr_values[i].known = 0; + } + clear_qp_mutex (qp_changemask); + clear_qp_implies (qp_changemask, qp_changemask); + } + /* After a call, all register values are undefined, except those marked + as "safe". */ + else if (strncmp (idesc->name, "br.call", 6) == 0 + || strncmp (idesc->name, "brl.call", 7) == 0) + { + /* FIXME keep GR values which are marked as "safe_across_calls" */ + clear_register_values (); + clear_qp_mutex (~qp_safe_across_calls); + clear_qp_implies (~qp_safe_across_calls, ~qp_safe_across_calls); + clear_qp_branch_flag (~qp_safe_across_calls); + } + else if (is_interruption_or_rfi (idesc) + || is_taken_branch (idesc)) + { + clear_register_values (); + clear_qp_mutex (~(valueT) 0); + clear_qp_implies (~(valueT) 0, ~(valueT) 0); + } + /* Look for mutex and implies relations. */ + else if ((idesc->operands[0] == IA64_OPND_P1 + || idesc->operands[0] == IA64_OPND_P2) + && (idesc->operands[1] == IA64_OPND_P1 + || idesc->operands[1] == IA64_OPND_P2)) + { + int p1 = CURR_SLOT.opnd[0].X_add_number - REG_P; + int p2 = CURR_SLOT.opnd[1].X_add_number - REG_P; + valueT p1mask = (valueT) 1 << p1; + valueT p2mask = (valueT) 1 << p2; + + /* If one of the PRs is PR0, we can't really do anything. */ + if (p1 == 0 || p2 == 0) + { + if (md.debug_dv) + fprintf (stderr, " Ignoring PRs due to inclusion of p0\n"); + } + /* In general, clear mutexes and implies which include P1 or P2, + with the following exceptions. */ + else if (strstr (idesc->name, ".or.andcm") != NULL) + { + 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) + { + clear_qp_implies (0, p1mask | p2mask); + } + else if (strstr (idesc->name, ".or") != NULL) + { + clear_qp_mutex (p1mask | p2mask); + clear_qp_implies (p1mask | p2mask, 0); + } + else + { + clear_qp_implies (p1mask | p2mask, p1mask | p2mask); + if (strstr (idesc->name, ".unc") != NULL) + { + add_qp_mutex (p1mask | p2mask); + if (CURR_SLOT.qp_regno != 0) + { + add_qp_imply (CURR_SLOT.opnd[0].X_add_number - REG_P, + CURR_SLOT.qp_regno); + add_qp_imply (CURR_SLOT.opnd[1].X_add_number - REG_P, + CURR_SLOT.qp_regno); + } + } + else if (CURR_SLOT.qp_regno == 0) + { + add_qp_mutex (p1mask | p2mask); + } + else + { + clear_qp_mutex (p1mask | p2mask); + } + } + } + /* Look for mov imm insns into GRs. */ + else if (idesc->operands[0] == IA64_OPND_R1 + && (idesc->operands[1] == IA64_OPND_IMM22 + || idesc->operands[1] == IA64_OPND_IMMU64) + && (strcmp (idesc->name, "mov") == 0 + || strcmp (idesc->name, "movl") == 0)) + { + int regno = CURR_SLOT.opnd[0].X_add_number - REG_GR; + if (regno > 0 && regno < NELEMS (gr_values)) + { + gr_values[regno].known = 1; + gr_values[regno].value = CURR_SLOT.opnd[1].X_add_number; + gr_values[regno].path = md.path; + if (md.debug_dv) + { + fprintf (stderr, " Know gr%d = ", regno); + fprintf_vma (stderr, gr_values[regno].value); + fputs ("\n", stderr); + } + } + } + else + { + clear_qp_mutex (qp_changemask); + clear_qp_implies (qp_changemask, qp_changemask); + } +} + +/* Return whether the given predicate registers are currently mutex. */ + +static int +qp_mutex (p1, p2, path) + int p1; + int p2; + int path; +{ + int i; + valueT mask; + + if (p1 != p2) + { + mask = ((valueT) 1 << p1) | (valueT) 1 << p2; + for (i = 0; i < qp_mutexeslen; i++) + { + if (qp_mutexes[i].path >= path + && (qp_mutexes[i].prmask & mask) == mask) + return 1; + } + } + return 0; +} + +/* Return whether the given resource is in the given insn's list of chks + Return 1 if the conflict is absolutely determined, 2 if it's a potential + conflict. */ + +static int +resources_match (rs, idesc, note, qp_regno, path) + struct rsrc *rs; + struct ia64_opcode *idesc; + int note; + int qp_regno; + int path; +{ + struct rsrc specs[MAX_SPECS]; + int count; + + /* If the marked resource's qp_regno and the given qp_regno are mutex, + we don't need to check. One exception is note 11, which indicates that + target predicates are written regardless of PR[qp]. */ + if (qp_mutex (rs->qp_regno, qp_regno, path) + && note != 11) + return 0; + + count = specify_resource (rs->dependency, idesc, DV_CHK, specs, note, path); + while (count-- > 0) + { + /* UNAT checking is a bit more specific than other resources */ + if (rs->dependency->specifier == IA64_RS_AR_UNAT + && specs[count].mem_offset.hint + && rs->mem_offset.hint) + { + if (rs->mem_offset.base == specs[count].mem_offset.base) + { + if (((rs->mem_offset.offset >> 3) & 0x3F) == + ((specs[count].mem_offset.offset >> 3) & 0x3F)) + return 1; + else + continue; + } + } + + /* Skip apparent PR write conflicts where both writes are an AND or both + writes are an OR. */ + if (rs->dependency->specifier == IA64_RS_PR + || rs->dependency->specifier == IA64_RS_PRr + || rs->dependency->specifier == IA64_RS_PR63) + { + if (specs[count].cmp_type != CMP_NONE + && specs[count].cmp_type == rs->cmp_type) + { + if (md.debug_dv) + fprintf (stderr, " %s on parallel compare allowed (PR%d)\n", + dv_mode[rs->dependency->mode], + rs->dependency->specifier != IA64_RS_PR63 ? + specs[count].index : 63); + continue; + } + if (md.debug_dv) + fprintf (stderr, + " %s on parallel compare conflict %s vs %s on PR%d\n", + dv_mode[rs->dependency->mode], + dv_cmp_type[rs->cmp_type], + dv_cmp_type[specs[count].cmp_type], + rs->dependency->specifier != IA64_RS_PR63 ? + specs[count].index : 63); + + } + + /* If either resource is not specific, conservatively assume a conflict + */ + if (!specs[count].specific || !rs->specific) + return 2; + else if (specs[count].index == rs->index) + return 1; + } +#if 0 + if (md.debug_dv) + fprintf (stderr, " No %s conflicts\n", rs->dependency->name); +#endif + + return 0; +} + +/* Indicate an instruction group break; if INSERT_STOP is non-zero, then + insert a stop to create the break. Update all resource dependencies + appropriately. If QP_REGNO is non-zero, only apply the break to resources + which use the same QP_REGNO and have the link_to_qp_branch flag set. + If SAVE_CURRENT is non-zero, don't affect resources marked by the current + instruction. */ + +static void +insn_group_break (insert_stop, qp_regno, save_current) + int insert_stop; + int qp_regno; + int save_current; +{ + int i; + + if (insert_stop && md.num_slots_in_use > 0) + PREV_SLOT.end_of_insn_group = 1; + + if (md.debug_dv) + { + fprintf (stderr, " Insn group break%s", + (insert_stop ? " (w/stop)" : "")); + if (qp_regno != 0) + fprintf (stderr, " effective for QP=%d", qp_regno); + fprintf (stderr, "\n"); + } + + i = 0; + while (i < regdepslen) + { + const struct ia64_dependency *dep = regdeps[i].dependency; + + if (qp_regno != 0 + && regdeps[i].qp_regno != qp_regno) + { + ++i; + continue; + } + + if (save_current + && CURR_SLOT.src_file == regdeps[i].file + && CURR_SLOT.src_line == regdeps[i].line) + { + ++i; + continue; + } + + /* clear dependencies which are automatically cleared by a stop, or + those that have reached the appropriate state of insn serialization */ + if (dep->semantics == IA64_DVS_IMPLIED + || dep->semantics == IA64_DVS_IMPLIEDF + || regdeps[i].insn_srlz == STATE_SRLZ) + { + print_dependency ("Removing", i); + regdeps[i] = regdeps[--regdepslen]; + } + else + { + if (dep->semantics == IA64_DVS_DATA + || dep->semantics == IA64_DVS_INSTR + || dep->semantics == IA64_DVS_SPECIFIC) + { + if (regdeps[i].insn_srlz == STATE_NONE) + regdeps[i].insn_srlz = STATE_STOP; + if (regdeps[i].data_srlz == STATE_NONE) + regdeps[i].data_srlz = STATE_STOP; + } + ++i; + } + } +} + +/* Add the given resource usage spec to the list of active dependencies. */ + +static void +mark_resource (idesc, dep, spec, depind, path) + struct ia64_opcode *idesc ATTRIBUTE_UNUSED; + const struct ia64_dependency *dep ATTRIBUTE_UNUSED; + struct rsrc *spec; + int depind; + int path; +{ + if (regdepslen == regdepstotlen) + { + regdepstotlen += 20; + regdeps = (struct rsrc *) + xrealloc ((void *) regdeps, + regdepstotlen * sizeof (struct rsrc)); + } + + regdeps[regdepslen] = *spec; + regdeps[regdepslen].depind = depind; + regdeps[regdepslen].path = path; + regdeps[regdepslen].file = CURR_SLOT.src_file; + regdeps[regdepslen].line = CURR_SLOT.src_line; + + print_dependency ("Adding", regdepslen); + + ++regdepslen; +} + +static void +print_dependency (action, depind) + const char *action; + int depind; +{ + if (md.debug_dv) + { + fprintf (stderr, " %s %s '%s'", + action, dv_mode[(regdeps[depind].dependency)->mode], + (regdeps[depind].dependency)->name); + if (regdeps[depind].specific && regdeps[depind].index != 0) + fprintf (stderr, " (%d)", regdeps[depind].index); + if (regdeps[depind].mem_offset.hint) + { + fputs (" ", stderr); + fprintf_vma (stderr, regdeps[depind].mem_offset.base); + fputs ("+", stderr); + fprintf_vma (stderr, regdeps[depind].mem_offset.offset); + } + fprintf (stderr, "\n"); + } +} + +static void +instruction_serialization () +{ + int i; + if (md.debug_dv) + fprintf (stderr, " Instruction serialization\n"); + for (i = 0; i < regdepslen; i++) + if (regdeps[i].insn_srlz == STATE_STOP) + regdeps[i].insn_srlz = STATE_SRLZ; +} + +static void +data_serialization () +{ + int i = 0; + if (md.debug_dv) + fprintf (stderr, " Data serialization\n"); + while (i < regdepslen) + { + if (regdeps[i].data_srlz == STATE_STOP + /* Note: as of 991210, all "other" dependencies are cleared by a + data serialization. This might change with new tables */ + || (regdeps[i].dependency)->semantics == IA64_DVS_OTHER) + { + print_dependency ("Removing", i); + regdeps[i] = regdeps[--regdepslen]; + } + else + ++i; + } +} + +/* Insert stops and serializations as needed to avoid DVs. */ + +static void +remove_marked_resource (rs) + struct rsrc *rs; +{ + switch (rs->dependency->semantics) + { + case IA64_DVS_SPECIFIC: + if (md.debug_dv) + fprintf (stderr, "Implementation-specific, assume worst case...\n"); + /* ...fall through... */ + case IA64_DVS_INSTR: + if (md.debug_dv) + fprintf (stderr, "Inserting instr serialization\n"); + if (rs->insn_srlz < STATE_STOP) + insn_group_break (1, 0, 0); + if (rs->insn_srlz < STATE_SRLZ) + { + int oldqp = CURR_SLOT.qp_regno; + struct ia64_opcode *oldidesc = CURR_SLOT.idesc; + /* Manually jam a srlz.i insn into the stream */ + CURR_SLOT.qp_regno = 0; + CURR_SLOT.idesc = ia64_find_opcode ("srlz.i"); + instruction_serialization (); + md.curr_slot = (md.curr_slot + 1) % NUM_SLOTS; + if (++md.num_slots_in_use >= NUM_SLOTS) + emit_one_bundle (); + CURR_SLOT.qp_regno = oldqp; + CURR_SLOT.idesc = oldidesc; + } + insn_group_break (1, 0, 0); + break; + case IA64_DVS_OTHER: /* as of rev2 (991220) of the DV tables, all + "other" types of DV are eliminated + by a data serialization */ + case IA64_DVS_DATA: + if (md.debug_dv) + fprintf (stderr, "Inserting data serialization\n"); + if (rs->data_srlz < STATE_STOP) + insn_group_break (1, 0, 0); + { + int oldqp = CURR_SLOT.qp_regno; + struct ia64_opcode *oldidesc = CURR_SLOT.idesc; + /* Manually jam a srlz.d insn into the stream */ + CURR_SLOT.qp_regno = 0; + CURR_SLOT.idesc = ia64_find_opcode ("srlz.d"); + data_serialization (); + md.curr_slot = (md.curr_slot + 1) % NUM_SLOTS; + if (++md.num_slots_in_use >= NUM_SLOTS) + emit_one_bundle (); + CURR_SLOT.qp_regno = oldqp; + CURR_SLOT.idesc = oldidesc; + } + break; + case IA64_DVS_IMPLIED: + case IA64_DVS_IMPLIEDF: + if (md.debug_dv) + fprintf (stderr, "Inserting stop\n"); + insn_group_break (1, 0, 0); + break; + default: + break; + } +} + +/* Check the resources used by the given opcode against the current dependency + list. + + The check is run once for each execution path encountered. In this case, + a unique execution path is the sequence of instructions following a code + entry point, e.g. the following has three execution paths, one starting + at L0, one at L1, and one at L2. + + L0: nop + L1: add + L2: add + br.ret +*/ + +static void +check_dependencies (idesc) + struct ia64_opcode *idesc; +{ + const struct ia64_opcode_dependency *opdeps = idesc->dependencies; + int path; + int i; + + /* Note that the number of marked resources may change within the + loop if in auto mode. */ + i = 0; + while (i < regdepslen) + { + struct rsrc *rs = ®deps[i]; + const struct ia64_dependency *dep = rs->dependency; + int chkind; + int note; + int start_over = 0; + + if (dep->semantics == IA64_DVS_NONE + || (chkind = depends_on (rs->depind, idesc)) == -1) + { + ++i; + continue; + } + + note = NOTE (opdeps->chks[chkind]); + + /* Check this resource against each execution path seen thus far. */ + for (path = 0; path <= md.path; path++) + { + int matchtype; + + /* If the dependency wasn't on the path being checked, ignore it. */ + if (rs->path < path) + continue; + + /* If the QP for this insn implies a QP which has branched, don't + bother checking. Ed. NOTE: I don't think this check is terribly + useful; what's the point of generating code which will only be + reached if its QP is zero? + This code was specifically inserted to handle the following code, + based on notes from Intel's DV checking code, where p1 implies p2. + + mov r4 = 2 + (p2) br.cond L + (p1) mov r4 = 7 + */ + if (CURR_SLOT.qp_regno != 0) + { + int skip = 0; + int implies; + for (implies = 0; implies < qp_implieslen; implies++) + { + if (qp_implies[implies].path >= path + && qp_implies[implies].p1 == CURR_SLOT.qp_regno + && qp_implies[implies].p2_branched) + { + skip = 1; + break; + } + } + if (skip) + continue; + } + + if ((matchtype = resources_match (rs, idesc, note, + CURR_SLOT.qp_regno, path)) != 0) + { + char msg[1024]; + char pathmsg[256] = ""; + char indexmsg[256] = ""; + int certain = (matchtype == 1 && CURR_SLOT.qp_regno == 0); + + if (path != 0) + sprintf (pathmsg, " when entry is at label '%s'", + md.entry_labels[path - 1]); + if (rs->specific && rs->index != 0) + sprintf (indexmsg, ", specific resource number is %d", + rs->index); + sprintf (msg, "Use of '%s' %s %s dependency '%s' (%s)%s%s", + idesc->name, + (certain ? "violates" : "may violate"), + dv_mode[dep->mode], dep->name, + dv_sem[dep->semantics], + pathmsg, indexmsg); + + if (md.explicit_mode) + { + as_warn ("%s", msg); + if (path < md.path) + as_warn (_("Only the first path encountering the conflict " + "is reported")); + as_warn_where (rs->file, rs->line, + _("This is the location of the " + "conflicting usage")); + /* Don't bother checking other paths, to avoid duplicating + the same warning */ + break; + } + else + { + if (md.debug_dv) + fprintf (stderr, "%s @ %s:%d\n", msg, rs->file, rs->line); + + remove_marked_resource (rs); + + /* since the set of dependencies has changed, start over */ + /* FIXME -- since we're removing dvs as we go, we + probably don't really need to start over... */ + start_over = 1; + break; + } + } + } + if (start_over) + i = 0; + else + ++i; + } +} + +/* Register new dependencies based on the given opcode. */ + +static void +mark_resources (idesc) + struct ia64_opcode *idesc; +{ + int i; + const struct ia64_opcode_dependency *opdeps = idesc->dependencies; + int add_only_qp_reads = 0; + + /* A conditional branch only uses its resources if it is taken; if it is + taken, we stop following that path. The other branch types effectively + *always* write their resources. If it's not taken, register only QP + reads. */ + if (is_conditional_branch (idesc) || is_interruption_or_rfi (idesc)) + { + add_only_qp_reads = 1; + } + + if (md.debug_dv) + fprintf (stderr, "Registering '%s' resource usage\n", idesc->name); + + for (i = 0; i < opdeps->nregs; i++) + { + const struct ia64_dependency *dep; + struct rsrc specs[MAX_SPECS]; + int note; + int path; + int count; + + dep = ia64_find_dependency (opdeps->regs[i]); + note = NOTE (opdeps->regs[i]); + + if (add_only_qp_reads + && !(dep->mode == IA64_DV_WAR + && (dep->specifier == IA64_RS_PR + || dep->specifier == IA64_RS_PRr + || dep->specifier == IA64_RS_PR63))) + continue; + + count = specify_resource (dep, idesc, DV_REG, specs, note, md.path); + +#if 0 + if (md.debug_dv && !count) + fprintf (stderr, " No %s %s usage found (path %d)\n", + dv_mode[dep->mode], dep->name, md.path); +#endif + + while (count-- > 0) + { + mark_resource (idesc, dep, &specs[count], + DEP (opdeps->regs[i]), md.path); + } + + /* The execution path may affect register values, which may in turn + affect which indirect-access resources are accessed. */ + switch (dep->specifier) + { + default: + break; + case IA64_RS_CPUID: + case IA64_RS_DBR: + case IA64_RS_IBR: + case IA64_RS_MSR: + case IA64_RS_PKR: + case IA64_RS_PMC: + case IA64_RS_PMD: + case IA64_RS_RR: + for (path = 0; path < md.path; path++) + { + count = specify_resource (dep, idesc, DV_REG, specs, note, path); + while (count-- > 0) + mark_resource (idesc, dep, &specs[count], + DEP (opdeps->regs[i]), path); + } + break; + } + } +} + +/* Remove dependencies when they no longer apply. */ + +static void +update_dependencies (idesc) + struct ia64_opcode *idesc; +{ + int i; + + if (strcmp (idesc->name, "srlz.i") == 0) + { + instruction_serialization (); + } + else if (strcmp (idesc->name, "srlz.d") == 0) + { + data_serialization (); + } + else if (is_interruption_or_rfi (idesc) + || is_taken_branch (idesc)) + { + /* Although technically the taken branch doesn't clear dependencies + which require a srlz.[id], we don't follow the branch; the next + instruction is assumed to start with a clean slate. */ + regdepslen = 0; + md.path = 0; + } + else if (is_conditional_branch (idesc) + && CURR_SLOT.qp_regno != 0) + { + int is_call = strstr (idesc->name, ".call") != NULL; + + for (i = 0; i < qp_implieslen; i++) + { + /* If the conditional branch's predicate is implied by the predicate + in an existing dependency, remove that dependency. */ + if (qp_implies[i].p2 == CURR_SLOT.qp_regno) + { + int depind = 0; + /* Note that this implied predicate takes a branch so that if + a later insn generates a DV but its predicate implies this + one, we can avoid the false DV warning. */ + qp_implies[i].p2_branched = 1; + while (depind < regdepslen) + { + if (regdeps[depind].qp_regno == qp_implies[i].p1) + { + print_dependency ("Removing", depind); + regdeps[depind] = regdeps[--regdepslen]; + } + else + ++depind; + } + } + } + /* Any marked resources which have this same predicate should be + cleared, provided that the QP hasn't been modified between the + marking instruction and the branch. */ + if (is_call) + { + insn_group_break (0, CURR_SLOT.qp_regno, 1); + } + else + { + i = 0; + while (i < regdepslen) + { + if (regdeps[i].qp_regno == CURR_SLOT.qp_regno + && regdeps[i].link_to_qp_branch + && (regdeps[i].file != CURR_SLOT.src_file + || regdeps[i].line != CURR_SLOT.src_line)) + { + /* Treat like a taken branch */ + print_dependency ("Removing", i); + regdeps[i] = regdeps[--regdepslen]; + } + else + ++i; + } + } + } +} + +/* Examine the current instruction for dependency violations. */ + +static int +check_dv (idesc) + struct ia64_opcode *idesc; +{ + if (md.debug_dv) + { + fprintf (stderr, "Checking %s for violations (line %d, %d/%d)\n", + idesc->name, CURR_SLOT.src_line, + idesc->dependencies->nchks, + idesc->dependencies->nregs); + } + + /* Look through the list of currently marked resources; if the current + instruction has the dependency in its chks list which uses that resource, + check against the specific resources used. */ + check_dependencies (idesc); + + /* Look up the instruction's regdeps (RAW writes, WAW writes, and WAR reads), + then add them to the list of marked resources. */ + mark_resources (idesc); + + /* There are several types of dependency semantics, and each has its own + requirements for being cleared + + Instruction serialization (insns separated by interruption, rfi, or + writer + srlz.i + reader, all in separate groups) clears DVS_INSTR. + + Data serialization (instruction serialization, or writer + srlz.d + + reader, where writer and srlz.d are in separate groups) clears + DVS_DATA. (This also clears DVS_OTHER, but that is not guaranteed to + always be the case). + + Instruction group break (groups separated by stop, taken branch, + interruption or rfi) clears DVS_IMPLIED and DVS_IMPLIEDF. + */ + update_dependencies (idesc); + + /* Sometimes, knowing a register value allows us to avoid giving a false DV + warning. Keep track of as many as possible that are useful. */ + note_register_values (idesc); + + /* We don't need or want this anymore. */ + md.mem_offset.hint = 0; + + return 0; +} + +/* Translate one line of assembly. Pseudo ops and labels do not show + here. */ +void +md_assemble (str) + char *str; +{ + char *saved_input_line_pointer, *mnemonic; + const struct pseudo_opcode *pdesc; + struct ia64_opcode *idesc; + unsigned char qp_regno; + unsigned int flags; + int ch; + + saved_input_line_pointer = input_line_pointer; + input_line_pointer = str; + + /* extract the opcode (mnemonic): */ + + mnemonic = input_line_pointer; + ch = get_symbol_end (); + pdesc = (struct pseudo_opcode *) hash_find (md.pseudo_hash, mnemonic); + if (pdesc) + { + *input_line_pointer = ch; + (*pdesc->handler) (pdesc->arg); + goto done; + } + + /* Find the instruction descriptor matching the arguments. */ + + idesc = ia64_find_opcode (mnemonic); + *input_line_pointer = ch; + if (!idesc) + { + as_bad ("Unknown opcode `%s'", mnemonic); + goto done; + } + + idesc = parse_operands (idesc); + if (!idesc) + goto done; + + /* Handle the dynamic ops we can handle now: */ + if (idesc->type == IA64_TYPE_DYN) + { + if (strcmp (idesc->name, "add") == 0) + { + if (CURR_SLOT.opnd[2].X_op == O_register + && CURR_SLOT.opnd[2].X_add_number < 4) + mnemonic = "addl"; + else + mnemonic = "adds"; + ia64_free_opcode (idesc); + idesc = ia64_find_opcode (mnemonic); +#if 0 + know (!idesc->next); +#endif + } + else if (strcmp (idesc->name, "mov") == 0) + { + enum ia64_opnd opnd1, opnd2; + int rop; + + opnd1 = idesc->operands[0]; + opnd2 = idesc->operands[1]; + if (opnd1 == IA64_OPND_AR3) + rop = 0; + else if (opnd2 == IA64_OPND_AR3) + rop = 1; + else + abort (); + if (CURR_SLOT.opnd[rop].X_op == O_register + && ar_is_in_integer_unit (CURR_SLOT.opnd[rop].X_add_number)) + mnemonic = "mov.i"; + else + mnemonic = "mov.m"; + ia64_free_opcode (idesc); + idesc = ia64_find_opcode (mnemonic); + while (idesc != NULL + && (idesc->operands[0] != opnd1 + || idesc->operands[1] != opnd2)) + idesc = get_next_opcode (idesc); + } + } + + qp_regno = 0; + if (md.qp.X_op == O_register) + { + qp_regno = md.qp.X_add_number - REG_P; + md.qp.X_op = O_absent; + } + + flags = idesc->flags; + + if ((flags & IA64_OPCODE_FIRST) != 0) + insn_group_break (1, 0, 0); + + if ((flags & IA64_OPCODE_NO_PRED) != 0 && qp_regno != 0) + { + as_bad ("`%s' cannot be predicated", idesc->name); + goto done; + } + + /* Build the instruction. */ + CURR_SLOT.qp_regno = qp_regno; + CURR_SLOT.idesc = idesc; + as_where (&CURR_SLOT.src_file, &CURR_SLOT.src_line); + dwarf2_where (&CURR_SLOT.debug_line); + + /* Add unwind entry, if there is one. */ + if (unwind.current_entry) + { + CURR_SLOT.unwind_record = unwind.current_entry; + unwind.current_entry = NULL; + } + + /* Check for dependency violations. */ + if (md.detect_dv) + check_dv (idesc); + + md.curr_slot = (md.curr_slot + 1) % NUM_SLOTS; + if (++md.num_slots_in_use >= NUM_SLOTS) + emit_one_bundle (); + + if ((flags & IA64_OPCODE_LAST) != 0) + insn_group_break (1, 0, 0); + + md.last_text_seg = now_seg; + + done: + input_line_pointer = saved_input_line_pointer; +} + +/* Called when symbol NAME cannot be found in the symbol table. + Should be used for dynamic valued symbols only. */ + +symbolS * +md_undefined_symbol (name) + char *name ATTRIBUTE_UNUSED; +{ + return 0; +} + +/* Called for any expression that can not be recognized. When the + function is called, `input_line_pointer' will point to the start of + the expression. */ + +void +md_operand (e) + expressionS *e; +{ + enum pseudo_type pseudo_type; + const char *name; + size_t len; + int ch, i; + + switch (*input_line_pointer) + { + case '@': + /* Find what relocation pseudo-function we're dealing with. */ + pseudo_type = 0; + ch = *++input_line_pointer; + for (i = 0; i < NELEMS (pseudo_func); ++i) + if (pseudo_func[i].name && pseudo_func[i].name[0] == ch) + { + len = strlen (pseudo_func[i].name); + if (strncmp (pseudo_func[i].name + 1, + input_line_pointer + 1, len - 1) == 0 + && !is_part_of_name (input_line_pointer[len])) + { + input_line_pointer += len; + pseudo_type = pseudo_func[i].type; + break; + } + } + switch (pseudo_type) + { + case PSEUDO_FUNC_RELOC: + SKIP_WHITESPACE (); + if (*input_line_pointer != '(') + { + as_bad ("Expected '('"); + goto err; + } + /* Skip '('. */ + ++input_line_pointer; + expression (e); + if (*input_line_pointer++ != ')') + { + as_bad ("Missing ')'"); + goto err; + } + if (e->X_op != O_symbol) + { + if (e->X_op != O_pseudo_fixup) + { + as_bad ("Not a symbolic expression"); + goto err; + } + if (S_GET_VALUE (e->X_op_symbol) == FUNC_FPTR_RELATIVE + && i == FUNC_LT_RELATIVE) + i = FUNC_LT_FPTR_RELATIVE; + else + { + as_bad ("Illegal combination of relocation functions"); + goto err; + } + } + /* Make sure gas doesn't get rid of local symbols that are used + in relocs. */ + e->X_op = O_pseudo_fixup; + e->X_op_symbol = pseudo_func[i].u.sym; + break; + + case PSEUDO_FUNC_CONST: + e->X_op = O_constant; + e->X_add_number = pseudo_func[i].u.ival; + break; + + case PSEUDO_FUNC_REG: + e->X_op = O_register; + e->X_add_number = pseudo_func[i].u.ival; + break; + + default: + name = input_line_pointer - 1; + get_symbol_end (); + as_bad ("Unknown pseudo function `%s'", name); + goto err; + } + break; + + case '[': + ++input_line_pointer; + expression (e); + if (*input_line_pointer != ']') + { + as_bad ("Closing bracket misssing"); + goto err; + } + else + { + if (e->X_op != O_register) + as_bad ("Register expected as index"); + + ++input_line_pointer; + e->X_op = O_index; + } + break; + + default: + break; + } + return; + + err: + ignore_rest_of_line (); +} + +/* Return 1 if it's OK to adjust a reloc by replacing the symbol with + a section symbol plus some offset. For relocs involving @fptr(), + directives we don't want such adjustments since we need to have the + original symbol's name in the reloc. */ +int +ia64_fix_adjustable (fix) + fixS *fix; +{ + /* Prevent all adjustments to global symbols */ + if (S_IS_EXTERN (fix->fx_addsy) || S_IS_WEAK (fix->fx_addsy)) + return 0; + + switch (fix->fx_r_type) + { + case BFD_RELOC_IA64_FPTR64I: + case BFD_RELOC_IA64_FPTR32MSB: + case BFD_RELOC_IA64_FPTR32LSB: + case BFD_RELOC_IA64_FPTR64MSB: + case BFD_RELOC_IA64_FPTR64LSB: + case BFD_RELOC_IA64_LTOFF_FPTR22: + case BFD_RELOC_IA64_LTOFF_FPTR64I: + return 0; + default: + break; + } + + return 1; +} + +int +ia64_force_relocation (fix) + fixS *fix; +{ + switch (fix->fx_r_type) + { + case BFD_RELOC_IA64_FPTR64I: + case BFD_RELOC_IA64_FPTR32MSB: + case BFD_RELOC_IA64_FPTR32LSB: + case BFD_RELOC_IA64_FPTR64MSB: + case BFD_RELOC_IA64_FPTR64LSB: + + case BFD_RELOC_IA64_LTOFF22: + case BFD_RELOC_IA64_LTOFF64I: + case BFD_RELOC_IA64_LTOFF_FPTR22: + case BFD_RELOC_IA64_LTOFF_FPTR64I: + case BFD_RELOC_IA64_PLTOFF22: + case BFD_RELOC_IA64_PLTOFF64I: + case BFD_RELOC_IA64_PLTOFF64MSB: + case BFD_RELOC_IA64_PLTOFF64LSB: + return 1; + + default: + return 0; + } + return 0; +} + +/* Decide from what point a pc-relative relocation is relative to, + relative to the pc-relative fixup. Er, relatively speaking. */ +long +ia64_pcrel_from_section (fix, sec) + fixS *fix; + segT sec; +{ + unsigned long off = fix->fx_frag->fr_address + fix->fx_where; + + if (bfd_get_section_flags (stdoutput, sec) & SEC_CODE) + off &= ~0xfUL; + + return off; +} + +/* This is called whenever some data item (not an instruction) needs a + fixup. We pick the right reloc code depending on the byteorder + currently in effect. */ +void +ia64_cons_fix_new (f, where, nbytes, exp) + fragS *f; + int where; + int nbytes; + expressionS *exp; +{ + bfd_reloc_code_real_type code; + fixS *fix; + + switch (nbytes) + { + /* There are no reloc for 8 and 16 bit quantities, but we allow + them here since they will work fine as long as the expression + is fully defined at the end of the pass over the source file. */ + case 1: code = BFD_RELOC_8; break; + case 2: code = BFD_RELOC_16; break; + case 4: + if (target_big_endian) + code = BFD_RELOC_IA64_DIR32MSB; + else + code = BFD_RELOC_IA64_DIR32LSB; + break; + + case 8: + if (target_big_endian) + code = BFD_RELOC_IA64_DIR64MSB; + else + code = BFD_RELOC_IA64_DIR64LSB; + break; + + default: + as_bad ("Unsupported fixup size %d", nbytes); + ignore_rest_of_line (); + return; + } + if (exp->X_op == O_pseudo_fixup) + { + /* ??? */ + 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(). */ + fix->tc_fix_data.bigendian = target_big_endian; +} + +/* Return the actual relocation we wish to associate with the pseudo + reloc described by SYM and R_TYPE. SYM should be one of the + symbols in the pseudo_func array, or NULL. */ + +static bfd_reloc_code_real_type +ia64_gen_real_reloc_type (sym, r_type) + struct symbol *sym; + bfd_reloc_code_real_type r_type; +{ + bfd_reloc_code_real_type new = 0; + + if (sym == NULL) + { + return r_type; + } + + switch (S_GET_VALUE (sym)) + { + case FUNC_FPTR_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_IMM64: new = BFD_RELOC_IA64_FPTR64I; break; + case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_FPTR32MSB; break; + case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_FPTR32LSB; break; + case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_FPTR64MSB; break; + case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_FPTR64LSB; break; + default: break; + } + break; + + case FUNC_GP_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_IMM22: new = BFD_RELOC_IA64_GPREL22; break; + case BFD_RELOC_IA64_IMM64: new = BFD_RELOC_IA64_GPREL64I; break; + case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_GPREL32MSB; break; + case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_GPREL32LSB; break; + case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_GPREL64MSB; break; + case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_GPREL64LSB; break; + default: break; + } + break; + + case FUNC_LT_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_IMM22: new = BFD_RELOC_IA64_LTOFF22; break; + case BFD_RELOC_IA64_IMM64: new = BFD_RELOC_IA64_LTOFF64I; break; + default: break; + } + break; + + case FUNC_PC_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_IMM22: new = BFD_RELOC_IA64_PCREL22; break; + case BFD_RELOC_IA64_IMM64: new = BFD_RELOC_IA64_PCREL64I; break; + case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_PCREL32MSB; break; + case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_PCREL32LSB; break; + case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_PCREL64MSB; break; + case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_PCREL64LSB; break; + default: break; + } + break; + + case FUNC_PLT_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_IMM22: new = BFD_RELOC_IA64_PLTOFF22; break; + case BFD_RELOC_IA64_IMM64: new = BFD_RELOC_IA64_PLTOFF64I; break; + case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_PLTOFF64MSB;break; + case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_PLTOFF64LSB;break; + default: break; + } + break; + + case FUNC_SEC_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_SECREL32MSB;break; + case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_SECREL32LSB;break; + case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_SECREL64MSB;break; + case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_SECREL64LSB;break; + default: break; + } + break; + + case FUNC_SEG_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_SEGREL32MSB;break; + case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_SEGREL32LSB;break; + case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_SEGREL64MSB;break; + case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_SEGREL64LSB;break; + default: break; + } + break; + + case FUNC_LTV_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_DIR32MSB: new = BFD_RELOC_IA64_LTV32MSB; break; + case BFD_RELOC_IA64_DIR32LSB: new = BFD_RELOC_IA64_LTV32LSB; break; + case BFD_RELOC_IA64_DIR64MSB: new = BFD_RELOC_IA64_LTV64MSB; break; + case BFD_RELOC_IA64_DIR64LSB: new = BFD_RELOC_IA64_LTV64LSB; break; + default: break; + } + break; + + case FUNC_LT_FPTR_RELATIVE: + switch (r_type) + { + case BFD_RELOC_IA64_IMM22: + new = BFD_RELOC_IA64_LTOFF_FPTR22; break; + case BFD_RELOC_IA64_IMM64: + new = BFD_RELOC_IA64_LTOFF_FPTR64I; break; + default: + break; + } + break; + default: + abort (); + } + /* Hmmmm. Should this ever occur? */ + if (new) + return new; + else + return r_type; +} + +/* Here is where generate the appropriate reloc for pseudo relocation + functions. */ +void +ia64_validate_fix (fix) + fixS *fix; +{ + switch (fix->fx_r_type) + { + case BFD_RELOC_IA64_FPTR64I: + case BFD_RELOC_IA64_FPTR32MSB: + case BFD_RELOC_IA64_FPTR64LSB: + case BFD_RELOC_IA64_LTOFF_FPTR22: + case BFD_RELOC_IA64_LTOFF_FPTR64I: + if (fix->fx_offset != 0) + as_bad_where (fix->fx_file, fix->fx_line, + "No addend allowed in @fptr() relocation"); + break; + default: + break; + } + + return; +} + +static void +fix_insn (fix, odesc, value) + fixS *fix; + const struct ia64_operand *odesc; + valueT value; +{ + bfd_vma insn[3], t0, t1, control_bits; + const char *err; + char *fixpos; + long slot; + + slot = fix->fx_where & 0x3; + fixpos = fix->fx_frag->fr_literal + (fix->fx_where - slot); + + /* Bundles are always in little-endian byte order */ + t0 = bfd_getl64 (fixpos); + t1 = bfd_getl64 (fixpos + 8); + control_bits = t0 & 0x1f; + insn[0] = (t0 >> 5) & 0x1ffffffffffLL; + insn[1] = ((t0 >> 46) & 0x3ffff) | ((t1 & 0x7fffff) << 18); + insn[2] = (t1 >> 23) & 0x1ffffffffffLL; + + err = NULL; + if (odesc - elf64_ia64_operands == IA64_OPND_IMMU64) + { + insn[1] = (value >> 22) & 0x1ffffffffffLL; + insn[2] |= (((value & 0x7f) << 13) + | (((value >> 7) & 0x1ff) << 27) + | (((value >> 16) & 0x1f) << 22) + | (((value >> 21) & 0x1) << 21) + | (((value >> 63) & 0x1) << 36)); + } + else if (odesc - elf64_ia64_operands == IA64_OPND_IMMU62) + { + if (value & ~0x3fffffffffffffffULL) + err = "integer operand out of range"; + insn[1] = (value >> 21) & 0x1ffffffffffLL; + insn[2] |= (((value & 0xfffff) << 6) | (((value >> 20) & 0x1) << 36)); + } + else if (odesc - elf64_ia64_operands == IA64_OPND_TGT64) + { + value >>= 4; + insn[1] = ((value >> 20) & 0x7fffffffffLL) << 2; + insn[2] |= ((((value >> 59) & 0x1) << 36) + | (((value >> 0) & 0xfffff) << 13)); + } + else + err = (*odesc->insert) (odesc, value, insn + slot); + + if (err) + as_bad_where (fix->fx_file, fix->fx_line, err); + + t0 = control_bits | (insn[0] << 5) | (insn[1] << 46); + t1 = ((insn[1] >> 18) & 0x7fffff) | (insn[2] << 23); + number_to_chars_littleendian (fixpos + 0, t0, 8); + number_to_chars_littleendian (fixpos + 8, t1, 8); +} + +/* Attempt to simplify or even eliminate a fixup. The return value is + ignored; perhaps it was once meaningful, but now it is historical. + To indicate that a fixup has been eliminated, set FIXP->FX_DONE. + + If fixp->fx_addsy is non-NULL, we'll have to generate a reloc entry + (if possible). */ +int +md_apply_fix3 (fix, valuep, seg) + fixS *fix; + valueT *valuep; + segT seg ATTRIBUTE_UNUSED; +{ + char *fixpos; + valueT value = *valuep; + int adjust = 0; + + fixpos = fix->fx_frag->fr_literal + fix->fx_where; + + if (fix->fx_pcrel) + { + switch (fix->fx_r_type) + { + case BFD_RELOC_IA64_DIR32MSB: + fix->fx_r_type = BFD_RELOC_IA64_PCREL32MSB; + adjust = 1; + break; + + case BFD_RELOC_IA64_DIR32LSB: + fix->fx_r_type = BFD_RELOC_IA64_PCREL32LSB; + adjust = 1; + break; + + case BFD_RELOC_IA64_DIR64MSB: + fix->fx_r_type = BFD_RELOC_IA64_PCREL64MSB; + adjust = 1; + break; + + case BFD_RELOC_IA64_DIR64LSB: + fix->fx_r_type = BFD_RELOC_IA64_PCREL64LSB; + adjust = 1; + break; + + default: + break; + } + } + if (fix->fx_addsy) + { + switch (fix->fx_r_type) + { + case 0: + 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; + } + + /* ??? This is a hack copied from tc-i386.c to make PCREL relocs + work. There should be a better way to handle this. */ + if (adjust) + fix->fx_offset += fix->fx_where + fix->fx_frag->fr_address; + } + else if (fix->tc_fix_data.opnd == IA64_OPND_NIL) + { + if (fix->tc_fix_data.bigendian) + number_to_chars_bigendian (fixpos, value, fix->fx_size); + 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 + fixup used internally in the assembler. */ + +arelent * +tc_gen_reloc (sec, fixp) + asection *sec ATTRIBUTE_UNUSED; + fixS *fixp; +{ + arelent *reloc; + + reloc = xmalloc (sizeof (*reloc)); + reloc->sym_ptr_ptr = (asymbol **) xmalloc (sizeof (asymbol *)); + *reloc->sym_ptr_ptr = symbol_get_bfdsym (fixp->fx_addsy); + reloc->address = fixp->fx_frag->fr_address + fixp->fx_where; + reloc->addend = fixp->fx_offset; + reloc->howto = bfd_reloc_type_lookup (stdoutput, fixp->fx_r_type); + + if (!reloc->howto) + { + as_bad_where (fixp->fx_file, fixp->fx_line, + "Cannot represent %s relocation in object file", + bfd_get_reloc_code_name (fixp->fx_r_type)); + } + return reloc; +} + +/* Turn a string in input_line_pointer into a floating point constant + of type TYPE, and store the appropriate bytes in *LIT. The number + of LITTLENUMS emitted is stored in *SIZE. An error message is + returned, or NULL on OK. */ + +#define MAX_LITTLENUMS 5 + +char * +md_atof (type, lit, size) + int type; + char *lit; + int *size; +{ + LITTLENUM_TYPE words[MAX_LITTLENUMS]; + LITTLENUM_TYPE *word; + char *t; + int prec; + + switch (type) + { + /* IEEE floats */ + case 'f': + case 'F': + case 's': + case 'S': + prec = 2; + break; + + case 'd': + case 'D': + case 'r': + case 'R': + prec = 4; + break; + + case 'x': + case 'X': + case 'p': + case 'P': + prec = 5; + break; + + default: + *size = 0; + return "Bad call to MD_ATOF()"; + } + t = atof_ieee (input_line_pointer, type, words); + if (t) + input_line_pointer = t; + *size = prec * sizeof (LITTLENUM_TYPE); + + for (word = words + prec - 1; prec--;) + { + md_number_to_chars (lit, (long) (*word--), sizeof (LITTLENUM_TYPE)); + lit += sizeof (LITTLENUM_TYPE); + } + return 0; +} + +/* Round up a section's size to the appropriate boundary. */ +valueT +md_section_align (seg, size) + segT seg; + valueT size; +{ + int align = bfd_get_section_alignment (stdoutput, seg); + valueT mask = ((valueT) 1 << align) - 1; + + return (size + mask) & ~mask; +} + +/* Handle ia64 specific semantics of the align directive. */ + +void +ia64_md_do_align (n, fill, len, max) + int n ATTRIBUTE_UNUSED; + const char *fill ATTRIBUTE_UNUSED; + int len ATTRIBUTE_UNUSED; + int max ATTRIBUTE_UNUSED; +{ + if (subseg_text_p (now_seg)) + ia64_flush_insns (); +} + +/* This is called from HANDLE_ALIGN in write.c. Fill in the contents + of an rs_align_code fragment. */ + +void +ia64_handle_align (fragp) + fragS *fragp; +{ + /* Use mfi bundle of nops with no stop bits. */ + static const unsigned char be_nop[] + = { 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0c}; + static const unsigned char le_nop[] + = { 0x0c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00}; + + int bytes; + char *p; + + if (fragp->fr_type != rs_align_code) + return; + + bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix; + p = fragp->fr_literal + fragp->fr_fix; + + /* Make sure we are on a 16-byte boundary, in case someone has been + putting data into a text section. */ + if (bytes & 15) + { + int fix = bytes & 15; + memset (p, 0, fix); + p += fix; + bytes -= fix; + fragp->fr_fix += fix; + } + + memcpy (p, (target_big_endian ? be_nop : le_nop), 16); + fragp->fr_var = 16; +} diff --git a/gnu/dist/toolchain/gas/config/tc-ia64.h b/gnu/dist/toolchain/gas/config/tc-ia64.h new file mode 100644 index 000000000000..f2b9fe43e8f1 --- /dev/null +++ b/gnu/dist/toolchain/gas/config/tc-ia64.h @@ -0,0 +1,261 @@ +/* tc-ia64.h -- Header file for tc-ia64.c. + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Contributed by David Mosberger-Tang + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GAS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include + +#define TC_IA64 + +/* Linux is little endian by default. HPUX is big endian by default. */ +#ifdef TE_HPUX +#define md_number_to_chars number_to_chars_bigendian +#define TARGET_BYTES_BIG_ENDIAN 1 +#else +#define md_number_to_chars number_to_chars_littleendian +#define TARGET_BYTES_BIG_ENDIAN 0 +#endif /* TE_HPUX */ + +/* We need to set the default object file format in ia64_init and not in + md_begin. This is because parse_args is called before md_begin, and we + do not want md_begin to wipe out the flag settings set by options parsed in + md_parse_args. */ + +#define HOST_SPECIAL_INIT ia64_init +extern void ia64_init PARAMS ((int, char **)); + +#define TARGET_FORMAT ia64_target_format() +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 +#define DIFF_EXPR_OK /* foo-. gets turned into PC relative relocs */ +#define NEED_INDEX_OPERATOR /* [ ] is index operator */ + +#define QUOTES_IN_INSN /* allow `string "foo;bar"' */ +#define LEX_AT LEX_NAME /* allow `@' inside name */ +#define LEX_QM LEX_NAME /* allow `?' inside name */ +#define LEX_HASH LEX_END_NAME /* allow `#' ending a name */ + +struct ia64_fix + { + int bigendian; /* byte order at fix location */ + enum ia64_opnd opnd; + }; + +extern void ia64_do_align PARAMS((int n)); +extern void ia64_end_of_source PARAMS((void)); +extern void ia64_start_line PARAMS((void)); +extern int ia64_unrecognized_line PARAMS((int ch)); +extern void ia64_frob_label PARAMS((struct symbol *sym)); +extern void ia64_flush_pending_output PARAMS((void)); +extern int ia64_parse_name (char *name, expressionS *e); +extern int ia64_optimize_expr PARAMS((expressionS *l, operatorT op, + expressionS *r)); +extern void ia64_cons_align PARAMS((int)); +extern void ia64_flush_insns PARAMS((void)); +extern int ia64_fix_adjustable PARAMS((struct fix *fix)); +extern int ia64_force_relocation PARAMS((struct fix *)); +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 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)); + +#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 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_short_jump(p,f,t,fr,s) \ + 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_flags ia64_elf_section_flags +#define TC_FIX_TYPE struct ia64_fix +#define TC_INIT_FIX_DATA(f) { f->tc_fix_data.opnd = 0; } +#define TC_CONS_FIX_NEW(f,o,l,e) ia64_cons_fix_new (f, o, l, e) +#define TC_VALIDATE_FIX(fix,seg,skip) ia64_validate_fix (fix) +#define MD_PCREL_FROM_SECTION(fix,sec) ia64_pcrel_from_section (fix, sec) +#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 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 \ +{ ".sbss", SHT_NOBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, \ +{ ".sdata", SHT_PROGBITS, SHF_ALLOC + SHF_WRITE + SHF_IA_64_SHORT }, + +#define DWARF2_LINE_MIN_INSN_LENGTH 1 /* so slot-multipliers can be 1 */ + +/* This is the information required for unwind records in an ia64 + object file. This is required by GAS and the compiler runtime. */ + +/* These are the starting point masks for the various types of + unwind records. To create a record of type R3 for instance, one + starts by using the value UNW_R3 and or-ing in any other required values. + These values are also unique (in context), so they can be used to identify + the various record types as well. UNW_Bx and some UNW_Px do have the + same value, but Px can only occur in a prologue context, and Bx in + a body context. */ + +#define UNW_R1 0x00 +#define UNW_R2 0x40 +#define UNW_R3 0x60 +#define UNW_P1 0x80 +#define UNW_P2 0xA0 +#define UNW_P3 0xB0 +#define UNW_P4 0xB8 +#define UNW_P5 0xB9 +#define UNW_P6 0xC0 +#define UNW_P7 0xE0 +#define UNW_P8 0xF0 +#define UNW_P9 0xF1 +#define UNW_P10 0xFF +#define UNW_X1 0xF9 +#define UNW_X2 0xFA +#define UNW_X3 0xFB +#define UNW_X4 0xFC +#define UNW_B1 0x80 +#define UNW_B2 0xC0 +#define UNW_B3 0xE0 +#define UNW_B4 0xF0 + +/* These are all the various types of unwind records. */ + +typedef enum +{ + prologue, prologue_gr, body, mem_stack_f, mem_stack_v, psp_gr, psp_sprel, + rp_when, rp_gr, rp_br, rp_psprel, rp_sprel, pfs_when, pfs_gr, pfs_psprel, + pfs_sprel, preds_when, preds_gr, preds_psprel, preds_sprel, + fr_mem, frgr_mem, gr_gr, gr_mem, br_mem, br_gr, spill_base, spill_mask, + unat_when, unat_gr, unat_psprel, unat_sprel, lc_when, lc_gr, lc_psprel, + lc_sprel, fpsr_when, fpsr_gr, fpsr_psprel, fpsr_sprel, + priunat_when_gr, priunat_when_mem, priunat_gr, priunat_psprel, + priunat_sprel, bsp_when, bsp_gr, bsp_psprel, bsp_sprel, bspstore_when, + bspstore_gr, bspstore_psprel, bspstore_sprel, rnat_when, rnat_gr, + rnat_psprel, rnat_sprel, epilogue, label_state, copy_state, + spill_psprel, spill_sprel, spill_reg, spill_psprel_p, spill_sprel_p, + spill_reg_p, unwabi +} unw_record_type; + +/* These structures declare the fields that can be used in each of the + 4 record formats, R, P, B and X. */ + +typedef struct unw_r_record +{ + unsigned long rlen; + unsigned short grmask; + unsigned short grsave; + /* masks to represent the union of save.g, save.f, save.b, and + save.gf: */ + unsigned long imask_size; + struct + { + unsigned char *i; + unsigned long fr_mem; + unsigned char gr_mem; + unsigned char br_mem; + } mask; +} unw_r_record; + +typedef struct unw_p_record +{ + void *imask; + unsigned long t; + unsigned long size; + unsigned long spoff; + unsigned long br; + unsigned long pspoff; + unsigned short gr; + unsigned short rmask; + unsigned short grmask; + unsigned long frmask; + unsigned short brmask; + unsigned char abi; + unsigned char context; +} unw_p_record; + +typedef struct unw_b_record +{ + unsigned long t; + unsigned long label; + unsigned short ecount; +} unw_b_record; + +typedef struct unw_x_record +{ + unsigned long t; + unsigned long spoff; + unsigned long pspoff; + unsigned short reg; + unsigned short treg; + unsigned short qp; + unsigned short ab; /* Value of the AB field.. */ + unsigned short xy; /* Value of the XY field.. */ +} unw_x_record; + +/* This structure is used to determine the specific record type and + its fields. */ +typedef struct unwind_record +{ + unw_record_type type; + union { + unw_r_record r; + unw_p_record p; + unw_b_record b; + unw_x_record x; + } record; +} unwind_record; + +/* This expression evaluates to false if the relocation is for a local + object for which we still want to do the relocation at runtime. + True if we are willing to perform this relocation while building + the .o file. This is only used for pcrel relocations. */ + +#define TC_RELOC_RTSYM_LOC_FIXUP(FIX) \ + ((FIX)->fx_addsy == NULL \ + || (FIX)->fx_r_type == 0 \ + || (! S_IS_EXTERNAL ((FIX)->fx_addsy) \ + && ! S_IS_WEAK ((FIX)->fx_addsy) \ + && S_IS_DEFINED ((FIX)->fx_addsy) \ + && ! S_IS_COMMON ((FIX)->fx_addsy))) diff --git a/gnu/dist/toolchain/gas/config/tc-m32r.c b/gnu/dist/toolchain/gas/config/tc-m32r.c index 7745338b0876..7aabf5b01641 100644 --- a/gnu/dist/toolchain/gas/config/tc-m32r.c +++ b/gnu/dist/toolchain/gas/config/tc-m32r.c @@ -1,5 +1,6 @@ /* tc-m32r.c -- Assembler for the Mitsubishi M32R. - Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -21,7 +22,7 @@ #include #include #include "as.h" -#include "subsegs.h" +#include "subsegs.h" #include "symcat.h" #include "opcodes/m32r-desc.h" #include "opcodes/m32r-opc.h" @@ -32,37 +33,37 @@ typedef struct sym_link { struct sym_link *next; - symbolS *symbol; + symbolS *symbol; } sym_linkS; -static sym_linkS *debug_sym_link = (sym_linkS *)0; - +static sym_linkS *debug_sym_link = (sym_linkS *) 0; + /* Structure to hold all of the different components describing an individual instruction. */ typedef struct { - const CGEN_INSN * insn; - const CGEN_INSN * orig_insn; - CGEN_FIELDS fields; + const CGEN_INSN *insn; + const CGEN_INSN *orig_insn; + CGEN_FIELDS fields; #if CGEN_INT_INSN_P - CGEN_INSN_INT buffer [1]; + CGEN_INSN_INT buffer[1]; #define INSN_VALUE(buf) (*(buf)) #else - unsigned char buffer [CGEN_MAX_INSN_SIZE]; + unsigned char buffer[CGEN_MAX_INSN_SIZE]; #define INSN_VALUE(buf) (buf) #endif - char * addr; - fragS * frag; - int num_fixups; - fixS * fixups [GAS_CGEN_MAX_FIXUPS]; - int indices [MAX_OPERAND_INSTANCES]; - sym_linkS *debug_sym_link; + char *addr; + fragS *frag; + int num_fixups; + fixS *fixups[GAS_CGEN_MAX_FIXUPS]; + int indices[MAX_OPERAND_INSTANCES]; + sym_linkS *debug_sym_link; } m32r_insn; /* prev_insn.insn is non-null if last insn was a 16 bit insn on a 32 bit boundary (i.e. was the first of two 16 bit insns). */ -static m32r_insn prev_insn; +static m32r_insn prev_insn; /* Non-zero if we've seen a relaxable insn since the last 32 bit alignment request. */ @@ -74,10 +75,11 @@ static int seen_relaxable_p = 0; This flag does not apply to them. */ static int m32r_relax; -#if 0 /* not supported yet */ +#if 0 +/* Not supported yet. */ /* If non-NULL, pointer to cpu description file to read. This allows runtime additions to the assembler. */ -static const char * m32r_cpu_desc; +static const char *m32r_cpu_desc; #endif /* Non-zero if warn when a high/shigh reloc has no matching low reloc. @@ -106,7 +108,7 @@ static int warn_explicit_parallel_conflicts = 1; /* Non-zero if insns can be made parallel. */ static int optimize; -/* stuff for .scomm symbols. */ +/* Stuff for .scomm symbols. */ static segT sbss_section; static asection scom_section; static asymbol scom_symbol; @@ -126,20 +128,23 @@ const char FLT_CHARS[] = "dD"; In order to implement this, we keep track of each unmatched HI relocation. We then sort them so that they immediately precede the - corresponding LO relocation. */ + corresponding LO relocation. */ struct m32r_hi_fixup { - struct m32r_hi_fixup * next; /* Next HI fixup. */ - fixS * fixp; /* This fixup. */ - segT seg; /* The section this fixup is in. */ + /* Next HI fixup. */ + struct m32r_hi_fixup *next; + /* This fixup. */ + fixS *fixp; + + /* The section this fixup is in. */ + segT seg; }; /* The list of unmatched HI relocs. */ -static struct m32r_hi_fixup * m32r_hi_fixup_list; - +static struct m32r_hi_fixup *m32r_hi_fixup_list; static void allow_m32rx (on) @@ -153,7 +158,8 @@ allow_m32rx (on) } #define M32R_SHORTOPTS "O" -const char * md_shortopts = M32R_SHORTOPTS; + +const char *md_shortopts = M32R_SHORTOPTS; struct option md_longopts[] = { @@ -177,7 +183,8 @@ struct option md_longopts[] = {"no-warn-unmatched-high", no_argument, NULL, OPTION_NO_WARN_UNMATCHED}, {"Wnuh", no_argument, NULL, OPTION_NO_WARN_UNMATCHED}, -#if 0 /* not supported yet */ +#if 0 + /* Not supported yet. */ #define OPTION_RELAX (OPTION_NO_WARN_UNMATCHED + 1) #define OPTION_CPU_DESC (OPTION_RELAX + 1) {"relax", no_argument, NULL, OPTION_RELAX}, @@ -185,12 +192,13 @@ struct option md_longopts[] = #endif {NULL, no_argument, NULL, 0} }; + size_t md_longopts_size = sizeof (md_longopts); int md_parse_option (c, arg) - int c; - char * arg; + int c; + char *arg; { switch (c) { @@ -201,15 +209,15 @@ md_parse_option (c, arg) case OPTION_M32R: allow_m32rx (0); break; - + case OPTION_M32RX: allow_m32rx (1); break; - + case OPTION_WARN_PARALLEL: warn_explicit_parallel_conflicts = 1; break; - + case OPTION_NO_WARN_PARALLEL: warn_explicit_parallel_conflicts = 0; break; @@ -232,8 +240,9 @@ md_parse_option (c, arg) case OPTION_NO_WARN_UNMATCHED: warn_unmatched_high = 0; break; - -#if 0 /* not supported yet */ + +#if 0 + /* Not supported yet. */ case OPTION_RELAX: m32r_relax = 1; break; @@ -245,13 +254,13 @@ md_parse_option (c, arg) default: return 0; } - + return 1; } void md_show_usage (stream) - FILE * stream; + FILE *stream; { fprintf (stream, _(" M32R specific command line options:\n")); @@ -290,7 +299,7 @@ md_show_usage (stream) fprintf (stream, _("\ -cpu-desc provide runtime cpu description file\n")); #endif -} +} static void fill_insn PARAMS ((int)); static void m32r_scomm PARAMS ((int)); @@ -308,7 +317,7 @@ const pseudo_typeS md_pseudo_table[] = { "fillinsn", fill_insn, 0 }, { "scomm", m32r_scomm, 0 }, { "debugsym", debug_sym, 0 }, - /* Not documented as so far there is no need for them.... */ + /* Not documented as so far there is no need for them.... */ { "m32r", allow_m32rx, 0 }, { "m32rx", allow_m32rx, 1 }, { NULL, NULL, 0 } @@ -316,56 +325,47 @@ const pseudo_typeS md_pseudo_table[] = /* FIXME: Should be machine generated. */ #define NOP_INSN 0x7000 -#define PAR_NOP_INSN 0xf000 /* can only be used in 2nd slot */ +#define PAR_NOP_INSN 0xf000 /* Can only be used in 2nd slot. */ -/* When we align the .text section, insert the correct NOP pattern. - N is the power of 2 alignment. LEN is the length of pattern FILL. - MAX is the maximum number of characters to skip when doing the alignment, - or 0 if there is no maximum. */ +/* This is called from HANDLE_ALIGN in write.c. Fill in the contents + of an rs_align_code fragment. */ -int -m32r_do_align (n, fill, len, max) - int n; - const char * fill; - int len; - int max; +void +m32r_handle_align (fragp) + fragS *fragp; { - /* Only do this if the fill pattern wasn't specified. */ - if (fill == NULL - && subseg_text_p (now_seg) - /* Only do this special handling if aligning to at least a - 4 byte boundary. */ - && n > 1 - /* Only do this special handling if we're allowed to emit at - least two bytes. */ - && (max == 0 || max > 1)) - { - static const unsigned char nop_pattern[] = { 0xf0, 0x00 }; + static const unsigned char nop_pattern[] = { 0xf0, 0x00 }; + static const unsigned char multi_nop_pattern[] = { 0x70, 0x00, 0xf0, 0x00 }; -#if 0 - /* First align to a 2 byte boundary, in case there is an odd .byte. */ - /* FIXME: How much memory will cause gas to use when assembling a big - program? Perhaps we can avoid the frag_align call? */ - frag_align (1, 0, 0); -#endif - /* Next align to a 4 byte boundary (we know n >= 2) using a parallel - nop. */ - frag_align_pattern (2, nop_pattern, sizeof nop_pattern, 0); - /* If doing larger alignments use a repeating sequence of appropriate - nops. */ - if (n > 2) - { - static const unsigned char multi_nop_pattern[] = - { 0x70, 0x00, 0xf0, 0x00 }; - frag_align_pattern (n, multi_nop_pattern, sizeof multi_nop_pattern, - max ? max - 2 : 0); - } - - prev_insn.insn = NULL; - return 1; + int bytes, fix; + char *p; + + if (fragp->fr_type != rs_align_code) + return; + + bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix; + p = fragp->fr_literal + fragp->fr_fix; + fix = 0; + + if (bytes & 1) + { + fix = 1; + *p++ = 0; + bytes--; } - return 0; + if (bytes & 2) + { + memcpy (p, nop_pattern, 2); + p += 2; + bytes -= 2; + fix += 2; + } + + memcpy (p, multi_nop_pattern, 4); + + fragp->fr_fix += fix; + fragp->fr_var = 4; } /* If the last instruction was the first of 2 16 bit insns, @@ -381,7 +381,7 @@ static void fill_insn (ignore) int ignore; { - (void) m32r_do_align (2, NULL, 0, 0); + frag_align_code (2, 0); prev_insn.insn = NULL; seen_relaxable_p = 0; } @@ -405,7 +405,7 @@ debug_sym (ignore) name = input_line_pointer; delim = get_symbol_end (); end_name = input_line_pointer; - + if ((symbolP = symbol_find (name)) == NULL && (symbolP = md_undefined_symbol (name)) == NULL) { @@ -444,14 +444,14 @@ expand_debug_syms (syms, align) if (!syms) return; - (void) m32r_do_align (align, NULL, 0, 0); - for (; syms != (sym_linkS *)0; syms = next_syms) + (void) frag_align_code (align, 0); + for (; syms != (sym_linkS *) 0; syms = next_syms) { symbolS *symbolP = syms->symbol; next_syms = syms->next; input_line_pointer = ".\n"; pseudo_set (symbolP); - free ((char *)syms); + free ((char *) syms); } input_line_pointer = save_input_line; @@ -467,11 +467,11 @@ m32r_fill_insn (done) { if (prev_seg != NULL) { - segT seg = now_seg; + segT seg = now_seg; subsegT subseg = now_subseg; subseg_set (prev_seg, prev_subseg); - + fill_insn (0); subseg_set (seg, subseg); @@ -480,7 +480,7 @@ m32r_fill_insn (done) if (done && debug_sym_link) { expand_debug_syms (debug_sym_link, 1); - debug_sym_link = (sym_linkS *)0; + debug_sym_link = (sym_linkS *) 0; } return 1; @@ -490,11 +490,11 @@ void md_begin () { flagword applicable; - segT seg; - subsegT subseg; + segT seg; + subsegT subseg; /* Initialize the `cgen' interface. */ - + /* Set the machine number and endian. */ gas_cgen_cpu_desc = m32r_cgen_cpu_open (CGEN_CPU_OPEN_MACHS, 0, CGEN_CPU_OPEN_ENDIAN, @@ -510,11 +510,12 @@ md_begin () /* This is a callback from cgen to gas to parse operands. */ cgen_set_parse_operand_fn (gas_cgen_cpu_desc, gas_cgen_parse_operand); -#if 0 /* not supported yet */ +#if 0 + /* Not supported yet. */ /* If a runtime cpu description file was provided, parse it. */ if (m32r_cpu_desc != NULL) { - const char * errmsg; + const char *errmsg; errmsg = cgen_read_cpu_file (gas_cgen_cpu_desc, m32r_cpu_desc); if (errmsg != NULL) @@ -529,12 +530,13 @@ md_begin () /* The sbss section is for local .scomm symbols. */ sbss_section = subseg_new (".sbss", 0); - + /* This is copied from perform_an_assembly_pass. */ applicable = bfd_applicable_section_flags (stdoutput); bfd_set_section_flags (stdoutput, sbss_section, applicable & SEC_ALLOC); - -#if 0 /* What does this do? [see perform_an_assembly_pass] */ + +#if 0 + /* What does this do? [see perform_an_assembly_pass] */ seg_info (bss_section)->bss = 1; #endif @@ -544,12 +546,12 @@ md_begin () but with the name .scommon. */ scom_section = bfd_com_section; scom_section.name = ".scommon"; - scom_section.output_section = & scom_section; - scom_section.symbol = & scom_symbol; - scom_section.symbol_ptr_ptr = & scom_section.symbol; - scom_symbol = * bfd_com_section.symbol; + scom_section.output_section = &scom_section; + scom_section.symbol = &scom_symbol; + scom_section.symbol_ptr_ptr = &scom_section.symbol; + scom_symbol = *bfd_com_section.symbol; scom_symbol.name = ".scommon"; - scom_symbol.section = & scom_section; + scom_symbol.section = &scom_section; allow_m32rx (enable_m32rx); } @@ -566,12 +568,12 @@ md_begin () static int first_writes_to_seconds_operands (a, b, check_outputs) - m32r_insn * a; - m32r_insn * b; - const int check_outputs; + m32r_insn *a; + m32r_insn *b; + const int check_outputs; { - const CGEN_OPINST * a_operands = CGEN_INSN_OPERANDS (a->insn); - const CGEN_OPINST * b_ops = CGEN_INSN_OPERANDS (b->insn); + const CGEN_OPINST *a_operands = CGEN_INSN_OPERANDS (a->insn); + const CGEN_OPINST *b_ops = CGEN_INSN_OPERANDS (b->insn); int a_index; /* If at least one of the instructions takes no operands, then there is @@ -579,7 +581,7 @@ first_writes_to_seconds_operands (a, b, check_outputs) eg 'nop'. */ if (a_operands == NULL || b_ops == NULL) return 0; - + /* Scan the operand list of 'a' looking for an output operand. */ for (a_index = 0; a_operands->type != CGEN_OPINST_END; @@ -588,21 +590,21 @@ first_writes_to_seconds_operands (a, b, check_outputs) if (a_operands->type == CGEN_OPINST_OUTPUT) { int b_index; - const CGEN_OPINST * b_operands = b_ops; + const CGEN_OPINST *b_operands = b_ops; /* Special Case: The Condition bit 'C' is a shadow of the CBR register (control register 1) and also a shadow of bit 31 of the program status word (control register 0). For now this is handled here, rather - than by cgen.... */ - + than by cgen.... */ + if (OPERAND_IS_COND_BIT (a_operands, a->indices, a_index)) { /* Scan operand list of 'b' looking for another reference to the condition bit, which goes in the right direction. */ for (b_index = 0; b_operands->type != CGEN_OPINST_END; - b_index ++, b_operands ++) + b_index++, b_operands++) { if ((b_operands->type == (check_outputs @@ -619,14 +621,14 @@ first_writes_to_seconds_operands (a, b, check_outputs) right direction. */ for (b_index = 0; b_operands->type != CGEN_OPINST_END; - b_index ++, b_operands ++) + b_index++, b_operands++) { if ((b_operands->type == (check_outputs ? CGEN_OPINST_OUTPUT : CGEN_OPINST_INPUT)) && (b_operands->hw_type == a_operands->hw_type) - && (a->indices [a_index] == b->indices [b_index])) + && (a->indices[a_index] == b->indices[b_index])) return 1; } } @@ -640,11 +642,12 @@ first_writes_to_seconds_operands (a, b, check_outputs) static int writes_to_pc (a) - m32r_insn * a; + m32r_insn *a; { -#if 0 /* Once PC operands are working.... */ - const CGEN_OPINST * a_operands == CGEN_INSN_OPERANDS (gas_cgen_cpu_desc, - a->insn); +#if 0 + /* Once PC operands are working.... */ + const CGEN_OPINST *a_operands == CGEN_INSN_OPERANDS (gas_cgen_cpu_desc, + a->insn); if (a_operands == NULL) return 0; @@ -652,10 +655,11 @@ writes_to_pc (a) while (a_operands->type != CGEN_OPINST_END) { if (a_operands->operand != NULL - && CGEN_OPERAND_INDEX (gas_cgen_cpu_desc, a_operands->operand) == M32R_OPERAND_PC) + && CGEN_OPERAND_INDEX (gas_cgen_cpu_desc, + a_operands->operand) == M32R_OPERAND_PC) return 1; - - a_operands ++; + + a_operands++; } #else if (CGEN_INSN_ATTR_VALUE (a->insn, CGEN_INSN_UNCOND_CTI) @@ -665,40 +669,40 @@ writes_to_pc (a) return 0; } -/* Returns NULL if the two 16 bit insns can be executed in parallel, - otherwise it returns a pointer to an error message explaining why not. */ +/* Return NULL if the two 16 bit insns can be executed in parallel. + Otherwise return a pointer to an error message explaining why not. */ static const char * can_make_parallel (a, b) - m32r_insn * a; - m32r_insn * b; + m32r_insn *a; + m32r_insn *b; { PIPE_ATTR a_pipe; PIPE_ATTR b_pipe; - + /* Make sure the instructions are the right length. */ - if ( CGEN_FIELDS_BITSIZE (& a->fields) != 16 - || CGEN_FIELDS_BITSIZE (& b->fields) != 16) - abort(); + if (CGEN_FIELDS_BITSIZE (&a->fields) != 16 + || CGEN_FIELDS_BITSIZE (&b->fields) != 16) + abort (); if (first_writes_to_seconds_operands (a, b, true)) return _("Instructions write to the same destination register."); - + a_pipe = CGEN_INSN_ATTR_VALUE (a->insn, CGEN_INSN_PIPE); b_pipe = CGEN_INSN_ATTR_VALUE (b->insn, CGEN_INSN_PIPE); /* Make sure that the instructions use the correct execution pipelines. */ - if ( a_pipe == PIPE_NONE + if (a_pipe == PIPE_NONE || b_pipe == PIPE_NONE) return _("Instructions do not use parallel execution pipelines."); /* Leave this test for last, since it is the only test that can go away if the instructions are swapped, and we want to make sure that any other errors are detected before this happens. */ - if ( a_pipe == PIPE_S + if (a_pipe == PIPE_S || b_pipe == PIPE_O) return _("Instructions share the same execution pipeline"); - + return NULL; } @@ -711,7 +715,7 @@ make_parallel (buffer) #if CGEN_INT_INSN_P *buffer |= 0x8000; #else - buffer [CGEN_CPU_ENDIAN (gas_cgen_cpu_desc) == CGEN_ENDIAN_BIG ? 0 : 1] + buffer[CGEN_CPU_ENDIAN (gas_cgen_cpu_desc) == CGEN_ENDIAN_BIG ? 0 : 1] |= 0x80; #endif } @@ -722,7 +726,7 @@ static void target_make_parallel (buffer) char *buffer; { - buffer [CGEN_CPU_ENDIAN (gas_cgen_cpu_desc) == CGEN_ENDIAN_BIG ? 0 : 1] + buffer[CGEN_CPU_ENDIAN (gas_cgen_cpu_desc) == CGEN_ENDIAN_BIG ? 0 : 1] |= 0x80; } @@ -731,17 +735,18 @@ target_make_parallel (buffer) static void assemble_two_insns (str, str2, parallel_p) - char * str; - char * str2; - int parallel_p; + char *str; + char *str2; + int parallel_p; { - char * str3; + char *str3; m32r_insn first; m32r_insn second; - char * errmsg; - char save_str2 = *str2; + char *errmsg; + char save_str2 = *str2; - * str2 = 0; /* Seperate the two instructions. */ + /* Seperate the two instructions. */ + *str2 = 0; /* Make sure the two insns begin on a 32 bit boundary. This is also done for the serial case (foo -> bar), relaxing doesn't @@ -752,7 +757,7 @@ assemble_two_insns (str, str2, parallel_p) fill_insn (0); first.debug_sym_link = debug_sym_link; - debug_sym_link = (sym_linkS *)0; + debug_sym_link = (sym_linkS *) 0; /* Parse the first instruction. */ if (! (first.insn = m32r_cgen_assemble_insn @@ -765,44 +770,54 @@ assemble_two_insns (str, str2, parallel_p) /* Check it. */ if (CGEN_FIELDS_BITSIZE (&first.fields) != 16) { - /* xgettext:c-format */ + /* xgettext:c-format */ as_bad (_("not a 16 bit instruction '%s'"), str); return; } else if (! enable_special && CGEN_INSN_ATTR_VALUE (first.insn, CGEN_INSN_SPECIAL)) { - /* xgettext:c-format */ + /* xgettext:c-format */ as_bad (_("unknown instruction '%s'"), str); return; } else if (! enable_m32rx - /* FIXME: Need standard macro to perform this test. */ - && CGEN_INSN_ATTR_VALUE (first.insn, CGEN_INSN_MACH) == (1 << MACH_M32RX)) + /* FIXME: Need standard macro to perform this test. */ + && (CGEN_INSN_ATTR_VALUE (first.insn, CGEN_INSN_MACH) + == (1 << MACH_M32RX))) { - /* xgettext:c-format */ + /* xgettext:c-format */ as_bad (_("instruction '%s' is for the M32RX only"), str); return; } - + /* Check to see if this is an allowable parallel insn. */ - if (parallel_p && CGEN_INSN_ATTR_VALUE (first.insn, CGEN_INSN_PIPE) == PIPE_NONE) + if (parallel_p + && CGEN_INSN_ATTR_VALUE (first.insn, CGEN_INSN_PIPE) == PIPE_NONE) { - /* xgettext:c-format */ + /* xgettext:c-format */ as_bad (_("instruction '%s' cannot be executed in parallel."), str); return; } - - *str2 = save_str2; /* Restore the original assembly text, just in case it is needed. */ - str3 = str; /* Save the original string pointer. */ - str = str2 + 2; /* Advanced past the parsed string. */ - str2 = str3; /* Remember the entire string in case it is needed for error messages. */ + + /* Restore the original assembly text, just in case it is needed. */ + *str2 = save_str2; + + /* Save the original string pointer. */ + str3 = str; + + /* Advanced past the parsed string. */ + str = str2 + 2; + + /* Remember the entire string in case it is needed for error + messages. */ + str2 = str3; /* Convert the opcode to lower case. */ { char *s2 = str; - - while (isspace (*s2 ++)) + + while (isspace (*s2++)) continue; --s2; @@ -811,11 +826,12 @@ assemble_two_insns (str, str2, parallel_p) { if (isupper ((unsigned char) *s2)) *s2 = tolower (*s2); - s2 ++; + s2++; } } - - /* Preserve any fixups that have been generated and reset the list to empty. */ + + /* Preserve any fixups that have been generated and reset the list + to empty. */ gas_cgen_save_fixups (); /* Get the indices of the operands of the instruction. */ @@ -834,7 +850,7 @@ assemble_two_insns (str, str2, parallel_p) (gas_cgen_cpu_desc, NULL, INSN_VALUE (first.buffer), NULL, 16, first.indices, &tmp_fields); } - + if (first.insn == NULL) as_fatal (_("internal error: lookup/get operands failed")); @@ -851,39 +867,40 @@ assemble_two_insns (str, str2, parallel_p) /* Check it. */ if (CGEN_FIELDS_BITSIZE (&second.fields) != 16) { - /* xgettext:c-format */ + /* xgettext:c-format */ as_bad (_("not a 16 bit instruction '%s'"), str); return; } else if (! enable_special && CGEN_INSN_ATTR_VALUE (second.insn, CGEN_INSN_SPECIAL)) { - /* xgettext:c-format */ + /* xgettext:c-format */ as_bad (_("unknown instruction '%s'"), str); return; } else if (! enable_m32rx && CGEN_INSN_ATTR_VALUE (second.insn, CGEN_INSN_MACH) == (1 << MACH_M32RX)) { - /* xgettext:c-format */ + /* xgettext:c-format */ as_bad (_("instruction '%s' is for the M32RX only"), str); return; } /* Check to see if this is an allowable parallel insn. */ - if (parallel_p && CGEN_INSN_ATTR_VALUE (second.insn, CGEN_INSN_PIPE) == PIPE_NONE) + if (parallel_p + && CGEN_INSN_ATTR_VALUE (second.insn, CGEN_INSN_PIPE) == PIPE_NONE) { - /* xgettext:c-format */ + /* xgettext:c-format */ as_bad (_("instruction '%s' cannot be executed in parallel."), str); return; } - + if (parallel_p && ! enable_m32rx) { if (CGEN_INSN_NUM (first.insn) != M32R_INSN_NOP && CGEN_INSN_NUM (second.insn) != M32R_INSN_NOP) { - /* xgettext:c-format */ + /* xgettext:c-format */ as_bad (_("'%s': only the NOP instruction can be issued in parallel on the m32r"), str2); return; } @@ -897,7 +914,7 @@ assemble_two_insns (str, str2, parallel_p) (gas_cgen_cpu_desc, NULL, INSN_VALUE (second.buffer), NULL, 16, second.indices, &tmp_fields); } - + if (second.insn == NULL) as_fatal (_("internal error: lookup/get operands failed")); @@ -908,20 +925,20 @@ assemble_two_insns (str, str2, parallel_p) variable warn_explicit_parallel_conflicts is true then we do generate a warning message. Similarly we assume that parallel branch and jump instructions are deliberate and should not produce errors. */ - + if (parallel_p && warn_explicit_parallel_conflicts) { - if (first_writes_to_seconds_operands (& first, & second, false)) - /* xgettext:c-format */ + if (first_writes_to_seconds_operands (&first, &second, false)) + /* xgettext:c-format */ as_warn (_("%s: output of 1st instruction is the same as an input to 2nd instruction - is this intentional ?"), str2); - - if (first_writes_to_seconds_operands (& second, & first, false)) - /* xgettext:c-format */ + + if (first_writes_to_seconds_operands (&second, &first, false)) + /* xgettext:c-format */ as_warn (_("%s: output of 2nd instruction is the same as an input to 1st instruction - is this intentional ?"), str2); } - + if (!parallel_p - || (errmsg = (char *) can_make_parallel (& first, & second)) == NULL) + || (errmsg = (char *) can_make_parallel (&first, &second)) == NULL) { /* Get the fixups for the first instruction. */ gas_cgen_swap_fixups (); @@ -929,8 +946,8 @@ assemble_two_insns (str, str2, parallel_p) /* Write it out. */ expand_debug_syms (first.debug_sym_link, 1); gas_cgen_finish_insn (first.orig_insn, first.buffer, - CGEN_FIELDS_BITSIZE (& first.fields), 0, NULL); - + CGEN_FIELDS_BITSIZE (&first.fields), 0, NULL); + /* Force the top bit of the second insn to be set. */ if (parallel_p) make_parallel (second.buffer); @@ -941,16 +958,16 @@ assemble_two_insns (str, str2, parallel_p) /* Write it out. */ expand_debug_syms (second.debug_sym_link, 1); gas_cgen_finish_insn (second.orig_insn, second.buffer, - CGEN_FIELDS_BITSIZE (& second.fields), 0, NULL); + CGEN_FIELDS_BITSIZE (&second.fields), 0, NULL); } /* Try swapping the instructions to see if they work that way. */ - else if (can_make_parallel (& second, & first) == NULL) + else if (can_make_parallel (&second, &first) == NULL) { /* Write out the second instruction first. */ expand_debug_syms (second.debug_sym_link, 1); gas_cgen_finish_insn (second.orig_insn, second.buffer, - CGEN_FIELDS_BITSIZE (& second.fields), 0, NULL); - + CGEN_FIELDS_BITSIZE (&second.fields), 0, NULL); + /* Force the top bit of the first instruction to be set. */ make_parallel (first.buffer); @@ -960,14 +977,14 @@ assemble_two_insns (str, str2, parallel_p) /* Write out the first instruction. */ expand_debug_syms (first.debug_sym_link, 1); gas_cgen_finish_insn (first.orig_insn, first.buffer, - CGEN_FIELDS_BITSIZE (& first.fields), 0, NULL); + CGEN_FIELDS_BITSIZE (&first.fields), 0, NULL); } else { as_bad ("'%s': %s", str2, errmsg); return; } - + /* Set these so m32r_fill_insn can use them. */ prev_seg = now_seg; prev_subseg = now_subseg; @@ -975,11 +992,11 @@ assemble_two_insns (str, str2, parallel_p) void md_assemble (str) - char * str; + char *str; { m32r_insn insn; - char * errmsg; - char * str2 = NULL; + char *errmsg; + char *str2 = NULL; /* Initialize GAS's cgen interface for a new instruction. */ gas_cgen_init_parse (); @@ -997,13 +1014,13 @@ md_assemble (str) assemble_two_insns (str, str2, 0); return; } - + insn.debug_sym_link = debug_sym_link; - debug_sym_link = (sym_linkS *)0; + debug_sym_link = (sym_linkS *) 0; insn.insn = m32r_cgen_assemble_insn - (gas_cgen_cpu_desc, str, & insn.fields, insn.buffer, & errmsg); - + (gas_cgen_cpu_desc, str, &insn.fields, insn.buffer, & errmsg); + if (!insn.insn) { as_bad (errmsg); @@ -1013,18 +1030,18 @@ md_assemble (str) if (! enable_special && CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_SPECIAL)) { - /* xgettext:c-format */ + /* xgettext:c-format */ as_bad (_("unknown instruction '%s'"), str); return; } else if (! enable_m32rx && CGEN_INSN_ATTR_VALUE (insn.insn, CGEN_INSN_MACH) == (1 << MACH_M32RX)) { - /* xgettext:c-format */ + /* xgettext:c-format */ as_bad (_("instruction '%s' is for the M32RX only"), str); return; } - + if (CGEN_INSN_BITSIZE (insn.insn) == 32) { /* 32 bit insns must live on 32 bit boundaries. */ @@ -1040,7 +1057,7 @@ md_assemble (str) /* Doesn't really matter what we pass for RELAX_P here. */ gas_cgen_finish_insn (insn.insn, insn.buffer, - CGEN_FIELDS_BITSIZE (& insn.fields), 1, NULL); + CGEN_FIELDS_BITSIZE (&insn.fields), 1, NULL); } else { @@ -1048,7 +1065,7 @@ md_assemble (str) int swap = false; if (CGEN_INSN_BITSIZE (insn.insn) != 16) - abort(); + abort (); insn.orig_insn = insn.insn; @@ -1058,7 +1075,7 @@ md_assemble (str) boundary. */ if (prev_insn.insn && seen_relaxable_p && optimize) fill_insn (0); - + if (enable_m32rx) { /* Get the indices of the operands of the instruction. @@ -1069,7 +1086,7 @@ md_assemble (str) (gas_cgen_cpu_desc, NULL, INSN_VALUE (insn.buffer), NULL, 16, insn.indices, &tmp_fields); } - + if (insn.insn == NULL) as_fatal (_("internal error: lookup/get operands failed")); } @@ -1088,17 +1105,16 @@ md_assemble (str) input to the current instruction then it cannot be combined. Otherwise call can_make_parallel() with both orderings of the instructions to see if they can be combined. */ - if ( ! on_32bit_boundary_p - && enable_m32rx - && optimize - && CGEN_INSN_ATTR_VALUE (insn.orig_insn, CGEN_INSN_RELAXABLE) == 0 - && ! writes_to_pc (& prev_insn) - && ! first_writes_to_seconds_operands (& prev_insn, &insn, false) - ) + if (! on_32bit_boundary_p + && enable_m32rx + && optimize + && CGEN_INSN_ATTR_VALUE (insn.orig_insn, CGEN_INSN_RELAXABLE) == 0 + && ! writes_to_pc (&prev_insn) + && ! first_writes_to_seconds_operands (&prev_insn, &insn, false)) { - if (can_make_parallel (& prev_insn, & insn) == NULL) + if (can_make_parallel (&prev_insn, &insn) == NULL) make_parallel (insn.buffer); - else if (can_make_parallel (& insn, & prev_insn) == NULL) + else if (can_make_parallel (&insn, &prev_insn) == NULL) swap = true; } @@ -1112,8 +1128,8 @@ md_assemble (str) frag_grow (4); gas_cgen_finish_insn (insn.orig_insn, insn.buffer, - CGEN_FIELDS_BITSIZE (& insn.fields), - 1 /*relax_p*/, &fi); + CGEN_FIELDS_BITSIZE (&insn.fields), + 1 /* relax_p */, &fi); insn.addr = fi.addr; insn.frag = fi.frag; insn.num_fixups = fi.num_fixups; @@ -1123,13 +1139,13 @@ md_assemble (str) if (swap) { - int i,tmp; + int i, tmp; #define SWAP_BYTES(a,b) tmp = a; a = b; b = tmp /* Swap the two insns */ - SWAP_BYTES (prev_insn.addr [0], insn.addr [0]); - SWAP_BYTES (prev_insn.addr [1], insn.addr [1]); + SWAP_BYTES (prev_insn.addr[0], insn.addr[0]); + SWAP_BYTES (prev_insn.addr[1], insn.addr[1]); target_make_parallel (insn.addr); @@ -1155,7 +1171,7 @@ md_assemble (str) prev_insn = insn; else prev_insn.insn = NULL; - + /* If the insn needs the following one to be on a 32 bit boundary (e.g. subroutine calls), fill this insn's slot. */ if (on_32bit_boundary_p @@ -1177,20 +1193,20 @@ md_assemble (str) /* The syntax in the manual says constants begin with '#'. We just ignore it. */ -void +void md_operand (expressionP) - expressionS * expressionP; + expressionS *expressionP; { - if (* input_line_pointer == '#') + if (*input_line_pointer == '#') { - input_line_pointer ++; + input_line_pointer++; expression (expressionP); } } valueT md_section_align (segment, size) - segT segment; + segT segment; valueT size; { int align = bfd_get_section_alignment (stdoutput, segment); @@ -1199,7 +1215,7 @@ md_section_align (segment, size) symbolS * md_undefined_symbol (name) - char * name; + char *name; { return 0; } @@ -1207,51 +1223,52 @@ md_undefined_symbol (name) /* .scomm pseudo-op handler. This is a new pseudo-op to handle putting objects in .scommon. - By doing this the linker won't need to do any work and more importantly - it removes the implicit -G arg necessary to correctly link the object file. -*/ + By doing this the linker won't need to do any work, + and more importantly it removes the implicit -G arg necessary to + correctly link the object file. */ static void m32r_scomm (ignore) int ignore; { - register char * name; - register char c; - register char * p; - offsetT size; - register symbolS * symbolP; - offsetT align; - int align2; + register char *name; + register char c; + register char *p; + offsetT size; + register symbolS *symbolP; + offsetT align; + int align2; 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; + *p = c; SKIP_WHITESPACE (); - if (* input_line_pointer != ',') + if (*input_line_pointer != ',') { as_bad (_("Expected comma after symbol-name: rest of line ignored.")); ignore_rest_of_line (); return; } - input_line_pointer ++; /* skip ',' */ + /* Skip ','. */ + input_line_pointer++; if ((size = get_absolute_expression ()) < 0) { - /* xgettext:c-format */ + /* xgettext:c-format */ as_warn (_(".SCOMMon length (%ld.) <0! Ignored."), (long) size); ignore_rest_of_line (); return; } /* The third argument to .scomm is the alignment. */ - if (* input_line_pointer != ',') + if (*input_line_pointer != ',') align = 8; else { - ++ input_line_pointer; + ++input_line_pointer; align = get_absolute_expression (); if (align <= 0) { @@ -1259,10 +1276,11 @@ m32r_scomm (ignore) align = 8; } } + /* Convert to a power of 2 alignment. */ if (align) { - for (align2 = 0; (align & 1) == 0; align >>= 1, ++ align2) + for (align2 = 0; (align & 1) == 0; align >>= 1, ++align2) continue; if (align != 1) { @@ -1274,13 +1292,13 @@ m32r_scomm (ignore) else align2 = 0; - * p = 0; + *p = 0; symbolP = symbol_find_or_make (name); - * p = c; + *p = c; if (S_IS_DEFINED (symbolP)) { - /* xgettext:c-format */ + /* xgettext:c-format */ as_bad (_("Ignoring attempt to re-define symbol `%s'."), S_GET_NAME (symbolP)); ignore_rest_of_line (); @@ -1289,7 +1307,7 @@ m32r_scomm (ignore) if (S_GET_VALUE (symbolP) && S_GET_VALUE (symbolP) != (valueT) size) { - /* xgettext:c-format */ + /* xgettext:c-format */ as_bad (_("Length of .scomm \"%s\" is already %ld. Not changed to %ld."), S_GET_NAME (symbolP), (long) S_GET_VALUE (symbolP), @@ -1301,24 +1319,24 @@ m32r_scomm (ignore) if (symbol_get_obj (symbolP)->local) { - segT old_sec = now_seg; - int old_subsec = now_subseg; - char * pfrag; + segT old_sec = now_seg; + int old_subsec = now_subseg; + char *pfrag; record_alignment (sbss_section, align2); subseg_set (sbss_section, 0); - + if (align2) frag_align (align2, 0, 0); - + if (S_GET_SEGMENT (symbolP) == sbss_section) symbol_get_frag (symbolP)->fr_symbol = 0; - + symbol_set_frag (symbolP, frag_now); - + pfrag = frag_var (rs_org, 1, 1, (relax_substateT) 0, symbolP, size, (char *) 0); - * pfrag = 0; + *pfrag = 0; S_SET_SIZE (symbolP, size); S_SET_SEGMENT (symbolP, sbss_section); S_CLEAR_EXTERNAL (symbolP); @@ -1329,7 +1347,7 @@ m32r_scomm (ignore) S_SET_VALUE (symbolP, (valueT) size); S_SET_ALIGN (symbolP, align2); S_SET_EXTERNAL (symbolP); - S_SET_SEGMENT (symbolP, & scom_section); + S_SET_SEGMENT (symbolP, &scom_section); } demand_empty_rest_of_line (); @@ -1367,8 +1385,8 @@ const relax_typeS md_relax_table[] = long m32r_relax_frag (fragP, stretch) - fragS * fragP; - long stretch; + fragS *fragP; + long stretch; { /* Address of branch insn. */ long address = fragP->fr_address + fragP->fr_fix - 2; @@ -1414,15 +1432,15 @@ m32r_relax_frag (fragP, stretch) Any symbol that is now undefined will not become defined. The guess for fr_var is ACTUALLY the growth beyond fr_fix. Whatever we do to grow fr_fix or fr_var contributes to our returned value. - Although it may not be explicit in the frag, pretend fr_var starts with a - 0 value. */ + Although it may not be explicit in the frag, pretend fr_var starts + with a 0 value. */ int md_estimate_size_before_relax (fragP, segment) - fragS * fragP; - segT segment; + fragS *fragP; + segT segment; { - int old_fr_fix = fragP->fr_fix; + int old_fr_fix = fragP->fr_fix; /* The only thing we have to handle here are symbols outside of the current segment. They may be undefined or in a different segment in @@ -1437,7 +1455,8 @@ md_estimate_size_before_relax (fragP, segment) all further handling to md_convert_frag. */ fragP->fr_subtype = 2; -#if 0 /* Can't use this, but leave in for illustration. */ +#if 0 + /* Can't use this, but leave in for illustration. */ /* Change 16 bit insn to 32 bit insn. */ fragP->fr_opcode[0] |= 0x80; @@ -1447,7 +1466,7 @@ md_estimate_size_before_relax (fragP, segment) /* Create a relocation for it. */ fix_new (fragP, old_fr_fix, 4, fragP->fr_symbol, - fragP->fr_offset, 1 /* pcrel */, + fragP->fr_offset, 1 /* pcrel */, /* FIXME: Can't use a real BFD reloc here. gas_cgen_md_apply_fix3 can't handle it. */ BFD_RELOC_M32R_26_PCREL); @@ -1456,8 +1475,8 @@ md_estimate_size_before_relax (fragP, segment) frag_wane (fragP); #else { - const CGEN_INSN * insn; - int i; + const CGEN_INSN *insn; + int i; /* Update the recorded insn. Fortunately we don't have to look very far. @@ -1481,9 +1500,9 @@ md_estimate_size_before_relax (fragP, segment) } return (fragP->fr_var + fragP->fr_fix - old_fr_fix); -} +} -/* *fragP has been relaxed to its final size, and now needs to have +/* *FRAGP has been relaxed to its final size, and now needs to have the bytes inside it modified to conform to the new size. Called after relaxation is finished. @@ -1492,16 +1511,16 @@ md_estimate_size_before_relax (fragP, segment) void md_convert_frag (abfd, sec, fragP) - bfd * abfd; - segT sec; - fragS * fragP; + bfd *abfd; + segT sec; + fragS *fragP; { - char * opcode; - char * displacement; - int target_address; - int opcode_address; - int extension; - int addend; + char *opcode; + char *displacement; + int target_address; + int opcode_address; + int extension; + int addend; opcode = fragP->fr_opcode; @@ -1510,29 +1529,29 @@ md_convert_frag (abfd, sec, fragP) switch (fragP->fr_subtype) { - case 1 : + case 1: extension = 0; - displacement = & opcode[1]; + displacement = &opcode[1]; break; - case 2 : + case 2: opcode[0] |= 0x80; extension = 2; - displacement = & opcode[1]; + displacement = &opcode[1]; break; - case 3 : + case 3: opcode[2] = opcode[0] | 0x80; md_number_to_chars (opcode, PAR_NOP_INSN, 2); opcode_address += 2; extension = 4; - displacement = & opcode[3]; + displacement = &opcode[3]; break; - default : + default: abort (); } if (S_GET_SEGMENT (fragP->fr_symbol) != sec) { - /* symbol must be resolved by linker */ + /* Symbol must be resolved by linker. */ if (fragP->fr_offset & 3) as_warn (_("Addend to unresolved symbol not on word boundary.")); addend = fragP->fr_offset >> 2; @@ -1556,8 +1575,8 @@ md_convert_frag (abfd, sec, fragP) /* Offset of branch insn in frag. */ fragP->fr_fix + extension - 4, fragP->fr_cgen.insn, - 4 /*length*/, - /* FIXME: quick hack */ + 4 /* Length. */, + /* FIXME: quick hack. */ #if 0 cgen_operand_lookup_by_num (gas_cgen_cpu_desc, fragP->fr_cgen.opindex), @@ -1584,8 +1603,8 @@ md_convert_frag (abfd, sec, fragP) long md_pcrel_from_section (fixP, sec) - fixS * fixP; - segT sec; + fixS *fixP; + segT sec; { if (fixP->fx_addsy != (symbolS *) NULL && (! S_IS_DEFINED (fixP->fx_addsy) @@ -1605,24 +1624,25 @@ md_pcrel_from_section (fixP, sec) bfd_reloc_code_real_type md_cgen_lookup_reloc (insn, operand, fixP) - const CGEN_INSN * insn; - const CGEN_OPERAND * operand; - fixS * fixP; + const CGEN_INSN *insn; + const CGEN_OPERAND *operand; + fixS *fixP; { switch (operand->type) { - case M32R_OPERAND_DISP8 : return BFD_RELOC_M32R_10_PCREL; - case M32R_OPERAND_DISP16 : return BFD_RELOC_M32R_18_PCREL; - case M32R_OPERAND_DISP24 : return BFD_RELOC_M32R_26_PCREL; - case M32R_OPERAND_UIMM24 : return BFD_RELOC_M32R_24; - case M32R_OPERAND_HI16 : - case M32R_OPERAND_SLO16 : - case M32R_OPERAND_ULO16 : + case M32R_OPERAND_DISP8: return BFD_RELOC_M32R_10_PCREL; + case M32R_OPERAND_DISP16: return BFD_RELOC_M32R_18_PCREL; + case M32R_OPERAND_DISP24: return BFD_RELOC_M32R_26_PCREL; + case M32R_OPERAND_UIMM24: return BFD_RELOC_M32R_24; + case M32R_OPERAND_HI16: + case M32R_OPERAND_SLO16: + case M32R_OPERAND_ULO16: /* If low/high/shigh/sda was used, it is recorded in `opinfo'. */ if (fixP->fx_cgen.opinfo != 0) return fixP->fx_cgen.opinfo; break; - default : /* avoid -Wall warning */ + default: + /* Avoid -Wall warning. */ break; } return BFD_RELOC_NONE; @@ -1632,11 +1652,11 @@ md_cgen_lookup_reloc (insn, operand, fixP) static void m32r_record_hi16 (reloc_type, fixP, seg) - int reloc_type; - fixS * fixP; - segT seg; + int reloc_type; + fixS *fixP; + segT seg; { - struct m32r_hi_fixup * hi_fixup; + struct m32r_hi_fixup *hi_fixup; assert (reloc_type == BFD_RELOC_M32R_HI16_SLO || reloc_type == BFD_RELOC_M32R_HI16_ULO); @@ -1646,7 +1666,7 @@ m32r_record_hi16 (reloc_type, fixP, seg) hi_fixup->fixp = fixP; hi_fixup->seg = now_seg; hi_fixup->next = m32r_hi_fixup_list; - + m32r_hi_fixup_list = hi_fixup; } @@ -1655,26 +1675,27 @@ m32r_record_hi16 (reloc_type, fixP, seg) fixS * m32r_cgen_record_fixup_exp (frag, where, insn, length, operand, opinfo, exp) - fragS * frag; - int where; - const CGEN_INSN * insn; - int length; - const CGEN_OPERAND * operand; - int opinfo; - expressionS * exp; + fragS *frag; + int where; + const CGEN_INSN *insn; + int length; + const CGEN_OPERAND *operand; + int opinfo; + expressionS *exp; { - fixS * fixP = gas_cgen_record_fixup_exp (frag, where, insn, length, - operand, opinfo, exp); + fixS *fixP = gas_cgen_record_fixup_exp (frag, where, insn, length, + operand, opinfo, exp); switch (operand->type) { - case M32R_OPERAND_HI16 : + case M32R_OPERAND_HI16: /* If low/high/shigh/sda was used, it is recorded in `opinfo'. */ if (fixP->fx_cgen.opinfo == BFD_RELOC_M32R_HI16_SLO || fixP->fx_cgen.opinfo == BFD_RELOC_M32R_HI16_ULO) m32r_record_hi16 (fixP->fx_cgen.opinfo, fixP, now_seg); break; - default : /* avoid -Wall warning */ + default: + /* Avoid -Wall warning */ break; } @@ -1693,12 +1714,12 @@ m32r_cgen_record_fixup_exp (frag, where, insn, length, operand, opinfo, exp) void m32r_frob_file () { - struct m32r_hi_fixup * l; + struct m32r_hi_fixup *l; for (l = m32r_hi_fixup_list; l != NULL; l = l->next) { - segment_info_type * seginfo; - int pass; + segment_info_type *seginfo; + int pass; assert (FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_M32R_HI16_SLO || FX_OPINFO_R_TYPE (l->fixp) == BFD_RELOC_M32R_HI16_ULO); @@ -1718,8 +1739,8 @@ m32r_frob_file () seginfo = seg_info (l->seg); for (pass = 0; pass < 2; pass++) { - fixS * f; - fixS * prev; + fixS *f; + fixS *prev; prev = NULL; for (f = seginfo->fix_root; f != NULL; f = f->fx_next) @@ -1733,17 +1754,17 @@ m32r_frob_file () || (FX_OPINFO_R_TYPE (prev) != BFD_RELOC_M32R_HI16_SLO && FX_OPINFO_R_TYPE (prev) != BFD_RELOC_M32R_HI16_ULO) || prev->fx_addsy != f->fx_addsy - || prev->fx_offset != f->fx_offset)) + || prev->fx_offset != f->fx_offset)) { - fixS ** pf; + fixS **pf; /* Move l->fixp before f. */ for (pf = &seginfo->fix_root; - * pf != l->fixp; - pf = & (* pf)->fx_next) - assert (* pf != NULL); + *pf != l->fixp; + pf = & (*pf)->fx_next) + assert (*pf != NULL); - * pf = l->fixp->fx_next; + *pf = l->fixp->fx_next; l->fixp->fx_next = f; if (prev == NULL) @@ -1774,7 +1795,7 @@ m32r_frob_file () int m32r_force_relocation (fix) - fixS * fix; + fixS *fix; { if (fix->fx_r_type == BFD_RELOC_VTABLE_INHERIT || fix->fx_r_type == BFD_RELOC_VTABLE_ENTRY) @@ -1783,17 +1804,16 @@ m32r_force_relocation (fix) if (! m32r_relax) return 0; - return (fix->fx_pcrel - || 0 /* ??? */); + return fix->fx_pcrel; } /* Write a value out to the object file, using the appropriate endianness. */ void md_number_to_chars (buf, val, n) - char * buf; + char *buf; valueT val; - int n; + int n; { if (target_big_endian) number_to_chars_bigendian (buf, val, n); @@ -1801,12 +1821,12 @@ md_number_to_chars (buf, val, n) number_to_chars_littleendian (buf, val, n); } -/* Turn a string in input_line_pointer into a floating point constant of type - type, and store the appropriate bytes in *litP. The number of LITTLENUMS - emitted is stored in *sizeP . An error message is returned, or NULL on OK. -*/ +/* Turn a string in input_line_pointer into a floating point constant + of type TYPE, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. An error message is + returned, or NULL on OK. */ -/* Equal to MAX_PRECISION in atof-ieee.c */ +/* Equal to MAX_PRECISION in atof-ieee.c. */ #define MAX_LITTLENUMS 6 char * @@ -1815,11 +1835,11 @@ md_atof (type, litP, sizeP) char *litP; int *sizeP; { - int i; - int prec; - LITTLENUM_TYPE words [MAX_LITTLENUMS]; - char * t; - char * atof_ieee (); + int i; + int prec; + LITTLENUM_TYPE words[MAX_LITTLENUMS]; + char *t; + char *atof_ieee (); switch (type) { @@ -1837,17 +1857,18 @@ md_atof (type, litP, sizeP) prec = 4; break; - /* FIXME: Some targets allow other format chars for bigger sizes here. */ + /* FIXME: Some targets allow other format chars for bigger sizes + here. */ default: - * sizeP = 0; + *sizeP = 0; return _("Bad call to md_atof()"); } t = atof_ieee (input_line_pointer, type, words); if (t) input_line_pointer = t; - * sizeP = prec * sizeof (LITTLENUM_TYPE); + *sizeP = prec * sizeof (LITTLENUM_TYPE); if (target_big_endian) { @@ -1867,7 +1888,7 @@ md_atof (type, litP, sizeP) litP += sizeof (LITTLENUM_TYPE); } } - + return 0; } @@ -1877,23 +1898,27 @@ m32r_elf_section_change_hook () /* If we have reached the end of a section and we have just emitted a 16 bit insn, then emit a nop to make sure that the section ends on a 32 bit boundary. */ - + if (prev_insn.insn || seen_relaxable_p) (void) m32r_fill_insn (0); } +/* Return true if can adjust the reloc to be relative to its section + (such as .data) instead of relative to some symbol. */ + boolean m32r_fix_adjustable (fixP) fixS *fixP; { bfd_reloc_code_real_type reloc_type; - + if ((int) fixP->fx_r_type >= (int) BFD_RELOC_UNUSED) { const CGEN_INSN *insn = NULL; int opindex = (int) fixP->fx_r_type - (int) BFD_RELOC_UNUSED; - const CGEN_OPERAND *operand = cgen_operand_lookup_by_num(gas_cgen_cpu_desc, opindex); + const CGEN_OPERAND *operand = + cgen_operand_lookup_by_num(gas_cgen_cpu_desc, opindex); reloc_type = md_cgen_lookup_reloc (insn, operand, fixP); } else @@ -1901,14 +1926,14 @@ m32r_fix_adjustable (fixP) if (fixP->fx_addsy == NULL) return 1; - - /* Prevent all adjustments to global symbols. */ + + /* Prevent all adjustments to global symbols. */ if (S_IS_EXTERN (fixP->fx_addsy)) return 0; if (S_IS_WEAK (fixP->fx_addsy)) return 0; - - /* We need the symbol name for the VTABLE entries */ + + /* We need the symbol name for the VTABLE entries. */ if (reloc_type == BFD_RELOC_VTABLE_INHERIT || reloc_type == BFD_RELOC_VTABLE_ENTRY) return 0; diff --git a/gnu/dist/toolchain/gas/config/tc-m32r.h b/gnu/dist/toolchain/gas/config/tc-m32r.h index ebcfca1c3f6c..9e04c19158ce 100644 --- a/gnu/dist/toolchain/gas/config/tc-m32r.h +++ b/gnu/dist/toolchain/gas/config/tc-m32r.h @@ -1,5 +1,5 @@ /* tc-m32r.h -- Header file for tc-m32r.c. - Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -16,7 +16,7 @@ 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. */ + Boston, MA 02111-1307, USA. */ #define TC_M32R @@ -36,7 +36,7 @@ /* call md_pcrel_from_section, not md_pcrel_from */ long md_pcrel_from_section PARAMS ((struct fix *, segT)); -#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section(FIXP, SEC) +#define MD_PCREL_FROM_SECTION(FIXP, SEC) md_pcrel_from_section(FIXP, SEC) /* Permit temporary numeric labels. */ #define LOCAL_LABELS_FB 1 @@ -61,11 +61,11 @@ m32r_relax_frag (fragP, stretch) /* Account for nop if 32 bit insn falls on odd halfword boundary. */ #define TC_CGEN_MAX_RELAX(insn, len) (6) -/* Alignments are used to ensure 32 bit insns live on 32 bit boundaries, so - we use a special alignment function to insert the correct nop pattern. */ -extern int m32r_do_align PARAMS ((int, const char *, int, int)); -#define md_do_align(n, fill, len, max, l) \ -if (m32r_do_align (n, fill, len, max)) goto l +/* Fill in rs_align_code fragments. */ +extern void m32r_handle_align PARAMS ((fragS *)); +#define HANDLE_ALIGN(f) m32r_handle_align (f) + +#define MAX_MEM_FOR_RS_ALIGN_CODE (1 + 2 + 4) #define MD_APPLY_FIX3 #define md_apply_fix3 gas_cgen_md_apply_fix3 @@ -99,4 +99,4 @@ int m32r_fill_insn PARAMS ((int)); #define md_cleanup m32r_elf_section_change_hook #define md_elf_section_change_hook m32r_elf_section_change_hook -extern void m32r_elf_section_change_hook (); +extern void m32r_elf_section_change_hook (); diff --git a/gnu/dist/toolchain/gas/config/tc-m68851.h b/gnu/dist/toolchain/gas/config/tc-m68851.h index 0f6d74133752..398e1d2d050f 100644 --- a/gnu/dist/toolchain/gas/config/tc-m68851.h +++ b/gnu/dist/toolchain/gas/config/tc-m68851.h @@ -1,22 +1,23 @@ /* This file is tc-m68851.h - Copyright (C) 1987-1992 Free Software Foundation, Inc. - + Copyright (C) 1987-1992, 2000 Free Software Foundation, Inc. + This file is part of GAS, the GNU Assembler. - + GAS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. - + GAS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with GAS; see the file COPYING. If not, write to - the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + 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. */ /* * pmmu.h @@ -26,16 +27,16 @@ to us as part of the changes for the m68851 Memory Management Unit */ /* Copyright (C) 1987 Free Software Foundation, Inc. - + This file is part of Gas, the GNU Assembler. - + The GNU assembler is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. No author or distributor accepts responsibility to anyone for the consequences of using it or for whether it serves any particular purpose or works at all, unless he says so in writing. Refer to the GNU Assembler General Public License for full details. - + Everyone is granted permission to copy, modify and redistribute the GNU Assembler, but only under the conditions described in the GNU Assembler General Public License. A copy of this license is @@ -47,10 +48,10 @@ #ifdef m68851 /* - I didn't use much imagination in choosing the + I didn't use much imagination in choosing the following codes, so many of them aren't very mnemonic. -rab - + P pmmu register Possible values: 000 TC Translation Control reg @@ -58,28 +59,28 @@ 101 VAL Validate Access Level 110 SCC Stack Change Control 111 AC Access Control - + W wide pmmu registers Possible values: 001 DRP Dma Root Pointer 010 SRP Supervisor Root Pointer 011 CRP Cpu Root Pointer - + f function code register 0 SFC 1 DFC - + V VAL register only - + X BADx, BACx 100 BAD Breakpoint Acknowledge Data 101 BAC Breakpoint Acknowledge Control - + Y PSR Z PCSR - + | memory (modes 2-6, 7.*) - + */ /* @@ -136,8 +137,7 @@ {"pbwcw", one(0xf089), one(0xffbf), "Bc"}, {"pbws", one(0xf0c8), one(0xffbf), "Bc"}, {"pbwsw", one(0xf088), one(0xffbf), "Bc"}, - - + {"pdbac", two(0xf048, 0x0007), two(0xfff8, 0xffff), "DsBw"}, {"pdbas", two(0xf048, 0x0006), two(0xfff8, 0xffff), "DsBw"}, {"pdbbc", two(0xf048, 0x0001), two(0xfff8, 0xffff), "DsBw"}, @@ -154,53 +154,53 @@ {"pdbss", two(0xf048, 0x0004), two(0xfff8, 0xffff), "DsBw"}, {"pdbwc", two(0xf048, 0x0009), two(0xfff8, 0xffff), "DsBw"}, {"pdbws", two(0xf048, 0x0008), two(0xfff8, 0xffff), "DsBw"}, - + {"pflusha", two(0xf000, 0x2400), two(0xffff, 0xffff), "" }, - + {"pflush", two(0xf000, 0x3010), two(0xffc0, 0xfe10), "T3T9" }, {"pflush", two(0xf000, 0x3810), two(0xffc0, 0xfe10), "T3T9&s" }, {"pflush", two(0xf000, 0x3008), two(0xffc0, 0xfe18), "D3T9" }, {"pflush", two(0xf000, 0x3808), two(0xffc0, 0xfe18), "D3T9&s" }, {"pflush", two(0xf000, 0x3000), two(0xffc0, 0xfe1e), "f3T9" }, {"pflush", two(0xf000, 0x3800), two(0xffc0, 0xfe1e), "f3T9&s" }, - + {"pflushs", two(0xf000, 0x3410), two(0xfff8, 0xfe10), "T3T9" }, {"pflushs", two(0xf000, 0x3c00), two(0xfff8, 0xfe00), "T3T9&s" }, {"pflushs", two(0xf000, 0x3408), two(0xfff8, 0xfe18), "D3T9" }, {"pflushs", two(0xf000, 0x3c08), two(0xfff8, 0xfe18), "D3T9&s" }, {"pflushs", two(0xf000, 0x3400), two(0xfff8, 0xfe1e), "f3T9" }, {"pflushs", two(0xf000, 0x3c00), two(0xfff8, 0xfe1e), "f3T9&s"}, - + {"pflushr", two(0xf000, 0xa000), two(0xffc0, 0xffff), "|s" }, - + {"ploadr", two(0xf000, 0x2210), two(0xffc0, 0xfff0), "T3&s" }, {"ploadr", two(0xf000, 0x2208), two(0xffc0, 0xfff8), "D3&s" }, {"ploadr", two(0xf000, 0x2200), two(0xffc0, 0xfffe), "f3&s" }, {"ploadw", two(0xf000, 0x2010), two(0xffc0, 0xfff0), "T3&s" }, {"ploadw", two(0xf000, 0x2008), two(0xffc0, 0xfff8), "D3&s" }, {"ploadw", two(0xf000, 0x2000), two(0xffc0, 0xfffe), "f3&s" }, - + /* TC, CRP, DRP, SRP, CAL, VAL, SCC, AC */ {"pmove", two(0xf000, 0x4000), two(0xffc0, 0xe3ff), "*sP8" }, {"pmove", two(0xf000, 0x4200), two(0xffc0, 0xe3ff), "P8%s" }, {"pmove", two(0xf000, 0x4000), two(0xffc0, 0xe3ff), "|sW8" }, {"pmove", two(0xf000, 0x4200), two(0xffc0, 0xe3ff), "W8~s" }, - + /* BADx, BACx */ {"pmove", two(0xf000, 0x6200), two(0xffc0, 0xe3e3), "*sX3" }, {"pmove", two(0xf000, 0x6000), two(0xffc0, 0xe3e3), "X3%s" }, - + /* PSR, PCSR */ /* {"pmove", two(0xf000, 0x6100), two(oxffc0, oxffff), "*sZ8" }, */ {"pmove", two(0xf000, 0x6000), two(0xffc0, 0xffff), "*sY8" }, {"pmove", two(0xf000, 0x6200), two(0xffc0, 0xffff), "Y8%s" }, {"pmove", two(0xf000, 0x6600), two(0xffc0, 0xffff), "Z8%s" }, - + {"prestore", one(0xf140), one(0xffc0), "&s"}, {"prestore", one(0xf158), one(0xfff8), "+s"}, {"psave", one(0xf100), one(0xffc0), "&s"}, {"psave", one(0xf100), one(0xffc0), "+s"}, - + {"psac", two(0xf040, 0x0007), two(0xffc0, 0xffff), "@s"}, {"psas", two(0xf040, 0x0006), two(0xffc0, 0xffff), "@s"}, {"psbc", two(0xf040, 0x0001), two(0xffc0, 0xffff), "@s"}, @@ -217,88 +217,86 @@ {"psss", two(0xf040, 0x0004), two(0xffc0, 0xffff), "@s"}, {"pswc", two(0xf040, 0x0009), two(0xffc0, 0xffff), "@s"}, {"psws", two(0xf040, 0x0008), two(0xffc0, 0xffff), "@s"}, - + {"ptestr", two(0xf000, 0x8210), two(0xffc0, 0xe3f0), "T3&sQ8" }, {"ptestr", two(0xf000, 0x8310), two(0xffc0, 0xe310), "T3&sQ8A9" }, {"ptestr", two(0xf000, 0x8208), two(0xffc0, 0xe3f8), "D3&sQ8" }, {"ptestr", two(0xf000, 0x8308), two(0xffc0, 0xe318), "D3&sQ8A9" }, {"ptestr", two(0xf000, 0x8200), two(0xffc0, 0xe3fe), "f3&sQ8" }, {"ptestr", two(0xf000, 0x8300), two(0xffc0, 0xe31e), "f3&sQ8A9" }, - + {"ptestw", two(0xf000, 0x8010), two(0xffc0, 0xe3f0), "T3&sQ8" }, {"ptestw", two(0xf000, 0x8110), two(0xffc0, 0xe310), "T3&sQ8A9" }, {"ptestw", two(0xf000, 0x8008), two(0xffc0, 0xe3f8), "D3&sQ8" }, {"ptestw", two(0xf000, 0x8108), two(0xffc0, 0xe318), "D3&sQ8A9" }, {"ptestw", two(0xf000, 0x8000), two(0xffc0, 0xe3fe), "f3&sQ8" }, {"ptestw", two(0xf000, 0x8100), two(0xffc0, 0xe31e), "f3&sQ8A9" }, - + {"ptrapacw", two(0xf07a, 0x0007), two(0xffff, 0xffff), "#w"}, {"ptrapacl", two(0xf07b, 0x0007), two(0xffff, 0xffff), "#l"}, {"ptrapac", two(0xf07c, 0x0007), two(0xffff, 0xffff), ""}, - + {"ptrapasw", two(0xf07a, 0x0006), two(0xffff, 0xffff), "#w"}, {"ptrapasl", two(0xf07b, 0x0006), two(0xffff, 0xffff), "#l"}, {"ptrapas", two(0xf07c, 0x0006), two(0xffff, 0xffff), ""}, - + {"ptrapbcw", two(0xf07a, 0x0001), two(0xffff, 0xffff), "#w"}, {"ptrapbcl", two(0xf07b, 0x0001), two(0xffff, 0xffff), "#l"}, {"ptrapbc", two(0xf07c, 0x0001), two(0xffff, 0xffff), ""}, - + {"ptrapbsw", two(0xf07a, 0x0000), two(0xffff, 0xffff), "#w"}, {"ptrapbsl", two(0xf07b, 0x0000), two(0xffff, 0xffff), "#l"}, {"ptrapbs", two(0xf07c, 0x0000), two(0xffff, 0xffff), ""}, - + {"ptrapccw", two(0xf07a, 0x000f), two(0xffff, 0xffff), "#w"}, {"ptrapccl", two(0xf07b, 0x000f), two(0xffff, 0xffff), "#l"}, {"ptrapcc", two(0xf07c, 0x000f), two(0xffff, 0xffff), ""}, - + {"ptrapcsw", two(0xf07a, 0x000e), two(0xffff, 0xffff), "#w"}, {"ptrapcsl", two(0xf07b, 0x000e), two(0xffff, 0xffff), "#l"}, {"ptrapcs", two(0xf07c, 0x000e), two(0xffff, 0xffff), ""}, - + {"ptrapgcw", two(0xf07a, 0x000d), two(0xffff, 0xffff), "#w"}, {"ptrapgcl", two(0xf07b, 0x000d), two(0xffff, 0xffff), "#l"}, {"ptrapgc", two(0xf07c, 0x000d), two(0xffff, 0xffff), ""}, - + {"ptrapgsw", two(0xf07a, 0x000c), two(0xffff, 0xffff), "#w"}, {"ptrapgsl", two(0xf07b, 0x000c), two(0xffff, 0xffff), "#l"}, {"ptrapgs", two(0xf07c, 0x000c), two(0xffff, 0xffff), ""}, - + {"ptrapicw", two(0xf07a, 0x000b), two(0xffff, 0xffff), "#w"}, {"ptrapicl", two(0xf07b, 0x000b), two(0xffff, 0xffff), "#l"}, {"ptrapic", two(0xf07c, 0x000b), two(0xffff, 0xffff), ""}, - + {"ptrapisw", two(0xf07a, 0x000a), two(0xffff, 0xffff), "#w"}, {"ptrapisl", two(0xf07b, 0x000a), two(0xffff, 0xffff), "#l"}, {"ptrapis", two(0xf07c, 0x000a), two(0xffff, 0xffff), ""}, - + {"ptraplcw", two(0xf07a, 0x0003), two(0xffff, 0xffff), "#w"}, {"ptraplcl", two(0xf07b, 0x0003), two(0xffff, 0xffff), "#l"}, {"ptraplc", two(0xf07c, 0x0003), two(0xffff, 0xffff), ""}, - + {"ptraplsw", two(0xf07a, 0x0002), two(0xffff, 0xffff), "#w"}, {"ptraplsl", two(0xf07b, 0x0002), two(0xffff, 0xffff), "#l"}, {"ptrapls", two(0xf07c, 0x0002), two(0xffff, 0xffff), ""}, - + {"ptrapscw", two(0xf07a, 0x0005), two(0xffff, 0xffff), "#w"}, {"ptrapscl", two(0xf07b, 0x0005), two(0xffff, 0xffff), "#l"}, {"ptrapsc", two(0xf07c, 0x0005), two(0xffff, 0xffff), ""}, - + {"ptrapssw", two(0xf07a, 0x0004), two(0xffff, 0xffff), "#w"}, {"ptrapssl", two(0xf07b, 0x0004), two(0xffff, 0xffff), "#l"}, {"ptrapss", two(0xf07c, 0x0004), two(0xffff, 0xffff), ""}, - + {"ptrapwcw", two(0xf07a, 0x0009), two(0xffff, 0xffff), "#w"}, {"ptrapwcl", two(0xf07b, 0x0009), two(0xffff, 0xffff), "#l"}, {"ptrapwc", two(0xf07c, 0x0009), two(0xffff, 0xffff), ""}, - + {"ptrapwsw", two(0xf07a, 0x0008), two(0xffff, 0xffff), "#w"}, {"ptrapwsl", two(0xf07b, 0x0008), two(0xffff, 0xffff), "#l"}, {"ptrapws", two(0xf07c, 0x0008), two(0xffff, 0xffff), ""}, - + {"pvalid", two(0xf000, 0x2800), two(0xffc0, 0xffff), "Vs&s"}, {"pvalid", two(0xf000, 0x2c00), two(0xffc0, 0xfff8), "A3&s" }, - -#endif /* m68851 */ -/* end of tc-m68851.h */ +#endif /* m68851 */ diff --git a/gnu/dist/toolchain/gas/config/tc-m68hc11.c b/gnu/dist/toolchain/gas/config/tc-m68hc11.c new file mode 100644 index 000000000000..62094411ec3e --- /dev/null +++ b/gnu/dist/toolchain/gas/config/tc-m68hc11.c @@ -0,0 +1,2813 @@ +/* tc-m68hc11.c -- Assembler code for the Motorola 68HC11 & 68HC12. + Copyright (C) 1999, 2000, 2001 Free Software Foundation. + Written by Stephane Carrez (stcarrez@worldnet.fr) + + This file is part of GAS, the GNU Assembler. + + GAS is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GAS is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GAS; see the file COPYING. If not, write to + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +#include +#include +#include "as.h" +#include "subsegs.h" +#include "opcode/m68hc11.h" +#include "dwarf2dbg.h" + +const char comment_chars[] = ";!"; +const char line_comment_chars[] = "#*"; +const char line_separator_chars[] = ""; + +const char EXP_CHARS[] = "eE"; +const char FLT_CHARS[] = "dD"; + +#define STATE_CONDITIONAL_BRANCH (1) +#define STATE_PC_RELATIVE (2) +#define STATE_INDEXED_OFFSET (3) +#define STATE_XBCC_BRANCH (4) +#define STATE_CONDITIONAL_BRANCH_6812 (5) + +#define STATE_BYTE (0) +#define STATE_BITS5 (0) +#define STATE_WORD (1) +#define STATE_BITS9 (1) +#define STATE_LONG (2) +#define STATE_BITS16 (2) +#define STATE_UNDF (3) /* Symbol undefined in pass1 */ + +/* This macro has no side-effects. */ +#define ENCODE_RELAX(what,length) (((what) << 2) + (length)) + +#define IS_OPCODE(C1,C2) (((C1) & 0x0FF) == ((C2) & 0x0FF)) + +/* This table describes how you change sizes for the various types of variable + size expressions. This version only supports two kinds. */ + +/* The fields are: + How far Forward this mode will reach. + How far Backward this mode will reach. + How many bytes this mode will add to the size of the frag. + Which mode to go to if the offset won't fit in this one. */ + +relax_typeS md_relax_table[] = { + {1, 1, 0, 0}, /* First entries aren't used. */ + {1, 1, 0, 0}, /* For no good reason except. */ + {1, 1, 0, 0}, /* that the VAX doesn't either. */ + {1, 1, 0, 0}, + + /* Relax for bcc . + These insns are translated into b!cc +3 jmp L. */ + {(127), (-128), 0, ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_WORD)}, + {0, 0, 3, 0}, + {1, 1, 0, 0}, + {1, 1, 0, 0}, + + /* Relax for bsr and bra . + These insns are translated into jsr and jmp. */ + {(127), (-128), 0, ENCODE_RELAX (STATE_PC_RELATIVE, STATE_WORD)}, + {0, 0, 1, 0}, + {1, 1, 0, 0}, + {1, 1, 0, 0}, + + /* Relax for indexed offset: 5-bits, 9-bits, 16-bits. */ + {(15), (-16), 0, ENCODE_RELAX (STATE_INDEXED_OFFSET, STATE_BITS9)}, + {(255), (-256), 1, ENCODE_RELAX (STATE_INDEXED_OFFSET, STATE_BITS16)}, + {0, 0, 2, 0}, + {1, 1, 0, 0}, + + /* Relax for dbeq/ibeq/tbeq r,: + These insns are translated into db!cc +3 jmp L. */ + {(255), (-256), 0, ENCODE_RELAX (STATE_XBCC_BRANCH, STATE_WORD)}, + {0, 0, 3, 0}, + {1, 1, 0, 0}, + {1, 1, 0, 0}, + + /* Relax for bcc on 68HC12. + These insns are translated into lbcc . */ + {(127), (-128), 0, ENCODE_RELAX (STATE_CONDITIONAL_BRANCH_6812, STATE_WORD)}, + {0, 0, 2, 0}, + {1, 1, 0, 0}, + {1, 1, 0, 0}, + +}; + +/* 68HC11 and 68HC12 registers. They are numbered according to the 68HC12. */ +typedef enum register_id { + REG_NONE = -1, + REG_A = 0, + REG_B = 1, + REG_CCR = 2, + REG_D = 4, + REG_X = 5, + REG_Y = 6, + REG_SP = 7, + REG_PC = 8 +} register_id; + +typedef struct operand { + expressionS exp; + register_id reg1; + register_id reg2; + int mode; +} operand; + +struct m68hc11_opcode_def { + long format; + int min_operands; + int max_operands; + int nb_modes; + int used; + struct m68hc11_opcode *opcode; +}; + +static struct m68hc11_opcode_def *m68hc11_opcode_defs = 0; +static int m68hc11_nb_opcode_defs = 0; + +typedef struct alias { + const char *name; + const char *alias; +} alias; + +static alias alias_opcodes[] = { + {"cpd", "cmpd"}, + {"cpx", "cmpx"}, + {"cpy", "cmpy"}, + {0, 0} +}; + +/* Local functions. */ +static register_id reg_name_search PARAMS ((char *)); +static register_id register_name PARAMS ((void)); +static int check_range PARAMS ((long, int)); +static void print_opcode_list PARAMS ((void)); +static void get_default_target PARAMS ((void)); +static void print_insn_format PARAMS ((char *)); +static int get_operand PARAMS ((operand *, int, long)); +static void fixup8 PARAMS ((expressionS *, int, int)); +static void fixup16 PARAMS ((expressionS *, int, int)); +static struct m68hc11_opcode *find_opcode + PARAMS ((struct m68hc11_opcode_def *, operand *, int *)); +static void build_jump_insn + PARAMS ((struct m68hc11_opcode *, operand *, int, int)); +static void build_insn + PARAMS ((struct m68hc11_opcode *, operand *, int)); + +/* Controls whether relative branches can be turned into long branches. + When the relative offset is too large, the insn are changed: + bra -> jmp + bsr -> jsr + bcc -> b!cc +3 + jmp L + dbcc -> db!cc +3 + jmp L + + Setting the flag forbidds this. */ +static short flag_fixed_branchs = 0; + +/* Force to use long jumps (absolute) instead of relative branches. */ +static short flag_force_long_jumps = 0; + +/* Change the direct addressing mode into an absolute addressing mode + when the insn does not support direct addressing. + For example, "clr *ZD0" is normally not possible and is changed + into "clr ZDO". */ +static short flag_strict_direct_addressing = 1; + +/* When an opcode has invalid operand, print out the syntax of the opcode + to stderr. */ +static short flag_print_insn_syntax = 0; + +/* Dumps the list of instructions with syntax and then exit: + 1 -> Only dumps the list (sorted by name) + 2 -> Generate an example (or test) that can be compiled. */ +static short flag_print_opcodes = 0; + +/* Opcode hash table. */ +static struct hash_control *m68hc11_hash; + +/* Current cpu (either cpu6811 or cpu6812). This is determined automagically + by 'get_default_target' by looking at default BFD vector. This is overriden + with the -m option. */ +static int current_architecture = 0; + +/* Default cpu determined by 'get_default_target'. */ +static const char *default_cpu; + +/* Number of opcodes in the sorted table (filtered by current cpu). */ +static int num_opcodes; + +/* The opcodes sorted by name and filtered by current cpu. */ +static struct m68hc11_opcode *m68hc11_sorted_opcodes; + +/* These are the machine dependent pseudo-ops. These are included so + the assembler can work on the output from the SUN C compiler, which + generates these. */ + +/* This table describes all the machine specific pseudo-ops the assembler + has to support. The fields are: + pseudo-op name without dot + function to call to execute this pseudo-op + Integer arg to pass to the function. */ +const pseudo_typeS md_pseudo_table[] = { + /* The following pseudo-ops are supported for MRI compatibility. */ + {"fcb", cons, 1}, + {"fdb", cons, 2}, + {"fcc", stringer, 1}, + {"rmb", s_space, 0}, + + /* Dwarf2 support for Gcc. */ + {"file", dwarf2_directive_file, 0}, + {"loc", dwarf2_directive_loc, 0}, + + /* Motorola ALIS. */ + {"xrefb", s_ignore, 0}, /* Same as xref */ + + {0, 0, 0} +}; + +/* Options and initialization. */ + +CONST char *md_shortopts = "Sm:"; + +struct option md_longopts[] = { +#define OPTION_FORCE_LONG_BRANCH (OPTION_MD_BASE) + {"force-long-branchs", no_argument, NULL, OPTION_FORCE_LONG_BRANCH}, + +#define OPTION_SHORT_BRANCHS (OPTION_MD_BASE + 1) + {"short-branchs", no_argument, NULL, OPTION_SHORT_BRANCHS}, + +#define OPTION_STRICT_DIRECT_MODE (OPTION_MD_BASE + 2) + {"strict-direct-mode", no_argument, NULL, OPTION_STRICT_DIRECT_MODE}, + +#define OPTION_PRINT_INSN_SYNTAX (OPTION_MD_BASE + 3) + {"print-insn-syntax", no_argument, NULL, OPTION_PRINT_INSN_SYNTAX}, + +#define OPTION_PRINT_OPCODES (OPTION_MD_BASE + 4) + {"print-opcodes", no_argument, NULL, OPTION_PRINT_OPCODES}, + +#define OPTION_GENERATE_EXAMPLE (OPTION_MD_BASE + 5) + {"generate-example", no_argument, NULL, OPTION_GENERATE_EXAMPLE}, + + {NULL, no_argument, NULL, 0} +}; +size_t md_longopts_size = sizeof (md_longopts); + +/* Get the target cpu for the assembler. This is based on the configure + options and on the -m68hc11/-m68hc12 option. If no option is specified, + we must get the default. */ +const char * +m68hc11_arch_format () +{ + get_default_target (); + if (current_architecture & cpu6811) + return "elf32-m68hc11"; + else + return "elf32-m68hc12"; +} + +enum bfd_architecture +m68hc11_arch () +{ + get_default_target (); + if (current_architecture & cpu6811) + return bfd_arch_m68hc11; + else + return bfd_arch_m68hc12; +} + +int +m68hc11_mach () +{ + return 0; +} + +/* Listing header selected according to cpu. */ +const char * +m68hc11_listing_header () +{ + if (current_architecture & cpu6811) + return "M68HC11 GAS "; + else + return "M68HC12 GAS "; +} + +void +md_show_usage (stream) + FILE *stream; +{ + get_default_target (); + fprintf (stream, _("\ +Motorola 68HC11/68HC12 options:\n\ + -m68hc11 | -m68hc12 specify the processor [default %s]\n\ + --force-long-branchs always turn relative branchs into absolute ones\n\ + -S,--short-branchs do not turn relative branchs into absolute ones\n\ + when the offset is out of range\n\ + --strict-direct-mode do not turn the direct mode into extended mode\n\ + when the instruction does not support direct mode\n\ + --print-insn-syntax print the syntax of instruction in case of error\n\ + --print-opcodes print the list of instructions with syntax\n\ + --generate-example generate an example of each instruction\n\ + (used for testing)\n"), default_cpu); + +} + +/* Try to identify the default target based on the BFD library. */ +static void +get_default_target () +{ + const bfd_target *target; + bfd abfd; + + if (current_architecture != 0) + return; + + default_cpu = "unknown"; + target = bfd_find_target (0, &abfd); + if (target && target->name) + { + if (strcmp (target->name, "elf32-m68hc12") == 0) + { + current_architecture = cpu6812; + default_cpu = "m68hc12"; + } + else if (strcmp (target->name, "elf32-m68hc11") == 0) + { + current_architecture = cpu6811; + default_cpu = "m68hc11"; + } + else + { + as_bad (_("Default target `%s' is not supported."), target->name); + } + } +} + +void +m68hc11_print_statistics (file) + FILE *file; +{ + int i; + struct m68hc11_opcode_def *opc; + + hash_print_statistics (file, "opcode table", m68hc11_hash); + + opc = m68hc11_opcode_defs; + if (opc == 0 || m68hc11_nb_opcode_defs == 0) + return; + + /* Dump the opcode statistics table. */ + fprintf (file, _("Name # Modes Min ops Max ops Modes mask # Used\n")); + for (i = 0; i < m68hc11_nb_opcode_defs; i++, opc++) + { + fprintf (file, "%-7.7s %5d %7d %7d 0x%08lx %7d\n", + opc->opcode->name, + opc->nb_modes, + opc->min_operands, opc->max_operands, opc->format, opc->used); + } +} + +int +md_parse_option (c, arg) + int c; + char *arg; +{ + get_default_target (); + switch (c) + { + /* -S means keep external to 2 bit offset rather than 16 bit one. */ + case OPTION_SHORT_BRANCHS: + case 'S': + flag_fixed_branchs = 1; + break; + + case OPTION_FORCE_LONG_BRANCH: + flag_force_long_jumps = 1; + break; + + case OPTION_PRINT_INSN_SYNTAX: + flag_print_insn_syntax = 1; + break; + + case OPTION_PRINT_OPCODES: + flag_print_opcodes = 1; + break; + + case OPTION_STRICT_DIRECT_MODE: + flag_strict_direct_addressing = 0; + break; + + case OPTION_GENERATE_EXAMPLE: + flag_print_opcodes = 2; + break; + + case 'm': + if (strcasecmp (arg, "68hc11") == 0) + current_architecture = cpu6811; + else if (strcasecmp (arg, "68hc12") == 0) + current_architecture = cpu6812; + else + as_bad (_("Option `%s' is not recognized."), arg); + break; + + default: + return 0; + } + + return 1; +} + +symbolS * +md_undefined_symbol (name) + char *name ATTRIBUTE_UNUSED; +{ + return 0; +} + +/* Equal to MAX_PRECISION in atof-ieee.c. */ +#define MAX_LITTLENUMS 6 + +/* Turn a string in input_line_pointer into a floating point constant + of type TYPE, and store the appropriate bytes in *LITP. The number + of LITTLENUMS emitted is stored in *SIZEP. An error message is + returned, or NULL on OK. */ +char * +md_atof (type, litP, sizeP) + char type; + char *litP; + int *sizeP; +{ + int prec; + LITTLENUM_TYPE words[MAX_LITTLENUMS]; + LITTLENUM_TYPE *wordP; + char *t; + + switch (type) + { + case 'f': + case 'F': + case 's': + case 'S': + prec = 2; + break; + + case 'd': + case 'D': + case 'r': + case 'R': + prec = 4; + break; + + case 'x': + case 'X': + prec = 6; + break; + + case 'p': + case 'P': + prec = 6; + break; + + default: + *sizeP = 0; + return _("Bad call to MD_ATOF()"); + } + t = atof_ieee (input_line_pointer, type, words); + if (t) + input_line_pointer = t; + + *sizeP = prec * sizeof (LITTLENUM_TYPE); + for (wordP = words; prec--;) + { + md_number_to_chars (litP, (long) (*wordP++), sizeof (LITTLENUM_TYPE)); + litP += sizeof (LITTLENUM_TYPE); + } + return 0; +} + +valueT +md_section_align (seg, addr) + asection *seg; + valueT addr; +{ + int align = bfd_get_section_alignment (stdoutput, seg); + return ((addr + (1 << align) - 1) & (-1 << align)); +} + +static int +cmp_opcode (op1, op2) + struct m68hc11_opcode *op1; + struct m68hc11_opcode *op2; +{ + return strcmp (op1->name, op2->name); +} + +/* Initialize the assembler. Create the opcode hash table + (sorted on the names) with the M6811 opcode table + (from opcode library). */ +void +md_begin () +{ + char *prev_name = ""; + struct m68hc11_opcode *opcodes; + struct m68hc11_opcode_def *opc = 0; + int i, j; + + get_default_target (); + + m68hc11_hash = hash_new (); + + /* Get a writable copy of the opcode table and sort it on the names. */ + opcodes = (struct m68hc11_opcode *) xmalloc (m68hc11_num_opcodes * + sizeof (struct + m68hc11_opcode)); + m68hc11_sorted_opcodes = opcodes; + num_opcodes = 0; + for (i = 0; i < m68hc11_num_opcodes; i++) + { + if (m68hc11_opcodes[i].arch & current_architecture) + { + opcodes[num_opcodes] = m68hc11_opcodes[i]; + if (opcodes[num_opcodes].name[0] == 'b' + && opcodes[num_opcodes].format & M6811_OP_JUMP_REL + && !(opcodes[num_opcodes].format & M6811_OP_BITMASK)) + { + num_opcodes++; + opcodes[num_opcodes] = m68hc11_opcodes[i]; + } + num_opcodes++; + for (j = 0; alias_opcodes[j].name != 0; j++) + if (strcmp (m68hc11_opcodes[i].name, alias_opcodes[j].name) == 0) + { + opcodes[num_opcodes] = m68hc11_opcodes[i]; + opcodes[num_opcodes].name = alias_opcodes[j].alias; + num_opcodes++; + break; + } + } + } + qsort (opcodes, num_opcodes, sizeof (struct m68hc11_opcode), cmp_opcode); + + opc = (struct m68hc11_opcode_def *) + xmalloc (num_opcodes * sizeof (struct m68hc11_opcode_def)); + m68hc11_opcode_defs = opc--; + + /* Insert unique names into hash table. The M6811 instruction set + has several identical opcode names that have different opcodes based + on the operands. This hash table then provides a quick index to + the first opcode with a particular name in the opcode table. */ + for (i = 0; i < num_opcodes; i++, opcodes++) + { + int expect; + + if (strcmp (prev_name, opcodes->name)) + { + prev_name = (char *) opcodes->name; + + opc++; + opc->format = 0; + opc->min_operands = 100; + opc->max_operands = 0; + opc->nb_modes = 0; + opc->opcode = opcodes; + opc->used = 0; + hash_insert (m68hc11_hash, opcodes->name, (char *) opc); + } + opc->nb_modes++; + opc->format |= opcodes->format; + + /* See how many operands this opcode needs. */ + expect = 0; + if (opcodes->format & M6811_OP_MASK) + expect++; + if (opcodes->format & M6811_OP_BITMASK) + expect++; + if (opcodes->format & (M6811_OP_JUMP_REL | M6812_OP_JUMP_REL16)) + expect++; + if (opcodes->format & (M6812_OP_IND16_P2 | M6812_OP_IDX_P2)) + expect++; + + if (expect < opc->min_operands) + opc->min_operands = expect; + if (expect > opc->max_operands) + opc->max_operands = expect; + } + opc++; + m68hc11_nb_opcode_defs = opc - m68hc11_opcode_defs; + + if (flag_print_opcodes) + { + print_opcode_list (); + exit (EXIT_SUCCESS); + } +} + +void +m68hc11_init_after_args () +{ +} + +/* Builtin help. */ + +/* Return a string that represents the operand format for the instruction. + When example is true, this generates an example of operand. This is used + to give an example and also to generate a test. */ +static char * +print_opcode_format (opcode, example) + struct m68hc11_opcode *opcode; + int example; +{ + static char buf[128]; + int format = opcode->format; + char *p; + + p = buf; + buf[0] = 0; + if (format & M6811_OP_IMM8) + { + if (example) + sprintf (p, "#%d", rand () & 0x0FF); + else + strcpy (p, _("#")); + p = &p[strlen (p)]; + } + + if (format & M6811_OP_IMM16) + { + if (example) + sprintf (p, "#%d", rand () & 0x0FFFF); + else + strcpy (p, _("#")); + p = &p[strlen (p)]; + } + + if (format & M6811_OP_IX) + { + if (example) + sprintf (p, "%d,X", rand () & 0x0FF); + else + strcpy (p, _(",X")); + p = &p[strlen (p)]; + } + + if (format & M6811_OP_IY) + { + if (example) + sprintf (p, "%d,X", rand () & 0x0FF); + else + strcpy (p, _(",X")); + p = &p[strlen (p)]; + } + + if (format & M6812_OP_IDX) + { + if (example) + sprintf (p, "%d,X", rand () & 0x0FF); + else + strcpy (p, "n,r"); + p = &p[strlen (p)]; + } + + if (format & M6811_OP_DIRECT) + { + if (example) + sprintf (p, "*Z%d", rand () & 0x0FF); + else + strcpy (p, _("*")); + p = &p[strlen (p)]; + } + + if (format & M6811_OP_BITMASK) + { + if (buf[0]) + *p++ = ' '; + + if (example) + sprintf (p, "#$%02x", rand () & 0x0FF); + else + strcpy (p, _("#")); + + p = &p[strlen (p)]; + if (format & M6811_OP_JUMP_REL) + *p++ = ' '; + } + + if (format & M6811_OP_IND16) + { + if (example) + sprintf (p, _("symbol%d"), rand () & 0x0FF); + else + strcpy (p, _("")); + + p = &p[strlen (p)]; + } + + if (format & (M6811_OP_JUMP_REL | M6812_OP_JUMP_REL16)) + { + if (example) + { + if (format & M6811_OP_BITMASK) + { + sprintf (p, ".+%d", rand () & 0x7F); + } + else + { + sprintf (p, "L%d", rand () & 0x0FF); + } + } + else + strcpy (p, _("